WO2017206865A1 - Application program shutdown method and apparatus, storage medium, and electronic device - Google Patents

Application program shutdown method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2017206865A1
WO2017206865A1 PCT/CN2017/086462 CN2017086462W WO2017206865A1 WO 2017206865 A1 WO2017206865 A1 WO 2017206865A1 CN 2017086462 W CN2017086462 W CN 2017086462W WO 2017206865 A1 WO2017206865 A1 WO 2017206865A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
function
function level
level
target
Prior art date
Application number
PCT/CN2017/086462
Other languages
French (fr)
Chinese (zh)
Inventor
黄宏用
Original Assignee
广东欧珀移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Publication of WO2017206865A1 publication Critical patent/WO2017206865A1/en

Links

Classifications

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

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:
  • a function in the application corresponding to the first objective function level is closed.
  • an embodiment of the present invention further provides an apparatus for shutting down an application, including:
  • a first acquiring module configured to receive a closing instruction of the application, and acquire user behavior characteristic information of the application within a preset time period
  • a second acquiring module configured to acquire a first target function level corresponding to the user behavior feature information
  • a first processing module configured to close a function in the application that corresponds 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:
  • a function in the application corresponding to the first objective function level is closed.
  • 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 of a method for shutting down an application program according to an embodiment of the present invention.
  • FIG. 2 is another schematic flowchart of a method for shutting down an application according to an embodiment of the present invention.
  • FIG. 3 is still another schematic flowchart of a method for shutting down an application according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
  • FIG. 4b is a schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
  • FIG. 4c is another schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another apparatus for shutting down an application program according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another apparatus for shutting down an application program according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 6 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, when the application installed on the smart terminal is running, it consumes a large amount of power and reduces the endurance of the smart terminal.
  • the application runs a main function and multiple sub-functions called by the main function to implement the functionality of the application.
  • the smart terminal closes all functions (including main functions, sub-functions, etc.) in the application when the application is closed.
  • 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. Therefore, the present invention can be overcome by the following implementations.
  • a method of closing an application including:
  • a function in the application corresponding to the first objective function level is closed.
  • the step of setting a function level for a function in an application specifically includes:
  • a function level is set for a function in the application according to the calling relationship.
  • the user behavior characteristic information includes a starting frequency
  • the step of acquiring the first target function level corresponding to the user behavior characteristic information specifically includes:
  • the first target function level is lower than a highest function level
  • the step of closing a function corresponding to the first target function level in the application 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 closing method of the application further includes:
  • a function in the application corresponding to the second objective function level is closed.
  • the step of setting a function level for a function in an application specifically includes:
  • the step of closing a function corresponding to the first target function level in the application specifically includes:
  • the calling function in the set corresponding to the first target function level is closed.
  • the step of obtaining a call relationship between functions in an application specifically includes:
  • the method further includes:
  • the embodiment of the invention provides a method and an apparatus for closing an application, which will be respectively described in detail below.
  • the device may be integrated into the terminal, and the terminal may be a device such as a smart phone or a tablet computer.
  • An application closing method includes: setting a function level to a function in an application, receiving a closing instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period, and acquiring the behavior of the user
  • the first target function level corresponding to the feature information, and the function corresponding to the first target function level in the application is closed.
  • the method for shutting down the application may include:
  • any application that can run on an operating system needs to have a main function (or a first-level function), and the main function is an entry to the application for other
  • the various functions (sub-functions) are called, and the functions are executed by the called sub-functions. Since the main function needs to give the running result of the application, the main function is also the exit of the application.
  • the main function is relatively simple, the specific details of the functions that the application needs to implement are encapsulated into the sub-function for the main function to call.
  • the sub-function can also call other sub-functions.
  • a function level may be set according to a call relationship between functions. For example, the level of the main function is set to level 1, and the level 1 function is called. The level of the function is set to level 2, the level of the function called by the level 2 function is set to level 3, the level of the function called by the level 3 function is set to level 4, and so on.
  • a larger value at the function level indicates that the function is in the lower level of the calling relationship, ie the lower the level of the function.
  • setting the function level to the function in the application can specifically include the following steps:
  • the implementation of the calling relationship between functions in the application may be implemented in various manners.
  • the calling relationship between the functions may be obtained according to a calling command in the function code.
  • the code of function A includes a call command to function B
  • the code of function B includes a call command for function C
  • the code of function C includes a call command for function D
  • a call between functions can be obtained.
  • the relationship is: function A calls function B, function B calls function C, and function C calls function D.
  • the function level of the function can be set according to the call relationship. For example, the level of the function A is set to level 1, the level of the function B is level 2, and the level of the function C is level 3. The level of function D is level 4.
  • S102 Receive a shutdown instruction of the application, and obtain user behavior characteristic information of the application within a preset time period.
  • the manner of receiving the closing instruction of the application may be various.
  • the closing instruction sent by the user's touch operation may be received through the screen, or the closing instruction sent by the user through the remote operation may be received, or the receiving terminal may be internal.
  • the preset time period may be a time value stored in advance in the built-in storage area of the terminal, or may be a time value set by the user and stored in the built-in storage area of the terminal, for example, 10 minutes.
  • the user behavior characteristic information may be user operation information of the application, for example, running the application for 3 minutes in 10 minutes, and for example, starting the application within 10 minutes, the activation frequency is 0.01.
  • a mapping relationship between the user behavior feature information and the target function level may be pre-stored in the built-in storage area of the terminal, and the mapping relationship may also be set by the user and stored in the built-in storage area of the terminal.
  • the mapping relationship stored in the built-in storage area of the terminal is invoked, and the target function level is obtained according to the mapping relationship. For example, if the target function level corresponding to the start frequency of the mapping relationship is 4, the corresponding target function level can be obtained according to the mapping relationship when the start frequency is 0.01.
  • the target function levels corresponding to the start frequencies 0.01 and 0.02 are all 4 levels. Therefore, in some embodiments of the present invention, acquiring the corresponding first target function level according to the user behavior characteristic information may specifically include the following steps:
  • the mapping relationship between the startup frequency interval and the target function level may be pre-stored in the built-in storage area of the terminal.
  • the target frequency level corresponding to the startup frequency interval [0.01, 0.03) is 4 levels
  • the corresponding objective function level is level 3.
  • the start frequency interval in which the start frequency is located is determined. For example, when the startup frequency is 0.02, it can be determined that the startup frequency is in the range of [0.01, 0.03), and then the pre-stored mapping relationship can be called to obtain the corresponding target function level of 4.
  • the corresponding function in the application is closed, for example, when the target function level is 4, all the level 4 functions in the application are closed.
  • the first objective function level should be lower than the highest function level (the highest function level is The level of the main function).
  • closing the corresponding function in the application according to the first target function level may specifically include the following steps:
  • the first target function level is the lowest function level, for example, querying whether all functions of the application running in the system have children called by the function corresponding to the target function level. function. For example, if the target function level is level 4, it is determined whether there is a level 5 function called by the level 4 function.
  • the function corresponding to the first target function level is turned off, for example, all level 4 functions are closed; when it is determined that the first target function level is not the lowest function level, the function is closed A function whose level is less than or equal to the target function level, for example, closing all level 4 functions and level 5 functions.
  • the The method of closing the application may further include the following steps:
  • the method for obtaining the current power information of the terminal is implemented by using a power management program that is provided by the terminal, and the power information may be a percentage of the total battery capacity.
  • the power information is 30% means that the terminal currently has 30% of the remaining power.
  • the mapping relationship between the power information and the second target function level may be pre-stored in the built-in storage area of the terminal, for example, the target function level corresponding to 30% power is 3, and the target function level corresponding to 20% power is 2, etc. After obtaining the power information of the terminal, the mapping relationship stored in the terminal is invoked to obtain the corresponding second target function level; or the mapping relationship between the power information interval and the second target function level may be pre-stored in the built-in storage area of the terminal.
  • the power function information [30%, 40%) corresponds to the target function level is 3, [20%, 30%) corresponds to the target function level is 2, etc.
  • after obtaining the power information of the terminal first determine the The power information interval in which the power information is located, and then acquiring the second target function level according to the power information interval and the mapping relationship.
  • the functions corresponding to the first objective function level have all been closed, and the function level of the remaining unclosed functions should be higher than the first target function level, therefore, the second objective function level should be higher than the first The target function level.
  • the application is closed. All of the level 2 functions, or close all level 2 functions in the application and functions with level 2 or lower level (level 3 functions, level 4 functions, etc.).
  • the method for closing an application sets a function level to a function in an application, receives a shutdown instruction of the application, and acquires a user behavior characteristic of the application within a preset time period.
  • Information obtaining a first target function level corresponding to the user behavior characteristic information, and closing a function corresponding to the first target function level in the application;
  • the solution first sets a function level to a function in the application, and then acquires a target Function level, and close the function in the application corresponding to the target function level, because the program does not directly close the application, but close the corresponding function in the application, so when you need to restart the application, you only need Recall the function that was closed.
  • the embodiment of the invention can improve the speed of restarting the application while reducing the power consumption of the terminal.
  • the closing device of the application is specifically integrated into the smart phone, and the method for closing the application in the smart phone is taken as an example for detailed description.
  • the application shutdown method can be as follows:
  • the implementation of the calling relationship between functions in the application may be implemented in various manners.
  • the calling relationship between the functions may be obtained according to a calling command in the function code.
  • the code of function A includes a call command to function B
  • the code of function B includes a call command for function C
  • the code of function C includes a call command for function D
  • a call between functions can be obtained.
  • the relationship is: function A calls function B, function B calls function C, and function C calls function D.
  • the function level of the function may be set according to the calling relationship.
  • the level of the function A is set to level 1
  • the level of the function B is level 2
  • the level of the function C is Level 3
  • the level of function D is level 4.
  • a larger value at the function level indicates that the function is in the lower level of the calling relationship, ie the lower the level of the function.
  • S203 Receive a shutdown instruction of the application, and obtain a startup frequency of the application within a preset time period.
  • the smart phone can receive a closing instruction sent by the user's touch operation through the screen.
  • the user clicks the close button (virtual button) of the application on the touch screen, and the smart phone sends a closing instruction to the application in response to the user's touch operation.
  • the preset time period may be a pre-stored time value in the smartphone.
  • the preset time period is 10 minutes, and within 10 minutes, the number of starts of the application is counted by a counting function, and the application starts every time. Once, the count value of the count function is incremented by 1.
  • the smart phone receives the closing command of the application, it retrieves the count value of the counting function within 10 minutes, and calculates the starting frequency of the application by the counting value and the duration of the preset time period.
  • the starting frequency may be divided into a plurality of intervals in advance.
  • the starting frequency may be divided into multiple intervals such as [0.01, 0.03), [0.03, 0.05), [0.05, 0.07), and when the application is acquired.
  • the starting frequency interval in which the starting frequency is located is determined. For example, when the starting frequency is 0.02, it can be determined that the starting frequency interval of the starting frequency is [0.01, 0.03).
  • the mapping relationship between the startup frequency interval and the target function level may be pre-stored in the built-in storage area of the terminal.
  • the target frequency level corresponding to the startup frequency interval [0.01, 0.03) is 4 levels, and the startup frequency interval [0.03] , 0.05) the corresponding objective function level is level 3; after determining the starting frequency interval in which the starting frequency is located, for example, the determined starting frequency interval is [0.01, 0.03), the pre-stored mapping relationship may be called to obtain the corresponding The objective function level is level 4.
  • the first target function level is the lowest function level, for example, querying whether all functions of the application running in the system have children called by the function corresponding to the target function level. function. For example, if the target function level is level 4, it is determined whether there is a level 5 function called by the level 4 function; if not, it is determined that the first object function level is the lowest function level, and then step S207 is performed, if any, Then, it is determined that the first target function level is not the lowest function level, and then step S208 is performed.
  • the function corresponding to the first target function level is turned off. For example, if the first target function level is level 4, all the level 4 functions are turned off.
  • the function whose function level is less than or equal to the target function level is turned off. For example, if the first target function level is level 4, all level 4 functions are closed and 5 Level function.
  • the method for obtaining the current power information of the terminal is implemented by using a power management program that is provided by the terminal, and the power information may be a percentage of the total battery capacity.
  • the power information is 30% means that the terminal currently has 30% of the remaining power.
  • a mapping relationship between the power information section and the second target function level may be pre-stored in the built-in storage area of the terminal.
  • the power function information (30%, 40%) corresponds to an objective function level of level 3, and the power information. [20%, 30%) corresponding target function level is level 2, etc., after obtaining the power information of the terminal, first determine the power information interval in which the power information is located, and then according to the power information interval and the pre-stored mapping relationship Get the second objective function level.
  • the level 2 function is closed, and all the level 2 functions in the application are closed, or all levels 2 in the application are closed.
  • Functions and functions whose function level is lower than level 2 level 3 function, level 4 function, etc.).
  • the method for closing an application acquires a calling relationship between functions in an application, sets a function level for a function in the application, receives a closing instruction of the application, and acquires the
  • the startup frequency of the application in the preset time period determines the start frequency interval in which the start frequency is located, and acquires a first target function level corresponding to the start frequency interval, and determines whether the first target function level is the lowest function level. If yes, the function corresponding to the first target function level in the application is closed, if otherwise, the function corresponding to the first target function level in the application is closed, and the function level is lower than the function of the first target function level.
  • the solution first closing the startup frequency of the application Corresponding function, and further close the function corresponding to the power information, due to The program does not directly close the application, but only close function corresponding application, therefore, when the need to restart the application need only recall function can be turned off.
  • the speed of restarting the application can be improved while reducing the power consumption of the terminal.
  • smart terminals are equipped with many sensors, for example, GPS (Global Positioning) System, Global Positioning System) sensors, gravity sensors, fingerprint sensors, image sensors, audio sensors, etc.
  • sensors for example, GPS (Global Positioning) System, Global Positioning System) sensors, gravity sensors, fingerprint sensors, image sensors, audio sensors, etc.
  • applications call these sensors through sensor call functions in the application, each sensor can be called by multiple applications, each application
  • the program can also call multiple sensors.
  • the calling function of the calling sensor in the application When the application is closed, usually the calling function of the calling sensor in the application is not closed.
  • the calling function remains running after the application is closed, which increases the power consumption of the terminal, thereby increasing the power consumption of the terminal and reducing the endurance of the terminal.
  • the device may be integrated into the terminal, and the terminal may be a device such as a smart phone or a tablet computer.
  • An embodiment of the present invention provides a method for closing an application, which can be used to close a calling function of a sensor when the application is closed.
  • the method includes: acquiring a set of calling functions of the calling sensor in the application, and setting a function of the calling function in the set. Level, receiving a closing instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period according to the closing instruction, acquiring a corresponding first objective function level according to the user behavior characteristic information, and according to the first An objective function level closes the corresponding calling function in the collection.
  • the application shutdown method can be as follows:
  • the calling function E is used to call the fingerprint sensor
  • the calling function F is used to call the image sensor
  • the calling function G is used to call the audio sensor, and then the function can be obtained.
  • the collection includes calling function E, calling function F, and calling function G.
  • the function when the function level is set, the function may be set according to the function importance of the sensor called by the multiple calling functions.
  • the fingerprint sensor is an authentication mode when entering the application, and the fingerprint sensor has the highest importance.
  • the fingerprint sensor can be set to the level of level 2 of the function E.
  • the image sensor is used to implement the basic functions of the application.
  • the importance of the image sensor is second.
  • the level of the image sensor calling function F can be set to level 3, and the audio sensor It is an additional function for implementing the application, and the audio sensor is of the least importance, and the level of the audio sensor calling function G can be set to level 4.
  • the identification bits may be set to the calling function in the collection, for example, the identification bits of all calling functions in the collection are set to 1, and the identification bits may also include colors, for example, all of the collections The flag of the calling function is set to green.
  • S303 Receive a shutdown instruction of the application, and obtain user behavior characteristic information of the application within a preset time period.
  • the manner of receiving the closing instruction of the application may be various.
  • the closing instruction sent by the user's touch operation may be received through the screen, or the closing instruction sent by the user through the remote operation may be received, or the receiving terminal may be internal.
  • the preset time period may be a time value stored in advance in the built-in storage area of the terminal, or may be a time value set by the user and stored in the built-in storage area of the terminal, for example, 10 minutes.
  • the user behavior characteristic information may be user operation information of the application, for example, running the application for 3 minutes in 10 minutes, and for example, starting the application within 10 minutes, the startup frequency is 0.04.
  • a mapping relationship between the user behavior feature information and the target function level may be pre-stored in the built-in storage area of the terminal, and the mapping relationship may also be set by the user and stored in the built-in storage area of the terminal.
  • the mapping relationship stored in the built-in storage area of the terminal is invoked, and the target function level is obtained according to the mapping relationship. For example, if the target function level corresponding to the start frequency 0.04 in the mapping relationship is level 3, when the user behavior feature information is obtained as the start frequency is 0.04, the corresponding target function level can be obtained according to the mapping relationship to be level 3.
  • the corresponding calling function in the set is closed.
  • the target function level is 3
  • all the level 3 calling functions in the set are closed, and all the level 3 in the set may be closed. Call the function and the level 4 call function.
  • the identification bit of the closed calling function may also be changed, for example, changing the flag of all calling functions that are closed in the collection from 1 to 2.
  • the flag can also include a color, for example, changing the flag of all calling functions that are turned off in the collection from green to red.
  • the closing method of the application program uses a set of calling functions for calling a sensor in an application, sets a function level for the calling function in the set, receives a closing instruction of the application, and acquires The user behavior feature information in the preset time period acquires a first target function level corresponding to the user behavior feature information, and closes a calling function corresponding to the first target function level in the set; Set the function level to the calling function in the collection, then get the corresponding target function level, and close the calling function corresponding to the target function level in the collection. Since the solution does not directly close the application, it closes the corresponding in the application. The function is called, so when you need to restart the application, you only need to recall the called function that was closed. In this embodiment, the speed of restarting the application can be improved while reducing the power consumption of the terminal.
  • the embodiment of the present invention further provides a device for shutting down an application, and the device for closing the application may be integrated in the terminal, and the terminal may specifically be a device such as a smart phone or a tablet computer.
  • An application closing device comprising:
  • a first acquiring module configured to receive a closing instruction of the application, and acquire user behavior characteristic information of the application within a preset time period
  • a second acquiring module configured to acquire a first target function level corresponding to the user behavior feature information
  • a first processing module configured to close a function in the application that corresponds to the first target function level.
  • the setting module specifically includes:
  • a first obtaining submodule configured to acquire a calling relationship between functions in an application
  • a submodule is set to set a function level for a function in the application.
  • the user behavior feature information includes a starting frequency
  • the second acquiring module specifically includes:
  • a second acquiring submodule configured to acquire a first target function level corresponding to the starting frequency interval.
  • the first target function level is lower than a highest function level
  • the first processing module specifically includes:
  • a determining submodule configured to determine whether the first target function level is the lowest function level
  • a processing submodule configured to: when the determining submodule determines to be YES, close a function corresponding to the first target function level in the application; when the determining submodule determines to be no, close the application The function corresponding to the first objective function level and the function level lower than the first objective function level.
  • the shutdown device further includes a second processing module, the second processing module is configured to:
  • a function in the application corresponding to the second objective function level is closed.
  • the shutdown device of the application may include: a setting module 401, a first obtaining module 402, a second obtaining module 403, and a first processing module 404, which are specifically described as follows:
  • the setting module 401 is configured to set a function level for a function in the application.
  • the first obtaining module 402 is configured to receive a closing instruction of the application, and obtain user behavior characteristic information of the application within a preset time period.
  • the second obtaining module 403 is configured to acquire a first target function level corresponding to the user behavior feature information.
  • the first processing module 404 is configured to close a function corresponding to the first target function level in the application.
  • the setting module 401 may include: a first obtaining submodule 4011 and a setting submodule 4012, as follows:
  • the first obtaining sub-module 4011 is configured to acquire a calling relationship between functions in an application.
  • the setting sub-module 4012 is configured to set a function level for the function in the application.
  • the user behavior characteristic information includes a startup frequency.
  • the second obtaining module 403 may include: a determining submodule 4031 and a second obtaining submodule 4032, as follows:
  • the determining sub-module 4031 is configured to determine a starting frequency interval in which the starting frequency is located.
  • the second obtaining submodule 4032 is configured to acquire a first target function level corresponding to the starting frequency interval.
  • the first target function level is lower than the highest function level.
  • the first processing module 404 may include: a determining submodule 4041 and a processing submodule 4042, as follows:
  • the determining sub-module 4041 is configured to determine whether the first target function level is the lowest function level.
  • the processing sub-module 4042 is configured to: when the determining sub-module 4041 determines YES, close a function corresponding to the first target function level in the application; when the determining sub-module 4041 determines to be no, close the application.
  • the function corresponding to the first objective function level and the function level lower than the function of the first objective function level.
  • the closing device of the application may further include: a second processing module 405; the second processing module 405 is configured to:
  • the closing device of the application program sets the function level to the function in the application program by the setting module 401, and the first obtaining module 402 receives the closing instruction of the application program, and acquires the application program in advance.
  • the second obtaining module 403 acquires the first target function level corresponding to the user behavior characteristic information
  • the first processing module 404 closes the function corresponding to the first target function level in the application program. Because the program does not close the application directly, but closes the corresponding function in the application, so when you need to restart the application, you only need to recall the closed function. In this embodiment, the speed of restarting the application can be improved while reducing the power consumption 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 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:
  • a function in the application corresponding to the first objective function level is closed.
  • the processor when the function level is set for a function in an application, the processor is further configured to perform the following steps:
  • a function level is set for a function in the application according to the calling relationship.
  • the user behavior characteristic information includes a startup frequency
  • the processor is further configured to perform the following steps:
  • the first target function level is lower than a highest function level, and when the function corresponding to the first target function level in the application is closed, 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:
  • a function in the application corresponding to the second objective function level is closed.
  • 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 step of closing a function corresponding to the first target function level in the application specifically includes:
  • the calling function in the set corresponding to the first target function level is closed.
  • 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.
  • the electronic device 500 may also include at least one type of sensor 508, such as a light sensor, a motion sensor, a velocity sensor, GPS (Global Positioning) System, Global Positioning System) sensors, image sensors, audio sensors, 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.
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

