WO2019062462A1 - Application control method and apparatus, storage medium and electronic device - Google Patents

Application control method and apparatus, storage medium and electronic device Download PDF

Info

Publication number
WO2019062462A1
WO2019062462A1 PCT/CN2018/103283 CN2018103283W WO2019062462A1 WO 2019062462 A1 WO2019062462 A1 WO 2019062462A1 CN 2018103283 W CN2018103283 W CN 2018103283W WO 2019062462 A1 WO2019062462 A1 WO 2019062462A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
preset
sampling
connection state
time point
Prior art date
Application number
PCT/CN2018/103283
Other languages
French (fr)
Chinese (zh)
Inventor
曾元清
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019062462A1 publication Critical patent/WO2019062462A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/29Graphical models, e.g. Bayesian networks
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Definitions

  • the present application relates to the field of computer technologies, and in particular, to an application control method, apparatus, storage medium, and electronic device.
  • the embodiments of the present application provide an application control method, device, storage medium, and electronic device, which can flexibly clean background applications and effectively improve system resources.
  • the embodiment of the present application provides an application control method, which is applied to an electronic device, and includes:
  • the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
  • the background application in the electronic device is controlled based on the trained Bayesian model.
  • the embodiment of the present application further provides an application control device, which is applied to an electronic device, and includes:
  • An acquiring module configured to acquire an operating parameter of the electronic device at each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
  • a generating module configured to generate a training sample according to the sampling time point and the running parameter
  • a training module configured to train the preset Bayesian model by using the training sample
  • control module configured to control a background application in the electronic device based on the trained Bayesian model.
  • the embodiment of the present application 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 any one of the application control methods described above.
  • the embodiment of the present application further provides an electronic device, including a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used in any one of the foregoing The steps in the application control method described.
  • FIG. 1 is a schematic flowchart diagram of an application control method according to an embodiment of the present application.
  • FIG. 2 is another schematic flowchart of an application control method according to an embodiment of the present application.
  • FIG. 3 is a flowchart of training a Bayesian model provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a frame of a Bayesian model provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an application control apparatus according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a generation module according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a generating submodule according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • Embodiments of the present application provide an application control method, apparatus, storage medium, and electronic device.
  • An application control method is applied to an electronic device, comprising: acquiring an operating parameter of the electronic device at each sampling time point in a historical time period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection.
  • a training sample is generated according to the sampling time point and the running parameter; the preset Bayesian model is trained by using the training sample; and the background application in the electronic device is controlled based on the trained Bayesian model.
  • the generating the training sample according to the sampling time point and the operating parameter comprises:
  • the training samples are generated according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
  • the generating the training sample according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state includes:
  • a training sample is generated according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value.
  • the determining, according to the sampling time point, the next switching application, and the foreground application, the predicted value of the target prediction application including:
  • the predicted value of the target prediction application is determined as a second preset value.
  • the according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection status, the network connection status, the target prediction application, and the predicted value are generated.
  • a training sample is generated based on the feature value and the predicted value.
  • the feature value comprises (q 1 , q 2 ... q m ), the predicted value comprises j1 and j2, and the training of the preset Bayesian model is performed by using the training sample, including :
  • N(j1) represents the number of occurrences of event j1
  • N(j2) represents the number of occurrences of event j2
  • P(j2) represents the probability of occurrence of event j2
  • the training based Bayesian model controls a background application in the electronic device, including:
  • the background application is closed according to the cleanup rate.
  • the calculating the cleanable rate of each background application using the trained Bayesian model and the current operational parameters includes:
  • the current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained.
  • the third preset formula is: P Where 1 ⁇ k ⁇ m, q k is the current eigenvalue.
  • the closing the background application according to the cleanup rate comprises:
  • the application control method is applied to an electronic device, and the specific process can be as follows:
  • the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state.
  • the historical period may be manually set, such as the previous month or the first two months.
  • the sampling time point is mainly determined according to the sampling frequency, for example, it can be sampled every minute or every two minutes, and can be expressed in the form of x minutes of x years x months x days x.
  • Both the charging connection state and the network connection state may include both connected and unconnected situations.
  • the running parameter may be obtained in real time, for example, the corresponding data collection operation is performed at the sampling time point, or may be obtained once, for example, the electronic device may record the historical time period in the local database in advance.
  • the screen change data, the charge state change data, the network state change data, and the application open data are displayed, and then the operation parameters of each sampling time point can be extracted at one time according to the sampling frequency.
  • the foregoing step 102 may specifically include:
  • the sampling date type is divided into weekly, which may include weekdays and weekends.
  • the sampling period is divided into daily, which can divide the day into 48 time periods.
  • the preset power range and the preset duration range may be manually set, and the preset power range may include three ranges indicating high power, medium power, and low power, for example, the high power may be 70%. -100%, the medium power can be 40%-70%, the low battery can be 0-40%, etc., the preset duration range can include three intervals indicating short, medium and long, for example, the length can be more than 10min, It can be 5-10min in length and 0-5min in short.
  • steps 1-3 may specifically include:
  • the target prediction application may be all applications installed in the electronic device, or may be partial applications. When it is a partial application, it may be several applications with the highest frequency of occurrence in the near future, and the specific quantity may be according to actual needs. And set.
  • the foreground application obtained before the sampling time point can be regarded as the current foreground application for the foreground application obtained by any sampling.
  • the previous foreground application that is obtained after the sampling time point can be regarded as the next switching application of the current foreground application.
  • different foreground applications that are closest to the current sampling time point can be taken as the previous switching application and Next switch application.
  • all foreground applications may be sorted according to the sampling time point. For any three adjacent different foreground applications after sorting, the front foreground application may serve as the previous switching application of the intermediate foreground application, followed by The foreground application can serve as the next switching application for the intermediate foreground application.
  • the predicted value may be an artificially set value, such as 0 and 1, where 0 indicates that the target prediction application will not switch to the foreground use in a short time, and 1 may indicate that the target prediction application will be in the Switch to the foreground for a short time. Since all the foreground applications collected in the historical period are known, the predicted value of the target prediction application can be determined according to the known foreground application and the sampling time point. In this case, the above steps 1-3-3 can be specifically include:
  • the predicted value of the target prediction application is determined as a second preset value.
  • the preset duration, the first preset value, and the second preset value may be manually set, and the preset duration is mainly used to define a length of time, which may be 10 minutes, and the first preset value may be Yes 1, the second preset value can be 0.
  • the preset duration is mainly used to define a length of time, which may be 10 minutes, and the first preset value may be Yes 1, the second preset value can be 0.
  • the predicted value of the target prediction application can be set to 1, otherwise, all are set to 0.
  • 1-3-4 Generate training samples according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value. .
  • each training sample may be composed of a plurality of known feature items and data of the tag items, the known The feature item may include the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection status, and the network connection status, etc., and the label item is mainly.
  • steps 1-3-4 may specifically include:
  • a training sample is generated based on the feature value and the predicted value.
  • the feature value can be mainly expressed in the form of Arabic numerals or letters, such as 1-10, and each feature item can also be expressed in the form of letters, such as the foreground.
  • the application is H
  • the sampling date type is B
  • the feature value of the feature item may be directly used as a prior condition, and the predicted value of each target prediction application is used as a posterior result to generate the training sample.
  • the feature values corresponding to each feature item may be preset, and the feature values of different feature items may be the same or different, for example, the feature values of the foreground application and the sampling period may include 0 to 10, However, each number refers to a different meaning in different feature items.
  • 0 can refer to the US group.
  • 0 can refer to the period from 0:00 to 1:00.
  • the eigenvalues may include (q 1 , q 2 ... q m ), and the predicted value may include j1 and j2.
  • N(j1) represents the number of occurrences of event j1
  • N(j2) represents the number of occurrences of event j2
  • P(j2) represents the probability of occurrence of event j2
  • the Bayesian model can be: Where m is the number of feature terms, q 1 , q 2 ... q m are the eigenvalues of the a priori condition, q i is the eigenvalue corresponding to the i-th feature item, and J is the predicted value of the target prediction application. To simplify the calculation, assuming that q 1 , q 2 ... q m are independent of each other, then Thus the Naive Bayes classifier model is obtained:
  • J MAX arg max P(J
  • q 1 , q 2 ... q m ) arg maxP(q 1
  • the probability value of each feature item is the statistical probability of the number of occurrences, that is, the above formula:
  • j1 is the first preset value and j2 is the second preset value. It is easy to know that the process of training the Bayesian model is the process of probability and statistics, that is, after training the Bayesian model, the probability values of different eigenvalues in each feature item can be obtained, such as P(q 1 ), P( q 1
  • the foregoing step 104 may specifically include:
  • the background application cleanup instruction may be automatically generated by the electronic device, for example, when the memory occupancy reaches a certain limit, or the power is insufficient, or the running speed is too slow, the background application cleanup instruction is generated, and of course, the background application is cleaned up.
  • the instructions may also be generated manually by the user. For example, the user may generate the background application cleanup instruction by clicking the specified cleanup icon.
  • steps 2-3 may specifically include:
  • the current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained.
  • the third preset formula is:
  • the current sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the previous switching application, the charging connection state, and the network may be obtained according to the current operating parameters.
  • q 1 ,q 2 ...q 9 ) P(j2)P(q 1
  • j2) is calculated on the premise that the current eigenvalue occurs The probability of occurrence of j2 (that is, the background application that currently needs to be predicted will not switch to the foreground in a short time), as the cleanable rate.
  • steps 2-4 may specifically include:
  • the preset threshold and the preset number can be manually set.
  • the preset threshold may be 0.5
  • the preset number may be 4, that is, when the calculated P(j2
  • the application control method provided in this embodiment is applied to an electronic device, and obtains an operation parameter of the electronic device at each sampling time point in a historical period, where the operation parameter includes a foreground application, a remaining power, a duration of a bright screen, and a charging connection state and a network connection state, and generating a training sample according to the sampling time point and the running parameter, and then training the preset Bayesian model by using the training sample, and based on the trained Bayesian model, the electronic device
  • the background application in the middle is controlled, so that the background application that needs to be cleaned can be selected according to the usage of the previous application.
  • the method is simple, the flexibility is high, the system resources are saved, and the user experience is good.
  • the application control device is specifically integrated into the electronic device as an example for detailed description.
  • an application control method may be as follows:
  • the electronic device acquires an operation parameter of each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state.
  • the historical time period may be the past month
  • the sampling time point may be every minute in the past month.
  • the running parameter may be extracted from a database, and the database may store the usage record of the application in the electronic device in the past month, the on-off record of the screen, the charging record, and the WiFi connection record, as shown in Table 1-4 below. Based on these records, the operating parameters for each sampling time point can be extracted.
  • the electronic device determines, according to the sampling time point, a sampling date type and a sampling period, and determines a preset power amount range to which the remaining power belongs, and determines a preset duration range to which the bright screen duration belongs.
  • the sampling time point is 10:55 on October 17, 2012, it can be divided into 48 time periods per day, then the day is Wednesday, the sampling date type is working day, and the sampling time is the 11th time period. If the remaining power is 80%, the preset power range can be 70%-100% of the corresponding high power. If the duration of the bright screen is 3 min, the preset duration may be a short duration corresponding to 0-5 min.
  • the electronic device acquires a target prediction application, and determines a previous switching application and a next switching application of the foreground application from the operating parameters according to the sampling time point.
  • the target prediction application may be the ten most recent applications APP1, APP2...APP10. All foreground applications can be sorted according to the sampling time point. For any three adjacent different foreground applications after sorting, the front foreground application can be used as the last switching application of the intermediate foreground application, and the latter foreground application can be used as the middle.
  • the next switching application of the foreground application for example, for a sampling time point, the foreground application may be APP10, the last switching application may be APP1, and the next switching application may be APP5.
  • the electronic device calculates a difference between a sampling time point of the next switching application and a sampling time point of the foreground application, and determines whether the target prediction application is the next switching application, and whether the difference does not exceed a preset.
  • the duration if yes, determines the predicted value of the target prediction application as the first preset value, and if not, determines the predicted value of the target prediction application as the second preset value.
  • the interval between APP1 and APP10 may be T1
  • the first preset value may be 1
  • the second preset value may be 0,
  • the preset duration may be 10 min.
  • the prediction application is APP5, and if T1 ⁇ 10, the predicted value of the target prediction application can be set to 1, otherwise, it is set to 0.
  • the electronic device separately obtains the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application, and according to the The eigenvalues and predicted values generate training samples.
  • composition of the training sample can be seen in FIG. 4, and the correspondence between the feature values and the feature items in the training sample can be seen in Table 5 below.
  • the electronic device inputs each training sample into a preset Bayesian model to train the Bayesian model.
  • the eigenvalues may include (q 1 , q 2 ... q m ), and the predicted value may include j1 and j2.
  • N(j1) represents the number of occurrences of event j1
  • N(j2) represents the number of occurrences of event j2
  • P(j2) represents the probability of occurrence of event j2
  • the Bayesian model can be: Where m is the number of feature terms, q 1 , q 2 ... q m are the eigenvalues of the a priori condition, q i is the eigenvalue corresponding to the i-th feature item, and J is the predicted value of the target prediction application. To simplify the calculation, assuming that q 1 , q 2 ... q m are independent of each other, then Thus the Naive Bayes classifier model is obtained:
  • J MAX arg max P(J
  • q 1 , q 2 ... q m ) arg maxP(q 1
  • the probability value of each feature item is the statistical probability of the number of occurrences, that is, the above formula:
  • j1 is the first preset value and j2 is the second preset value. It is easy to know that the process of training the Bayesian model is the process of probability and statistics, that is, after training the Bayesian model, the probability values of different eigenvalues in each feature item can be obtained, such as P(q 1 ), P( q 1
  • the electronic device acquires a background application cleanup instruction.
  • the electronic device can automatically generate the background application cleaning instruction.
  • the electronic device acquires the background application and the current running parameter according to the background application cleanup instruction.
  • the electronic device calculates a cleanable rate of each background application by using the trained Bayesian model and the current operating parameters.
  • step 209 may further include:
  • the current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained.
  • the third preset formula is:
  • the current sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the previous switching application, the charging connection state, and the network may be obtained according to the current operating parameters.
  • q 1 ,q 2 ...q 9 ) P(j2)P(q 1
  • j2) is calculated on the premise that the current eigenvalue occurs The probability of occurrence of j2 (that is, the background application that currently needs to be predicted will not switch to the foreground in a short time), as the cleanable rate.
  • the electronic device selects a background application whose cleaning rate is not less than a preset threshold as the target application, or selects a preset number of background applications with the highest cleanup rate as the target application, and closes the target application.
  • the preset threshold may be 0.5
  • the preset number may be 4, that is, when the calculated P(j2
  • the application control method wherein the electronic device can acquire the running parameters of each sampling time point in the historical time period, the operating parameters include the foreground application, the remaining power, the screen duration, the charging connection state, and the network.
  • connection state and then determining a sampling date type and a sampling period according to the sampling time point, determining a preset power amount range to which the remaining power belongs, and determining a preset duration range to which the bright screen duration belongs, and then acquiring a target prediction application And determining, according to the sampling time point, the previous switching application and the next switching application of the foreground application from the operating parameter, and then calculating a difference between the sampling time point of the next switching application and the sampling time point of the foreground application.
  • a foreground sample a sampling date type, a sampling period, a preset power range, a preset duration range, a charging connection state, a network connection state, and a feature value corresponding to the target prediction application, and generating a training sample according to the feature value and the predicted value, and then
  • Each training sample is input into a preset Bayesian model to train the Bayesian model, and then a background application cleanup instruction is obtained, and the background application and the current running parameter are obtained according to the background application cleanup instruction.
  • the method is simple, the flexibility is high, the system resources are saved, and the user experience is saved. Feeling good.
  • an application control device which may be implemented as an independent entity or integrated in an electronic device, such as a terminal.
  • the terminal can include a mobile phone, a tablet computer, a personal computer, and the like.
  • An embodiment of the present application provides an application control apparatus, which is applied to an electronic device, and includes:
  • An acquiring module configured to acquire an operating parameter of the electronic device at each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
  • a generating module configured to generate a training sample according to the sampling time point and the running parameter
  • a training module configured to train the preset Bayesian model by using the training sample
  • control module configured to control a background application in the electronic device based on the trained Bayesian model.
  • the generating module comprises:
  • a first determining submodule configured to determine a sampling date type and a sampling period according to the sampling time point
  • a second determining sub-module configured to determine a preset power range to which the remaining power belongs, and determine a preset duration range to which the bright time duration belongs;
  • And generating a submodule configured to generate a training sample according to the sampling date type, a sampling period, a preset power range, a preset duration range, a foreground application, a charging connection state, and a network connection state.
  • the generating submodule comprises:
  • a first determining unit configured to determine, according to the sampling time point, a previous switching application and a next switching application of the foreground application from the operating parameters
  • a second determining unit configured to determine a predicted value of the target prediction application according to the sampling time point, a next switching application, and a foreground application;
  • a generating unit configured to generate a training sample according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value .
  • the second determining unit is specifically configured to:
  • the predicted value of the target prediction application is determined as a second preset value.
  • the generating unit is specifically configured to:
  • a training sample is generated based on the feature value and the predicted value.
  • the feature values include (q 1 , q 2 . . . q m ), the predicted values include j1 and j2, and the training module is specifically configured to:
  • N(j1) represents the number of occurrences of event j1
  • N(j2) represents the number of occurrences of event j2
  • P(j2) represents the probability of occurrence of event j2
  • control module is specifically configured to:
  • the background application is closed according to the cleanup rate.
  • control module is specifically configured to:
  • the current feature value is input into the third preset formula for calculation to obtain a cleanable rate, and the third preset formula is:
  • control module is specifically configured to:
  • FIG. 5 specifically describes an application control device provided by an embodiment of the present application, which is applied to an electronic device, which may include: an obtaining module 10, a generating module 20, a training module 30, and a control module 40, where:
  • the obtaining module 10 is configured to acquire an operating parameter of the electronic device at each sampling time point in the historical period, where the running parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state.
  • the historical period may be manually set, such as the previous month or the first two months.
  • the sampling time point mainly refers to the sampling frequency, for example, it can be sampled every minute or every two minutes, and can be expressed in the form of x minutes x x x x x x x.
  • Both the charging connection state and the network connection state may include both connected and unconnected situations.
  • the running parameter may be acquired in real time.
  • the acquiring module 10 obtains the corresponding data collecting operation at the sampling time point, or may be acquired at one time.
  • the electronic device may record the historical time period in the local database in advance.
  • the obtaining module 10 can extract the running parameters of each sampling time point at a time according to the sampling frequency.
  • the generating module 20 is configured to generate a training sample according to the sampling time point and the running parameter.
  • the generating module 20 may specifically include a first determining submodule 21, a second determining submodule 22, and a generating submodule 22, where:
  • the first determining sub-module 21 is configured to determine a sampling date type and a sampling period according to the sampling time point.
  • the sampling date type is divided into weekly, which may include weekdays and weekends.
  • the sampling period is divided into daily, which can divide the day into 48 time periods.
  • the second determining sub-module 22 is configured to determine a preset power range to which the remaining power belongs, and determine a preset duration range to which the bright screen duration belongs.
  • the preset power range and the preset duration range may be manually set, and the preset power range may include three ranges indicating high power, medium power, and low power, for example, the high power may be 70%. -100%, the medium power can be 40%-70%, the low battery can be 0-40%, etc., the preset duration range can include three intervals indicating short, medium and long, for example, the length can be more than 10min, It can be 5-10min in length and 0-5min in short.
  • the generating submodule 23 is configured to generate a training sample according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
  • the generating sub-module 23 may specifically include an obtaining unit 231, a first determining unit 232, a second determining unit 233, and a generating unit 234, where:
  • the obtaining unit 231 is configured to acquire a target prediction application.
  • the target prediction application may be all applications installed in the electronic device, or may be partial applications. When it is a partial application, it may be several applications with the highest frequency of occurrence in the near future, and the specific quantity may be according to actual needs. And set.
  • the first determining unit 232 is configured to determine, according to the sampling time point, the last switching application and the next switching application of the foreground application from the operating parameters.
  • the foreground application obtained before the sampling time point can be regarded as the current foreground application for the foreground application obtained by any sampling.
  • the different foreground applications obtained after the sampling time point can be regarded as the next switching application of the current foreground application.
  • the first determining unit 232 can take different foreground applications that are closest to the current sampling time point. The last switch application and the next switch application. In the actual operation process, all foreground applications may be sorted according to the sampling time point. For any three adjacent different foreground applications after sorting, the front foreground application may serve as the previous switching application of the intermediate foreground application, followed by The foreground application can serve as the next switching application for the intermediate foreground application.
  • the second determining unit 233 is configured to determine a predicted value of the target prediction application according to the sampling time point, the next switching application, and the foreground application.
  • the predicted value may be an artificially set value, such as 0 and 1, where 0 indicates that the target prediction application will not switch to the foreground use in a short time, and 1 may indicate that the target prediction application will be in the Switch to the foreground for a short time. Since all the foreground applications collected during the historical period are known, the predicted value of the target prediction application can be determined according to the known foreground application and the sampling time point thereof. At this time, the second determining unit 233 can further use to:
  • the predicted value of the target prediction application is determined as a second preset value.
  • the preset duration, the first preset value, and the second preset value may be manually set, and the preset duration is mainly used to define a length of time, which may be 10 minutes, and the first preset value may be Yes 1, the second preset value can be 0.
  • the second determining unit 233 needs to further analyze the length of time taken to switch from the current application to the next switching application, only when the interval duration is in advance.
  • the predicted value of the target prediction application can be set to 1 when the duration is within, otherwise all are set to 0.
  • the generating unit 234 is configured to generate a training sample according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value. .
  • each training sample may be composed of a plurality of known feature items and data of the tag items, the known The feature item may include the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection status, and the network connection status, etc., and the label item is mainly.
  • the generating unit 234 can be specifically configured to:
  • a training sample is generated based on the feature value and the predicted value.
  • the feature value can be mainly expressed in the form of Arabic numerals or letters, such as 1-10, and each feature item can also be expressed in the form of letters, such as the foreground.
  • the application is H
  • the sampling date type is B
  • the generating unit 234 may directly use the feature value of the feature item as a prior condition, and use the predicted value of each target prediction application as a posterior result to generate the training sample.
  • the feature values corresponding to each feature item may be preset, and the feature values of different feature items may be the same or different, for example, the feature values of the foreground application and the sampling period may include 0 to 10, However, each number refers to a different meaning in different feature items.
  • 0 can refer to the US group.
  • 0 can refer to the period from 0:00 to 1:00.
  • the training module 30 is configured to train the preset Bayesian model with the training sample.
  • the feature value may include (q 1 , q 2 ... q m ), and the predicted value may include j1 and j2.
  • the training module 30 may specifically be used to:
  • N(j1) represents the number of occurrences of event j1
  • N(j2) represents the number of occurrences of event j2
  • P(j2) represents the probability of occurrence of event j2
  • the Bayesian model can be: Where m is the number of feature terms, q 1 , q 2 ... q m are the eigenvalues of the a priori condition, q i is the eigenvalue corresponding to the i-th feature item, and J is the predicted value of the target prediction application. To simplify the calculation, assuming that q 2 , q 2 ... q m are independent of each other, then Thus the Naive Bayes classifier model is obtained:
  • J MAX arg max P(J
  • q 1 , q 2 ... q m ) arg maxP(q 1
  • the probability value of each feature item is the statistical probability of the number of occurrences, that is, the above formula:
  • j1 is the first preset value and j2 is the second preset value. It is easy to know that the process of training the Bayesian model is the process of probability and statistics, that is, after training the Bayesian model, the probability values of different eigenvalues in each feature item can be obtained, such as P(q 1 ), P( q 1
  • the control module 40 is configured to control the background application in the electronic device based on the trained Bayesian model.
  • control module 40 can be specifically configured to:
  • the background application cleanup instruction may be automatically generated by the electronic device, for example, when the memory occupancy reaches a certain limit, or the power is insufficient, or the running speed is too slow, the background application cleanup instruction is generated, and of course, the background application is cleaned up.
  • the instructions may also be generated manually by the user. For example, the user may generate the background application cleanup instruction by clicking the specified cleanup icon.
  • control module 40 may specifically be used to:
  • the current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained.
  • the third preset formula is:
  • the current sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the previous switching application, the charging connection state, and the network may be obtained according to the current operating parameters.
  • q 1 ,q 2 ...q 9 ) P(j2)P(q 1
  • j2) is calculated on the premise that the current eigenvalue occurs The probability of occurrence of j2 (that is, the background application that currently needs to be predicted will not switch to the foreground in a short time), as the cleanable rate.
  • control module 40 can further be used to:
  • the preset threshold and the preset number can be manually set.
  • the preset threshold may be 0.5
  • the preset number may be 4, that is, when the calculated P(j2
  • the foregoing units 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 method embodiments and details are not described herein.
  • the application control device provided in this embodiment is applied to an electronic device, and the operation parameter of the electronic device is obtained by the acquisition module 10 at each sampling time point in the historical time period, and the operation parameter includes the foreground application, the remaining power, and the light is turned on.
  • the generating module 20 generates a training sample according to the sampling time point and the operating parameter, and the training module 30 uses the training sample to train the preset Bayesian model, and the control module 40 is based on
  • the trained Bayesian model controls the background application in the electronic device, so that the background application that needs to be cleaned can be selected according to the usage of the previous application, the method is simple, the flexibility is high, and the system resources are saved, and the user Experience is good.
  • the embodiment of the present application further provides an electronic device, which may be a device such as a smart phone or a tablet computer.
  • the electronic device 500 includes a processor 501, a memory 502, a display screen 503, and a control circuit 504.
  • the processor 501 is electrically connected to the memory 502, the display screen 503, and the control circuit 504, respectively.
  • the processor 501 is a control center of the electronic device 500, and connects various parts of the entire electronic device using various interfaces and lines, executes the electronic by running or loading an application stored in the memory 502, and calling data stored in the memory 502.
  • the various functions and processing data of the device enable overall monitoring of the electronic device.
  • the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more applications into the memory 502 according to the following steps, and is stored and stored in the memory 502 by the processor 501.
  • the application thus implementing various functions:
  • the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
  • the background application in the electronic device is controlled based on the trained Bayesian model.
  • the processor can be used to perform the following steps when generating training samples based on the sampling time points and operational parameters:
  • the training samples are generated according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
  • the processor can be used to perform the following steps when generating training samples according to the sampling date type, sampling period, preset power range, preset duration range, foreground application, charging connection status, and network connection status. :
  • a training sample is generated according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value.
  • the processor is operable to perform the following steps when determining the predicted value of the target prediction application based on the sampling time point, the next switching application, and the foreground application:
  • the predicted value of the target prediction application is determined as a second preset value.
  • the processor can be used to perform the following steps:
  • a training sample is generated based on the feature value and the predicted value.
  • the feature values include (q 1 , q 2 . . . q m ), the predicted values include j1 and j2, when the preset Bayesian model is trained using the training samples,
  • This processor can be used to perform the following steps:
  • N(j1) represents the number of occurrences of event j1
  • N(j2) represents the number of occurrences of event j2
  • P(j2) represents the probability of occurrence of event j2
  • the processor when the background application in the electronic device is controlled based on the trained Bayesian model, the processor can be used to perform the following steps:
  • the background application is closed according to the cleanup rate.
  • the processor can be used to perform the following steps when calculating the cleanable rate of each background application using the trained Bayesian model and current operational parameters:
  • the current feature value is input into the third preset formula for calculation to obtain a cleanable rate, and the third preset formula is:
  • the processor when the background application is closed according to the cleanup rate, the processor can be used to perform the following steps:
  • 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 terminal, 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 terminal through a speaker and a microphone.
  • Electronic device 500 may also include at least one type of sensor 508, such as a light sensor, motion sensor, 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 and/or the backlight when the terminal moves to the ear.
  • 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.
  • the terminal can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
  • Power source 509 is used to power various components of electronic device 500.
  • the power supply 509 can be logically coupled to the processor 501 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
  • the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • an embodiment of the present invention provides a storage medium in which a plurality of instructions are stored, which can be loaded by a processor to perform the steps in any of the application control methods provided by the embodiments of the present invention.
  • the storage medium may include: a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
  • ROM read only memory
  • RAM random access memory
  • magnetic disk a magnetic disk or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Disclosed are an application control method and apparatus, a storage medium and an electronic device. The application control method is applied to the electronic device, and comprises: acquiring operating parameters of the electronic device at each sampling time point in a historical time period; according to the sampling time point and the operating parameters, generating a training sample; using the training sample to train a pre-set Bayesian model; and based on the trained Bayesian model, controlling a background application in the electronic device.

Description

应用控制方法、装置、存储介质以及电子设备Application control method, device, storage medium, and electronic device
本申请要求于2017年9月30日提交中国专利局、申请号为201710923081.6、发明名称为“应用控制方法、装置、存储介质以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on Sep. 30, 2017, filed Jan. In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种应用控制方法、装置、存储介质以及电子设备。The present application relates to the field of computer technologies, and in particular, to an application control method, apparatus, storage medium, and electronic device.
背景技术Background technique
随着科技的发展,智能手机、平板电脑(PAD)等移动终端已经成为用户生活中不可或缺的设备。With the development of technology, mobile terminals such as smartphones and tablet PCs (PADs) have become indispensable devices in user life.
目前,终端安装的应用程序越来越多,用户在使用完毕终端中的应用程序时,通常会执行如切换至新的应用程序、返回主界面、或者锁屏的操作,此时使用完毕的应用程序被切换至后台,这些在后台的应用程序会继续运行,例如,与服务器交换数据,监听用户动作等;在运行过程中,会持续占用系统资源,例如,占用系统内存、消耗数据流量、消耗终端电量等。为避免使用完毕的应用程序继续占用系统资源,通常需要对后台的应用程序进行清理,比如根据应用程序消耗的内存数量来选择消耗内存较多的应用程序进行清理,或者根据终端出厂时设置的应用程序优先级,清理低优先级的应用程序,等等,但是,这些清理方法都比较死板,无法灵活地判定哪些应用程序可以清理,难以有效提升系统资源。At present, there are more and more applications installed on the terminal. When the user finishes using the application in the terminal, the user usually performs operations such as switching to a new application, returning to the main interface, or locking the screen. The program is switched to the background, these applications in the background will continue to run, for example, exchange data with the server, listen to user actions, etc.; during the running process, it will continue to occupy system resources, for example, occupy system memory, consume data traffic, consume Terminal power, etc. In order to prevent the used application from continuing to occupy system resources, it is usually necessary to clean up the background application, such as selecting the application that consumes more memory according to the amount of memory consumed by the application, or according to the application set at the factory. Program priority, clean up low-priority applications, and so on, but these cleanup methods are relatively rigid, unable to flexibly determine which applications can be cleaned, and it is difficult to effectively improve system resources.
发明内容Summary of the invention
本申请实施例提供一种应用控制方法、装置、存储介质以及电子设备,能灵活清理后台应用程序,有效提升系统资源。The embodiments of the present application provide an application control method, device, storage medium, and electronic device, which can flexibly clean background applications and effectively improve system resources.
本申请实施例提供了一种应用控制方法,应用于电子设备,包括:The embodiment of the present application provides an application control method, which is applied to an electronic device, and includes:
获取历史时段内每一采样时间点所述电子设备的运行参数,所述运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;Obtaining an operating parameter of the electronic device at each sampling time point in the historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
根据所述采样时间点和运行参数生成训练样本;Generating a training sample according to the sampling time point and the running parameter;
利用所述训练样本对预设的贝叶斯模型进行训练;Training the preset Bayesian model with the training sample;
基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制。The background application in the electronic device is controlled based on the trained Bayesian model.
本申请实施例还提供了一种应用控制装置,应用于电子设备,包括:The embodiment of the present application further provides an application control device, which is applied to an electronic device, and includes:
获取模块,用于获取历史时段内每一采样时间点所述电子设备的运行参数,所述运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;An acquiring module, configured to acquire an operating parameter of the electronic device at each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
生成模块,用于根据所述采样时间点和运行参数生成训练样本;a generating module, configured to generate a training sample according to the sampling time point and the running parameter;
训练模块,用于利用所述训练样本对预设的贝叶斯模型进行训练;a training module, configured to train the preset Bayesian model by using the training sample;
控制模块,用于基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制。And a control module, configured to control a background application in the electronic device based on the trained Bayesian model.
本申请实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一项应用控制方法。The embodiment of the present application 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 any one of the application control methods described above.
本申请实施例还提供了一种电子设备,包括处理器和存储器,所述处理器与所述存储器电性连接,所述存储器用于存储指令和数据,所述处理器用于上述任一项所述的应用控制方法中的步骤。The embodiment of the present application further provides an electronic device, including a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used in any one of the foregoing The steps in the application control method described.
附图说明DRAWINGS
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其它有益效果显而易见。The technical solutions and other advantageous effects of the present application will be apparent from the detailed description of the embodiments of the present application.
图1为本申请实施例提供的应用控制方法的流程示意图。FIG. 1 is a schematic flowchart diagram of an application control method according to an embodiment of the present application.
图2为本申请实施例提供的应用控制方法的另一流程示意图。FIG. 2 is another schematic flowchart of an application control method according to an embodiment of the present application.
图3为本申请实施例提供的贝叶斯模型的训练流程图。FIG. 3 is a flowchart of training a Bayesian model provided by an embodiment of the present application.
图4为本申请实施例提供的贝叶斯模型的框架示意图。FIG. 4 is a schematic diagram of a frame of a Bayesian model provided by an embodiment of the present application.
图5为本申请实施例提供的应用控制装置的结构示意图。FIG. 5 is a schematic structural diagram of an application control apparatus according to an embodiment of the present application.
图6为本申请实施例提供的生成模块的结构示意图。FIG. 6 is a schematic structural diagram of a generation module according to an embodiment of the present application.
图7为本申请实施例提供的生成子模块的结构示意图。FIG. 7 is a schematic structural diagram of a generating submodule according to an embodiment of the present disclosure.
图8为本申请实施例提供的电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present application without creative efforts are within the scope of the present application.
本申请实施例提供一种应用控制方法、装置、存储介质以及电子设备。Embodiments of the present application provide an application control method, apparatus, storage medium, and electronic device.
一种应用控制方法,应用于电子设备,包括:获取历史时段内每一采样时间点该电子设备的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;根据该采样时间点和运行参数生成训练样本;利用该训练样本对预设的贝叶斯模型进行训练;基于训练后的贝叶斯模型对该电子设备中的后台应用进行控制。An application control method is applied to an electronic device, comprising: acquiring an operating parameter of the electronic device at each sampling time point in a historical time period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection. a training sample is generated according to the sampling time point and the running parameter; the preset Bayesian model is trained by using the training sample; and the background application in the electronic device is controlled based on the trained Bayesian model.
在一些实施例中,所述根据所述采样时间点和运行参数生成训练样本,包括:In some embodiments, the generating the training sample according to the sampling time point and the operating parameter comprises:
根据所述采样时间点确定采样日期类型和采样时段;Determining a sampling date type and a sampling period according to the sampling time point;
确定所述剩余电量所属的预设电量范围,以及确定所述已亮屏时长所属的预设时长范围;Determining a preset power range to which the remaining power belongs, and determining a preset duration range to which the bright screen duration belongs;
根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。The training samples are generated according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
在一些实施例中,所述根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本,包括:In some embodiments, the generating the training sample according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state, includes:
获取目标预测应用;Obtain a target prediction application;
根据所述采样时间点从运行参数中确定所述前台应用的上一切换应用和下一切换应用;Determining, according to the sampling time point, a previous switching application and a next switching application of the foreground application from the operating parameters;
根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值;Determining a predicted value of the target prediction application according to the sampling time point, a next switching application, and a foreground application;
根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。A training sample is generated according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value.
在一些实施例中,所述根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值,包括:In some embodiments, the determining, according to the sampling time point, the next switching application, and the foreground application, the predicted value of the target prediction application, including:
计算所述下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
判断所述目标预测应用是否为所述下一切换应用,且所述差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
若是,则将所述目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as a first preset value;
若否,则将所述目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
在一些实施例中,所述根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本,包括:In some embodiments, the according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection status, the network connection status, the target prediction application, and the predicted value. Generate training samples, including:
分别获取所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
根据所述特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
在一些实施例中,所述特征值包括(q 1,q 2…q m),所述预测值包括j1和j2,所述利用所述训练样本对预设的贝叶斯模型进行训练,包括: In some embodiments, the feature value comprises (q 1 , q 2 ... q m ), the predicted value comprises j1 and j2, and the training of the preset Bayesian model is performed by using the training sample, including :
将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
Figure PCTCN2018103283-appb-000001
其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
Figure PCTCN2018103283-appb-000001
Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
Figure PCTCN2018103283-appb-000002
其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
Figure PCTCN2018103283-appb-000002
Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
在一些实施例中,所述基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制,包括:In some embodiments, the training based Bayesian model controls a background application in the electronic device, including:
获取后台应用清理指令;Get background application cleanup instructions;
根据所述后台应用清理指令获取所述电子设备的后台应用、以及当前的运行参数;Obtaining, according to the background application cleanup instruction, a background application of the electronic device, and current running parameters;
利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率;Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters;
根据所述可清理率关闭所述后台应用。The background application is closed according to the cleanup rate.
在一些实施例中,所述利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率,包括:In some embodiments, the calculating the cleanable rate of each background application using the trained Bayesian model and the current operational parameters includes:
根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
将当前特征值输入第三预设公式中进行计算,得到可清理率,所述第三预设公式为:P
Figure PCTCN2018103283-appb-000003
其中,1≤k≤m,q k为当前特征值。
The current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained. The third preset formula is: P
Figure PCTCN2018103283-appb-000003
Where 1 ≤ k ≤ m, q k is the current eigenvalue.
在一些实施例中,所述根据所述可清理率关闭所述后台应用,包括:In some embodiments, the closing the background application according to the cleanup rate comprises:
选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
关闭所述目标应用。Close the target app.
如图1所示,该应用控制方法应用于电子设备,其具体流程可以如下:As shown in FIG. 1, the application control method is applied to an electronic device, and the specific process can be as follows:
101、获取历史时段内每一采样时间点该电子设备的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态。101. Obtain an operating parameter of the electronic device at each sampling time point in the historical time period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state.
本实施例中,该历史时段可以人为设定,比如可以是前一个月或前两个月。该采样时间点主要根据采样频率而定,比如可以每分钟或者每两分钟采样一次,其可以表现为x年x月x日x时x分的形式。该充电连接状态和网络连接状态均可以包括连接和未连接两种情况。In this embodiment, the historical period may be manually set, such as the previous month or the first two months. The sampling time point is mainly determined according to the sampling frequency, for example, it can be sampled every minute or every two minutes, and can be expressed in the form of x minutes of x years x months x days x. Both the charging connection state and the network connection state may include both connected and unconnected situations.
实际应用过程中,该运行参数可以是实时获取的,比如到达采样时间点即进行对应数据的采集操作,也可以是一次性获取的,比如电子设备可以提前在本地数据库中记录历史时段内每一次亮灭屏变化数据、充电状态变化数据、网络状态变化数据、以及应用打开数据,之后,可以根据采样频率一次性提取出每一采样时间点的运行参数。In the actual application process, the running parameter may be obtained in real time, for example, the corresponding data collection operation is performed at the sampling time point, or may be obtained once, for example, the electronic device may record the historical time period in the local database in advance. The screen change data, the charge state change data, the network state change data, and the application open data are displayed, and then the operation parameters of each sampling time point can be extracted at one time according to the sampling frequency.
102、根据该采样时间点和运行参数生成训练样本。102. Generate a training sample according to the sampling time point and the running parameter.
例如,上述步骤102具体可以包括:For example, the foregoing step 102 may specifically include:
1-1、根据该采样时间点确定采样日期类型和采样时段。1-1. Determine a sampling date type and a sampling period according to the sampling time point.
本实施例中,该采样日期类型是对每周进行划分,其可以包括工作日和周末。该采样时段是对每天进行划分,其可以将一天分为48个时段。In this embodiment, the sampling date type is divided into weekly, which may include weekdays and weekends. The sampling period is divided into daily, which can divide the day into 48 time periods.
1-2、确定该剩余电量所属的预设电量范围,以及确定该已亮屏时长所属的预设时长范围。1-2. Determine a preset power range to which the remaining power belongs, and determine a preset duration range to which the bright time duration belongs.
本实施例中,该预设电量范围和预设时长范围均可以人为设定,该预设电量范围可以 包括指示高电量、中电量和低电量的三个区间范围,比如高电量可以是70%-100%,中电量可以是40%-70%,低电量可以是0-40%等,该预设时长范围可以包括指示短、中和长的三个区间范围,比如长可以是10min以上,中可以是5-10min,短可以是0-5min。In this embodiment, the preset power range and the preset duration range may be manually set, and the preset power range may include three ranges indicating high power, medium power, and low power, for example, the high power may be 70%. -100%, the medium power can be 40%-70%, the low battery can be 0-40%, etc., the preset duration range can include three intervals indicating short, medium and long, for example, the length can be more than 10min, It can be 5-10min in length and 0-5min in short.
1-3、根据该采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。1-3. Generate training samples according to the sampling date type, sampling period, preset power range, preset duration range, foreground application, charging connection status, and network connection status.
例如,上述步骤1-3具体可以包括:For example, the foregoing steps 1-3 may specifically include:
1-3-1、获取目标预测应用。1-3-1. Obtain the target prediction application.
本实施例中,该目标预测应用可以是电子设备中所安装的全部应用,也可以是部分应用,当为部分应用时,其可以是近期出现频率最高的若干个应用,具体数量可以根据实际需求而定。In this embodiment, the target prediction application may be all applications installed in the electronic device, or may be partial applications. When it is a partial application, it may be several applications with the highest frequency of occurrence in the near future, and the specific quantity may be according to actual needs. And set.
1-3-2、根据该采样时间点从运行参数中确定该前台应用的上一切换应用和下一切换应用。1-3-2. Determine, according to the sampling time point, the last switching application and the next switching application of the foreground application from the operating parameters.
本实施例中,由于历史时段内每次采样获得的前台应用都是已知的,故对于任意一次采样获得的前台应用,在该采样时间点之前获得的不同前台应用都可以认为是当前前台应用的上一切换应用,在该采样时间点之后获得的不同前台应用都可以认为是当前前台应用的下一切换应用,通常,可以取离当前采样时间点最近的不同前台应用作为上一切换应用和下一切换应用。实际操作过程中,可以先根据采样时间点对所有前台应用进行排序,对于排序后的任意三个相邻的不同前台应用,前面的前台应用可以作为中间的前台应用的上一切换应用,后面的前台应用可以作为中间的前台应用的下一切换应用。In this embodiment, since the foreground application obtained by each sampling in the historical period is known, the foreground application obtained before the sampling time point can be regarded as the current foreground application for the foreground application obtained by any sampling. The previous foreground application that is obtained after the sampling time point can be regarded as the next switching application of the current foreground application. Generally, different foreground applications that are closest to the current sampling time point can be taken as the previous switching application and Next switch application. In the actual operation process, all foreground applications may be sorted according to the sampling time point. For any three adjacent different foreground applications after sorting, the front foreground application may serve as the previous switching application of the intermediate foreground application, followed by The foreground application can serve as the next switching application for the intermediate foreground application.
1-3-3、根据该采样时间点、下一切换应用以及前台应用确定该目标预测应用的预测值。1-3-3. Determine a predicted value of the target prediction application according to the sampling time point, the next switching application, and the foreground application.
本实施例中,该预测值可以是人为设定的数值,比如0和1,其中,0可以表示该目标预测应用不会在短时间内切换至前台使用,1可以表示该目标预测应用会在短时间内切换至前台使用。由于在历史时段内采集的所有前台应用都是已知的,故可以根据已知前台应用、以及其采样时间点来确定目标预测应用的预测值,此时,上述步骤1-3-3具体可以包括:In this embodiment, the predicted value may be an artificially set value, such as 0 and 1, where 0 indicates that the target prediction application will not switch to the foreground use in a short time, and 1 may indicate that the target prediction application will be in the Switch to the foreground for a short time. Since all the foreground applications collected in the historical period are known, the predicted value of the target prediction application can be determined according to the known foreground application and the sampling time point. In this case, the above steps 1-3-3 can be specifically include:
计算该下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
判断该目标预测应用是否为该下一切换应用,且该差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
若是,则将该目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as the first preset value;
若否,则将该目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
本实施例中,该预设时长、第一预设数值和第二预设数值均可以人为设定,该预设时长主要用于界定时间长短,其可以是10min,该第一预设数值可以是1,第二预设数值可以是0。对于每次采样,当需要预测的目标预测应用即为下一切换应用时,需要进一步分析从当前应用切换至下一切换应用所花的时长,只有当该间隔时长在预设时长之内时,才可以将该目标预测应用的预测值设为1,否则,全部设为0。In this embodiment, the preset duration, the first preset value, and the second preset value may be manually set, and the preset duration is mainly used to define a length of time, which may be 10 minutes, and the first preset value may be Yes 1, the second preset value can be 0. For each sampling, when the target prediction application that needs to be predicted is the next switching application, it is necessary to further analyze the length of time taken to switch from the current application to the next switching application, only when the interval duration is within the preset duration, The predicted value of the target prediction application can be set to 1, otherwise, all are set to 0.
1-3-4、根据该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。1-3-4. Generate training samples according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value. .
本实施例中,为从多个维度对用户行为进行分析,以使训练出的机器学习模型更拟人化,每一训练样本可以由多个已知特征项以及标签项的数据组成,该已知特征项可以包括该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态和网络连接状态等,该标签项主要是。In this embodiment, in order to analyze the user behavior from multiple dimensions, so that the trained machine learning model is more anthropomorphic, each training sample may be composed of a plurality of known feature items and data of the tag items, the known The feature item may include the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection status, and the network connection status, etc., and the label item is mainly.
例如,上述步骤1-3-4具体可以包括:For example, the foregoing steps 1-3-4 may specifically include:
分别获取该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
根据该特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
本实施例中,由于计算机程序一般以字符的形式编码运行,故该特征值主要可以表现 为阿拉伯数字或字母的形式,比如1-10,每一特征项也可以表现为字母的形式,比如前台应用为H,采样日期类型为B,等等。在生成训练样本时,可以直接将特征项的特征值作为先验条件,将每一目标预测应用的预测值作为后验结果,生成该训练样本。In this embodiment, since the computer program generally runs in the form of characters, the feature value can be mainly expressed in the form of Arabic numerals or letters, such as 1-10, and each feature item can also be expressed in the form of letters, such as the foreground. The application is H, the sampling date type is B, and so on. When generating the training sample, the feature value of the feature item may be directly used as a prior condition, and the predicted value of each target prediction application is used as a posterior result to generate the training sample.
容易理解的是,每一特征项对应的特征值可以是预先设定好的,不同特征项的特征值可以相同,也可以不同,比如前台应用和采样时段的特征值都可以包括0~10,但是,每个数字在不同的特征项中指代的意义不同,比如对于前台应用,0可以指代美团,对于采样时段,0可以指代0:00-1:00这个时段。It is easy to understand that the feature values corresponding to each feature item may be preset, and the feature values of different feature items may be the same or different, for example, the feature values of the foreground application and the sampling period may include 0 to 10, However, each number refers to a different meaning in different feature items. For example, for the foreground application, 0 can refer to the US group. For the sampling period, 0 can refer to the period from 0:00 to 1:00.
103、利用该训练样本对预设的贝叶斯模型进行训练。103. Train the preset Bayesian model with the training sample.
例如,该特征值可以包括(q 1,q 2…q m),该预测值可以包括j1和j2,此时,上述步骤103具体可以包括: For example, the eigenvalues may include (q 1 , q 2 ... q m ), and the predicted value may include j1 and j2.
将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
Figure PCTCN2018103283-appb-000004
其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
Figure PCTCN2018103283-appb-000004
Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
Figure PCTCN2018103283-appb-000005
其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
Figure PCTCN2018103283-appb-000005
Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
本实施例中,该贝叶斯模型可以为:
Figure PCTCN2018103283-appb-000006
其中,m为特征项的个数,q 1,q 2…q m为先验条件的特征值,q i为第i个特征项对应的特征值,J为目标预测应用的预测值。为简化计算,假设q 1,q 2…q m是相互独立的,则
Figure PCTCN2018103283-appb-000007
Figure PCTCN2018103283-appb-000008
从而得到朴素贝叶斯分类器模型:
In this embodiment, the Bayesian model can be:
Figure PCTCN2018103283-appb-000006
Where m is the number of feature terms, q 1 , q 2 ... q m are the eigenvalues of the a priori condition, q i is the eigenvalue corresponding to the i-th feature item, and J is the predicted value of the target prediction application. To simplify the calculation, assuming that q 1 , q 2 ... q m are independent of each other, then
Figure PCTCN2018103283-appb-000007
Figure PCTCN2018103283-appb-000008
Thus the Naive Bayes classifier model is obtained:
J MAX=arg max P(J|q 1,q 2…q m)=arg maxP(q 1|J)P(q 2|J)…P(q m|J),其中J可以表示j1或j2,各个特征项概率值是出现次数的统计概率,也即上述公式: J MAX = arg max P(J|q 1 , q 2 ... q m )=arg maxP(q 1 |J)P(q 2 |J)...P(q m |J), where J can represent j1 or j2 The probability value of each feature item is the statistical probability of the number of occurrences, that is, the above formula:
Figure PCTCN2018103283-appb-000009
其中,j1为第一预设数值,j2为第二预设数值。容易得知,训练贝叶斯模型的过程就是概率统计的过程,也即对贝叶斯模型训练后,可以得到每个特征项中不同特征值的概率值,比如P(q 1)、P(q 1|j2)。
Figure PCTCN2018103283-appb-000009
Where j1 is the first preset value and j2 is the second preset value. It is easy to know that the process of training the Bayesian model is the process of probability and statistics, that is, after training the Bayesian model, the probability values of different eigenvalues in each feature item can be obtained, such as P(q 1 ), P( q 1 |j2).
104、基于训练后的贝叶斯模型对该电子设备中的后台应用进行控制。104. Control the background application in the electronic device based on the trained Bayesian model.
例如,上述步骤104具体可以包括:For example, the foregoing step 104 may specifically include:
2-1、获取后台应用清理指令。2-1. Obtain the background application cleanup command.
本实施例中,该后台应用清理指令可以是电子设备自动生成的,比如内存占用量到达一定限度,或者电量不足,或者运行速度过慢时,生成该后台应用清理指令,当然,该后台应用清理指令也可以是用户手动操作生成的,比如用户可以通过点击指定清理图标来生成该后台应用清理指令。In this embodiment, the background application cleanup instruction may be automatically generated by the electronic device, for example, when the memory occupancy reaches a certain limit, or the power is insufficient, or the running speed is too slow, the background application cleanup instruction is generated, and of course, the background application is cleaned up. The instructions may also be generated manually by the user. For example, the user may generate the background application cleanup instruction by clicking the specified cleanup icon.
2-2、根据该后台应用清理指令获取该电子设备的后台应用、以及当前的运行参数。2-2. Obtain a background application of the electronic device and current running parameters according to the background application cleanup instruction.
2-3、利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率。2-3. Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters.
例如,上述步骤2-3具体可以包括:For example, the foregoing steps 2-3 may specifically include:
根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
将当前特征值输入第三预设公式中进行计算,得到可清理率,该第三预设公式为:The current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained. The third preset formula is:
Figure PCTCN2018103283-appb-000010
其中,1≤k≤m,q k为当前特征值。
Figure PCTCN2018103283-appb-000010
Where 1 ≤ k ≤ m, q k is the current eigenvalue.
本实施例中,和训练过程类似,可以先根据当前的运行参数得到当前的采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、上一切换应用、充电连接状态、网络连接状态以及当前需预测的后台应用这9个特征项,则m为9,并获取这几个特征项对应的特征值q 1,q 2…q 9,之后利用公式: In this embodiment, similar to the training process, the current sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the previous switching application, the charging connection state, and the network may be obtained according to the current operating parameters. The connection state and the 9 feature items of the background application that are currently to be predicted, then m is 9, and the feature values q 1 , q 2 ... q 9 corresponding to the feature items are obtained, and then the formula is used:
P(j2|q 1,q 2…q 9)=P(j2)P(q 1|j2)P(q 2|j2)…P(q 9|j2)来计算在当前特征值发生的前提下,j2发生的概率(也即当前需预测的后台应用不会在短时间内切换至前台)的概率值,作为可清理率。 P(j2|q 1 ,q 2 ...q 9 )=P(j2)P(q 1 |j2)P(q 2 |j2)...P(q 9 |j2) is calculated on the premise that the current eigenvalue occurs The probability of occurrence of j2 (that is, the background application that currently needs to be predicted will not switch to the foreground in a short time), as the cleanable rate.
2-4、根据该可清理率关闭该后台应用。2-4. The background application is closed according to the cleanup rate.
例如,上述步骤2-4具体可以包括:For example, the foregoing steps 2-4 may specifically include:
选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
关闭该目标应用。Close the target app.
本实施例中,该预设阈值和预设个数均可以人为设定,比如该预设阈值可以为0.5,该预设个数可以为4,也即当计算出的P(j2|q 1,q 2…q m)大于0.5时,可以认为后台应用i短时间内不会切换至前台,进而可以作为清理对象进行清理。 In this embodiment, the preset threshold and the preset number can be manually set. For example, the preset threshold may be 0.5, and the preset number may be 4, that is, when the calculated P(j2|q 1 When q 2 ... q m ) is greater than 0.5, it can be considered that the background application i will not switch to the foreground in a short time, and thus can be cleaned up as a cleanup object.
由上述可知,本实施例提供的应用控制方法,应用于电子设备,通过获取历史时段内每一采样时间点该电子设备的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态,并根据该采样时间点和运行参数生成训练样本,接着利用该训练样本对预设的贝叶斯模型进行训练,并基于训练后的贝叶斯模型对该电子设备中的后台应用进行控制,从而可以根据以往应用的使用情况较好地选出需要清理的后台应用,方法简单,灵活性高,节约了系统资源,用户体验感好。It can be seen from the above that the application control method provided in this embodiment is applied to an electronic device, and obtains an operation parameter of the electronic device at each sampling time point in a historical period, where the operation parameter includes a foreground application, a remaining power, a duration of a bright screen, and a charging connection state and a network connection state, and generating a training sample according to the sampling time point and the running parameter, and then training the preset Bayesian model by using the training sample, and based on the trained Bayesian model, the electronic device The background application in the middle is controlled, so that the background application that needs to be cleaned can be selected according to the usage of the previous application. The method is simple, the flexibility is high, the system resources are saved, and the user experience is good.
在本实施例中,将以该应用控制装置具体集成在电子设备中为例进行详细说明。In this embodiment, the application control device is specifically integrated into the electronic device as an example for detailed description.
请参见图2和图3,一种应用控制方法,具体流程可以如下:Referring to FIG. 2 and FIG. 3, an application control method may be as follows:
201、电子设备获取历史时段内每一采样时间点的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态。201. The electronic device acquires an operation parameter of each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state.
譬如,该历史时段可以是过去一个月,该采样时间点可以是过去一个月内每分钟所。该运行参数可以是从数据库中提取出来的,该数据库内可以存储有过去一个月电子设备中应用的使用记录、屏幕的亮灭记录、充电记录以及WiFi连接记录,如下表1-4,之后,根据这些记录可以提取出每一采样时间点的运行参数。For example, the historical time period may be the past month, and the sampling time point may be every minute in the past month. The running parameter may be extracted from a database, and the database may store the usage record of the application in the electronic device in the past month, the on-off record of the screen, the charging record, and the WiFi connection record, as shown in Table 1-4 below. Based on these records, the operating parameters for each sampling time point can be extracted.
应用名Application name 打开此应用的时间戳Open the timestamp of this app
com.tencent.mobileqqCom.tencent.mobileqq 14575506554651457550655465
com.android.settingsCom.android.settings 14576051075221457605107522
...... ......
表1:应用使用记录Table 1: Application Usage Record
屏幕状态变化Screen status change 时间戳Timestamp
亮->灭Bright->off 14576051315751457605131575
灭->亮Off->light 14576051517861457605151786
...... ......
表2:亮屏灭屏记录Table 2: Bright screen off screen recording
充电状态变化State of charge change 电量Electricity 时间戳Timestamp
进入充电Enter charging 23%twenty three% 14576051315101457605131510
灭退出充电Out of charge 80%80% 14576051517861457605151786
...... ......
表3:充电记录Table 3: Charging record
Wifi状态变化Wifi status change SSIDSSID BSSIDBSSID 时间戳Timestamp
连接wifiConnect wifi ...... ...... 14576051115101457605111510
断开wifiDisconnect wifi ...... ...... 14576051312861457605131286
...... ......
表4:Wifi记录Table 4: Wifi Record
202、电子设备根据该采样时间点确定采样日期类型和采样时段,并确定该剩余电量所属的预设电量范围,以及确定该已亮屏时长所属的预设时长范围。202. The electronic device determines, according to the sampling time point, a sampling date type and a sampling period, and determines a preset power amount range to which the remaining power belongs, and determines a preset duration range to which the bright screen duration belongs.
譬如,若采样时间点为2012年10月17日10时55分,每天可以分为48个时段,则当天为周三,其采样日期类型为工作日,采样时段为第11个时段。若剩余电量为80%,则其预设电量范围可以为70%-100%所对应的高电量。若已亮屏时长为3min,则其预设时长范围可以为0-5min所对应的短时长。For example, if the sampling time point is 10:55 on October 17, 2012, it can be divided into 48 time periods per day, then the day is Wednesday, the sampling date type is working day, and the sampling time is the 11th time period. If the remaining power is 80%, the preset power range can be 70%-100% of the corresponding high power. If the duration of the bright screen is 3 min, the preset duration may be a short duration corresponding to 0-5 min.
203、电子设备获取目标预测应用,并根据该采样时间点从运行参数中确定该前台应用的上一切换应用和下一切换应用。203. The electronic device acquires a target prediction application, and determines a previous switching application and a next switching application of the foreground application from the operating parameters according to the sampling time point.
譬如,该目标预测应用可以是近期出现频率最高的十个个应用APP1、APP2…APP10。可以先根据采样时间点对所有前台应用进行排序,对于排序后的任意三个相邻的不同前台应用,前面的前台应用可以作为中间的前台应用的上一切换应用,后面的前台应用可以作为中间的前台应用的下一切换应用,比如对于某个采样时间点,前台应用可以为APP10,上一切换应用可以为APP1,下一切换应用可以为APP5。For example, the target prediction application may be the ten most recent applications APP1, APP2...APP10. All foreground applications can be sorted according to the sampling time point. For any three adjacent different foreground applications after sorting, the front foreground application can be used as the last switching application of the intermediate foreground application, and the latter foreground application can be used as the middle. The next switching application of the foreground application, for example, for a sampling time point, the foreground application may be APP10, the last switching application may be APP1, and the next switching application may be APP5.
204、电子设备计算该下一切换应用的采样时间点与前台应用的采样时间点之间的差值,并判断该目标预测应用是否为该下一切换应用,且该差值是否不超过预设时长,若是,则将该目标预测应用的预测值确定为第一预设数值,若否,则将该目标预测应用的预测值确定为第二预设数值。204. The electronic device calculates a difference between a sampling time point of the next switching application and a sampling time point of the foreground application, and determines whether the target prediction application is the next switching application, and whether the difference does not exceed a preset. The duration, if yes, determines the predicted value of the target prediction application as the first preset value, and if not, determines the predicted value of the target prediction application as the second preset value.
譬如,采样得到APP1与APP10的间隔时长可以为T1,该第一预设数值可以是1,第二预设数值可以是0,该预设时长可以为10min,此时,若正需要预测的目标预测应用为APP5,且T1≤10,则可以将目标预测应用的预测值设定为1,否则,设定为0。For example, the interval between APP1 and APP10 may be T1, the first preset value may be 1, the second preset value may be 0, and the preset duration may be 10 min. The prediction application is APP5, and if T1 ≤ 10, the predicted value of the target prediction application can be set to 1, otherwise, it is set to 0.
205、电子设备分别获取该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值,并根据该特征值和预测值生成训练样本。205. The electronic device separately obtains the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application, and according to the The eigenvalues and predicted values generate training samples.
譬如,该训练样本的组成可以参见图4,该训练样本中特征值和特征项的对应关系可以参见下表5,For example, the composition of the training sample can be seen in FIG. 4, and the correspondence between the feature values and the feature items in the training sample can be seen in Table 5 below.
Figure PCTCN2018103283-appb-000011
Figure PCTCN2018103283-appb-000011
Figure PCTCN2018103283-appb-000012
Figure PCTCN2018103283-appb-000012
表5table 5
206、电子设备将每一训练样本输入预设的贝叶斯模型中,以对该贝叶斯模型进行训练。206. The electronic device inputs each training sample into a preset Bayesian model to train the Bayesian model.
譬如,该特征值可以包括(q 1,q 2…q m),该预测值可以包括j1和j2,此时,上述步骤206具体可以包括: For example, the eigenvalues may include (q 1 , q 2 ... q m ), and the predicted value may include j1 and j2.
将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
Figure PCTCN2018103283-appb-000013
其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
Figure PCTCN2018103283-appb-000013
Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
Figure PCTCN2018103283-appb-000014
其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
Figure PCTCN2018103283-appb-000014
Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
本实施例中,该贝叶斯模型可以为:
Figure PCTCN2018103283-appb-000015
其中,m为特征项的个数,q 1,q 2…q m为先验条件的特征值,q i为第i个特征项对应的特征值,J为目标预测应用的预测值。为简化计算,假设q 1,q 2…q m是相互独立的,则
Figure PCTCN2018103283-appb-000016
Figure PCTCN2018103283-appb-000017
从而得到朴素贝叶斯分类器模型:
In this embodiment, the Bayesian model can be:
Figure PCTCN2018103283-appb-000015
Where m is the number of feature terms, q 1 , q 2 ... q m are the eigenvalues of the a priori condition, q i is the eigenvalue corresponding to the i-th feature item, and J is the predicted value of the target prediction application. To simplify the calculation, assuming that q 1 , q 2 ... q m are independent of each other, then
Figure PCTCN2018103283-appb-000016
Figure PCTCN2018103283-appb-000017
Thus the Naive Bayes classifier model is obtained:
J MAX=arg max P(J|q 1,q 2…q m)=arg maxP(q 1|J)P(q 2|J)…P(q m|J),其中J可以表示j1或j2,各个特征项概率值是出现次数的统计概率,也即上述公式: J MAX = arg max P(J|q 1 , q 2 ... q m )=arg maxP(q 1 |J)P(q 2 |J)...P(q m |J), where J can represent j1 or j2 The probability value of each feature item is the statistical probability of the number of occurrences, that is, the above formula:
Figure PCTCN2018103283-appb-000018
Figure PCTCN2018103283-appb-000018
其中,j1为第一预设数值,j2为第二预设数值。容易得知,训练贝叶斯模型的过程就是概率统计的过程,也即对贝叶斯模型训练后,可以得到每个特征项中不同特征值的概率值,比如P(q 1)、P(q 1|j2)。 Where j1 is the first preset value and j2 is the second preset value. It is easy to know that the process of training the Bayesian model is the process of probability and statistics, that is, after training the Bayesian model, the probability values of different eigenvalues in each feature item can be obtained, such as P(q 1 ), P( q 1 |j2).
207、电子设备获取后台应用清理指令。207. The electronic device acquires a background application cleanup instruction.
譬如,当检测到内存占用量到达一定限度,或者电量不足,或者运行速度过慢时,电子设备可以自动生成该后台应用清理指令。For example, when it is detected that the memory usage reaches a certain limit, or the power is insufficient, or the running speed is too slow, the electronic device can automatically generate the background application cleaning instruction.
208、电子设备根据该后台应用清理指令获取后台应用、以及当前的运行参数。208. The electronic device acquires the background application and the current running parameter according to the background application cleanup instruction.
209、电子设备利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率。209. The electronic device calculates a cleanable rate of each background application by using the trained Bayesian model and the current operating parameters.
譬如,上述步骤209进一步可以包括:For example, the above step 209 may further include:
根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
将当前特征值输入第三预设公式中进行计算,得到可清理率,该第三预设公式为:The current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained. The third preset formula is:
Figure PCTCN2018103283-appb-000019
其中,1≤k≤m,q k为当前特征值。
Figure PCTCN2018103283-appb-000019
Where 1 ≤ k ≤ m, q k is the current eigenvalue.
本实施例中,和训练过程类似,可以先根据当前的运行参数得到当前的采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、上一切换应用、充电连接状态、网络连接状态以及当前需预测的后台应用这9个特征项,则m为9,并获取这几个特征项对应的特征值q 1,q 2…q 9,之后利用公式: In this embodiment, similar to the training process, the current sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the previous switching application, the charging connection state, and the network may be obtained according to the current operating parameters. The connection state and the 9 feature items of the background application that are currently to be predicted, then m is 9, and the feature values q 1 , q 2 ... q 9 corresponding to the feature items are obtained, and then the formula is used:
P(j2|q 1,q 2…q 9)=P(j2)P(q 1|j2)P(q 2|j2)…P(q 9|j2)来计算在当前特征值发生的前提下,j2发生的概率(也即当前需预测的后台应用不会在短时间内切换至前台)的概率值,作为可清理率。 P(j2|q 1 ,q 2 ...q 9 )=P(j2)P(q 1 |j2)P(q 2 |j2)...P(q 9 |j2) is calculated on the premise that the current eigenvalue occurs The probability of occurrence of j2 (that is, the background application that currently needs to be predicted will not switch to the foreground in a short time), as the cleanable rate.
210、电子设备选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用,并关闭该目标应用。210. The electronic device selects a background application whose cleaning rate is not less than a preset threshold as the target application, or selects a preset number of background applications with the highest cleanup rate as the target application, and closes the target application.
譬如,该预设阈值可以为0.5,该预设个数可以为4,也即当计算出的P(j2|q 1,q 2…q m)大于0.5时,可以认为后台应用i短时间内不会切换至前台,进而可以作为清理对象进行清理。 For example, the preset threshold may be 0.5, and the preset number may be 4, that is, when the calculated P(j2|q 1 , q 2 ... q m ) is greater than 0.5, the background application i may be considered as a short time. It will not switch to the foreground and can be cleaned up as a cleanup object.
由上述可知,本实施例提供的应用控制方法,其中电子设备可以获取历史时段内每一采样时间点的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态,接着,根据该采样时间点确定采样日期类型和采样时段,并确定该剩余电量所属的预设电量范围,以及确定该已亮屏时长所属的预设时长范围,接着,获取目标预测应用,并根据该采样时间点从运行参数中确定该前台应用的上一切换应用和下一切换应用,之后,计算该下一切换应用的采样时间点与前台应用的采样时间点之间的差值,并判断该目标预测应用是否为该下一切换应用,且该差值是否不超过预设时长,若是,则将该目标预测应用的预测值确定为第一预设数值,若否,则将该目标预测应用的预测值确定为第二预设数值,之后,分别获取该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值,并根据该特征值和预测值生成训练样本,接着,将每一训练样本输入预设的贝叶斯模型中,以对该贝叶斯模型进行训练,接着,获取后台应用清理指令,并根据该后台应用清理指令获取后台应用、以及当前的运行参数,接着,利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率,并选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用,之后关闭该目标应用,从而可以根据以往应用的使用情况较好地选出需要清理的后台应用,方法简单,灵活性高,节约了系统资源,用户体验感好。It can be seen from the above that the application control method provided in this embodiment, wherein the electronic device can acquire the running parameters of each sampling time point in the historical time period, the operating parameters include the foreground application, the remaining power, the screen duration, the charging connection state, and the network. a connection state, and then determining a sampling date type and a sampling period according to the sampling time point, determining a preset power amount range to which the remaining power belongs, and determining a preset duration range to which the bright screen duration belongs, and then acquiring a target prediction application And determining, according to the sampling time point, the previous switching application and the next switching application of the foreground application from the operating parameter, and then calculating a difference between the sampling time point of the next switching application and the sampling time point of the foreground application. And determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration, and if yes, determining the predicted value of the target prediction application as a first preset value, and if not, The predicted value of the target prediction application is determined as a second preset value, and then the previous handover is respectively obtained. a foreground sample, a sampling date type, a sampling period, a preset power range, a preset duration range, a charging connection state, a network connection state, and a feature value corresponding to the target prediction application, and generating a training sample according to the feature value and the predicted value, and then Each training sample is input into a preset Bayesian model to train the Bayesian model, and then a background application cleanup instruction is obtained, and the background application and the current running parameter are obtained according to the background application cleanup instruction. Then, using the trained Bayesian model and the current running parameters to calculate the cleanable rate of each background application, and selecting a background application whose cleaning rate is not less than a preset threshold as the target application, or selecting the highest cleanable rate The preset number of background applications is used as the target application, and then the target application is closed, so that the background application that needs to be cleaned can be selected according to the usage of the previous application, the method is simple, the flexibility is high, the system resources are saved, and the user experience is saved. Feeling good.
根据上述实施例所描述的方法,本实施例将从应用控制装置的角度进一步进行描述,该应用控制装置具体可以作为独立的实体来实现,也可以集成在电子设备,比如终端中来实现,该终端可以包括手机、平板电脑以及个人计算机等。According to the method described in the foregoing embodiments, the present embodiment is further described from the perspective of an application control device, which may be implemented as an independent entity or integrated in an electronic device, such as a terminal. The terminal can include a mobile phone, a tablet computer, a personal computer, and the like.
本申请实施例提供一种应用控制装置,应用于电子设备,其包括:An embodiment of the present application provides an application control apparatus, which is applied to an electronic device, and includes:
获取模块,用于获取历史时段内每一采样时间点所述电子设备的运行参数,所述运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;An acquiring module, configured to acquire an operating parameter of the electronic device at each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
生成模块,用于根据所述采样时间点和运行参数生成训练样本;a generating module, configured to generate a training sample according to the sampling time point and the running parameter;
训练模块,用于利用所述训练样本对预设的贝叶斯模型进行训练;a training module, configured to train the preset Bayesian model by using the training sample;
控制模块,用于基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制。And a control module, configured to control a background application in the electronic device based on the trained Bayesian model.
在一些实施例中,所述生成模块包括:In some embodiments, the generating module comprises:
第一确定子模块,用于根据所述采样时间点确定采样日期类型和采样时段;a first determining submodule, configured to determine a sampling date type and a sampling period according to the sampling time point;
第二确定子模块,用于确定所述剩余电量所属的预设电量范围,以及确定所述已亮屏时长所属的预设时长范围;a second determining sub-module, configured to determine a preset power range to which the remaining power belongs, and determine a preset duration range to which the bright time duration belongs;
生成子模块,用于根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。And generating a submodule, configured to generate a training sample according to the sampling date type, a sampling period, a preset power range, a preset duration range, a foreground application, a charging connection state, and a network connection state.
在一些实施例中,所述生成子模块包括:In some embodiments, the generating submodule comprises:
获取单元,用于获取目标预测应用;An obtaining unit for acquiring a target prediction application;
第一确定单元,用于根据所述采样时间点从运行参数中确定所述前台应用的上一切换应用和下一切换应用;a first determining unit, configured to determine, according to the sampling time point, a previous switching application and a next switching application of the foreground application from the operating parameters;
第二确定单元,用于根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值;a second determining unit, configured to determine a predicted value of the target prediction application according to the sampling time point, a next switching application, and a foreground application;
生成单元,用于根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。a generating unit, configured to generate a training sample according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value .
在一些实施例中,所述第二确定单元具体用于:In some embodiments, the second determining unit is specifically configured to:
计算所述下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
判断所述目标预测应用是否为所述下一切换应用,且所述差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
若是,则将所述目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as a first preset value;
若否,则将所述目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
在一些实施例中,所述生成单元具体用于:In some embodiments, the generating unit is specifically configured to:
分别获取所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
根据所述特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
在一些实施例中,所述特征值包括(q 1,q 2…q m),所述预测值包括j1和j2,所述训练模块具体用于: In some embodiments, the feature values include (q 1 , q 2 . . . q m ), the predicted values include j1 and j2, and the training module is specifically configured to:
将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
Figure PCTCN2018103283-appb-000020
其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
Figure PCTCN2018103283-appb-000020
Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
Figure PCTCN2018103283-appb-000021
其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
Figure PCTCN2018103283-appb-000021
Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
在一些实施例中,所述控制模块具体用于:In some embodiments, the control module is specifically configured to:
获取后台应用清理指令;Get background application cleanup instructions;
根据所述后台应用清理指令获取所述电子设备的后台应用、以及当前的运行参数;Obtaining, according to the background application cleanup instruction, a background application of the electronic device, and current running parameters;
利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率;Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters;
根据所述可清理率关闭所述后台应用。The background application is closed according to the cleanup rate.
在一些实施例中,所述控制模块具体用于:In some embodiments, the control module is specifically configured to:
根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
将当前特征值输入第三预设公式中进行计算,得到可清理率,所述第三预设公式为:The current feature value is input into the third preset formula for calculation to obtain a cleanable rate, and the third preset formula is:
Figure PCTCN2018103283-appb-000022
其中,1≤k≤m,q k为当前特征值。
Figure PCTCN2018103283-appb-000022
Where 1 ≤ k ≤ m, q k is the current eigenvalue.
在一些实施例中,所述控制模块具体用于:In some embodiments, the control module is specifically configured to:
选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
关闭所述目标应用。Close the target app.
请参阅图5,图5具体描述了本申请实施例提供的应用控制装置,应用于电子设备,其可以包括:获取模块10、生成模块20、训练模块30和控制模块40,其中:Referring to FIG. 5, FIG. 5 specifically describes an application control device provided by an embodiment of the present application, which is applied to an electronic device, which may include: an obtaining module 10, a generating module 20, a training module 30, and a control module 40, where:
(1)获取模块10(1) Acquisition module 10
获取模块10,用于获取历史时段内每一采样时间点该电子设备的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态。The obtaining module 10 is configured to acquire an operating parameter of the electronic device at each sampling time point in the historical period, where the running parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state.
本实施例中,该历史时段可以人为设定,比如可以是前一个月或前两个月。该采样时间点主要指采样频率,比如可以每分钟或者每两分钟采样一次,其可以表现为x年x月x日x时x分的形式。该充电连接状态和网络连接状态均可以包括连接和未连接两种情况。In this embodiment, the historical period may be manually set, such as the previous month or the first two months. The sampling time point mainly refers to the sampling frequency, for example, it can be sampled every minute or every two minutes, and can be expressed in the form of x minutes x x x x x x. Both the charging connection state and the network connection state may include both connected and unconnected situations.
实际应用过程中,该运行参数可以是实时获取的,比如到达采样时间点获取模块10即进行对应数据的采集操作,也可以是一次性获取的,比如电子设备可以提前在本地数据库中记录历史时段内每一次亮灭屏变化数据、充电状态变化数据、网络状态变化数据、以及应用打开数据,之后,获取模块10可以根据采样频率一次性提取出每一采样时间点的运行参数。In the actual application process, the running parameter may be acquired in real time. For example, the acquiring module 10 obtains the corresponding data collecting operation at the sampling time point, or may be acquired at one time. For example, the electronic device may record the historical time period in the local database in advance. Each time the screen change data, the charging state change data, the network state change data, and the application open data are performed, the obtaining module 10 can extract the running parameters of each sampling time point at a time according to the sampling frequency.
(2)生成模块20(2) Generation module 20
生成模块20,用于根据该采样时间点和运行参数生成训练样本。The generating module 20 is configured to generate a training sample according to the sampling time point and the running parameter.
例如,请参见图6,该生成模块20具体可以包括第一确定子模块21、第二确定子模块22和生成子模块22,其中:For example, referring to FIG. 6, the generating module 20 may specifically include a first determining submodule 21, a second determining submodule 22, and a generating submodule 22, where:
第一确定子模块21,用于根据该采样时间点确定采样日期类型和采样时段。The first determining sub-module 21 is configured to determine a sampling date type and a sampling period according to the sampling time point.
本实施例中,该采样日期类型是对每周进行划分,其可以包括工作日和周末。该采样时段是对每天进行划分,其可以将一天分为48个时段。In this embodiment, the sampling date type is divided into weekly, which may include weekdays and weekends. The sampling period is divided into daily, which can divide the day into 48 time periods.
第二确定子模块22,用于确定该剩余电量所属的预设电量范围,以及确定该已亮屏时长所属的预设时长范围。The second determining sub-module 22 is configured to determine a preset power range to which the remaining power belongs, and determine a preset duration range to which the bright screen duration belongs.
本实施例中,该预设电量范围和预设时长范围均可以人为设定,该预设电量范围可以包括指示高电量、中电量和低电量的三个区间范围,比如高电量可以是70%-100%,中电量可以是40%-70%,低电量可以是0-40%等,该预设时长范围可以包括指示短、中和长的三个区间范围,比如长可以是10min以上,中可以是5-10min,短可以是0-5min。In this embodiment, the preset power range and the preset duration range may be manually set, and the preset power range may include three ranges indicating high power, medium power, and low power, for example, the high power may be 70%. -100%, the medium power can be 40%-70%, the low battery can be 0-40%, etc., the preset duration range can include three intervals indicating short, medium and long, for example, the length can be more than 10min, It can be 5-10min in length and 0-5min in short.
生成子模块23,用于根据该采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。The generating submodule 23 is configured to generate a training sample according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
例如,请参见图7,该生成子模块23具体可以包括获取单元231、第一确定单元232、第二确定单元233以及生成单元234,其中:For example, referring to FIG. 7, the generating sub-module 23 may specifically include an obtaining unit 231, a first determining unit 232, a second determining unit 233, and a generating unit 234, where:
获取单元231,用于获取目标预测应用。The obtaining unit 231 is configured to acquire a target prediction application.
本实施例中,该目标预测应用可以是电子设备中所安装的全部应用,也可以是部分应用,当为部分应用时,其可以是近期出现频率最高的若干个应用,具体数量可以根据实际需求而定。In this embodiment, the target prediction application may be all applications installed in the electronic device, or may be partial applications. When it is a partial application, it may be several applications with the highest frequency of occurrence in the near future, and the specific quantity may be according to actual needs. And set.
第一确定单元232,用于根据该采样时间点从运行参数中确定该前台应用的上一切换应用和下一切换应用。The first determining unit 232 is configured to determine, according to the sampling time point, the last switching application and the next switching application of the foreground application from the operating parameters.
本实施例中,由于历史时段内每次采样获得的前台应用都是已知的,故对于任意一次采样获得的前台应用,在该采样时间点之前获得的不同前台应用都可以认为是当前前台应用的上一切换应用,在该采样时间点之后获得的不同前台应用都可以认为是当前前台应用的下一切换应用,通常,第一确定单元232可以取离当前采样时间点最近的不同前台应用作为上一切换应用和下一切换应用。实际操作过程中,可以先根据采样时间点对所有前台应用进行排序,对于排序后的任意三个相邻的不同前台应用,前面的前台应用可以作为中间的前台应用的上一切换应用,后面的前台应用可以作为中间的前台应用的下一切换应用。In this embodiment, since the foreground application obtained by each sampling in the historical period is known, the foreground application obtained before the sampling time point can be regarded as the current foreground application for the foreground application obtained by any sampling. For the previous switching application, the different foreground applications obtained after the sampling time point can be regarded as the next switching application of the current foreground application. Generally, the first determining unit 232 can take different foreground applications that are closest to the current sampling time point. The last switch application and the next switch application. In the actual operation process, all foreground applications may be sorted according to the sampling time point. For any three adjacent different foreground applications after sorting, the front foreground application may serve as the previous switching application of the intermediate foreground application, followed by The foreground application can serve as the next switching application for the intermediate foreground application.
第二确定单元233,用于根据该采样时间点、下一切换应用以及前台应用确定该目标 预测应用的预测值。The second determining unit 233 is configured to determine a predicted value of the target prediction application according to the sampling time point, the next switching application, and the foreground application.
本实施例中,该预测值可以是人为设定的数值,比如0和1,其中,0可以表示该目标预测应用不会在短时间内切换至前台使用,1可以表示该目标预测应用会在短时间内切换至前台使用。由于在历史时段内采集的所有前台应用都是已知的,故可以根据已知前台应用、以及其采样时间点来确定目标预测应用的预测值,此时,该第二确定单元233进一步可以用于:In this embodiment, the predicted value may be an artificially set value, such as 0 and 1, where 0 indicates that the target prediction application will not switch to the foreground use in a short time, and 1 may indicate that the target prediction application will be in the Switch to the foreground for a short time. Since all the foreground applications collected during the historical period are known, the predicted value of the target prediction application can be determined according to the known foreground application and the sampling time point thereof. At this time, the second determining unit 233 can further use to:
计算该下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
判断该目标预测应用是否为该下一切换应用,且该差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
若是,则将该目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as the first preset value;
若否,则将该目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
本实施例中,该预设时长、第一预设数值和第二预设数值均可以人为设定,该预设时长主要用于界定时间长短,其可以是10min,该第一预设数值可以是1,第二预设数值可以是0。对于每次采样,当需要预测的目标预测应用即为下一切换应用时,该第二确定单元233需要进一步分析从当前应用切换至下一切换应用所花的时长,只有当该间隔时长在预设时长之内时,才可以将该目标预测应用的预测值设为1,否则,全部设为0。In this embodiment, the preset duration, the first preset value, and the second preset value may be manually set, and the preset duration is mainly used to define a length of time, which may be 10 minutes, and the first preset value may be Yes 1, the second preset value can be 0. For each sampling, when the target prediction application that needs to be predicted is the next switching application, the second determining unit 233 needs to further analyze the length of time taken to switch from the current application to the next switching application, only when the interval duration is in advance. The predicted value of the target prediction application can be set to 1 when the duration is within, otherwise all are set to 0.
生成单元234,用于根据该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。The generating unit 234 is configured to generate a training sample according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value. .
本实施例中,为从多个维度对用户行为进行分析,以使训练出的机器学习模型更拟人化,每一训练样本可以由多个已知特征项以及标签项的数据组成,该已知特征项可以包括该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态和网络连接状态等,该标签项主要是。In this embodiment, in order to analyze the user behavior from multiple dimensions, so that the trained machine learning model is more anthropomorphic, each training sample may be composed of a plurality of known feature items and data of the tag items, the known The feature item may include the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection status, and the network connection status, etc., and the label item is mainly.
例如,该生成单元234具体可以用于:For example, the generating unit 234 can be specifically configured to:
分别获取该上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
根据该特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
本实施例中,由于计算机程序一般以字符的形式编码运行,故该特征值主要可以表现为阿拉伯数字或字母的形式,比如1-10,每一特征项也可以表现为字母的形式,比如前台应用为H,采样日期类型为B,等等。在生成训练样本时,该生成单元234可以直接将特征项的特征值作为先验条件,将每一目标预测应用的预测值作为后验结果,生成该训练样本。In this embodiment, since the computer program generally runs in the form of characters, the feature value can be mainly expressed in the form of Arabic numerals or letters, such as 1-10, and each feature item can also be expressed in the form of letters, such as the foreground. The application is H, the sampling date type is B, and so on. When generating the training sample, the generating unit 234 may directly use the feature value of the feature item as a prior condition, and use the predicted value of each target prediction application as a posterior result to generate the training sample.
容易理解的是,每一特征项对应的特征值可以是预先设定好的,不同特征项的特征值可以相同,也可以不同,比如前台应用和采样时段的特征值都可以包括0~10,但是,每个数字在不同的特征项中指代的意义不同,比如对于前台应用,0可以指代美团,对于采样时段,0可以指代0:00-1:00这个时段。It is easy to understand that the feature values corresponding to each feature item may be preset, and the feature values of different feature items may be the same or different, for example, the feature values of the foreground application and the sampling period may include 0 to 10, However, each number refers to a different meaning in different feature items. For example, for the foreground application, 0 can refer to the US group. For the sampling period, 0 can refer to the period from 0:00 to 1:00.
(3)训练模块30(3) Training module 30
训练模块30,用于利用该训练样本对预设的贝叶斯模型进行训练。The training module 30 is configured to train the preset Bayesian model with the training sample.
例如,该特征值可以包括(q 1,q 2…q m),该预测值可以包括j1和j2,此时,该训练模块30具体可以用于: For example, the feature value may include (q 1 , q 2 ... q m ), and the predicted value may include j1 and j2. In this case, the training module 30 may specifically be used to:
将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
Figure PCTCN2018103283-appb-000023
其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
Figure PCTCN2018103283-appb-000023
Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述 第二预设公式为:
Figure PCTCN2018103283-appb-000024
其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
Figure PCTCN2018103283-appb-000024
Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
本实施例中,该贝叶斯模型可以为:
Figure PCTCN2018103283-appb-000025
其中,m为特征项的个数,q 1,q 2…q m为先验条件的特征值,q i为第i个特征项对应的特征值,J为目标预测应用的预测值。为简化计算,假设q 2,q 2…q m是相互独立的,则
Figure PCTCN2018103283-appb-000026
Figure PCTCN2018103283-appb-000027
从而得到朴素贝叶斯分类器模型:
In this embodiment, the Bayesian model can be:
Figure PCTCN2018103283-appb-000025
Where m is the number of feature terms, q 1 , q 2 ... q m are the eigenvalues of the a priori condition, q i is the eigenvalue corresponding to the i-th feature item, and J is the predicted value of the target prediction application. To simplify the calculation, assuming that q 2 , q 2 ... q m are independent of each other, then
Figure PCTCN2018103283-appb-000026
Figure PCTCN2018103283-appb-000027
Thus the Naive Bayes classifier model is obtained:
J MAX=arg max P(J|q 1,q 2…q m)=arg maxP(q 1|J)P(q 2|J)…P(q m|J),其中J可以表示j1或j2,各个特征项概率值是出现次数的统计概率,也即上述公式: J MAX = arg max P(J|q 1 , q 2 ... q m )=arg maxP(q 1 |J)P(q 2 |J)...P(q m |J), where J can represent j1 or j2 The probability value of each feature item is the statistical probability of the number of occurrences, that is, the above formula:
Figure PCTCN2018103283-appb-000028
其中,j1为第一预设数值,j2为第二预设数值。容易得知,训练贝叶斯模型的过程就是概率统计的过程,也即对贝叶斯模型训练后,可以得到每个特征项中不同特征值的概率值,比如P(q 1)、P(q 1|j2)。
Figure PCTCN2018103283-appb-000028
Where j1 is the first preset value and j2 is the second preset value. It is easy to know that the process of training the Bayesian model is the process of probability and statistics, that is, after training the Bayesian model, the probability values of different eigenvalues in each feature item can be obtained, such as P(q 1 ), P( q 1 |j2).
(4)控制模块40(4) Control module 40
控制模块40,用于基于训练后的贝叶斯模型对该电子设备中的后台应用进行控制。The control module 40 is configured to control the background application in the electronic device based on the trained Bayesian model.
例如,该控制模块40具体可以用于:For example, the control module 40 can be specifically configured to:
2-1、获取后台应用清理指令。2-1. Obtain the background application cleanup command.
本实施例中,该后台应用清理指令可以是电子设备自动生成的,比如内存占用量到达一定限度,或者电量不足,或者运行速度过慢时,生成该后台应用清理指令,当然,该后台应用清理指令也可以是用户手动操作生成的,比如用户可以通过点击指定清理图标来生成该后台应用清理指令。In this embodiment, the background application cleanup instruction may be automatically generated by the electronic device, for example, when the memory occupancy reaches a certain limit, or the power is insufficient, or the running speed is too slow, the background application cleanup instruction is generated, and of course, the background application is cleaned up. The instructions may also be generated manually by the user. For example, the user may generate the background application cleanup instruction by clicking the specified cleanup icon.
2-2、根据该后台应用清理指令获取该电子设备的后台应用、以及当前的运行参数。2-2. Obtain a background application of the electronic device and current running parameters according to the background application cleanup instruction.
2-3、利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率。2-3. Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters.
例如,上述控制模块40具体可以用于:For example, the foregoing control module 40 may specifically be used to:
根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
将当前特征值输入第三预设公式中进行计算,得到可清理率,该第三预设公式为:The current feature value is input into the third preset formula for calculation, and the cleanable rate is obtained. The third preset formula is:
Figure PCTCN2018103283-appb-000029
其中,1≤k≤m,q k为当前特征值。
Figure PCTCN2018103283-appb-000029
Where 1 ≤ k ≤ m, q k is the current eigenvalue.
本实施例中,和训练过程类似,可以先根据当前的运行参数得到当前的采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、上一切换应用、充电连接状态、网络连接状态以及当前需预测的后台应用这9个特征项,则m为9,并获取这几个特征项对应的特征值q 1,q 2…q 9,之后利用公式: In this embodiment, similar to the training process, the current sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the previous switching application, the charging connection state, and the network may be obtained according to the current operating parameters. The connection state and the 9 feature items of the background application that are currently to be predicted, then m is 9, and the feature values q 1 , q 2 ... q 9 corresponding to the feature items are obtained, and then the formula is used:
P(j2|q 1,q 2…q 9)=P(j2)P(q 1|j2)P(q 2|j2)…P(q 9|j2)来计算在当前特征值发生的前提下,j2发生的概率(也即当前需预测的后台应用不会在短时间内切换至前台)的概率值,作为可清理率。 P(j2|q 1 ,q 2 ...q 9 )=P(j2)P(q 1 |j2)P(q 2 |j2)...P(q 9 |j2) is calculated on the premise that the current eigenvalue occurs The probability of occurrence of j2 (that is, the background application that currently needs to be predicted will not switch to the foreground in a short time), as the cleanable rate.
2-4、根据该可清理率关闭该后台应用。2-4. The background application is closed according to the cleanup rate.
例如,该控制模块40进一步可以用于:For example, the control module 40 can further be used to:
选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
关闭该目标应用。Close the target app.
本实施例中,该预设阈值和预设个数均可以人为设定,比如该预设阈值可以为0.5,该预设个数可以为4,也即当计算出的P(j2|q 1,q 2…q m)大于0.5时,可以认为后台应用i短时间内不会切换至前台,进而可以作为清理对象进行清理。 In this embodiment, the preset threshold and the preset number can be manually set. For example, the preset threshold may be 0.5, and the preset number may be 4, that is, when the calculated P(j2|q 1 When q 2 ... q m ) is greater than 0.5, it can be considered that the background application i will not switch to the foreground in a short time, and thus can be cleaned up as a cleanup object.
具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元的具体实施可参见前面的方法实施例,在此不再赘述。In the specific implementation, the foregoing units 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, refer to the foregoing method embodiments, and details are not described herein.
由上述可知,本实施例提供的应用控制装置,应用于电子设备,通过获取模块10获取历史时段内每一采样时间点该电子设备的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态,接着,生成模块20根据该采样时间点和运行参数生成训练样本,训练模块30利用该训练样本对预设的贝叶斯模型进行训练,控制模块40基于训练后的贝叶斯模型对该电子设备中的后台应用进行控制,从而可以根据以往应用的使用情况较好地选出需要清理的后台应用,方法简单,灵活性高,节约了系统资源,用户体验感好。It can be seen from the above that the application control device provided in this embodiment is applied to an electronic device, and the operation parameter of the electronic device is obtained by the acquisition module 10 at each sampling time point in the historical time period, and the operation parameter includes the foreground application, the remaining power, and the light is turned on. The screen duration, the charging connection state, and the network connection state. Then, the generating module 20 generates a training sample according to the sampling time point and the operating parameter, and the training module 30 uses the training sample to train the preset Bayesian model, and the control module 40 is based on The trained Bayesian model controls the background application in the electronic device, so that the background application that needs to be cleaned can be selected according to the usage of the previous application, the method is simple, the flexibility is high, and the system resources are saved, and the user Experience is good.
另外,本申请实施例还提供了一种电子设备,该电子设备可以是智能手机、平板电脑等设备。图8所示,电子设备500包括处理器501、存储器502、显示屏503以及控制电路504。其中,处理器501分别与存储器502、显示屏503、控制电路504电性连接。In addition, the embodiment of the present application further provides an electronic device, which may be a device such as a smart phone or a tablet computer. As shown in FIG. 8, 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:
获取历史时段内每一采样时间点该电子设备的运行参数,该运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;Obtaining an operating parameter of the electronic device at each sampling time point in the historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
根据该采样时间点和运行参数生成训练样本;Generating a training sample according to the sampling time point and the running parameter;
利用该训练样本对预设的贝叶斯模型进行训练;Using the training sample to train the preset Bayesian model;
基于训练后的贝叶斯模型对该电子设备中的后台应用进行控制。The background application in the electronic device is controlled based on the trained Bayesian model.
在一些实施例中,在根据所述采样时间点和运行参数生成训练样本时,该处理器可用于执行以下步骤:In some embodiments, the processor can be used to perform the following steps when generating training samples based on the sampling time points and operational parameters:
根据所述采样时间点确定采样日期类型和采样时段;Determining a sampling date type and a sampling period according to the sampling time point;
确定所述剩余电量所属的预设电量范围,以及确定所述已亮屏时长所属的预设时长范围;Determining a preset power range to which the remaining power belongs, and determining a preset duration range to which the bright screen duration belongs;
根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。The training samples are generated according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
在一些实施例中,在根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本时,该处理器可用于执行以下步骤:In some embodiments, the processor can be used to perform the following steps when generating training samples according to the sampling date type, sampling period, preset power range, preset duration range, foreground application, charging connection status, and network connection status. :
获取目标预测应用;Obtain a target prediction application;
根据所述采样时间点从运行参数中确定所述前台应用的上一切换应用和下一切换应用;Determining, according to the sampling time point, a previous switching application and a next switching application of the foreground application from the operating parameters;
根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值;Determining a predicted value of the target prediction application according to the sampling time point, a next switching application, and a foreground application;
根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。A training sample is generated according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value.
在一些实施例中,在根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值时,该处理器可用于执行以下步骤:In some embodiments, the processor is operable to perform the following steps when determining the predicted value of the target prediction application based on the sampling time point, the next switching application, and the foreground application:
计算所述下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
判断所述目标预测应用是否为所述下一切换应用,且所述差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
若是,则将所述目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as a first preset value;
若否,则将所述目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
在一些实施例中,在根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本时,该处理器可用于执行以下步骤:In some embodiments, generating according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value. When training a sample, the processor can be used to perform the following steps:
分别获取所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
根据所述特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
在一些实施例中,所述特征值包括(q 1,q 2…q m),所述预测值包括j1和j2,在述利用所述训练样本对预设的贝叶斯模型进行训练时,该处理器可用于执行以下步骤: In some embodiments, the feature values include (q 1 , q 2 . . . q m ), the predicted values include j1 and j2, when the preset Bayesian model is trained using the training samples, This processor can be used to perform the following steps:
将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
Figure PCTCN2018103283-appb-000030
其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
Figure PCTCN2018103283-appb-000030
Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
Figure PCTCN2018103283-appb-000031
其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
Figure PCTCN2018103283-appb-000031
Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
在一些实施例中,在基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制时,该处理器可用于执行以下步骤:In some embodiments, when the background application in the electronic device is controlled based on the trained Bayesian model, the processor can be used to perform the following steps:
获取后台应用清理指令;Get background application cleanup instructions;
根据所述后台应用清理指令获取所述电子设备的后台应用、以及当前的运行参数;Obtaining, according to the background application cleanup instruction, a background application of the electronic device, and current running parameters;
利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率;Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters;
根据所述可清理率关闭所述后台应用。The background application is closed according to the cleanup rate.
在一些实施例中,在利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率时,该处理器可用于执行以下步骤:In some embodiments, the processor can be used to perform the following steps when calculating the cleanable rate of each background application using the trained Bayesian model and current operational parameters:
根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
将当前特征值输入第三预设公式中进行计算,得到可清理率,所述第三预设公式为:The current feature value is input into the third preset formula for calculation to obtain a cleanable rate, and the third preset formula is:
Figure PCTCN2018103283-appb-000032
其中,1≤k≤m,q k为当前特征值。
Figure PCTCN2018103283-appb-000032
Where 1 ≤ k ≤ m, q k is the current eigenvalue.
在一些实施例中,在根据所述可清理率关闭所述后台应用时,该处理器可用于执行以下步骤:In some embodiments, when the background application is closed according to the cleanup rate, the processor can be used to perform the following steps:
选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
关闭所述目标应用。Close the target app.
存储器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 terminal, 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.
在一些实施例中,如图8所示,电子设备500还包括:射频电路505、输入单元506、音频电路507、传感器508以及电源509。其中,处理器501分别与射频电路505、输入单元506、音频电路507、传感器508以及电源509电性连接。In some embodiments, as shown in FIG. 8, 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 terminal through a speaker and a microphone.
电子设备500还可以包括至少一种传感器508,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在终端移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。 Electronic device 500 may also include at least one type of sensor 508, such as a light sensor, motion sensor, 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 and/or the backlight when the terminal moves to the ear. . 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 gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for the terminal can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
电源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.
尽管图8中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 8, the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。为此,本发明实施例提供一种存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本发明实施例所提供的任一种应用控制方法中的步骤。It will be understood by those skilled in the art that all or part of the steps of the various methods in the above embodiments may be completed by instructions or controlled by related hardware, which may be stored in a computer readable storage medium. And loaded and executed by the processor. To this end, an embodiment of the present invention provides a storage medium in which a plurality of instructions are stored, which can be loaded by a processor to perform the steps in any of the application control methods provided by the embodiments of the present invention.
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。The storage medium may include: a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
由于该存储介质中所存储的指令,可以执行本发明实施例所提供的任一种应用控制方法中的步骤,因此,可以实现本发明实施例所提供的任一种应用控制方法所能实现的有益效果,详见前面的实施例,在此不再赘述。The steps in the application control method provided by the embodiments of the present invention may be implemented by using the instructions stored in the storage medium. Therefore, any application control method provided by the embodiments of the present invention may be implemented. For the beneficial effects, see the previous embodiments in detail, and details are not described herein again.
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of the foregoing operations, refer to the foregoing embodiments, and details are not described herein again.
综上所述,虽然本申请已以优选实施例揭露如上,但上述优选实施例并非用以限制本申请,本领域的普通技术人员,在不脱离本申请的精神和范围内,均可作各种更动与润饰,因此本申请的保护范围以权利要求界定的范围为准。In the above, although the present application has been disclosed in the above preferred embodiments, the preferred embodiments are not intended to limit the application, and those skilled in the art can make various modifications without departing from the spirit and scope of the application. The invention is modified and retouched, and the scope of protection of the present application is determined by the scope defined by the claims.

Claims (20)

  1. 一种应用控制方法,应用于电子设备,其包括:An application control method is applied to an electronic device, including:
    获取历史时段内每一采样时间点所述电子设备的运行参数,所述运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;Obtaining an operating parameter of the electronic device at each sampling time point in the historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
    根据所述采样时间点和运行参数生成训练样本;Generating a training sample according to the sampling time point and the running parameter;
    利用所述训练样本对预设的贝叶斯模型进行训练;Training the preset Bayesian model with the training sample;
    基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制。The background application in the electronic device is controlled based on the trained Bayesian model.
  2. 根据权利要求1所述的应用控制方法,其中,所述根据所述采样时间点和运行参数生成训练样本,包括:The application control method according to claim 1, wherein the generating the training sample according to the sampling time point and the operating parameter comprises:
    根据所述采样时间点确定采样日期类型和采样时段;Determining a sampling date type and a sampling period according to the sampling time point;
    确定所述剩余电量所属的预设电量范围,以及确定所述已亮屏时长所属的预设时长范围;Determining a preset power range to which the remaining power belongs, and determining a preset duration range to which the bright screen duration belongs;
    根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。The training samples are generated according to the sampling date type, the sampling period, the preset power range, the preset duration range, the foreground application, the charging connection state, and the network connection state.
  3. 根据权利要求2所述的应用控制方法,其中,所述根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本,包括:The application control method according to claim 2, wherein the generating a training sample according to the sampling date type, a sampling period, a preset power range, a preset duration range, a foreground application, a charging connection state, and a network connection state, including :
    获取目标预测应用;Obtain a target prediction application;
    根据所述采样时间点从运行参数中确定所述前台应用的上一切换应用和下一切换应用;Determining, according to the sampling time point, a previous switching application and a next switching application of the foreground application from the operating parameters;
    根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值;Determining a predicted value of the target prediction application according to the sampling time point, a next switching application, and a foreground application;
    根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。A training sample is generated according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value.
  4. 根据权利要求3所述的应用控制方法,其中,所述根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值,包括:The application control method according to claim 3, wherein the determining the predicted value of the target prediction application according to the sampling time point, the next switching application, and the foreground application comprises:
    计算所述下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
    判断所述目标预测应用是否为所述下一切换应用,且所述差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
    若是,则将所述目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as a first preset value;
    若否,则将所述目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
  5. 根据权利要求3所述的应用控制方法,其中,所述根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本,包括:The application control method according to claim 3, wherein the according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, and the network connection state , target prediction applications, and predictive value generation training samples, including:
    分别获取所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
    根据所述特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
  6. 根据权利要求5所述的应用控制方法,其中,所述特征值包括(q 1,q 2…q m),所述预测值包括j1和j2,所述利用所述训练样本对预设的贝叶斯模型进行训练,包括: The application control method according to claim 5, wherein said feature value comprises (q 1 , q 2 ... q m ), said predicted value comprises j1 and j2, said using said training sample for a preset shell The Yesi model is trained to include:
    将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
    Figure PCTCN2018103283-appb-100001
    其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
    And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
    Figure PCTCN2018103283-appb-100001
    Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
    将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
    Figure PCTCN2018103283-appb-100002
    其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下, 事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
    And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
    Figure PCTCN2018103283-appb-100002
    Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
  7. 根据权利要求6所述的应用控制方法,其中,所述基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制,包括:The application control method according to claim 6, wherein the controlling the background application in the electronic device based on the trained Bayesian model comprises:
    获取后台应用清理指令;Get background application cleanup instructions;
    根据所述后台应用清理指令获取所述电子设备的后台应用、以及当前的运行参数;Obtaining, according to the background application cleanup instruction, a background application of the electronic device, and current running parameters;
    利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率;Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters;
    根据所述可清理率关闭所述后台应用。The background application is closed according to the cleanup rate.
  8. 根据权利要求7所述的应用控制方法,其中,所述利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率,包括:The application control method according to claim 7, wherein the calculating the cleanable rate of each background application by using the trained Bayesian model and the current running parameters comprises:
    根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
    将当前特征值输入第三预设公式中进行计算,得到可清理率,所述第三预设公式为:The current feature value is input into the third preset formula for calculation to obtain a cleanable rate, and the third preset formula is:
    Figure PCTCN2018103283-appb-100003
    其中,1≤k≤m,q k为当前特征值。
    Figure PCTCN2018103283-appb-100003
    Where 1 ≤ k ≤ m, q k is the current eigenvalue.
  9. 根据权利要求7所述的应用控制方法,其中,所述根据所述可清理率关闭所述后台应用,包括:The application control method according to claim 7, wherein the closing the background application according to the cleanup rate comprises:
    选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
    关闭所述目标应用。Close the target app.
  10. 一种应用控制装置,应用于电子设备,其包括:An application control device is applied to an electronic device, including:
    获取模块,用于获取历史时段内每一采样时间点所述电子设备的运行参数,所述运行参数包括前台应用、剩余电量、已亮屏时长、充电连接状态以及网络连接状态;An acquiring module, configured to acquire an operating parameter of the electronic device at each sampling time point in a historical period, where the operating parameter includes a foreground application, a remaining power, a screened duration, a charging connection state, and a network connection state;
    生成模块,用于根据所述采样时间点和运行参数生成训练样本;a generating module, configured to generate a training sample according to the sampling time point and the running parameter;
    训练模块,用于利用所述训练样本对预设的贝叶斯模型进行训练;a training module, configured to train the preset Bayesian model by using the training sample;
    控制模块,用于基于训练后的贝叶斯模型对所述电子设备中的后台应用进行控制。And a control module, configured to control a background application in the electronic device based on the trained Bayesian model.
  11. 根据权利要求10所述的应用控制装置,其中,所述生成模块包括:The application control device according to claim 10, wherein the generating module comprises:
    第一确定子模块,用于根据所述采样时间点确定采样日期类型和采样时段;a first determining submodule, configured to determine a sampling date type and a sampling period according to the sampling time point;
    第二确定子模块,用于确定所述剩余电量所属的预设电量范围,以及确定所述已亮屏时长所属的预设时长范围;a second determining sub-module, configured to determine a preset power range to which the remaining power belongs, and determine a preset duration range to which the bright time duration belongs;
    生成子模块,用于根据所述采样日期类型、采样时段、预设电量范围、预设时长范围、前台应用、充电连接状态和网络连接状态生成训练样本。And generating a submodule, configured to generate a training sample according to the sampling date type, a sampling period, a preset power range, a preset duration range, a foreground application, a charging connection state, and a network connection state.
  12. 根据权利要求11所述的应用控制装置,其中,所述生成子模块包括:The application control device according to claim 11, wherein the generating submodule comprises:
    获取单元,用于获取目标预测应用;An obtaining unit for acquiring a target prediction application;
    第一确定单元,用于根据所述采样时间点从运行参数中确定所述前台应用的上一切换应用和下一切换应用;a first determining unit, configured to determine, according to the sampling time point, a previous switching application and a next switching application of the foreground application from the operating parameters;
    第二确定单元,用于根据所述采样时间点、下一切换应用以及前台应用确定所述目标预测应用的预测值;a second determining unit, configured to determine a predicted value of the target prediction application according to the sampling time point, a next switching application, and a foreground application;
    生成单元,用于根据所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态、目标预测应用以及预测值生成训练样本。a generating unit, configured to generate a training sample according to the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, the target prediction application, and the predicted value .
  13. 根据权利要求12所述的应用控制装置,其中,所述第二确定单元具体用于:The application control device according to claim 12, wherein the second determining unit is specifically configured to:
    计算所述下一切换应用的采样时间点与前台应用的采样时间点之间的差值;Calculating a difference between a sampling time point of the next switching application and a sampling time point of the foreground application;
    判断所述目标预测应用是否为所述下一切换应用,且所述差值是否不超过预设时长;Determining whether the target prediction application is the next handover application, and whether the difference does not exceed a preset duration;
    若是,则将所述目标预测应用的预测值确定为第一预设数值;If yes, determining the predicted value of the target prediction application as a first preset value;
    若否,则将所述目标预测应用的预测值确定为第二预设数值。If not, the predicted value of the target prediction application is determined as a second preset value.
  14. 根据权利要求12所述的应用控制装置,其中,所述生成单元具体用于:The application control device according to claim 12, wherein the generating unit is specifically configured to:
    分别获取所述上一切换应用、前台应用、采样日期类型、采样时段、预设电量范围、预设时长范围、充电连接状态、网络连接状态以及目标预测应用对应的特征值;Obtaining, respectively, the previous switching application, the foreground application, the sampling date type, the sampling period, the preset power range, the preset duration range, the charging connection state, the network connection state, and the feature value corresponding to the target prediction application;
    根据所述特征值和预测值生成训练样本。A training sample is generated based on the feature value and the predicted value.
  15. 根据权利要求14所述的应用控制装置,其中,所述特征值包括(q 1,q 2…q m),所述预测值包括j1和j2,所述训练模块具体用于: The application control device according to claim 14, wherein the feature value comprises (q 1 , q 2 ... q m ), the predicted value comprises j1 and j2, and the training module is specifically configured to:
    将所述预测值输入第一预设公式中,得到对应预测值的概率,所述第一预设公式为:
    Figure PCTCN2018103283-appb-100004
    其中N(j1)表示事件j1出现的次数,N(j2)表示事件j2出现的次数,P(j2)表示事件j2发生的概率;
    And inputting the predicted value into the first preset formula to obtain a probability of the corresponding predicted value, where the first preset formula is:
    Figure PCTCN2018103283-appb-100004
    Where N(j1) represents the number of occurrences of event j1, N(j2) represents the number of occurrences of event j2, and P(j2) represents the probability of occurrence of event j2;
    将所述特征值和预测值输入第二预设公式中,得到对应特征值和预测值的概率,所述第二预设公式为:
    Figure PCTCN2018103283-appb-100005
    其中,1≤i≤m,P(q i|j2)表示在事件j2发生的前提下,事件q i发生的概率,N(q i,j2)表示事件q i和j2同时发生的次数。
    And inputting the feature value and the predicted value into the second preset formula to obtain a probability of the corresponding feature value and the predicted value, where the second preset formula is:
    Figure PCTCN2018103283-appb-100005
    Where 1 ≤ i ≤ m, P(q i | j2) represents the probability that the event q i occurs on the premise that the event j2 occurs, and N(q i , j2) represents the number of times the events q i and j2 occur simultaneously.
  16. 根据权利要求15所述的应用控制装置,其中,所述控制模块具体用于:The application control device according to claim 15, wherein the control module is specifically configured to:
    获取后台应用清理指令;Get background application cleanup instructions;
    根据所述后台应用清理指令获取所述电子设备的后台应用、以及当前的运行参数;Obtaining, according to the background application cleanup instruction, a background application of the electronic device, and current running parameters;
    利用训练后的贝叶斯模型和当前的运行参数计算每一后台应用的可清理率;Calculate the cleanable rate of each background application by using the trained Bayesian model and the current operating parameters;
    根据所述可清理率关闭所述后台应用。The background application is closed according to the cleanup rate.
  17. 根据权利要求16所述的应用控制装置,其中,所述控制模块具体用于:The application control device according to claim 16, wherein the control module is specifically configured to:
    根据当前的运行参数确定当前特征值;Determining a current feature value according to current operating parameters;
    将当前特征值输入第三预设公式中进行计算,得到可清理率,所述第三预设公式为:The current feature value is input into the third preset formula for calculation to obtain a cleanable rate, and the third preset formula is:
    Figure PCTCN2018103283-appb-100006
    其中,1≤k≤m,q k为当前特征值。
    Figure PCTCN2018103283-appb-100006
    Where 1 ≤ k ≤ m, q k is the current eigenvalue.
  18. 根据权利要求16所述的应用控制装置,其中,所述控制模块具体用于:The application control device according to claim 16, wherein the control module is specifically configured to:
    选取可清理率不小于预设阈值的后台应用作为目标应用,或者,选取可清理率最高的预设个数后台应用作为目标应用;Select a background application whose cleaning rate is not less than the preset threshold as the target application, or select the preset number of background applications with the highest cleanup rate as the target application;
    关闭所述目标应用。Close the target app.
  19. 一种计算机可读存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行权利要求1所述的应用控制方法。A computer readable storage medium, wherein the storage medium stores a plurality of instructions adapted to be loaded by a processor to perform the application control method of claim 1.
  20. 一种电子设备,其包括处理器和存储器,所述处理器与所述存储器电性连接,所述存储器用于存储指令和数据,所述处理器用于执行权利要求1所述的应用控制方法中的步骤。An electronic device comprising a processor and a memory, the processor being electrically connected to the memory, the memory for storing instructions and data, the processor being configured to execute the application control method according to claim 1 A step of.
PCT/CN2018/103283 2017-09-30 2018-08-30 Application control method and apparatus, storage medium and electronic device WO2019062462A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710923081.6 2017-09-30
CN201710923081.6A CN107704876B (en) 2017-09-30 2017-09-30 Application control method, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2019062462A1 true WO2019062462A1 (en) 2019-04-04

Family

ID=61184454

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/103283 WO2019062462A1 (en) 2017-09-30 2018-08-30 Application control method and apparatus, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN107704876B (en)
WO (1) WO2019062462A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111985708A (en) * 2020-08-17 2020-11-24 云南电网有限责任公司电力科学研究院 High-voltage circuit breaker failure probability prediction method and device based on Bayesian algorithm
CN117691719A (en) * 2024-01-30 2024-03-12 深圳市方利来科技有限公司 Charging control method and system for electric toothbrush

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704876B (en) * 2017-09-30 2020-09-08 Oppo广东移动通信有限公司 Application control method, device, storage medium and electronic equipment
CN111722695B (en) * 2019-03-18 2022-03-25 北京小米移动软件有限公司 Terminal equipment power consumption optimization method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120210150A1 (en) * 2011-02-10 2012-08-16 Alcatel-Lucent Usa Inc. Method And Apparatus Of Smart Power Management For Mobile Communication Terminals
CN106201686A (en) * 2016-06-30 2016-12-07 北京小米移动软件有限公司 Management method, device and the terminal of application
CN106648023A (en) * 2016-10-02 2017-05-10 上海青橙实业有限公司 Mobile terminal and power-saving method of mobile terminal based on neural network
CN107133094A (en) * 2017-06-05 2017-09-05 努比亚技术有限公司 Application management method, mobile terminal and computer-readable recording medium
CN107704876A (en) * 2017-09-30 2018-02-16 广东欧珀移动通信有限公司 Application control method, apparatus, storage medium and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9189252B2 (en) * 2011-12-30 2015-11-17 Microsoft Technology Licensing, Llc Context-based device action prediction
CN105701025B (en) * 2015-12-31 2019-07-23 华为技术有限公司 A kind of method for recovering internal storage and device
CN105718027B (en) * 2016-01-20 2019-05-31 努比亚技术有限公司 The management method and mobile terminal of background application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120210150A1 (en) * 2011-02-10 2012-08-16 Alcatel-Lucent Usa Inc. Method And Apparatus Of Smart Power Management For Mobile Communication Terminals
CN106201686A (en) * 2016-06-30 2016-12-07 北京小米移动软件有限公司 Management method, device and the terminal of application
CN106648023A (en) * 2016-10-02 2017-05-10 上海青橙实业有限公司 Mobile terminal and power-saving method of mobile terminal based on neural network
CN107133094A (en) * 2017-06-05 2017-09-05 努比亚技术有限公司 Application management method, mobile terminal and computer-readable recording medium
CN107704876A (en) * 2017-09-30 2018-02-16 广东欧珀移动通信有限公司 Application control method, apparatus, storage medium and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111985708A (en) * 2020-08-17 2020-11-24 云南电网有限责任公司电力科学研究院 High-voltage circuit breaker failure probability prediction method and device based on Bayesian algorithm
CN111985708B (en) * 2020-08-17 2023-09-22 云南电网有限责任公司电力科学研究院 Bayesian algorithm-based high-voltage circuit breaker refusal operation probability prediction method and device
CN117691719A (en) * 2024-01-30 2024-03-12 深圳市方利来科技有限公司 Charging control method and system for electric toothbrush
CN117691719B (en) * 2024-01-30 2024-04-05 深圳市方利来科技有限公司 Charging control method and system for electric toothbrush

Also Published As

Publication number Publication date
CN107704876A (en) 2018-02-16
CN107704876B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
WO2019062460A1 (en) Application control method and apparatus, storage medium and electronic device
CN107678803B (en) Application control method and device, storage medium and electronic equipment
CN108337358B (en) Application cleaning method and device, storage medium and electronic equipment
EP3502880B1 (en) Method for preloading application, storage medium, and terminal device
US10891142B2 (en) Method and device for preloading application, storage medium, and terminal device
CN107809542B (en) Application program control method and device, storage medium and electronic equipment
WO2019062462A1 (en) Application control method and apparatus, storage medium and electronic device
WO2019062405A1 (en) Application program processing method and apparatus, storage medium, and electronic device
WO2019062414A1 (en) Method and apparatus for managing and controlling application program, storage medium, and electronic device
CN107545404B (en) Bill reminding method and device
WO2019062342A9 (en) Background application cleaning method and apparatus, and storage medium and electronic device
CN107943583A (en) Processing method, device, storage medium and the electronic equipment of application program
EP3671441A1 (en) Application management method and apparatus, storage medium, and electronic device
CN107402808B (en) Process management method, device, storage medium and electronic equipment
WO2019085749A1 (en) Application program control method and apparatus, medium, and electronic device
US20200241483A1 (en) Method and Device for Managing and Controlling Application, Medium, and Electronic Device
US20190205786A1 (en) Method and system for classifying time-series data
WO2019062358A1 (en) Application program control method and terminal device
WO2019096134A1 (en) Information storage method and apparatus, storage medium, and electronic device
CN111459569A (en) Fast traffic method, device, electronic equipment and storage medium
CN107943570B (en) Application management method and device, storage medium and electronic equipment
WO2019085754A1 (en) Application cleaning method and apparatus, and storage medium and electronic device
CN115017002B (en) Frequency prediction method and frequency prediction device
CN111538852A (en) Multimedia resource processing method, device, storage medium and equipment
WO2019062404A1 (en) Application program processing 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: 18862523

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

Country of ref document: EP

Kind code of ref document: A1