Disclosed are an application program shutdown method and apparatus, a storage medium, and an electronic device. The method comprises: setting function levels for functions in an application program, receiving a shutdown command for the application program and obtaining user behavioral characteristic information, obtaining a first target function level corresponding to the user behavioral characteristic information, and shutting down functions corresponding to the first target function level in the application program. The present solution reduces terminal power consumption at the same time as increasing application program restart speed.

Description

一种应用程序的关闭方法、装置、存储介质及电子设备 Method, device, storage medium and electronic device for closing application 技术领域Technical field
本发明涉及终端技术领域,具体涉及一种应用程序的关闭方法、装置、存储介质及电子设备。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.
背景技术Background technique
随着智能终端的发展,智能终端能够兼容的功能越来越多,不仅丰富用户的生活,还给用户带来便利。随着移动终端设备日益融入人们生活、应用功能日趋完善,给用户带来了极大便利以及提高用户体验。With the development of intelligent terminals, more and more functions are compatible with intelligent terminals, which not only enriches the lives of users, but also brings convenience to users. As mobile terminal devices are increasingly integrated into people's lives and application functions are becoming more and more perfect, users are greatly facilitated and the user experience is improved.
技术问题technical problem
本发明实施例提供一种应用程序的关闭方法、装置、存储介质及电子设备,可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。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.
技术解决方案Technical solution
第一方面,本发明实施例提供了一种应用程序的关闭方法,包括:In a first aspect, an embodiment of the present invention provides a method for shutting down an application, including:
对应用程序中的函数设置函数级别;Set the function level for functions in the application;
接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;Receiving a shutdown instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period;
获取与所述用户行为特征信息对应的第一目标函数级别;Obtaining a first target function level corresponding to the user behavior feature information;
关闭所述应用程序中与所述第一目标函数级别对应的函数。A function in the application corresponding to the first objective function level is closed.
第二方面,本发明实施例还提供了一种应用程序的关闭装置,包括:In a second aspect, an embodiment of the present invention further provides an apparatus for shutting down an application, including:
设置模块,用于对应用程序中的函数设置函数级别;Set a module to set the function level for functions in the application;
第一获取模块,用于接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;a first acquiring module, configured to receive a closing instruction of the application, and acquire user behavior characteristic information of the application within a preset time period;
第二获取模块,用于获取与所述用户行为特征信息对应的第一目标函数级别;a second acquiring module, configured to acquire a first target function level corresponding to the user behavior feature information;
第一处理模块,用于关闭所述应用程序中与所述第一目标函数级别对应的函数。a first processing module, configured to close a function in the application that corresponds to the first target function level.
第三方面,本发明实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如上面所述的应用程序的关闭方法的步骤。In a third aspect, 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. .
第四方面,本发明实施例还提供了一种电子设备,包括处理器和存储器,所述存储器用于存储指令和数据,所述处理器用于执行以下步骤:In a fourth aspect, 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:
对应用程序中的函数设置函数级别;Set the function level for functions in the application;
接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;Receiving a shutdown instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period;
获取与所述用户行为特征信息对应的第一目标函数级别;Obtaining a first target function level corresponding to the user behavior feature information;
关闭所述应用程序中与所述第一目标函数级别对应的函数。A function in the application corresponding to the first objective function level is closed.
有益效果 Beneficial effect
本发明实施例提供一种应用程序的关闭方法、装置、存储介质及电子设备,可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。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.
附图说明DRAWINGS
图1是本发明实施例提供的应用程序的关闭方法的流程示意图。FIG. 1 is a schematic flowchart of a method for shutting down an application program according to an embodiment of the present invention.
图2是本发明实施例提供的应用程序的关闭方法的另一流程示意图。FIG. 2 is another schematic flowchart of a method for shutting down an application according to an embodiment of the present invention.
图3是本发明实施例提供的应用程序的关闭方法的又一流程示意图。FIG. 3 is still another schematic flowchart of a method for shutting down an application according to an embodiment of the present invention.
图4a是本发明实施例提供的应用程序的关闭装置的结构示意图。FIG. 4 is a schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
图4b是本发明实施例提供的应用程序的关闭装置的一结构示意图。FIG. 4b is a schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
图4c是本发明实施例提供的应用程序的关闭装置的另一结构示意图。FIG. 4c is another schematic structural diagram of an apparatus for shutting down an application according to an embodiment of the present invention.
图4d是本发明实施例提供的应用程序的关闭装置的又一结构示意图。FIG. 4 is a schematic structural diagram of another apparatus for shutting down an application program according to an embodiment of the present invention.
图4e是本发明实施例提供的应用程序的关闭装置的再一结构示意图。FIG. 4 is a schematic structural diagram of another apparatus for shutting down an application program according to an embodiment of the present invention.
图5是本发明实施例提供的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
图6是本发明实施例提供的电子设备的另一结构示意图。FIG. 6 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
目前,为了实现各种功能以满足用户的各种需求,通常智能终端会安装各种各样的应用程序(可以简称为应用)。但是,智能终端上安装的应用程序在运行时,会消耗大量的电量,降低智能终端的续航能力。At present, 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, when the application installed on the smart terminal is running, it consumes a large amount of power and reduces the endurance of the smart terminal.
应用程序在运行时,会运行一个主函数以及被主函数调用的多个子函数,来实现应用程序的功能。目前,为了减少智能终端电量的消耗,进而提升智能终端的续航能力,智能终端在关闭应用程序时会关闭应用程序中所有的函数(包括主函数、子函数等等)。At runtime, the application runs a main function and multiple sub-functions called by the main function to implement the functionality of the application. At present, in order to reduce the consumption of power of the smart terminal and thereby improve the endurance of the smart terminal, the smart terminal closes all functions (including main functions, sub-functions, etc.) in the application when the application is closed.
然而,目前应用程序的关闭方案虽然可以降低终端电量消耗,但是由于该方案是关闭应用程序中所有的函数,如果在关闭应用程序之后,智能终端需要重新启动该应用程序,那么此时,智能终端需要重新调用该应用程序的所有函数,会导致应用程序重新启动的速度比较慢。因此,本发明可以采用如下的实现方式来克服。However, although 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. Therefore, the present invention can be overcome by the following implementations.
一种应用程序的关闭方法,包括:A method of closing an application, including:
对应用程序中的函数设置函数级别;Set the function level for functions in the application;
接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;Receiving a shutdown instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period;
获取与所述用户行为特征信息对应的第一目标函数级别;Obtaining a first target function level corresponding to the user behavior feature information;
关闭所述应用程序中与所述第一目标函数级别对应的函数。A function in the application corresponding to the first objective function level is closed.
在一些实施例中,所述对应用程序中的函数设置函数级别的步骤具体包括:In some embodiments, the step of setting a function level for a function in an application specifically includes:
获取应用程序中函数之间的调用关系;Get the call relationship between functions in the application;
根据所述调用关系,对所述应用程序中的函数设置函数级别。A function level is set for a function in the application according to the calling relationship.
在一些实施例中,所述用户行为特征信息包括启动频率,所述获取与所述用户行为特征信息对应的第一目标函数级别的步骤具体包括:In some embodiments, the user behavior characteristic information includes a starting frequency, and the step of acquiring the first target function level corresponding to the user behavior characteristic information specifically includes:
确定所述启动频率所处的启动频率区间;Determining a starting frequency interval in which the starting frequency is located;
获取与所述启动频率区间对应的第一目标函数级别。Obtaining a first objective function level corresponding to the startup frequency interval.
在一些实施例中,所述第一目标函数级别低于最高函数级别,所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤具体包括:In some embodiments, the first target function level is lower than a highest function level, and the step of closing a function corresponding to the first target function level in the application specifically includes:
判断所述第一目标函数级别是否为最低函数级别;Determining whether the first objective function level is the lowest function level;
若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;If yes, closing a function corresponding to the first target function level in the application;
若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。If not, 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.
在一些实施例中,所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤之后,所述应用程序的关闭方法还包括:In some embodiments, after the step of closing a function corresponding to the first target function level in the application, the closing method of the application further includes:
获取终端当前的电量信息;Obtain current power information of the terminal;
获取与所述电量信息对应的第二目标函数级别,所述第二目标函数级别高于所述第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level;
关闭所述应用程序中与所述第二目标函数级别对应的函数。A function in the application corresponding to the second objective function level is closed.
在一些实施例中,所述对应用程序中的函数设置函数级别的步骤具体包括:In some embodiments, the step of setting a function level for a function in an application specifically includes:
获取应用程序中调用传感器的调用函数的集合;Get a collection of call functions that call the sensor in the application;
对所述集合中的调用函数设置函数级别;Setting a function level for the calling function in the collection;
所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤具体包括:The step of closing a function corresponding to the first target function level in the application specifically includes:
关闭所述集合中与所述第一目标函数级别对应的调用函数。The calling function in the set corresponding to the first target function level is closed.
在一些实施例中,获取应用程序中函数之间的调用关系的步骤具体包括:In some embodiments, the step of obtaining a call relationship between functions in an application specifically includes:
根据函数代码中的调用命令来获取函数之间的调用关系。Get the calling relationship between functions according to the calling command in the function code.
在一些实施例中,在关闭所述集合中与所述第一目标函数级别对应的调用函数的步骤之后,还包括:In some embodiments, after the step of closing the calling function in the set corresponding to the first target function level, the method further includes:
更改被关闭的调用函数的标识位。Change the flag bit of the called function that is closed.
本发明实施例提供一种应用程序的关闭方法和装置,以下将分别进行详细说明。The embodiment of the invention provides a method and an apparatus for closing an application, which will be respectively described in detail below.
本实施例将从应用程序的关闭装置的角度进行描述,该装置具体可以集成在终端中,该终端可以为智能手机、平板电脑等设备。This embodiment is described from the perspective of the device for shutting down the device. The device may be integrated into the terminal, and the terminal may be a device such as a smart phone or a tablet computer.
一种应用程序的关闭方法,包括:对应用程序中的函数设置函数级别,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息,获取与该用户行为特征信息对应的第一目标函数级别,并关闭该应用程序中与该第一目标函数级别对应的函数。An application closing method includes: setting a function level to a function in an application, receiving a closing instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period, and acquiring the behavior of the user The first target function level corresponding to the feature information, and the function corresponding to the first target function level in the application is closed.
如图1所示,该应用程序的关闭方法,具体流程可以包括:As shown in FIG. 1 , the method for shutting down the application may include:
S101,对应用程序中的函数设置函数级别。S101, setting a function level for a function in an application.
具体地,能够在操作系统(例如,安卓系统,Android)上运行的任何一个应用程序,都需要有一个主函数(或称为一级函数),主函数是应用程序的入口,用于对其它的各种函数(子函数)进行调用,由被调用的子函数来执行各种功能,同时由于主函数需要给出应用程序的运行结果,因此主函数也是应用程序的出口。通常主函数比较简洁,应用程序需要实现的功能的具体细节被封装到子函数里面供主函数调用,此外,子函数也可以调用其它的子函数。Specifically, any application that can run on an operating system (for example, Android, Android) needs to have a main function (or a first-level function), and the main function is an entry to the application for other The various functions (sub-functions) are called, and the functions are executed by the called sub-functions. Since the main function needs to give the running result of the application, the main function is also the exit of the application. Usually the main function is relatively simple, the specific details of the functions that the application needs to implement are encapsulated into the sub-function for the main function to call. In addition, the sub-function can also call other sub-functions.
对应用程序中的函数设置函数级别可以有多种实现方法,本发明实施例中可以根据函数之间的调用关系来设置函数级别,例如,主函数的级别设置为1级,1级函数调用的函数的级别设置为2级,2级函数调用的函数的级别设置为3级,3级函数调用的函数的级别设置为4级,以此类推。函数级别的数值越大表明该函数在调用关系中处于越下层的位置,即该函数的级别越低。There may be multiple implementation methods for setting a function level to a function in an application. In the embodiment of the present invention, a function level may be set according to a call relationship between functions. For example, the level of the main function is set to level 1, and the level 1 function is called. The level of the function is set to level 2, the level of the function called by the level 2 function is set to level 3, the level of the function called by the level 3 function is set to level 4, and so on. A larger value at the function level indicates that the function is in the lower level of the calling relationship, ie the lower the level of the function.
根据函数之间的调用关系来设置函数级别时,对应用程序中的函数设置函数级别具体可以包括以下步骤:When setting the function level according to the calling relationship between functions, setting the function level to the function in the application can specifically include the following steps:
获取应用程序中函数之间的调用关系;Get the call relationship between functions in the application;
对该应用程序中的函数设置函数级别。Set the function level for the function in the application.
具体地,获取应用程序中函数之间的调用关系的实现方式可以有多种,例如,可以根据函数代码中的调用命令来获取函数之间的调用关系。例如,函数A的代码中包括对函数B的调用命令,函数B的代码中包括对函数C的调用命令,函数C的代码中包括对函数D的调用命令,则可以获取到函数之间的调用关系为:函数A调用函数B,函数B调用函数C,函数C调用函数D。Specifically, the implementation of the calling relationship between functions in the application may be implemented in various manners. For example, the calling relationship between the functions may be obtained according to a calling command in the function code. For example, the code of function A includes a call command to function B, the code of function B includes a call command for function C, and the code of function C includes a call command for function D, and then a call between functions can be obtained. The relationship is: function A calls function B, function B calls function C, and function C calls function D.
当获取到函数之间的调用关系后,可以根据该调用关系来设置函数的函数级别,例如,设置函数A的级别为1级,函数B的级别为2级,函数C的级别为3级,函数D的级别为4级。After the call relationship between the functions is obtained, the function level of the function can be set according to the call relationship. For example, the level of the function A is set to level 1, the level of the function B is level 2, and the level of the function C is level 3. The level of function D is level 4.
S102,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息。S102. Receive a shutdown instruction of the application, and obtain user behavior characteristic information of the application within a preset time period.
具体地,接收应用程序的关闭指令的方式可以有多种,例如,可以通过屏幕接收用户的触摸操作发送的关闭指令,也可以接收用户通过远程操作发送的关闭指令,还可以是接收终端内部的定时器触发的关闭指令。Specifically, the manner of receiving the closing instruction of the application may be various. For example, the closing instruction sent by the user's touch operation may be received through the screen, or the closing instruction sent by the user through the remote operation may be received, or the receiving terminal may be internal. A shutdown command triggered by a timer.
接收到关闭指令后,获取应用程序在预设时间段内的用户行为特征信息。该预设时间段可以是预先存储在终端内置存储区域的一个时间值,也可以是用户设置并存储在终端内置存储区域的一个时间值,例如,10分钟。用户行为特征信息可以是用户对该应用程序的操作信息,例如,在10分钟内运行该应用程序3分钟,再例如,在10分钟内启动该应用程序的启动频率为0.01。After receiving the shutdown command, the user behavior characteristic information of the application within a preset time period is obtained. The preset time period may be a time value stored in advance in the built-in storage area of the terminal, or may be a time value set by the user and stored in the built-in storage area of the terminal, for example, 10 minutes. The user behavior characteristic information may be user operation information of the application, for example, running the application for 3 minutes in 10 minutes, and for example, starting the application within 10 minutes, the activation frequency is 0.01.
S103,获取与该用户行为特征信息对应的第一目标函数级别。S103. Acquire a first target function level corresponding to the user behavior characteristic information.
具体地,可以在终端的内置存储区域中预先存储用户行为特征信息与目标函数级别之间的映射关系,该映射关系也可以由用户设置并存储在终端的内置存储区域中。当获取到用户行为特征信息后,调用存储在终端内置存储区域中的映射关系,根据该映射关系获取目标函数级别。例如,映射关系中启动频率0.01对应的目标函数级别为4级,则当获取到用户行为特征信息为启动频率是0.01时,可以根据该映射关系获取到对应的目标函数级别为4级。Specifically, a mapping relationship between the user behavior feature information and the target function level may be pre-stored in the built-in storage area of the terminal, and the mapping relationship may also be set by the user and stored in the built-in storage area of the terminal. After obtaining the user behavior characteristic information, the mapping relationship stored in the built-in storage area of the terminal is invoked, and the target function level is obtained according to the mapping relationship. For example, if the target function level corresponding to the start frequency of the mapping relationship is 4, the corresponding target function level can be obtained according to the mapping relationship when the start frequency is 0.01.
实际应用中,可能存在多种用户行为特征信息都对应着同一个目标函数级别,例如,启动频率0.01与0.02对应的目标函数级别都是4级,因此,在本发明的一些实施例中,当用户行为特征信息包括启动频率时,根据该用户行为特征信息获取对应的第一目标函数级别可以具体包括以下步骤:In practical applications, there may be multiple user behavior feature information corresponding to the same objective function level. For example, the target function levels corresponding to the start frequencies 0.01 and 0.02 are all 4 levels. Therefore, in some embodiments of the present invention, When the user behavior characteristic information includes the startup frequency, acquiring the corresponding first target function level according to the user behavior characteristic information may specifically include the following steps:
确定该启动频率所处的启动频率区间;Determining the starting frequency interval at which the starting frequency is located;
获取与该启动频率区间对应的第一目标函数级别。Obtaining a first objective function level corresponding to the startup frequency interval.
具体地,可以在终端的内置存储区域中预先存储启动频率区间与目标函数级别之间的映射关系,例如,启动频率区间[0.01,0.03)对应的目标函数级别为4级,启动频率区间[0.03,0.05)对应的目标函数级别为3级。Specifically, the mapping relationship between the startup frequency interval and the target function level may be pre-stored in the built-in storage area of the terminal. For example, the target frequency level corresponding to the startup frequency interval [0.01, 0.03) is 4 levels, and the startup frequency interval [0.03] , 0.05) The corresponding objective function level is level 3.
当获取到应用程序在预设时间段内的启动频率时,确定该启动频率所处的启动频率区间。例如,获取到启动频率为0.02时,可以确定该启动频率所处的启动频率区间为[0.01,0.03),然后调用预先存储的映射关系可以获取到对应的目标函数级别为4级。When the start frequency of the application within the preset time period is obtained, the start frequency interval in which the start frequency is located is determined. For example, when the startup frequency is 0.02, it can be determined that the startup frequency is in the range of [0.01, 0.03), and then the pre-stored mapping relationship can be called to obtain the corresponding target function level of 4.
S104,关闭该应用程序中与该第一目标函数级别对应的函数。S104. Close the function in the application corresponding to the first target function level.
具体地,当获取到目标函数级别时,关闭应用程序中对应的函数,例如,获取到目标函数级别为4级时,关闭应用程序中所有的4级函数。Specifically, when the target function level is acquired, the corresponding function in the application is closed, for example, when the target function level is 4, all the level 4 functions in the application are closed.
为了保证应用程序在下次启动时能够加快启动速度,需要保持应用程序中主函数的持续运行,即主函数不能被关闭,因此,该第一目标函数级别应当低于最高函数级别(最高函数级别即为主函数的级别)。In order to ensure that the application can speed up the startup at the next startup, it is necessary to keep the main function in the application running continuously, that is, the main function cannot be closed. Therefore, the first objective function level should be lower than the highest function level (the highest function level is The level of the main function).
具体应用中,当某个函数被关闭后,被该函数调用的子函数将无法发挥作用(因为被调用的子函数无法将其函数返回值输入到应用程序中),因此,若存在被该函数调用的子函数,可以进一步关闭被该函数调用的子函数。因此,根据该第一目标函数级别关闭该应用程序中对应的函数可以具体包括以下步骤:In a specific application, when a function is closed, the sub-function called by the function will not work (because the called sub-function cannot input its function return value into the application), so if there is a function The called subfunction can further close the subfunction called by the function. Therefore, closing the corresponding function in the application according to the first target function level may specifically include the following steps:
判断该第一目标函数级别是否为最低函数级别;Determining whether the first objective function level is the lowest function level;
若是,则关闭该应用程序中该第一目标函数级别对应的函数;If yes, the function corresponding to the first target function level in the application is closed;
若否,则关闭该应用程序中该第一目标函数级别对应的函数,以及函数级别低于该第一目标函数级别的函数。If not, the function corresponding to the first objective function level in the application and the function whose function level is lower than the first target function level are closed.
具体地,判断该第一目标函数级别是否为最低函数级别的方法可以有多种,例如,查询该应用程序在系统中运行的所有函数中,是否存在被该目标函数级别对应的函数调用的子函数。例如,该目标函数级别为4级,则判断是否存在被4级函数调用的5级函数。Specifically, there may be various methods for determining whether the first target function level is the lowest function level, for example, querying whether all functions of the application running in the system have children called by the function corresponding to the target function level. function. For example, if the target function level is level 4, it is determined whether there is a level 5 function called by the level 4 function.
当判断该第一目标函数级别是最低函数级别时,关闭该第一目标函数级别对应的函数,例如,关闭所有的4级函数;当判断该第一目标函数级别不是最低函数级别时,关闭函数级别小于或等于该目标函数级别的函数,例如,关闭所有4级函数以及5级函数。When it is determined that the first target function level is the lowest function level, the function corresponding to the first target function level is turned off, for example, all level 4 functions are closed; when it is determined that the first target function level is not the lowest function level, the function is closed A function whose level is less than or equal to the target function level, for example, closing all level 4 functions and level 5 functions.
实际应用中,在根据第一目标函数级别关闭应用程序中对应的函数后,可能会存在以下情况,即终端当前电量不多,用户希望能进一步关闭应用程序中剩余的未关闭函数,因此,该应用程序的关闭方法可进一步包括以下步骤:In practical applications, after the corresponding function in the application is closed according to the first target function level, there may be the following situation, that is, the current power of the terminal is not much, and the user desires to further close the remaining unclosed functions in the application, therefore, the The method of closing the application may further include the following steps:
获取终端当前的电量信息;Obtain current power information of the terminal;
获取与该电量信息对应的第二目标函数级别,该第二目标函数级别高于该第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, the second target function level being higher than the first target function level;
关闭该应用程序中与该第二目标函数级别对应的函数。Close the function in the application that corresponds to the second objective function level.
具体地,获取终端当前的电量信息的实现方式有多种,例如,可以通过终端自带的电源管理程序获取电量信息,该电量信息可以是剩余电量占电池总容量的百分比,例如,电量信息为30%表示终端当前剩余30%电量。Specifically, the method for obtaining the current power information of the terminal is implemented by using a power management program that is provided by the terminal, and the power information may be a percentage of the total battery capacity. For example, the power information is 30% means that the terminal currently has 30% of the remaining power.
可以在终端的内置存储区域中预先存储电量信息与第二目标函数级别之间的映射关系,例如30%电量对应的目标函数级别为3级,20%电量对应的目标函数级别为2级等,获取到终端的电量信息后,调用终端中存储的映射关系来获取对应的第二目标函数级别;也可以在终端的内置存储区域中预先存储电量信息区间与第二目标函数级别之间的映射关系,例如,电量信息[30%,40%)对应的目标函数级别为3级,[20%,30%)对应的目标函数级别为2级等,则获取到终端的电量信息后,先确定该电量信息所处的电量信息区间,随后根据该电量信息区间和映射关系获取第二目标函数级别。The mapping relationship between the power information and the second target function level may be pre-stored in the built-in storage area of the terminal, for example, the target function level corresponding to 30% power is 3, and the target function level corresponding to 20% power is 2, etc. After obtaining the power information of the terminal, the mapping relationship stored in the terminal is invoked to obtain the corresponding second target function level; or the mapping relationship between the power information interval and the second target function level may be pre-stored in the built-in storage area of the terminal. For example, if the power function information [30%, 40%) corresponds to the target function level is 3, [20%, 30%) corresponds to the target function level is 2, etc., after obtaining the power information of the terminal, first determine the The power information interval in which the power information is located, and then acquiring the second target function level according to the power information interval and the mapping relationship.
根据上文的描述,第一目标函数级别对应的函数已经都被关闭,剩余的未关闭函数的函数级别应当高于第一目标函数级别,因此,该第二目标函数级别应当高于该第一目标函数级别。According to the above description, the functions corresponding to the first objective function level have all been closed, and the function level of the remaining unclosed functions should be higher than the first target function level, therefore, the second objective function level should be higher than the first The target function level.
关闭该应用程序中与该第二目标函数级别对应的函数,具体地,获取到第二目标函数级别后,例如,根据电量信息20%获取到第二目标函数级别为2级,则关闭应用程序中所有的2级函数,或者关闭应用程序中所有的2级函数以及函数级别低于2级的函数(3级函数、4级函数等)。Close the function corresponding to the second target function level in the application. Specifically, after obtaining the second target function level, for example, if the second target function level is obtained according to the power information 20%, the application is closed. All of the level 2 functions, or close all level 2 functions in the application and functions with level 2 or lower level (level 3 functions, level 4 functions, etc.).
由上可知,本发明实施例提供的应用程序的关闭方法,采用对应用程序中的函数设置函数级别,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息,获取与该用户行为特征信息对应的第一目标函数级别,并关闭该应用程序中与该第一目标函数级别对应的函数;该方案首先对应用程序中的函数设置函数级别,然后获取目标函数级别,并关闭应用程序中与该目标函数级别对应的函数,由于该方案并没有直接关闭应用程序,而是关闭应用程序中对应的函数,因此,在需要重新启动该应用程序时,只需要重新调用被关闭的函数即可。本发明实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。It can be seen that the method for closing an application provided by the embodiment of the present invention sets a function level to a function in an application, receives a shutdown instruction of the application, and acquires a user behavior characteristic of the application within a preset time period. Information, obtaining a first target function level corresponding to the user behavior characteristic information, and closing a function corresponding to the first target function level in the application; the solution first sets a function level to a function in the application, and then acquires a target Function level, and close the function in the application corresponding to the target function level, because the program does not directly close the application, but close the corresponding function in the application, so when you need to restart the application, you only need Recall the function that was closed. The embodiment of the invention can improve the speed of restarting the application while reducing the power consumption of the terminal.
根据上述实施例所描述的应用程序的关闭方法,以下将举例作进一步详细说明。The method of closing the application according to the above embodiment will be further described in detail below.
在本实施例中,将以应用程序的关闭装置具体集成在智能手机中,以智能手机中应用程序的关闭方法为例进行详细描述。In this embodiment, the closing device of the application is specifically integrated into the smart phone, and the method for closing the application in the smart phone is taken as an example for detailed description.
如图2所示,该应用程序的关闭方法,具体流程可以如下:As shown in Figure 2, the application shutdown method can be as follows:
S201,获取应用程序中函数之间的调用关系。S201. Acquire a calling relationship between functions in an application.
具体地,获取应用程序中函数之间的调用关系的实现方式可以有多种,例如,可以根据函数代码中的调用命令来获取函数之间的调用关系。例如,函数A的代码中包括对函数B的调用命令,函数B的代码中包括对函数C的调用命令,函数C的代码中包括对函数D的调用命令,则可以获取到函数之间的调用关系为:函数A调用函数B,函数B调用函数C,函数C调用函数D。Specifically, the implementation of the calling relationship between functions in the application may be implemented in various manners. For example, the calling relationship between the functions may be obtained according to a calling command in the function code. For example, the code of function A includes a call command to function B, the code of function B includes a call command for function C, and the code of function C includes a call command for function D, and then a call between functions can be obtained. The relationship is: function A calls function B, function B calls function C, and function C calls function D.
S202,对该应用程序中的函数设置函数级别。S202, setting a function level for a function in the application.
具体地,当获取到函数之间的调用关系后,可以根据该调用关系来设置函数的函数级别,例如,设置函数A的级别为1级,函数B的级别为2级,函数C的级别为3级,函数D的级别为4级。函数级别的数值越大表明该函数在调用关系中处于越下层的位置,即该函数的级别越低。Specifically, after the calling relationship between the functions is obtained, the function level of the function may be set according to the calling relationship. For example, the level of the function A is set to level 1, the level of the function B is level 2, and the level of the function C is Level 3, the level of function D is level 4. A larger value at the function level indicates that the function is in the lower level of the calling relationship, ie the lower the level of the function.
S203,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的启动频率。S203. Receive a shutdown instruction of the application, and obtain a startup frequency of the application within a preset time period.
具体地,智能手机可以通过屏幕接收用户的触摸操作发送的关闭指令,例如,用户点击触摸屏上该应用程序的关闭按钮(虚拟按钮),智能手机向该应用程序发送关闭指令以响应用户的触摸操作。预设时间段可以是智能手机中预先存储的一个时间值,例如,预设时间段为10分钟,在10分钟内,通过计数函数来对该应用程序的启动次数进行计数,该应用程序每启动一次,计数函数的计数数值增加1。当智能手机接收到该应用程序的关闭指令时,调取10分钟内该计数函数的计数数值,以该计数数值与该预设时间段的时长来计算该应用程序的启动频率。Specifically, the smart phone can receive a closing instruction sent by the user's touch operation through the screen. For example, the user clicks the close button (virtual button) of the application on the touch screen, and the smart phone sends a closing instruction to the application in response to the user's touch operation. . The preset time period may be a pre-stored time value in the smartphone. For example, the preset time period is 10 minutes, and within 10 minutes, the number of starts of the application is counted by a counting function, and the application starts every time. Once, the count value of the count function is incremented by 1. When the smart phone receives the closing command of the application, it retrieves the count value of the counting function within 10 minutes, and calculates the starting frequency of the application by the counting value and the duration of the preset time period.
S204,确定该启动频率所处的启动频率区间。S204. Determine a starting frequency interval in which the starting frequency is located.
具体地,可以预先将启动频率划分为多个区间,例如,可以将启动频率划分为[0.01,0.03)、[0.03,0.05)、[0.05,0.07)等多个区间,当获取到应用程序在预设时间段内的启动频率后,确定该启动频率所处的启动频率区间。例如,获取到启动频率为0.02时,可以确定该启动频率所处的启动频率区间为[0.01,0.03)。Specifically, the starting frequency may be divided into a plurality of intervals in advance. For example, the starting frequency may be divided into multiple intervals such as [0.01, 0.03), [0.03, 0.05), [0.05, 0.07), and when the application is acquired. After the starting frequency within the preset time period, the starting frequency interval in which the starting frequency is located is determined. For example, when the starting frequency is 0.02, it can be determined that the starting frequency interval of the starting frequency is [0.01, 0.03).
S205,获取与该启动频率区间对应的第一目标函数级别。S205. Acquire a first target function level corresponding to the startup frequency interval.
具体地,可以在终端的内置存储区域中预先存储启动频率区间与目标函数级别之间的映射关系,例如,启动频率区间[0.01,0.03)对应的目标函数级别为4级,启动频率区间[0.03,0.05)对应的目标函数级别为3级;当确定启动频率所处的启动频率区间后,例如,确定的启动频率区间为[0.01,0.03),则可以调用预先存储的映射关系获取到对应的目标函数级别为4级。Specifically, the mapping relationship between the startup frequency interval and the target function level may be pre-stored in the built-in storage area of the terminal. For example, the target frequency level corresponding to the startup frequency interval [0.01, 0.03) is 4 levels, and the startup frequency interval [0.03] , 0.05) the corresponding objective function level is level 3; after determining the starting frequency interval in which the starting frequency is located, for example, the determined starting frequency interval is [0.01, 0.03), the pre-stored mapping relationship may be called to obtain the corresponding The objective function level is level 4.
S206,判断该第一目标函数级别是否为最低函数级别。S206. Determine whether the first target function level is the lowest function level.
具体地,判断该第一目标函数级别是否为最低函数级别的方法可以有多种,例如,查询该应用程序在系统中运行的所有函数中,是否存在被该目标函数级别对应的函数调用的子函数。例如,该目标函数级别为4级,则判断是否存在被4级函数调用的5级函数;若不存在,则判断为该第一目标函数级别是最低函数级别,随后执行步骤S207,若存在,则判断为该第一目标函数级别不是最低函数级别,随后执行步骤S208。Specifically, there may be various methods for determining whether the first target function level is the lowest function level, for example, querying whether all functions of the application running in the system have children called by the function corresponding to the target function level. function. For example, if the target function level is level 4, it is determined whether there is a level 5 function called by the level 4 function; if not, it is determined that the first object function level is the lowest function level, and then step S207 is performed, if any, Then, it is determined that the first target function level is not the lowest function level, and then step S208 is performed.
S207,关闭该应用程序中与该第一目标函数级别对应的函数。S207. Close the function in the application corresponding to the first target function level.
具体地,当判断该第一目标函数级别是最低函数级别时,关闭该第一目标函数级别对应的函数,例如,第一目标函数级别为4级,则关闭所有的4级函数。Specifically, when it is determined that the first target function level is the lowest function level, the function corresponding to the first target function level is turned off. For example, if the first target function level is level 4, all the level 4 functions are turned off.
S208,关闭该应用程序中与该第一目标函数级别对应的函数,以及函数级别低于该第一目标函数级别的函数。S208. Close a function in the application corresponding to the first target function level, and a function whose function level is lower than the first target function level.
具体地,当判断该第一目标函数级别不是最低函数级别时,关闭函数级别小于或等于该目标函数级别的函数,例如,第一目标函数级别为4级,则关闭所有的4级函数以及5级函数。Specifically, when it is determined that the first target function level is not the lowest function level, the function whose function level is less than or equal to the target function level is turned off. For example, if the first target function level is level 4, all level 4 functions are closed and 5 Level function.
S209,获取终端当前的电量信息。S209. Acquire current power information of the terminal.
具体地,获取终端当前的电量信息的实现方式有多种,例如,可以通过终端自带的电源管理程序获取电量信息,该电量信息可以是剩余电量占电池总容量的百分比,例如,电量信息为30%表示终端当前剩余30%电量。Specifically, the method for obtaining the current power information of the terminal is implemented by using a power management program that is provided by the terminal, and the power information may be a percentage of the total battery capacity. For example, the power information is 30% means that the terminal currently has 30% of the remaining power.
S210,获取与该电量信息对应的第二目标函数级别,该第二目标函数级别高于该第一目标函数级别。S210. Acquire a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level.
具体地,可以在终端的内置存储区域中预先存储电量信息区间与第二目标函数级别之间的映射关系,例如,电量信息[30%,40%)对应的目标函数级别为3级,电量信息[20%,30%)对应的目标函数级别为2级等,则获取到终端的电量信息后,先确定该电量信息所处的电量信息区间,随后根据该电量信息区间和预先存储的映射关系获取第二目标函数级别。Specifically, a mapping relationship between the power information section and the second target function level may be pre-stored in the built-in storage area of the terminal. For example, the power function information (30%, 40%) corresponds to an objective function level of level 3, and the power information. [20%, 30%) corresponding target function level is level 2, etc., after obtaining the power information of the terminal, first determine the power information interval in which the power information is located, and then according to the power information interval and the pre-stored mapping relationship Get the second objective function level.
S211,关闭该应用程序中与该第二目标函数级别对应的函数。S211, closing a function corresponding to the second target function level in the application.
具体地,获取到第二目标函数级别后,例如,根据电量信息20%获取到第二目标函数级别为2级,则关闭应用程序中所有的2级函数,或者关闭应用程序中所有的2级函数以及函数级别低于2级的函数(3级函数、4级函数等)。Specifically, after obtaining the second target function level, for example, if the second target function level is obtained according to the power information 20%, the level 2 function is closed, and all the level 2 functions in the application are closed, or all levels 2 in the application are closed. Functions and functions whose function level is lower than level 2 (level 3 function, level 4 function, etc.).
由上可知,本发明实施例提供的应用程序的关闭方法,采用获取应用程序中函数之间的调用关系,对该应用程序中的函数设置函数级别,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的启动频率,确定该启动频率所处的启动频率区间,并获取与该启动频率区间对应的第一目标函数级别,判断该第一目标函数级别是否为最低函数级别,若是则关闭该应用程序中与该第一目标函数级别对应的函数,若否则关闭该应用程序中与该第一目标函数级别对应的函数,以及函数级别低于该第一目标函数级别的函数,随后获取终端当前的电量信息,并获取与该电量信息对应的第二目标函数级别,关闭该应用程序中与该第二目标函数级别对应的函数;该方案首先关闭与该应用程序的启动频率对应的函数,并进一步关闭与该电量信息对应的函数,由于该方案并没有直接关闭应用程序,而是只关闭应用程序中对应的函数,因此,在需要重新启动该应用程序时,只需要重新调用被关闭的函数即可。本实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。It can be seen that the method for closing an application provided by the embodiment of the present invention acquires a calling relationship between functions in an application, sets a function level for a function in the application, receives a closing instruction of the application, and acquires the The startup frequency of the application in the preset time period determines the start frequency interval in which the start frequency is located, and acquires a first target function level corresponding to the start frequency interval, and determines whether the first target function level is the lowest function level. If yes, the function corresponding to the first target function level in the application is closed, if otherwise, the function corresponding to the first target function level in the application is closed, and the function level is lower than the function of the first target function level. And acquiring the current power information of the terminal, and acquiring a second target function level corresponding to the power information, and closing a function corresponding to the second target function level in the application; the solution first closing the startup frequency of the application Corresponding function, and further close the function corresponding to the power information, due to The program does not directly close the application, but only close function corresponding application, therefore, when the need to restart the application need only recall function can be turned off. In this embodiment, the speed of restarting the application can be improved while reducing the power consumption of the terminal.
目前的智能终端都设置有很多的传感器,例如,GPS(Global Positioning System,全球定位系统)传感器、重力传感器、指纹传感器、图像传感器、音频传感器等,应用程序通过应用程序中的传感器调用函数来调用这些传感器,每个传感器可以被多个应用程序调用,每个应用程序也可以调用多个传感器。Currently, smart terminals are equipped with many sensors, for example, GPS (Global Positioning) System, Global Positioning System) sensors, gravity sensors, fingerprint sensors, image sensors, audio sensors, etc., applications call these sensors through sensor call functions in the application, each sensor can be called by multiple applications, each application The program can also call multiple sensors.
在应用程序关闭时,通常应用程序中调用传感器的调用函数并未关闭,调用函数在应用程序关闭后依然保持运行会增加终端的功率消耗,进而增加终端的电量消耗,降低终端的续航能力。When the application is closed, usually the calling function of the calling sensor in the application is not closed. The calling function remains running after the application is closed, which increases the power consumption of the terminal, thereby increasing the power consumption of the terminal and reducing the endurance of the terminal.
本实施例将从应用程序的关闭装置的角度进行描述,该装置具体可以集成在终端中,该终端可以为智能手机、平板电脑等设备。This embodiment is described from the perspective of the device for shutting down the device. The device may be integrated into the terminal, and the terminal may be a device such as a smart phone or a tablet computer.
本发明实施例提供一种应用程序的关闭方法,可以在应用程序关闭时关闭传感器的调用函数,该方法包括:获取应用程序中调用传感器的调用函数的集合,对该集合中的调用函数设置函数级别,接收该应用程序的关闭指令,并根据该关闭指令获取该应用程序在预设时间段内的用户行为特征信息,根据该用户行为特征信息获取对应的第一目标函数级别,并根据该第一目标函数级别关闭该集合中对应的调用函数。An embodiment of the present invention provides a method for closing an application, which can be used to close a calling function of a sensor when the application is closed. The method includes: acquiring a set of calling functions of the calling sensor in the application, and setting a function of the calling function in the set. Level, receiving a closing instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period according to the closing instruction, acquiring a corresponding first objective function level according to the user behavior characteristic information, and according to the first An objective function level closes the corresponding calling function in the collection.
如图3所示,该应用程序的关闭方法,具体流程可以如下:As shown in Figure 3, the application shutdown method can be as follows:
S301,获取应用程序中调用传感器的调用函数的集合。S301. Acquire a collection of calling functions of the calling sensor in the application.
具体地,应用程序中存在多个调用函数用于调用多个传感器,例如,调用函数E用于调用指纹传感器,调用函数F用于调用图像传感器,调用函数G用于调用音频传感器,则可以获取到该集合包括调用函数E、调用函数F、调用函数G。Specifically, there are multiple calling functions in the application for calling multiple sensors. For example, the calling function E is used to call the fingerprint sensor, the calling function F is used to call the image sensor, and the calling function G is used to call the audio sensor, and then the function can be obtained. The collection includes calling function E, calling function F, and calling function G.
S302,对该集合中的调用函数设置函数级别。S302, setting a function level for the calling function in the set.
具体地,设置函数级别时,可以根据该多个调用函数所调用的传感器的功能重要性来进行设置,例如,指纹传感器是进入该应用程序时的鉴权方式,则指纹传感器的重要性最高,可设置指纹传感器调用函数E的级别为2级,图像传感器是用于实现该应用程序的基本功能,则图像传感器的重要性次之,可设置图像传感器调用函数F的级别为3级,音频传感器是用于实现该应用程序的附加功能,则音频传感器的重要性最低,可将音频传感器调用函数G的级别设置为4级。Specifically, when the function level is set, the function may be set according to the function importance of the sensor called by the multiple calling functions. For example, the fingerprint sensor is an authentication mode when entering the application, and the fingerprint sensor has the highest importance. The fingerprint sensor can be set to the level of level 2 of the function E. The image sensor is used to implement the basic functions of the application. The importance of the image sensor is second. The level of the image sensor calling function F can be set to level 3, and the audio sensor It is an additional function for implementing the application, and the audio sensor is of the least importance, and the level of the audio sensor calling function G can be set to level 4.
在本发明的一些实施例中,可以对集合中的调用函数设置标识位,例如,将集合中的所有调用函数的标识位设置为1,标识位还可以包括颜色,例如,将集合中的所有调用函数的标识位设置为绿色。In some embodiments of the invention, the identification bits may be set to the calling function in the collection, for example, the identification bits of all calling functions in the collection are set to 1, and the identification bits may also include colors, for example, all of the collections The flag of the calling function is set to green.
S303,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息。S303. Receive a shutdown instruction of the application, and obtain user behavior characteristic information of the application within a preset time period.
具体地,接收应用程序的关闭指令的方式可以有多种,例如,可以通过屏幕接收用户的触摸操作发送的关闭指令,也可以接收用户通过远程操作发送的关闭指令,还可以是接收终端内部的定时器触发的关闭指令。Specifically, the manner of receiving the closing instruction of the application may be various. For example, the closing instruction sent by the user's touch operation may be received through the screen, or the closing instruction sent by the user through the remote operation may be received, or the receiving terminal may be internal. A shutdown command triggered by a timer.
接收到关闭指令后,获取应用程序在预设时间段内的用户行为特征信息。该预设时间段可以是预先存储在终端内置存储区域的一个时间值,也可以是用户设置并存储在终端内置存储区域的一个时间值,例如,10分钟。用户行为特征信息可以是用户对该应用程序的操作信息,例如,在10分钟内运行该应用程序3分钟,再例如,在10分钟内启动该应用程序的启动频率为0.04。After receiving the shutdown command, the user behavior characteristic information of the application within a preset time period is obtained. The preset time period may be a time value stored in advance in the built-in storage area of the terminal, or may be a time value set by the user and stored in the built-in storage area of the terminal, for example, 10 minutes. The user behavior characteristic information may be user operation information of the application, for example, running the application for 3 minutes in 10 minutes, and for example, starting the application within 10 minutes, the startup frequency is 0.04.
S304,获取与该用户行为特征信息对应的第一目标函数级别。S304. Acquire a first target function level corresponding to the user behavior characteristic information.
具体地,可以在终端的内置存储区域中预先存储用户行为特征信息与目标函数级别之间的映射关系,该映射关系也可以由用户设置并存储在终端的内置存储区域中。当获取到用户行为特征信息后,调用存储在终端内置存储区域中的映射关系,根据该映射关系获取目标函数级别。例如,映射关系中启动频率0.04对应的目标函数级别为3级,则当获取到用户行为特征信息为启动频率是0.04时,可以根据该映射关系获取到对应的目标函数级别为3级。Specifically, a mapping relationship between the user behavior feature information and the target function level may be pre-stored in the built-in storage area of the terminal, and the mapping relationship may also be set by the user and stored in the built-in storage area of the terminal. After obtaining the user behavior characteristic information, the mapping relationship stored in the built-in storage area of the terminal is invoked, and the target function level is obtained according to the mapping relationship. For example, if the target function level corresponding to the start frequency 0.04 in the mapping relationship is level 3, when the user behavior feature information is obtained as the start frequency is 0.04, the corresponding target function level can be obtained according to the mapping relationship to be level 3.
S305,关闭该集合中与该第一目标函数级别对应的调用函数。S305. Close the calling function in the set corresponding to the first target function level.
具体地,当获取到目标函数级别时,关闭集合中对应的调用函数,例如,获取到目标函数级别为3级时,关闭集合中所有的3级调用函数,也可以关闭集合中所有的3级调用函数和4级调用函数。Specifically, when the target function level is obtained, the corresponding calling function in the set is closed. For example, when the target function level is 3, all the level 3 calling functions in the set are closed, and all the level 3 in the set may be closed. Call the function and the level 4 call function.
在本发明的一些实施例中,在关闭集合中对应的调用函数后,还可以更改被关闭的调用函数的标识位,例如,将集合中被关闭的所有调用函数的标识位由1更改为2,标识位还可以包括颜色,例如,将集合中被关闭的所有调用函数的标识位由绿色更改为红色。In some embodiments of the present invention, after the corresponding calling function in the collection is closed, the identification bit of the closed calling function may also be changed, for example, changing the flag of all calling functions that are closed in the collection from 1 to 2. The flag can also include a color, for example, changing the flag of all calling functions that are turned off in the collection from green to red.
由上可知,本发明实施例提供的应用程序的关闭方法,采用获取应用程序中调用传感器的调用函数的集合,对该集合中的调用函数设置函数级别,接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息,获取与该用户行为特征信息对应的第一目标函数级别,并关闭该集合中与该第一目标函数级别对应的调用函数;该方案首先对集合中的调用函数设置函数级别,然后获取对应的目标函数级别,并关闭集合中与该目标函数级别对应的调用函数,由于该方案并没有直接关闭应用程序,而是关闭应用程序中对应的调用函数,因此,在需要重新启动该应用程序时,只需要重新调用被关闭的调用函数即可。本实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。It can be seen that the closing method of the application program provided by the embodiment of the present invention uses a set of calling functions for calling a sensor in an application, sets a function level for the calling function in the set, receives a closing instruction of the application, and acquires The user behavior feature information in the preset time period acquires a first target function level corresponding to the user behavior feature information, and closes a calling function corresponding to the first target function level in the set; Set the function level to the calling function in the collection, then get the corresponding target function level, and close the calling function corresponding to the target function level in the collection. Since the solution does not directly close the application, it closes the corresponding in the application. The function is called, so when you need to restart the application, you only need to recall the called function that was closed. In this embodiment, the speed of restarting the application can be improved while reducing the power consumption of the terminal.
为了更好地实施以上方法,本发明实施例还提供一种应用程序的关闭装置,该应用程序的关闭装置可以集成在终端中,该终端具体可以是智能手机、平板电脑等设备。In order to better implement the above method, the embodiment of the present invention further provides a device for shutting down an application, and the device for closing the application may be integrated in the terminal, and the terminal may specifically be a device such as a smart phone or a tablet computer.
一种应用程序的关闭装置,包括:An application closing device comprising:
设置模块,用于对应用程序中的函数设置函数级别;Set a module to set the function level for functions in the application;
第一获取模块,用于接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;a first acquiring module, configured to receive a closing instruction of the application, and acquire user behavior characteristic information of the application within a preset time period;
第二获取模块,用于获取与所述用户行为特征信息对应的第一目标函数级别;a second acquiring module, configured to acquire a first target function level corresponding to the user behavior feature information;
第一处理模块,用于关闭所述应用程序中与所述第一目标函数级别对应的函数。a first processing module, configured to close a function in the application that corresponds to the first target function level.
在一些实施例中,所述设置模块具体包括:In some embodiments, the setting module specifically includes:
第一获取子模块,用于获取应用程序中函数之间的调用关系;a first obtaining submodule, configured to acquire a calling relationship between functions in an application;
设置子模块,用于对所述应用程序中的函数设置函数级别。A submodule is set to set a function level for a function in the application.
在一些实施例中,所述用户行为特征信息包括启动频率,所述第二获取模块具体包括:In some embodiments, the user behavior feature information includes a starting frequency, and the second acquiring module specifically includes:
确定子模块,用于确定所述启动频率所处的启动频率区间;Determining a submodule for determining a starting frequency interval in which the starting frequency is located;
第二获取子模块,用于获取与所述启动频率区间对应的第一目标函数级别。And a second acquiring submodule, configured to acquire a first target function level corresponding to the starting frequency interval.
在一些实施例中,所述第一目标函数级别低于最高函数级别,所述第一处理模块具体包括:In some embodiments, the first target function level is lower than a highest function level, and the first processing module specifically includes:
判断子模块,用于判断所述第一目标函数级别是否为最低函数级别;a determining submodule, configured to determine whether the first target function level is the lowest function level;
处理子模块,用于在所述判断子模块判断为是时,关闭所述应用程序中所述第一目标函数级别对应的函数;在所述判断子模块判断为否时,关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。a processing submodule, configured to: when the determining submodule determines to be YES, close a function corresponding to the first target function level in the application; when the determining submodule determines to be no, close the application The function corresponding to the first objective function level and the function level lower than the first objective function level.
在一些实施例中,所述关闭装置还包括第二处理模块,所述第二处理模块用于:In some embodiments, the shutdown device further includes a second processing module, the second processing module is configured to:
获取终端当前的电量信息;Obtain current power information of the terminal;
获取与所述电量信息对应的第二目标函数级别,所述第二目标函数级别高于所述第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level;
关闭所述应用程序中与所述第二目标函数级别对应的函数。A function in the application corresponding to the second objective function level is closed.
如图4a所示,该应用程序的关闭装置可以包括:设置模块401、第一获取模块402、第二获取模块403、第一处理模块404,具体描述如下:As shown in FIG. 4a, the shutdown device of the application may include: a setting module 401, a first obtaining module 402, a second obtaining module 403, and a first processing module 404, which are specifically described as follows:
该设置模块401,用于对应用程序中的函数设置函数级别。The setting module 401 is configured to set a function level for a function in the application.
该第一获取模块402,用于接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息。The first obtaining module 402 is configured to receive a closing instruction of the application, and obtain user behavior characteristic information of the application within a preset time period.
该第二获取模块403,用于获取与该用户行为特征信息对应的第一目标函数级别。The second obtaining module 403 is configured to acquire a first target function level corresponding to the user behavior feature information.
该第一处理模块404,用于关闭该应用程序中与该第一目标函数级别对应的函数。The first processing module 404 is configured to close a function corresponding to the first target function level in the application.
在本发明的一些实施例中,如图4b所示,该设置模块401可以包括:第一获取子模块4011、设置子模块4012,具体如下:In some embodiments of the present invention, as shown in FIG. 4b, the setting module 401 may include: a first obtaining submodule 4011 and a setting submodule 4012, as follows:
该第一获取子模块4011,用于获取应用程序中函数之间的调用关系。The first obtaining sub-module 4011 is configured to acquire a calling relationship between functions in an application.
该设置子模块4012,用于对该应用程序中的函数设置函数级别。The setting sub-module 4012 is configured to set a function level for the function in the application.
在本发明的一些实施例中,该用户行为特征信息包括启动频率,如图4c所示,该第二获取模块403可以包括:确定子模块4031、第二获取子模块4032,具体如下:In some embodiments of the present invention, the user behavior characteristic information includes a startup frequency. As shown in FIG. 4c, the second obtaining module 403 may include: a determining submodule 4031 and a second obtaining submodule 4032, as follows:
该确定子模块4031,用于确定该启动频率所处的启动频率区间。The determining sub-module 4031 is configured to determine a starting frequency interval in which the starting frequency is located.
该第二获取子模块4032,用于获取与该启动频率区间对应的第一目标函数级别。The second obtaining submodule 4032 is configured to acquire a first target function level corresponding to the starting frequency interval.
在本发明的一些实施例中,第一目标函数级别低于最高函数级别,如图4d所示,该第一处理模块404可以包括:判断子模块4041、处理子模块4042,具体如下:In some embodiments of the present invention, the first target function level is lower than the highest function level. As shown in FIG. 4d, the first processing module 404 may include: a determining submodule 4041 and a processing submodule 4042, as follows:
该判断子模块4041,用于判断该第一目标函数级别是否为最低函数级别。The determining sub-module 4041 is configured to determine whether the first target function level is the lowest function level.
该处理子模块4042,用于在该判断子模块4041判断为是时,关闭该应用程序中该第一目标函数级别对应的函数;在该判断子模块4041判断为否时,关闭该应用程序中该第一目标函数级别对应的函数,以及函数级别低于该第一目标函数级别的函数。The processing sub-module 4042 is configured to: when the determining sub-module 4041 determines YES, close a function corresponding to the first target function level in the application; when the determining sub-module 4041 determines to be no, close the application. The function corresponding to the first objective function level and the function level lower than the function of the first objective function level.
在本发明的一些实施例中,如图4e所示,该应用程序的关闭装置还可以包括:第二处理模块405;该第二处理模块405用于:In some embodiments of the present invention, as shown in FIG. 4e, the closing device of the application may further include: a second processing module 405; the second processing module 405 is configured to:
获取终端当前的电量信息;Obtain current power information of the terminal;
获取与该电量信息对应的第二目标函数级别,该第二目标函数级别高于该第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, the second target function level being higher than the first target function level;
关闭该应用程序中与该第二目标函数级别对应的函数。Close the function in the application that corresponds to the second objective function level.
由上可知,本发明实施例提供的应用程序的关闭装置,通过设置模块401对应用程序中的函数设置函数级别,第一获取模块402接收该应用程序的关闭指令,并获取该应用程序在预设时间段内的用户行为特征信息,第二获取模块403获取与该用户行为特征信息对应的第一目标函数级别,第一处理模块404关闭该应用程序中与该第一目标函数级别对应的函数;由于该方案并没有直接关闭应用程序,而是关闭应用程序中对应的函数,因此,在需要重新启动该应用程序时,只需要重新调用被关闭的函数即可。本实施例可以在降低终端电量消耗的同时,提升应用程序重新启动的速度。It can be seen from the above that the closing device of the application program provided by the embodiment of the present invention sets the function level to the function in the application program by the setting module 401, and the first obtaining module 402 receives the closing instruction of the application program, and acquires the application program in advance. Setting the user behavior characteristic information in the time period, the second obtaining module 403 acquires the first target function level corresponding to the user behavior characteristic information, and the first processing module 404 closes the function corresponding to the first target function level in the application program. Because the program does not close the application directly, but closes the corresponding function in the application, so when you need to restart the application, you only need to recall the closed function. In this embodiment, the speed of restarting the application can be improved while reducing the power consumption of the terminal.
具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个模块的具体实施可参见前面的方法实施例,在此不再赘述。For the specific implementation, 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. For the specific implementation of the foregoing modules, refer to the foregoing method embodiments, and details are not described herein again.
在一些实施例中,还提供一种电子设备,该电子设备可以是智能手机、平板电脑等设备。图5所示,电子设备500包括处理器501、存储器502、显示屏503以及控制电路504。其中,处理器501分别与存储器502、显示屏503、控制电路504电性连接。In some embodiments, an electronic device is also provided, which may be a device such as a smartphone, a tablet, or the like. As shown in FIG. 5, 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.
处理器501是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的应用程序,以及调用存储在存储器502内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。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.
在本实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器502中,并由处理器501来运行存储在存储器502中的应用程序,从而实现各种功能:In this embodiment, 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. In the application, thus implementing various functions:
对应用程序中的函数设置函数级别;Set the function level for functions in the application;
接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;Receiving a shutdown instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period;
获取与所述用户行为特征信息对应的第一目标函数级别;Obtaining a first target function level corresponding to the user behavior feature information;
关闭所述应用程序中与所述第一目标函数级别对应的函数。A function in the application corresponding to the first objective function level is closed.
在一些实施例中,所述对应用程序中的函数设置函数级别时,所述处理器还用于执行以下步骤:In some embodiments, when the function level is set for a function in an application, the processor is further configured to perform the following steps:
获取应用程序中函数之间的调用关系;Get the call relationship between functions in the application;
根据所述调用关系,对所述应用程序中的函数设置函数级别。A function level is set for a function in the application according to the calling relationship.
在一些实施例中,所述用户行为特征信息包括启动频率,所述获取与所述用户行为特征信息对应的第一目标函数级别时,所述处理器还用于执行以下步骤:In some embodiments, the user behavior characteristic information includes a startup frequency, and when the first target function level corresponding to the user behavior characteristic information is acquired, the processor is further configured to perform the following steps:
确定所述启动频率所处的启动频率区间;Determining a starting frequency interval in which the starting frequency is located;
获取与所述启动频率区间对应的第一目标函数级别。Obtaining a first objective function level corresponding to the startup frequency interval.
在一些实施例中,所述第一目标函数级别低于最高函数级别,所述关闭所述应用程序中与所述第一目标函数级别对应的函数时,所述处理器还用于执行以下步骤:In some embodiments, the first target function level is lower than a highest function level, and when the function corresponding to the first target function level in the application is closed, the processor is further configured to perform the following steps. :
判断所述第一目标函数级别是否为最低函数级别;Determining whether the first objective function level is the lowest function level;
若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;If yes, closing a function corresponding to the first target function level in the application;
若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。If not, 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.
在一些实施例中,所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤之后,所述处理器还用于执行以下步骤:In some embodiments, after the step of closing a function corresponding to the first target function level in the application, the processor is further configured to perform the following steps:
获取电子设备当前的电量信息;Obtaining current power information of the electronic device;
获取与所述电量信息对应的第二目标函数级别,所述第二目标函数级别高于所述第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level;
关闭所述应用程序中与所述第二目标函数级别对应的函数。A function in the application corresponding to the second objective function level is closed.
在一些实施例中,所述对应用程序中的函数设置函数级别时,所述处理器还用于执行以下步骤:In some embodiments, when the function level is set for a function in an application, the processor is further configured to perform the following steps:
获取应用程序中调用传感器的调用函数的集合;Get a collection of call functions that call the sensor in the application;
对所述集合中的调用函数设置函数级别;Setting a function level for the calling function in the collection;
所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤具体包括:The step of closing a function corresponding to the first target function level in the application specifically includes:
关闭所述集合中与所述第一目标函数级别对应的调用函数。The calling function in the set corresponding to the first target function level is closed.
存储器502可用于存储应用程序和数据。存储器502存储的应用程序中包含有可在处理器中执行的指令。应用程序可以组成各种功能模块。处理器501通过运行存储在存储器502的应用程序,从而执行各种功能应用以及数据处理。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.
显示屏503可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图像、文本、图标、视频和其任意组合来构成。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.
控制电路504与显示屏503电性连接,用于控制显示屏503显示信息。The control circuit 504 is electrically connected to the display screen 503 for controlling the display screen 503 to display information.
在一些实施例中,如图6所示,电子设备500还包括:射频电路505、输入单元506、音频电路507、传感器508以及电源509。其中,处理器501分别与射频电路505、输入单元506、音频电路507、传感器508以及电源509电性连接。In some embodiments, as shown in FIG. 6, 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.
射频电路505用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。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.
输入单元506可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元506可以包括指纹识别模组。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.
音频电路507可通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 507 can provide an audio interface between the user and the electronic device through a speaker and a microphone.
电子设备500还可以包括至少一种传感器508,比如光传感器、运动传感器、力度传感器、GPS(Global Positioning System,全球定位系统)传感器、图像传感器、音频传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在电子设备移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等; 至于电子设备还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The electronic device 500 may also include at least one type of sensor 508, such as a light sensor, a motion sensor, a velocity sensor, GPS (Global Positioning) System, Global Positioning System) sensors, image sensors, audio sensors, and other sensors. Specifically, 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. As a kind of motion sensor, 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. It can be used to identify the posture of electronic devices (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; Other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like that can be configured in an electronic device are not described herein.
电源509用于给电子设备500的各个部件供电。在一些实施例中,电源509可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。Power source 509 is used to power various components of electronic device 500. In some embodiments, 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.
尽管图6中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 6, the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
本发明实施例还提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一实施例所述的应用程序的关闭方法。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)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps of the foregoing embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium and stored. Media can include: read only memory (ROM, Read Only Memory), Random Access Memory (RAM), disk or optical disk.
以上对本发明实施例所提供的一种应用程序的关闭方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method and apparatus for shutting down an application provided by the embodiments of the present invention are described in detail. The principles and implementation manners of the present invention are described in the specific examples. The description of the above embodiments is only used to help understanding. The method of the present invention and its core idea; at the same time, those skilled in the art, according to the idea of the present invention, there are some changes in the specific implementation manner and application scope. In summary, the content of the present specification should not be understood. To limit the invention.

Claims (20)

  1. 一种应用程序的关闭方法,其中,包括:An application closing method, which includes:
    对应用程序中的函数设置函数级别;Set the function level for functions in the application;
    接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;Receiving a shutdown instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period;
    获取与所述用户行为特征信息对应的第一目标函数级别;Obtaining a first target function level corresponding to the user behavior feature information;
    关闭所述应用程序中与所述第一目标函数级别对应的函数。A function in the application corresponding to the first objective function level is closed.
  2. 根据权利要求1所述的应用程序的关闭方法,其中,所述对应用程序中的函数设置函数级别的步骤具体包括:The method for shutting down an application according to claim 1, wherein the step of setting a function level to a function in the application specifically comprises:
    获取应用程序中函数之间的调用关系;Get the call relationship between functions in the application;
    根据所述调用关系,对所述应用程序中的函数设置函数级别。A function level is set for a function in the application according to the calling relationship.
  3. 根据权利要求1所述的应用程序的关闭方法,其中,所述用户行为特征信息包括启动频率,所述获取与所述用户行为特征信息对应的第一目标函数级别的步骤具体包括:The method for shutting down an application according to claim 1, wherein the user behavior characteristic information comprises a starting frequency, and the step of acquiring a first target function level corresponding to the user behavior characteristic information comprises:
    确定所述启动频率所处的启动频率区间;Determining a starting frequency interval in which the starting frequency is located;
    获取与所述启动频率区间对应的第一目标函数级别。Obtaining a first objective function level corresponding to the startup frequency interval.
  4. 根据权利要求1所述的应用程序的关闭方法,其中,所述第一目标函数级别低于最高函数级别,所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤具体包括:The method for shutting down an application according to claim 1, wherein said first objective function level is lower than a highest function level, and said step of turning off a function corresponding to said first objective function level in said application is specific include:
    判断所述第一目标函数级别是否为最低函数级别;Determining whether the first objective function level is the lowest function level;
    若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;If yes, closing a function corresponding to the first target function level in the application;
    若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。If not, 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.
  5. 根据权利要求4所述的应用程序的关闭方法,其中,所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤之后,所述应用程序的关闭方法还包括:The method for shutting down an application according to claim 4, wherein after the step of closing a function corresponding to the first target function level in the application, the closing method of the application further comprises:
    获取终端当前的电量信息;Obtain current power information of the terminal;
    获取与所述电量信息对应的第二目标函数级别,所述第二目标函数级别高于所述第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level;
    关闭所述应用程序中与所述第二目标函数级别对应的函数。A function in the application corresponding to the second objective function level is closed.
  6. 根据权利要求1所述的应用程序的关闭方法,其中,所述对应用程序中的函数设置函数级别的步骤具体包括:The method for shutting down an application according to claim 1, wherein the step of setting a function level to a function in the application specifically comprises:
    获取应用程序中调用传感器的调用函数的集合;Get a collection of call functions that call the sensor in the application;
    对所述集合中的调用函数设置函数级别;Setting a function level for the calling function in the collection;
    所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤具体包括:The step of closing a function corresponding to the first target function level in the application specifically includes:
    关闭所述集合中与所述第一目标函数级别对应的调用函数。The calling function in the set corresponding to the first target function level is closed.
  7. 根据权利要求2所述的应用程序的关闭方法,其中,获取应用程序中函数之间的调用关系的步骤具体包括:The method for closing an application according to claim 2, wherein the step of acquiring a calling relationship between functions in the application specifically comprises:
    根据函数代码中的调用命令来获取函数之间的调用关系。Get the calling relationship between functions according to the calling command in the function code.
  8. 根据权利要求6所述的应用程序的关闭方法,其中,在关闭所述集合中与所述第一目标函数级别对应的调用函数的步骤之后,还包括:The method for closing an application according to claim 6, wherein after the step of closing the calling function corresponding to the first target function level in the set, the method further comprises:
    更改被关闭的调用函数的标识位。Change the flag bit of the called function that is closed.
  9. 一种应用程序的关闭装置,其中,包括:An application closing device, comprising:
    设置模块,用于对应用程序中的函数设置函数级别;Set a module to set the function level for functions in the application;
    第一获取模块,用于接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;a first acquiring module, configured to receive a closing instruction of the application, and acquire user behavior characteristic information of the application within a preset time period;
    第二获取模块,用于获取与所述用户行为特征信息对应的第一目标函数级别;a second acquiring module, configured to acquire a first target function level corresponding to the user behavior feature information;
    第一处理模块,用于关闭所述应用程序中与所述第一目标函数级别对应的函数。a first processing module, configured to close a function in the application that corresponds to the first target function level.
  10. 根据权利要求9所述的应用程序的关闭装置,其中,所述设置模块具体包括:The device for shutting down the application according to claim 9, wherein the setting module specifically comprises:
    第一获取子模块,用于获取应用程序中函数之间的调用关系;a first obtaining submodule, configured to acquire a calling relationship between functions in an application;
    设置子模块,用于对所述应用程序中的函数设置函数级别。A submodule is set to set a function level for a function in the application.
  11. 根据权利要求9所述的应用程序的关闭装置,其中,所述用户行为特征信息包括启动频率,所述第二获取模块具体包括:The device for shutting down the application according to claim 9, wherein the user behavior characteristic information includes a startup frequency, and the second acquisition module specifically includes:
    确定子模块,用于确定所述启动频率所处的启动频率区间;Determining a submodule for determining a starting frequency interval in which the starting frequency is located;
    第二获取子模块,用于获取与所述启动频率区间对应的第一目标函数级别。And a second acquiring submodule, configured to acquire a first target function level corresponding to the starting frequency interval.
  12. 根据权利要求9所述的应用程序的关闭装置,其中,所述第一目标函数级别低于最高函数级别,所述第一处理模块具体包括:The apparatus for shutting down an application according to claim 9, wherein the first target function level is lower than a highest function level, and the first processing module specifically includes:
    判断子模块,用于判断所述第一目标函数级别是否为最低函数级别;a determining submodule, configured to determine whether the first target function level is the lowest function level;
    处理子模块,用于在所述判断子模块判断为是时,关闭所述应用程序中所述第一目标函数级别对应的函数;在所述判断子模块判断为否时,关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。a processing submodule, configured to: when the determining submodule determines to be YES, close a function corresponding to the first target function level in the application; when the determining submodule determines to be no, close the application The function corresponding to the first objective function level and the function level lower than the first objective function level.
  13. 根据权利要求12所述的应用程序的关闭装置,其中,所述关闭装置还包括第二处理模块,所述第二处理模块用于:The shutdown device of the application of claim 12, wherein the shutdown device further comprises a second processing module, the second processing module for:
    获取终端当前的电量信息;Obtain current power information of the terminal;
    获取与所述电量信息对应的第二目标函数级别,所述第二目标函数级别高于所述第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level;
    关闭所述应用程序中与所述第二目标函数级别对应的函数。A function in the application corresponding to the second objective function level is closed.
  14. 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如权利要求1至8任一项所述的应用程序的关闭方法的步骤。A storage medium, wherein the storage medium stores a plurality of instructions adapted to be loaded by a processor to perform the steps of the shutdown method of the application according to any one of claims 1 to 8.
  15. 一种电子设备,其中,包括处理器和存储器,所述存储器用于存储指令和数据,所述处理器用于执行以下步骤:An electronic device, comprising a processor and a memory, the memory for storing instructions and data, the processor for performing the following steps:
    对应用程序中的函数设置函数级别;Set the function level for functions in the application;
    接收所述应用程序的关闭指令,并获取所述应用程序在预设时间段内的用户行为特征信息;Receiving a shutdown instruction of the application, and acquiring user behavior characteristic information of the application within a preset time period;
    获取与所述用户行为特征信息对应的第一目标函数级别;Obtaining a first target function level corresponding to the user behavior feature information;
    关闭所述应用程序中与所述第一目标函数级别对应的函数。A function in the application corresponding to the first objective function level is closed.
  16. 根据权利要求15所述的电子设备,其中,所述对应用程序中的函数设置函数级别时,所述处理器还用于执行以下步骤:The electronic device of claim 15, wherein the processor is further configured to perform the following steps when the function level is set to a function in an application:
    获取应用程序中函数之间的调用关系;Get the call relationship between functions in the application;
    根据所述调用关系,对所述应用程序中的函数设置函数级别。A function level is set for a function in the application according to the calling relationship.
  17. 根据权利要求15所述的电子设备,其中,所述用户行为特征信息包括启动频率,所述获取与所述用户行为特征信息对应的第一目标函数级别时,所述处理器还用于执行以下步骤:The electronic device according to claim 15, wherein the user behavior characteristic information includes a startup frequency, and when the first target function level corresponding to the user behavior characteristic information is acquired, the processor is further configured to execute the following step:
    确定所述启动频率所处的启动频率区间;Determining a starting frequency interval in which the starting frequency is located;
    获取与所述启动频率区间对应的第一目标函数级别。Obtaining a first objective function level corresponding to the startup frequency interval.
  18. 根据权利要求15所述的电子设备,其中,所述第一目标函数级别低于最高函数级别,所述关闭所述应用程序中与所述第一目标函数级别对应的函数时,所述处理器还用于执行以下步骤:The electronic device of claim 15, wherein the first objective function level is lower than a highest function level, and the processor is turned off when the function corresponding to the first target function level is closed in the application Also used to perform the following steps:
    判断所述第一目标函数级别是否为最低函数级别;Determining whether the first objective function level is the lowest function level;
    若是,则关闭所述应用程序中所述第一目标函数级别对应的函数;If yes, closing a function corresponding to the first target function level in the application;
    若否,则关闭所述应用程序中所述第一目标函数级别对应的函数,以及函数级别低于所述第一目标函数级别的函数。If not, 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.
  19. 根据权利要求18所述的电子设备,其中,所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤之后,所述处理器还用于执行以下步骤:The electronic device of claim 18, wherein the processor is further configured to perform the following steps after the step of closing a function corresponding to the first target function level in the application:
    获取电子设备当前的电量信息;Obtaining current power information of the electronic device;
    获取与所述电量信息对应的第二目标函数级别,所述第二目标函数级别高于所述第一目标函数级别;Obtaining a second target function level corresponding to the power quantity information, where the second target function level is higher than the first target function level;
    关闭所述应用程序中与所述第二目标函数级别对应的函数。A function in the application corresponding to the second objective function level is closed.
  20. 根据权利要求15所述的电子设备,其中,所述对应用程序中的函数设置函数级别时,所述处理器还用于执行以下步骤:The electronic device of claim 15, wherein the processor is further configured to perform the following steps when the function level is set to a function in an application:
    获取应用程序中调用传感器的调用函数的集合;Get a collection of call functions that call the sensor in the application;
    对所述集合中的调用函数设置函数级别;Setting a function level for the calling function in the collection;
    所述关闭所述应用程序中与所述第一目标函数级别对应的函数的步骤具体包括:The step of closing a function corresponding to the first target function level in the application specifically includes:
    关闭所述集合中与所述第一目标函数级别对应的调用函数。The calling function in the set corresponding to the first target function level is closed.
PCT/CN2017/086462 2016-05-31 2017-05-29 Application program shutdown method and apparatus, storage medium, and electronic device WO2017206865A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610379764.5A CN106020907B (en) 2016-05-31 2016-05-31 A kind of method for closing and device of application program
CN201610379764.5 2016-05-31

Publications (1)

Publication Number Publication Date
WO2017206865A1 true WO2017206865A1 (en) 2017-12-07

Family

ID=57092070

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086462 WO2017206865A1 (en) 2016-05-31 2017-05-29 Application program shutdown method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN106020907B (en)
WO (1) WO2017206865A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112997150A (en) * 2018-12-29 2021-06-18 深圳市欢太科技有限公司 Application program management method and device, storage medium and electronic equipment

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095492B (en) * 2016-05-31 2017-11-07 广东欧珀移动通信有限公司 The method for closing and device of a kind of application program
CN106095412B (en) * 2016-05-31 2019-07-16 Oppo广东移动通信有限公司 A kind of method for closing and device of application program
CN106020907B (en) * 2016-05-31 2019-12-03 Oppo广东移动通信有限公司 A kind of method for closing and device of application program
CN107800757B (en) * 2017-03-28 2020-10-27 平安壹钱包电子商务有限公司 User behavior recording method and device
CN108008988A (en) * 2017-12-27 2018-05-08 深圳豪客互联网有限公司 A kind of apparatus control method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176842A (en) * 2013-03-15 2013-06-26 广东欧珀移动通信有限公司 Background process management method and mobile terminal thereof
CN104317373A (en) * 2014-10-21 2015-01-28 北京奇虎科技有限公司 Method and device for cooling mobile terminal
US20160147636A1 (en) * 2014-11-21 2016-05-26 Vmware, Inc. Enhanced resiliency testing by enabling state level control for request
CN106020907A (en) * 2016-05-31 2016-10-12 广东欧珀移动通信有限公司 Application shut-down method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8069435B1 (en) * 2003-08-18 2011-11-29 Oracle America, Inc. System and method for integration of web services
CN103369508B (en) * 2013-06-25 2016-12-28 华为技术有限公司 Data load method and terminal unit
US9547363B2 (en) * 2014-07-16 2017-01-17 Mediatek Inc. Power-saving method and associated electronic device
CN105100429B (en) * 2015-06-08 2018-03-06 北京金山安全软件有限公司 Method and device for determining use time of residual electric quantity of mobile terminal
CN105141771A (en) * 2015-09-08 2015-12-09 北京网诺星云科技有限公司 Method and device for determining system-level behaviour preferences of user
CN105260117B (en) * 2015-09-30 2020-11-10 北京小米移动软件有限公司 Application program control method and device
CN105227779B (en) * 2015-10-30 2019-06-28 上海斐讯数据通信技术有限公司 A kind of management method, management system and the mobile phone of mobile terminal application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176842A (en) * 2013-03-15 2013-06-26 广东欧珀移动通信有限公司 Background process management method and mobile terminal thereof
CN104317373A (en) * 2014-10-21 2015-01-28 北京奇虎科技有限公司 Method and device for cooling mobile terminal
US20160147636A1 (en) * 2014-11-21 2016-05-26 Vmware, Inc. Enhanced resiliency testing by enabling state level control for request
CN106020907A (en) * 2016-05-31 2016-10-12 广东欧珀移动通信有限公司 Application shut-down method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112997150A (en) * 2018-12-29 2021-06-18 深圳市欢太科技有限公司 Application program management method and device, storage medium and electronic equipment
CN112997150B (en) * 2018-12-29 2023-12-08 深圳市欢太科技有限公司 Application management method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN106020907A (en) 2016-10-12
CN106020907B (en) 2019-12-03

Similar Documents

Publication Publication Date Title
WO2017206865A1 (en) Application program shutdown method and apparatus, storage medium, and electronic device
WO2018084628A1 (en) Display apparatus and control method thereof
EP3652612A1 (en) Method and electronic device for providing mode switching and storage medium thereof
WO2018161604A1 (en) Playback control method and device for mobile terminal, storage medium and electronic device
WO2018076866A1 (en) Data processing method, device, storage medium, electronic device and server
WO2018090822A1 (en) Smart watch-based mobile terminal camera control method and control system
WO2018090823A1 (en) Method and system for protecting system partition key data, and terminal
WO2015180013A1 (en) Touch operation method and apparatus for terminal
WO2018161572A1 (en) Method and apparatus for controlling frame rate of mobile terminal, storage medium, and electronic device
WO2019164323A1 (en) Electronic device and method for controlling storage of content displayed on display panel
WO2019124912A1 (en) Electronic device and method for controlling output timing of signal corresponding to state in which content can be received based on display location of content displayed on display
WO2015057013A1 (en) Method by which portable device displays information through wearable device, and device therefor
WO2018129972A1 (en) Charging processing method and apparatus, storage medium, and electronic device
WO2018076864A1 (en) Data synchronization method, apparatus, storage medium and electronic device
WO2021107511A1 (en) Electronic device, and method for controlling and operating foldable display
WO2017206879A1 (en) Mobile terminal application program processing method and apparatus, storage medium, and electronic device
WO2017206867A1 (en) Sensor shutdown method and apparatus, storage medium, and electronic device
WO2017206870A1 (en) Sensor shutdown method and apparatus, storage medium, and electronic device
WO2021162320A1 (en) Electronic device and method for operating high speed screen of electronic device
WO2017206892A1 (en) Sensor processing method and apparatus of mobile terminal, storage medium, and electronic device
WO2018076811A1 (en) Data sharing method, device, system, storage medium and electronic device
WO2017206871A1 (en) Application program shutdown method and apparatus, storage medium, and electronic device
WO2021054784A1 (en) Electronic device and method for changing user interface according to user input
WO2019000467A1 (en) Alarm clock prompt method and apparatus, storage medium, and electronic device
WO2017206873A1 (en) Application program shutdown method and apparatus, storage medium, and electronic device

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

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

Country of ref document: EP

Kind code of ref document: A1