WO2019085742A1 - 后台应用清理方法、装置、存储介质及电子设备 - Google Patents

后台应用清理方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2019085742A1
WO2019085742A1 PCT/CN2018/110466 CN2018110466W WO2019085742A1 WO 2019085742 A1 WO2019085742 A1 WO 2019085742A1 CN 2018110466 W CN2018110466 W CN 2018110466W WO 2019085742 A1 WO2019085742 A1 WO 2019085742A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
application
samples
feature information
distance
Prior art date
Application number
PCT/CN2018/110466
Other languages
English (en)
French (fr)
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 WO2019085742A1 publication Critical patent/WO2019085742A1/zh

Links

Images

Classifications

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

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a background application cleaning method, apparatus, storage medium, and electronic device.
  • the system of the electronic device supports multiple applications running at the same time, that is, one application runs in the foreground, and other applications can run in the background. If the application running in the background is not cleaned for a long time, the available memory of the electronic device becomes smaller, and the central processing unit (CPU) usage rate is too high, causing the electronic device to run slower, jamming, and power consumption. Too fast and other issues. Therefore, it is necessary to provide a method to solve the above problems.
  • CPU central processing unit
  • the embodiment of the present application provides a background application cleaning method, device, storage medium, and electronic device, which can improve the running fluency of the electronic device and reduce power consumption.
  • the background application cleaning method provided by the embodiment of the present application includes:
  • the current feature information of the application is predicted by using a subset of samples corresponding to the current timestamp, and whether the application can be cleaned according to the prediction result is determined.
  • the background application cleaning device provided by the embodiment of the present application includes:
  • a collecting unit configured to collect multi-dimensional feature information of the application as a sample, and construct a sample total set of the application
  • a training unit configured to train the total sample set to obtain a sample subset corresponding to each acquisition time stamp
  • a prediction unit configured to: when the application enters the background, predict the current feature information of the application by using a subset of samples corresponding to the current timestamp, and determine whether the application can be cleaned according to the prediction result.
  • the storage medium provided by the embodiment of the present application has a computer program stored thereon, and when the computer program runs on the computer, the computer is executed to perform background application cleaning according to the first aspect of the embodiment of the present application. method.
  • an electronic device provided by an embodiment of the present application includes a processor and a memory, where the memory has a computer program, and the processor is configured to perform the method according to the first aspect of the present application by calling the computer program.
  • the background application cleanup method is configured to perform the method according to the first aspect of the present application by calling the computer program.
  • FIG. 1 is a schematic diagram of an application scenario of a background application cleaning method according to an embodiment of the present disclosure.
  • FIG. 2 is a schematic flowchart of a background application cleaning method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a process of obtaining a subset of samples by training according to an embodiment of the present application.
  • FIG. 4a is another schematic flowchart of a background application cleaning method provided by an embodiment of the present application.
  • FIG. 4b is still another schematic flowchart of a background application cleaning method provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a background application cleaning apparatus according to an embodiment of the present application.
  • FIG. 6 is another schematic structural diagram of a background application cleaning apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the embodiment of the present application provides a background application cleaning method, including the following steps:
  • the current feature information of the application is predicted by using a sample subset corresponding to the current time stamp, and whether the application can be cleaned according to the prediction result is determined.
  • the multi-dimensional feature information of the application is collected as a sample, and a sample total set of the application is constructed, including:
  • the multi-dimensional feature information of the application is collected as a sample according to a preset frequency, and a sample total set of the application is constructed.
  • the sample total set is trained to obtain a sample subset corresponding to each acquisition timestamp, including:
  • Each sample of the total set of samples is traversed to obtain a subset of samples corresponding to each acquisition timestamp.
  • calculating a distance between any one of the sample total set and each of the other samples based on the first preset formula, the first preset formula is:
  • d ij represents the distance between the sample i and the sample j
  • x i represents the sample i
  • x j represents the sample j
  • n represents the dimension of the feature information of the sample
  • x ik represents the k-th feature information of the sample i
  • x jk represents The kth feature information of the sample j.
  • the method further includes:
  • Each sample in the selected sample set is traversed to obtain a subset of samples corresponding to each acquisition timestamp.
  • the distance density of each sample is calculated based on the distance between any one of the sample sets and each of the other samples, including:
  • Each sample in the total set of samples is traversed to obtain a distance density for each sample.
  • the current feature information of the application is predicted by using a sample subset corresponding to the current timestamp, including:
  • determining whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp includes:
  • the number of statistics is greater than the preset number threshold, determining that the current feature information of the application belongs to the sample subset corresponding to the current time stamp, and if the number of statistics is less than or equal to the preset number threshold, determining the current application The feature information does not belong to the sample subset corresponding to the current timestamp.
  • the multi-dimensional feature information of the application includes running feature information of the application and/or state feature information of the electronic device.
  • the method further includes:
  • the determined application that can be cleaned is cleaned up.
  • the background application cleaning method provided by the embodiment of the present application may be the background application cleaning device provided by the embodiment of the present application or the electronic device integrated with the background application cleaning device, wherein the background application cleaning device may adopt hardware or software.
  • the electronic device may be a device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
  • FIG. 1 is a schematic diagram of an application scenario of a background application cleaning method according to an embodiment of the present disclosure.
  • the background device cleaning device is an electronic device, and the electronic device can collect multi-dimensional feature information of the application as a sample to construct the application. a sample total set, adding an acquisition timestamp to each sample in the total sample set, training the sample total set, obtaining a sample subset corresponding to each acquisition timestamp, and utilizing when the application enters the background
  • the sample subset corresponding to the current timestamp predicts current feature information of the application, and determines whether the application can be cleaned according to the prediction result, where the prediction result includes cleanable or non-cleanable. If the predicted result is cleanable, the application running in the background may be closed, and if the predicted result is not cleanable, the state in which the application is running in the background is maintained.
  • the background application cleaning device receives the cleaning request, detecting that the application running in the background of the electronic device includes the application a, the application b, and the application c; collected time stamps corresponding to a subset of samples M a, b of the application, the time stamp corresponding to each acquisition sample subsets M b, c of the application, the time stamp corresponding to each acquisition sample subsets M c, with the current time stamp
  • the corresponding sample subset M a1 is used to predict the application a, and the prediction result a′ is obtained.
  • the application b is predicted by the sample subset M b1 corresponding to the current time stamp, and the prediction result b′ is obtained, and the sample corresponding to the current time stamp is obtained.
  • the set M c1 predicts the application c, and obtains the predicted result c′; according to the predicted results a′, b′ and c′, it is determined whether the application a, the application b and the application c running in the background can be cleaned up, for example: the prediction result a′, c 'For non-cleanable, predictive result b' is cleanable, then keep the application a, c running in the background unchanged, and close the application b running in the background.
  • the embodiment of the present application will provide a background application cleaning method from the perspective of the background application cleaning device.
  • the background application cleaning device may be specifically integrated in the electronic device.
  • the background application cleaning method includes: collecting multi-dimensional feature information of the application as a sample, constructing a sample total set of the application; adding an acquisition timestamp to each sample in the total sample set; and training the sample total set to obtain a sample subset corresponding to each acquisition time stamp; when the application enters the background, the current feature information of the application is predicted by using a sample subset corresponding to the current time stamp, and determining whether the application can be cleaned according to the prediction result .
  • a background application cleanup method is provided. As shown in FIG. 2, the specific process of the background application cleanup method provided by the embodiment of the present application may be as follows:
  • Step S201 Collect multi-dimensional feature information of the application as a sample, and construct a sample total set of the application.
  • the application mentioned in this embodiment may be any application installed on the electronic device, such as an office application, a communication application, a game application, a shopping application, and the like.
  • the multi-dimensional feature information of the application has a dimension of a certain length, and the parameters in each dimension correspond to a feature information of the application, that is, the multi-dimensional feature information is composed of a plurality of feature information.
  • the plurality of feature information may include feature information related to the application itself, that is, running feature information of the application, for example, the duration of the application cutting into the background; the duration of the electronic device being cut off during the background cutting; the number of times the application enters the foreground; The time in the foreground; the way the application enters the background, for example: being switched by the home button (home button), being switched back by the return button, being switched in by other applications, etc.; the type of application, including level one (common application), level two (other applications) and so on.
  • the plurality of feature information may further include related feature information of the electronic device where the application is located, that is, state feature information of the electronic device, for example, an off time of the electronic device, a bright time, a current power, and a wireless network connection state of the electronic device. Whether the electronic device is in a charging state or the like.
  • the total sample set of the application may be included in the historical time period, and the application is a running state (including running in the foreground or running in the background), and multiple samples are collected according to a preset frequency.
  • the historical time period can be, for example, the past 1 day and the past 7 days; the preset frequency can be, for example, collected once per minute and collected every hour. It can be understood that the multi-dimensional feature data of the application acquired at one time constitutes one sample, and a plurality of samples constitute the total sample.
  • Step S202 Add an acquisition timestamp for each sample in the total sample set.
  • the collection timestamp of the sample indicates the collection time of the sample, and each sample has a corresponding acquisition timestamp.
  • the specific representation of the acquisition timestamp can be determined by the sampling time period and the sampling frequency.
  • the acquisition time stamp can be composed of hours and minutes, such as 12:01, 17:20, 19:35, etc.; in addition, since the day includes 1440 (24*) 60) minutes, you can also directly use the minute to indicate the acquisition timestamp, such as the 1st minute, the 2nd minute... the 1440th minute; in this case, if the application is always running in the past day, it will collect 1440 Samples, each sample corresponding to an acquisition timestamp.
  • the acquisition time period is the past day, and the sampling frequency is collected once every hour
  • the acquisition time stamp can be composed of hours, such as 1 point, 2 points, ... 24 points; in this case, if in the past day, the application When it is always running, 24 samples will be collected, one for each acquisition timestamp.
  • the collection time stamp can be composed of weeks, hours, and minutes, such as Monday 12:01, Wednesday 17:20, Sunday 19:35, and so on.
  • the sampling time period is the past seven days (one week)
  • the sampling frequency is collected once every hour
  • the collection time stamp can be composed of weeks and hours, such as 1 Monday, 2 pm, and 24 pm.
  • Step S203 Train the sample total set to obtain a sample subset corresponding to each acquisition time stamp.
  • the feature information of the multi-dimensional feature information of the application that is not directly represented by the numerical value may be quantified by a specific numerical value.
  • the value 1 can be used to indicate the normal state, and the value 0 is used to indicate the abnormal state (or vice versa); for example, for the feature information of whether the electronic device is in the charging state, The value 1 can be used to indicate the state of charge, and the value 0 is used to indicate the uncharged state (and vice versa).
  • Step S2031 Calculate a distance between any one of the samples in the total set of samples and each of the other samples.
  • a distance between any one of the sample total set and each of the other samples may be calculated based on the first preset formula, where the first preset formula is:
  • d ij represents the distance between the sample i and the sample j
  • x i represents the sample i
  • x j represents the sample j
  • n represents the dimension of the feature information of the sample
  • x ik represents the k-th feature information of the sample i
  • x jk represents The kth feature information of the sample j.
  • Step S2032 for any one of the samples, collecting a sample whose total distance between the sample and the any one of the samples is greater than the preset distance threshold, where there is one distance from the arbitrary sample in the total sample set. For samples larger than the preset distance threshold, the distance density of any one of the samples is increased by one.
  • the distance between each of the other samples in the total set of samples and the sample 1 may be sequentially determined, and each sample having a distance from the sample 1 is greater than the preset distance threshold. , the distance density of the sample 1 is increased by one. The distance density of each sample can be increased from zero. For example, in the total sample set, there are a total of 10 samples having a distance from the sample 1 greater than the preset distance threshold, and the distance density of the sample 1 is 10.
  • the preset distance threshold can be customized according to the actual demand, for example, the values are 5, 6, and so on.
  • Step S2033 traversing each sample in the total sample set to obtain a distance density of each sample.
  • Step S2034 Select a sample whose distance density is greater than the preset density threshold from the total sample set to form a selected sample set.
  • the samples with the distance density less than the preset density threshold are filtered out, and the remaining samples constitute the selected sample set.
  • the purpose of this is to remove the noise in the total concentration of the sample and avoid noise interference to improve the prediction accuracy.
  • the preset density threshold can be customized according to actual needs, for example, the values are 5, 10, and so on.
  • Step S2035 Select, from the selected sample set, a sample whose distance from the arbitrary one of the samples is less than or equal to the preset distance threshold, and classify the selected sample and the any one of the samples into a sample subset.
  • the sample subset is used as a sample subset corresponding to the acquisition timestamp of any one of the samples.
  • any one of the samples is sample 1, that is, a sample whose distance from the sample 1 is less than or equal to the preset distance threshold is selected from the selected sample set, and the selected sample and the sample 1 form a sample subset, which will constitute The sample subset is taken as the sample subset corresponding to the acquisition timestamp of sample 1.
  • Step S2036 traversing each sample in the selected sample set to obtain a sample subset corresponding to each acquisition time stamp.
  • one acquisition timestamp will correspond to one sample subset, one sample subset will include multiple samples, and the same sample may belong to different sample subsets.
  • the sample total set may not be filtered, but the sample subset corresponding to each acquisition time stamp is generated according to the distance between each sample in the total sample set, that is, During the training, steps S2032 to S2034 may be omitted.
  • the above steps S2031 to S2036 may be repeated to generate a sample subset corresponding to the acquisition time stamp for the plurality of applications.
  • a sample subset corresponding to the collection time stamp may be generated for each application installed in the electronic device, so that when an application of the electronic device enters the background, the application may be cleaned according to the sample subset corresponding to the corresponding time stamp. Make predictions.
  • the above steps S2031 to S2036 are repeated for the new application, and a sample subset corresponding to the acquisition time stamp of the new application is generated.
  • steps S2031 - S2036 may be done in advance in the server.
  • the electronic device may send the collected sample collection of each application to the server, and train each sample total set in the server to obtain a sample subset corresponding to each application time stamp of each application, and the server will train The result is sent to the electronic device.
  • the electronic device directly predicts the corresponding application according to the training result obtained from the server.
  • Step S204 When the application enters the background, the current feature information of the application is predicted by using a sample subset corresponding to the current timestamp, and it is determined according to the prediction result whether the application can be cleaned up.
  • the current feature information of the application is collected at the current time, and the current timestamp represents the collection time of the current feature information of the application, and the current feature information of the application is collected when the sample is composed.
  • the multi-dimensional feature information of the application has the same dimension, and the corresponding parameter values of the two may be the same or different in each dimension.
  • the sample subset corresponding to the current timestamp may be obtained first, and it is determined whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp. Since each sample in the sample subset is collected in a state in which the application is in operation, if the current feature information of the application belongs to a subset of samples corresponding to the current timestamp, it indicates that the application preferably continues to be in the sample. The running status determines that the predicted result is not cleanable. If it does not belong, it determines that the predicted result is cleanable.
  • a specific prediction manner may be determined according to a specific sampling manner. For example, if the sampling time period is the past day and the sampling frequency is once per minute, you can use the sample subset corresponding to each minute of the past day to predict whether the application can be cleaned up at a certain time in the next day; for example: use yesterday 8:25 The corresponding sample subsets are predicted to predict whether the application running in the background can be cleaned up at 8:25 today. For another example, the sampling time period is the past week, and the sampling frequency is once per minute.
  • the sample subset corresponding to each minute of the past week is used to predict whether the application can be cleaned up in a certain day of the next week; for example: The sample subset corresponding to 12:30 on Wednesday predicts whether the application running in the background can be cleaned up at 12:30 on Wednesday.
  • the preset cleaning condition is, for example, an application cleanup instruction sent by the user, or the remaining power of the electronic device (the remaining power may be a percentage value of the remaining power, or may be a capacitance value of the remaining power) less than a preset power threshold, or run in the background.
  • the number of applications is greater than a preset number threshold, or the available memory of the electronic device is less than a preset memory threshold.
  • the application by collecting the multi-dimensional feature information of the application as a sample, constructing a sample set of the application, adding an acquisition timestamp to each sample in the total sample set, and then training the sample set.
  • the application realizes automatic cleaning of the background application, improves the running fluency of the electronic device, and reduces power consumption.
  • the embodiment of the present application can make the cleaning of the corresponding application more personalized, because each of the samples of the sample collection includes a plurality of feature information that reflects the behavior habits of the user using the application.
  • a sample total set is constructed and trained according to the multi-dimensional feature information of each application, and a sample subset corresponding to each acquisition time stamp for each application is obtained, and current feature information and a dedicated sample subset of each application are adopted. Predicting whether the application can be cleaned can improve the accuracy of the cleanup.
  • another background application cleaning method is provided. Referring to FIG. 4a and FIG. 4b together, the method in this embodiment includes:
  • step S401 during the historical time period, and the application is in the running state, the multi-dimensional feature information of the application is collected as a sample according to a preset frequency, and a sample total set of the application is constructed.
  • the historical time period can be, for example, the past 1 day and the past 7 days; the preset frequency can be, for example, collected once per minute and collected every hour. It can be understood that the multi-dimensional feature data of the application acquired at one time constitutes one sample, and a plurality of samples constitute the total sample.
  • the multi-dimensional feature information of the application has a dimension of a certain length, and the parameters in each dimension correspond to a feature information of the application, that is, the multi-dimensional feature information is composed of a plurality of feature information.
  • the plurality of feature information may include feature information related to the application itself, that is, running feature information of the application, for example, the duration of the application cutting into the background; the duration of the electronic device being cut off during the background cutting; the number of times the application enters the foreground; The time in the foreground; the way the application enters the background, for example: being switched by the home button (home button), being switched back by the return button, being switched in by other applications, etc.; the type of application, including level one (common application), level two (other applications) and so on.
  • the plurality of feature information may further include related feature information of the electronic device where the application is located, that is, state feature information of the electronic device, for example, an off time of the electronic device, a bright time, a current power, and a wireless network connection state of the electronic device. Whether the electronic device is in a charging state or the like.
  • Step S402 Add an acquisition timestamp for each sample in the total sample set.
  • the collection timestamp of the sample indicates the collection time of the sample, and each sample has a corresponding acquisition timestamp.
  • the specific representation of the acquisition timestamp can be determined by the sampling time period and the sampling frequency.
  • the acquisition time stamp can be composed of hours and minutes, such as 12:01, 17:20, 19:35, etc.; in addition, since the day includes 1440 (24*) 60) minutes, you can also directly use the minute to indicate the acquisition timestamp, such as the 1st minute, the 2nd minute... the 1440th minute; in this case, if the application is always running in the past day, it will collect 1440 Samples, each sample corresponding to an acquisition timestamp.
  • the acquisition time period is the past day, and the sampling frequency is collected once every hour
  • the acquisition time stamp can be composed of hours, such as 1 point, 2 points, ... 24 points; in this case, if in the past day, the application When it is always running, 24 samples will be collected, one for each acquisition timestamp.
  • the collection time stamp can be composed of weeks, hours, and minutes, such as Monday 12:01, third 17:20, Sunday 19:35, etc. .
  • the sampling time period is the past seven days (one week)
  • the sampling frequency is collected once every hour
  • the collection time stamp can be composed of weeks and hours, such as 1 Monday, 2 pm, and 24 pm.
  • the application mentioned in this embodiment is application 1.
  • the total sample set of application 1 includes N samples, and each sample includes feature information of Q dimensions, for example, Q is 30, and the sampling time period is the past day.
  • the sampling frequency is hourly, then the sample total set of application 1 and the acquisition timestamp of each sample can be as shown in Table 1 below:
  • Step S403 training the total sample set to obtain a sample subset corresponding to each acquisition time stamp.
  • the noise in the total sample set can be filtered out to form a selected sample set.
  • the selected sample set consisting of denoising includes M samples, then M is less than or equal to N, and M and N are positive integers.
  • the acquisition timestamp of each sample in the selected sample set is the same as the acquisition timestamp of the corresponding sample in the sample set.
  • the collection timestamps of the selected sample set and each of its samples can be as shown in Table 2 below:
  • Step S404 When the application enters the background, obtain a sample subset corresponding to the current timestamp.
  • the sample subset corresponding to 6 points can be obtained according to FIG. 4b.
  • step S405 it is determined whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp. If yes, step S406 is performed; otherwise, step S407 is performed.
  • the current feature information of the application is collected at the current time, the current timestamp is the collection time of the current feature information of the application, and the current feature information of the application and the multi-dimensional application of the application collected when the sample is composed
  • the feature information has the same dimension, and the corresponding parameter values of the two in each dimension may be the same or different.
  • the number of the feature information of the sample subset corresponding to the current timestamp in the current feature information of the application may be counted; if the number of statistics is greater than the preset number threshold, determining the current feature information of the application If the number of statistics is less than or equal to the preset number threshold, the current feature information of the application does not belong to the sample subset corresponding to the current timestamp.
  • the preset number threshold can be customized according to actual needs. For example, when the dimension of the feature information of the sample is 30, the preset number threshold may be 20, and when the feature information of the 30-dimensional feature information of the application belongs to the sample subset corresponding to the current timestamp. And determining that the current feature information of the application belongs to the sample subset corresponding to the current timestamp.
  • Step S406 determining that the prediction result is not cleanable.
  • each sample in the sample subset is collected in a state in which the application is in operation, if the current feature information of the application belongs to a subset of samples corresponding to the current timestamp, it indicates that the application preferably continues to be in the sample.
  • the running state determines that the predicted result is not cleanable. In this case, the state in which the application is running in the background can be maintained.
  • Step S407 determining that the prediction result is cleanable.
  • the preset cleaning condition is, for example, an application cleanup instruction sent by the user, or the remaining power of the electronic device (the remaining power may be a percentage value of the remaining power, or may be a capacitance value of the remaining power) less than a preset power threshold, or run in the background.
  • the number of applications is greater than a preset number threshold, or the available memory of the electronic device is less than a preset memory threshold.
  • the application by collecting the multi-dimensional feature information of the application as a sample, constructing a sample set of the application, adding an acquisition timestamp to each sample in the total sample set, and then training the sample set.
  • the application realizes automatic cleaning of the background application, improves the running fluency of the electronic device, and reduces power consumption.
  • the embodiment of the present application further provides a background application cleaning device, including an acquisition unit, an adding unit, a training unit, and a prediction unit, as follows:
  • a collecting unit configured to collect multi-dimensional feature information of the application as a sample, and construct a sample total set of the application
  • a training unit configured to train the total sample set to obtain a sample subset corresponding to each acquisition time stamp
  • a prediction unit configured to: when the application enters the background, predict the current feature information of the application by using a subset of samples corresponding to the current timestamp, and determine whether the application can be cleaned according to the prediction result.
  • the collecting unit is specifically configured to:
  • the multi-dimensional feature information of the application is collected as a sample according to a preset frequency, and a sample total set of the application is constructed.
  • the training unit comprises:
  • a distance calculation unit configured to calculate a distance between any one of the sample sets and each of the other samples
  • a subset forming unit configured to select, from the total sample set, a sample whose distance from the arbitrary one of the samples is less than or equal to a preset distance threshold, and classify the selected sample and the any one of the samples into a sample subset, and The subset of samples is used as a subset of samples corresponding to an acquisition timestamp of any one of the samples;
  • the subset constituting unit traverses each sample in the total sample set to obtain a sample subset corresponding to each acquisition time stamp.
  • the distance calculation unit calculates a distance between any one of the sample total set and each of the other samples based on the first preset formula, where the first preset formula is:
  • d ij represents the distance between the sample i and the sample j
  • x i represents the sample i
  • x j represents the sample j
  • n represents the dimension of the feature information of the sample
  • x ik represents the k-th feature information of the sample i
  • x jk represents The kth feature information of the sample j.
  • the apparatus further includes:
  • a density calculation unit configured to calculate a distance density of each sample according to a distance between any one of the samples in the total set of samples and each of the other samples;
  • a selection set forming unit configured to select a sample having a distance density greater than the preset density threshold from the total sample set to form a selected sample set
  • the subset forming unit is further configured to: select, from the selected sample set, a sample whose distance from the arbitrary one of the samples is less than or equal to the preset distance threshold, and classify the selected sample and the any one of the samples as a sample subset, the subset of samples being used as a sample subset corresponding to an acquisition timestamp of the any one of the samples;
  • the subset constituting unit traverses each sample in the selected sample set to obtain a sample subset corresponding to each acquisition time stamp.
  • the density calculation unit is specifically configured to:
  • Each sample in the total set of samples is traversed to obtain a distance density for each sample.
  • the prediction unit comprises:
  • An obtaining unit configured to obtain a sample subset corresponding to the current timestamp
  • a determining unit configured to determine whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp, and if yes, determine that the predicted result is not cleanable, and if not, determine that the predicted result is cleanable.
  • the determining, by the determining unit, whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp includes:
  • the determining unit is configured to count the number of feature information of the sample subset corresponding to the current timestamp in the current feature information of the application; if the number of statistics is greater than the preset number threshold, determine the current feature information of the application. If the number of statistics is less than or equal to the preset number threshold, the current feature information of the application does not belong to the sample subset corresponding to the current timestamp.
  • the multi-dimensional feature information of the application includes operational feature information of the application and/or state feature information of the electronic device.
  • the apparatus further includes:
  • the cleaning unit is configured to detect whether the preset cleaning condition is met; if the preset cleaning condition is met, the determined cleanable application is cleaned.
  • a background application cleaning device is further provided, and the background application cleaning device is applied to an electronic device.
  • the background application cleaning device includes an acquisition unit 501, an adding unit 502, a training unit 503, and Prediction unit 504 is as follows:
  • the collecting unit 501 is configured to collect multi-dimensional feature information of the application as a sample, and construct a sample total set of the application;
  • An adding unit 502, configured to add an acquisition timestamp to each sample in the total sample set
  • the training unit 503 is configured to train the total sample set to obtain a sample subset corresponding to each acquisition time stamp;
  • the prediction unit 504 is configured to: when the application enters the background, predict the current feature information of the application by using a subset of samples corresponding to the current timestamp, and determine whether the application can be cleaned according to the prediction result.
  • the collecting unit 501 is specifically configured to:
  • the multi-dimensional feature information of the application is collected as a sample according to a preset frequency, and a sample total set of the application is constructed.
  • the training unit 503 includes:
  • a distance calculating unit 5031 configured to calculate a distance between any one of the sample sets and each of the other samples
  • the subset constituting unit 5034 is configured to select, from the total sample set, a sample whose distance from the arbitrary one of the samples is less than or equal to a preset distance threshold, and classify the selected sample and the any one of the samples into one sample subset. Using the sample subset as a sample subset corresponding to an acquisition timestamp of the any one of the samples;
  • the subset constituting unit 5034 traverses each sample in the total sample set to obtain a sample subset corresponding to each acquisition time stamp.
  • the distance calculation unit 5031 calculates a distance between any one of the sample total set and each of the other samples based on the first preset formula, the first preset formula is:
  • d ij represents the distance between sample i and sample j
  • x i represents sample i
  • x j represents sample j
  • n represents the dimension of the feature information of the sample
  • x ik represents the kth feature of sample i
  • x jk represents the sample The kth feature of j.
  • the apparatus further includes:
  • a density calculation unit 5032 configured to calculate a distance density of each sample according to a distance between any one of the samples in the total set of samples and each of the other samples;
  • the selected set forming unit 5033 is configured to select a sample having a distance density greater than the preset density threshold from the total sample set to form a selected sample set;
  • the subset constituting unit 5034 is further configured to: select, from the selected sample set, a sample whose distance from the arbitrary one of the samples is less than or equal to the preset distance threshold, and return the selected sample to the any one of the samples.
  • the sample subset is used as a sample subset corresponding to an acquisition timestamp of the any one of the samples;
  • the subset constructing unit 5034 traverses each sample in the selected sample set to obtain a sample subset corresponding to each acquisition time stamp.
  • the density calculation unit 5032 is specifically configured to:
  • Each sample in the total set of samples is traversed to obtain a distance density for each sample.
  • the prediction unit 504 includes:
  • the obtaining unit 5041 is configured to obtain a sample subset corresponding to the current time stamp
  • the determining unit 5042 is configured to determine whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp, and if yes, determine that the predicted result is not cleanable, and if not, determine that the predicted result is cleanable.
  • the determining unit 5042 determining whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp includes:
  • the determining unit 5042 is configured to count the number of feature information of the sample subset corresponding to the current timestamp in the current feature information of the application; if the number of statistics is greater than the preset number threshold, determine the current feature of the application. The information belongs to the sample subset corresponding to the current timestamp. If the number of statistics is less than or equal to the preset number threshold, it is determined that the current feature information of the application does not belong to the sample subset corresponding to the current timestamp.
  • the multi-dimensional feature information of the application includes operational characteristic information of the application and/or state characteristic information of the electronic device.
  • the apparatus further includes:
  • the cleaning unit 505 is configured to detect whether the preset cleaning condition is met; if the preset cleaning condition is met, the determined cleanable application is cleaned.
  • the multi-dimensional feature information of the application is collected by the collecting unit 501 as a sample, and the sample total set of the application is constructed, and the adding unit 502 is used for each sample in the total sample set. Adding an acquisition timestamp, and then training the sample total set by the training unit 503 to obtain a sample subset corresponding to each acquisition timestamp.
  • the prediction unit 504 uses the sample sub-corresponding to the current timestamp. The prediction of the application can improve the accuracy of the prediction, and determine whether the application can be cleaned according to the prediction result, thereby realizing the automatic cleaning of the background application, improving the running fluency of the electronic device and reducing the power consumption.
  • the foregoing modules may be implemented as a separate entity, or may be implemented in any combination, and may be implemented as the same or a plurality of entities.
  • the foregoing modules refer to the foregoing method embodiments, and details are not described herein again.
  • the electronic device 600 includes a processor 601 and a memory 602.
  • the processor 601 is electrically connected to the memory 602.
  • the processor 600 is a control center of the electronic device 600 that connects various portions of the entire electronic device using various interfaces and lines, by running or loading a computer program stored in the memory 602, and recalling data stored in the memory 602, The various functions of the electronic device 600 are performed and data is processed to thereby perform overall monitoring of the electronic device 600.
  • the memory 602 can be used to store software programs and modules, and the processor 601 executes various functional applications and data processing by running computer programs and modules stored in the memory 602.
  • the memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a computer program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of electronic devices, etc.
  • memory 602 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 602 can also include a memory controller to provide processor 601 access to memory 602.
  • the processor 601 in the electronic device 600 loads the instructions corresponding to the process of one or more computer programs into the memory 602 according to the following steps, and is stored in the memory 602 by the processor 601.
  • the computer program in which to implement various functions, as follows:
  • the current feature information of the application is predicted by using a sample subset corresponding to the current time stamp, and whether the application can be cleaned according to the prediction result is determined.
  • the processor 601 when collecting multi-dimensional feature information of the application as a sample and constructing a sample set of the application, the processor 601 specifically performs the following steps:
  • the multi-dimensional feature information of the application is collected as a sample according to a preset frequency, and a sample total set of the application is constructed.
  • the processor 601 when training the sample set to obtain a subset of samples corresponding to each acquisition timestamp, the processor 601 specifically performs the following steps:
  • Each sample of the total set of samples is traversed to obtain a subset of samples corresponding to each acquisition timestamp.
  • the processor 601 calculates a distance between any one of the sample sets and each of the other samples based on the first preset formula, the first preset formula is:
  • d ij represents the distance between sample i and sample j
  • x i represents sample i
  • x j represents sample j
  • n represents the dimension of the feature information of the sample
  • x ik represents the kth feature of sample i
  • x jk represents the sample The kth feature of j.
  • the processor 601 is further configured to perform the following steps:
  • Each sample in the selected sample set is traversed to obtain a subset of samples corresponding to each acquisition timestamp.
  • the processor 601 is specifically configured to perform the following steps when calculating the distance density of each sample according to the distance between any one of the samples in the total set of samples and each of the other samples:
  • Each sample in the total set of samples is traversed to obtain a distance density for each sample.
  • the processor 601 when predicting current feature information of the application by using a subset of samples corresponding to the current timestamp, is specifically configured to perform the following steps:
  • the processor 601 when determining whether the current feature information of the application belongs to the sample subset corresponding to the current timestamp, the processor 601 is specifically configured to perform the following steps:
  • the number of statistics is greater than the preset number threshold, determining that the current feature information of the application belongs to the sample subset corresponding to the current time stamp, and if the number of statistics is less than or equal to the preset number threshold, determining the current application The feature information does not belong to the sample subset corresponding to the current timestamp.
  • the multi-dimensional feature information of the application includes operational characteristic information of the application and/or state characteristic information of the electronic device.
  • the processor 601 is further configured to perform the following steps:
  • the determined application that can be cleaned is cleaned up.
  • the electronic device in the embodiment of the present application constructs a sample total set of the application by collecting multi-dimensional feature information of the application as a sample, and adds an acquisition time stamp for each sample in the total sample set, and then The sample total set is trained to obtain a sample subset corresponding to each acquisition time stamp.
  • the application enters the background, the application is predicted by using the sample subset corresponding to the current time stamp, thereby improving the accuracy of the prediction. According to the prediction result, it is determined whether the application can be cleaned up, thereby realizing the automatic cleaning of the background application, improving the running fluency of the electronic device and reducing the power consumption.
  • the electronic device 600 may further include: a display 603, a radio frequency circuit 604, an audio circuit 605, and a power source 606.
  • the display 603, the radio frequency circuit 604, the audio circuit 605, and the power source 606 are electrically connected to the processor 601, respectively.
  • the display 603 can be used to display information entered by a user or information provided to a user, as well as various graphical user interfaces, which can be composed of graphics, text, icons, video, and any combination thereof.
  • the display 603 can include a display panel.
  • the display panel can be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • the radio frequency circuit 604 can be used for transceiving 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 audio circuit 605 can be used to provide an audio interface between a user and an electronic device through a speaker or a microphone.
  • the power source 606 can be used to power various components of the electronic device 600.
  • the power source 606 can be logically coupled to the processor 601 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
  • the electronic device 600 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the embodiment of the present application further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, causes the computer to execute the background application cleaning method in any of the above embodiments, such as: Collecting multi-dimensional feature information of the application as a sample, constructing a sample total set of the application; adding an acquisition timestamp to each sample in the total sample set; training the sample total set to obtain a corresponding timestamp of each acquisition timestamp a sample subset; when the application enters the background, the current feature information of the application is predicted by using a sample subset corresponding to the current time stamp, and whether the application can be cleaned according to the prediction result is determined.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM).
  • ROM read only memory
  • RAM random access memory
  • the computer program may be stored in a computer readable storage medium, such as in a memory of the electronic device, and executed by at least one processor in the electronic device, and may include, for example, a background application during execution.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory, a random access memory, or the like.
  • each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated module if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例公开了一种后台应用清理方法、装置、存储介质及电子设备,其中,后台应用清理方法包括:采集应用的多维特征信息作为样本,构建所述应用的样本总集;为所述样本总集中的每个样本添加采集时间戳;对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。

Description

后台应用清理方法、装置、存储介质及电子设备
本申请要求于2017年10月31日提交中国专利局、申请号为201711045112.9、发明名称为“后台应用清理方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,具体涉及一种后台应用清理方法、装置、存储介质及电子设备。
背景技术
目前,智能手机等电子设备上,通常会安装多个不同功能的应用,以解决用户的不同需求。目前电子设备的***支持多个应用同时运行,即一个应用在前台运行,其他应用可以在后台运行。如果长时间不清理后台运行的应用,则会导致电子设备的可用内存变小、中央处理器(central processing unit,CPU)占用率过高,导致电子设备出现运行速度变慢,卡顿,耗电过快等问题。因此,有必要提供一种方法解决上述问题。
技术解决方案
本申请实施例提供了一种后台应用清理方法、装置、存储介质及电子设备,能够提高电子设备的运行流畅度,降低功耗。
第一方面,本申请实施例提供的后台应用清理方法,包括:
采集应用的多维特征信息作为样本,构建所述应用的样本总集;
为所述样本总集中的每个样本添加采集时间戳;
对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
第二方面,本申请实施例提供的后台应用清理装置,包括:
采集单元,用于采集应用的多维特征信息作为样本,构建所述应用的样本总集;
添加单元,用于为所述样本总集中的每个样本添加采集时间戳;
训练单元,用于对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
预测单元,用于当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请实施例第一方面所述的后台应用清理方法。
第四方面,本申请实施例提供的电子设备,包括处理器和存储器,所述存储器有计算机程序,所述处理器通过调用所述计算机程序,用于执行如本申请实施例第一方面所述的后台应用清理方法。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的后台应用清理方法的应用场景示意图。
图2是本申请实施例提供的后台应用清理方法的流程示意图。
图3是本申请实施例提供的训练得到样本子集的流程示意图。
图4a是本申请实施例提供的后台应用清理方法的另一流程示意图。
图4b是本申请实施例提供的后台应用清理方法的又一流程示意图。
图5是本申请实施例提供的后台应用清理装置的结构示意图。
图6是本申请实施例提供的后台应用清理装置的另一结构示意图。
图7是本申请实施例提供的电子设备的结构示意图。
图8是本申请实施例提供的电子设备的另一结构示意图。
本发明的实施方式
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。
由于如果长时间不清理电子设备后台运行的应用,会导致电子设备出现运行速度变慢,卡顿,耗电过快等一系列问题。因而,本申请实施例提供了一种后台应用清理方法,包括以下步骤:
采集应用的多维特征信息作为样本,构建所述应用的样本总集;
为所述样本总集中的每个样本添加采集时间戳;
对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
一实施例中,采集应用的多维特征信息作为样本,构建所述应用的样本总集,包括:
在历史时间段内,且所述应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
一实施例中,对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,包括:
计算所述样本总集中的任意一个样本与其他每个样本之间的距离;
从所述样本总集中选取与所述任意一个样本的距离小于或等于预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
遍历所述样本总集中的每个样本,得到每个采集时间戳对应的样本子集。
一实施例中,基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
Figure PCTCN2018110466-appb-000001
d ij表示样本i与样本j之间的距离,x i表示样本i,x j表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征信息,x jk表示样本j的第k个特征信息。
一实施例中,在计算所述样本总集中的任意一个样本与其他每个样本之间的距离之后,还包括:
根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度;
从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集;
从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
一实施例中,根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度,包括:
针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预 设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于所述预设距离阈值的样本,则将所述任意一个样本的距离密度增加1;
遍历所述样本总集中的每个样本,得到每个样本的距离密度。
一实施例中,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,包括:
获取当前时间戳对应的样本子集;
判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集;
若属于,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
一实施例中,判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集,包括:
统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的数量;
若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
一实施例中,所述应用的多维特征信息包括所述应用的运行特征信息和/或所述电子设备的状态特征信息。
一实施例中,所述方法还包括:
检测是否满足预设清理条件;
若满足所述预设清理条件,则清理所确定的可以清理的应用。
本申请实施例提供的后台应用清理方法,其执行主体可以是本申请实施例提供的后台应用清理装置,或者集成了该后台应用清理装置的电子设备,其中该后台应用清理装置可以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等设备。
请参阅图1,图1为本申请实施例提供的后台应用清理方法的应用场景示意图,以后台应用清理装置为电子设备为例,电子设备可以采集应用的多维特征信息作为样本,构建所述应用的样本总集,为所述样本总集中的每个样本添加采集时间戳,对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用,所述预测结果包括可清理或不可清理。若预测结果为可清理,则可以关闭后台运行的所述应用,若预测结果为不可清理,则保持所述应用在后台运行的状态不变。
具体的,如图1所示,比如,后台应用清理装置在接收到清理请求时,检测到在电子设备的后台运行的应用包括应用a、应用b以及应用c;然后分别获取应用a的、每个采集时间戳对应的样本子集M a,应用b的、每个采集时间戳对应的样本子集M b,应用c的、每个采集时间戳对应的样本子集M c,通过当前时间戳对应的样本子集M a1对应用a进行预测,得到预测结果a’,通过当前时间戳对应的样本子集M b1对应用b进行预测,得到预测结果b’,通过当前时间戳对应的样本子集M c1对应用c进行预测,得到预测结果c’;根据预测结果a’、b’以及c’确定后台运行的应用a、应用b以及应用c是否可以清理,例如:预测结果a’、c’为不可清理,预测结果b’为可清理,则保持应用a、c在后台运行的状态不变,而将后台运行的应用b关闭。
本申请实施例将从后台应用清理装置的角度,描述本申请实施例提供后台应用清理方 法,该后台应用清理装置具体可以集成在电子设备中。该后台应用清理方法包括:采集应用的多维特征信息作为样本,构建所述应用的样本总集;为所述样本总集中的每个样本添加采集时间戳;对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
在一优选实施例中,提供了一种后台应用清理方法,如图2所示,本申请实施例提供的后台应用清理方法的具体流程可以如下:
步骤S201、采集应用的多维特征信息作为样本,构建所述应用的样本总集。
本实施例所提及的应用,可以是电子设备上安装的任何一个应用,例如:办公应用、通信应用、游戏应用、购物应用等。
应用的多维特征信息具有一定长度的维度,其每个维度上的参数均对应表征应用的一种特征信息,即该多维特征信息由多个特征信息构成。
该多个特征信息可以包括应用自身相关的特征信息,即应用的运行特征信息,例如:应用切入到后台的时长;应用切入到后台期间,电子设备的灭屏时长;应用进入前台的次数;应用处于前台的时间;应用进入后台的方式,例如:被主页键(home键)切换进入、被返回键切换进入,被其他应用切换进入等;应用的类型,包括一级(常用应用)、二级(其他应用)等。
该多个特征信息还可以包括应用所在的电子设备的相关特征信息,即电子设备的状态特征信息,例如:电子设备的灭屏时间、亮屏时间、当前电量,电子设备的无线网络连接状态,电子设备是否在充电状态等。
需要说明的是,以上对特征信息的举例并不代表对特征信息的限定。
应用的样本总集中,可以包括在历史时间段内,且所述应用为运行状态(包括在前台运行,或者在后台运行)时,按照预设频率采集的多个样本。历史时间段,例如可以是过去1天、过去7天;预设频率,例如可以是每分钟采集一次、每小时采集一次。可以理解的是,一次采集的应用的多维特征数据构成一个样本,多个样本,构成所述样本总集。
步骤S202、为所述样本总集中的每个样本添加采集时间戳。
样本的采集时间戳,表示样本的采集时间,每个样本都具有对应的采集时间戳,采集时间戳的具体表示方式可由采样时间段和采样频率决定。
例如:采样时间段为过去一天,采样频率为每分钟采集一次,则采集时间戳可由小时、分钟构成,比如12:01、17:20、19:35等;另外,由于一天包括1440(24*60)分钟,也可以直接用分钟表示采集时间戳,比如第1分钟、第2分钟……第1440分钟;在这种情况下,如果在过去的一天,应用一直处于运行状态,则将采集1440个样本,每个样本对应一个采集时间戳。再例如:采集时间段为过去一天,采样频率为每小时采集一次,则采集时间戳可由小时构成,比如1点、2点……24点;在这种情况下,如果在过去的一天,应用一直处于运行状态,则将采集24个样本,每个样本对应一个采集时间戳。
例如:采样时间段为过去七天(一周),采样频率为每分钟采集一次,则采集时间戳可由星期、小时、分钟构成,比如周一12:01、周三17:20、周日19:35等。再例如,采样时间段为过去七天(一周),采样频率为每小时采集一次,则采集时间戳可由星期、小时构成,比如周一1点、周四2点、周六24点等。
步骤S203、对所述样本总集进行训练,得到每个采集时间戳对应的样本子集。
为便于训练,可以将应用的多维特征信息中,未用数值直接表示的特征信息用具体的数值量化出来。例如:针对电子设备的无线网连接状态这个特征信息,可以用数值1表示正常的状态,用数值0表示异常的状态(反之亦可);再例如:针对电子设备是否在充电状态这个特征信息,可以用数值1表示充电状态,用数值0表示未充电状态(反之亦可)。
具体的训练过程,可参阅图3所示,包括以下步骤:
步骤S2031、计算样本总集中的任意一个样本与其他每个样本之间的距离。
具体地,可以基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
Figure PCTCN2018110466-appb-000002
d ij表示样本i与样本j之间的距离,x i表示样本i,x j表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征信息,x jk表示样本j的第k个特征信息。
步骤S2032、针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于预设距离阈值的样本,则将所述任意一个样本的距离密度增加1。
具体地,针对所述任意一个样本,例如样本1,可以依次判断样本总集中的其他每个样本与样本1之间的距离,每存在一个与样本1的距离大于所述预设距离阈值的样本,则将样本1的距离密度增加1。每个样本的距离密度可以从0开始增加。例如,样本总集中,总共存在10个与样本1之间的距离大于预设距离阈值的样本,则样本1的距离密度即为10。
预设距离阈值可视实际需求自定义取值,例如取值为5、6等。
步骤S2033、遍历所述样本总集中的每个样本,得到每个样本的距离密度。
步骤S2034、从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集。
即过滤掉样本总集中存在的,距离密度小于所述预设密度阈值的样本,剩余样本构成精选样本集。这样做的目的是:去除样本总集中的噪点,避免噪声干扰,以提高预测准确度。
预设密度阈值可视实际需求自定义取值,例如取值为5、10等。
步骤S2035、从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集。
例如,所述任意一个样本为样本1,即从精选样本集中选取与样本1的距离小于或等于所述预设距离阈值的样本,将选取的样本与样本1构成一个样本子集,将构成的样本子集作为样本1的采集时间戳对应的样本子集。
步骤S2036、遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
从上面的描述可以看出,一个采集时间戳会对应一个样本子集,一个样本子集中会包括多个样本,而同一个样本可能属于不同的样本子集。
实际应用中,在对样本总集进行训练的过程中,还可以不对样本总集进行过滤,而直接根据样本总集中各个样本之间的距离,生成每个采集时间戳对应的样本子集,即训练过程中,可以省略步骤S2032~S2034。
在某些实施例中,可以重复上述步骤S2031~S2036,为多个应用生成采集时间戳对应的样本子集。例如:可以为电子设备中安装的每个应用生成采集时间戳对应的样本子集,从而当电子设备的某个应用进入后台时,可以根据相应时间戳对应的样本子集对该应用是否可清理进行预测。
在某些实施例中,可以在检测到有新的应用安装至电子设备时,针对该新的应用重复上述步骤S2031~S2036,生成该新的应用程序的采集时间戳对应的样本子集。
在某些实施例中,步骤S2031~S2036可以预先在服务器中完成。例如,电子设备可以将采集的各个应用的样本总集发送给服务器,在服务器中对每个样本总集进行训练,得到每个应用的、每个采集时间戳对应的样本子集,服务器将训练结果发送给电子设备,当需要预测应用是否可以清理时,电子设备直接根据从服务器得到的训练结果对对应应用进行预测。
步骤S204、当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
需要说明的是,所述应用的当前特征信息是在当前时刻采集的,所述当前时间戳即表示所述应用的当前特征信息的采集时间,所述应用的当前特征信息与构成样本时采集的所述应用的多维特征信息,具有相同的维度,二者在每个维度上对应的参数值可能相同,也可能不同。
具体地,可以先获取当前时间戳对应的样本子集,判断所述应用的当前特征信息是否属于当前时间戳对应的样本子集。由于样本子集中的各个样本,是在所述应用为运行的状态下采集的,因此,若所述应用的当前特征信息属于当前时间戳对应的样本子集,则表明所述应用最好继续处于运行状态,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
需要说明的是,本实施例中,可以根据具体的采样方式确定具体的预测方式。例如:采样时间段是过去一天,采样频率是每分钟一次,则可以利用过去一天每分钟对应的样本子集,预测未来一天内某分钟时,应用是否可以被清理;比如:利用昨天8:25分对应的样本子集,预测今天8:25分时,后台运行的应用是否可以被清理。再例如,采样时间段是过去一周,采样频率是每分钟一次,则利用过去一周每天每分钟对应的样本子集,预测未来一周内某天某分钟时,应用是否可以被清理;比如:利用上周三12:30分对应的样本子集,预测本周三12:30分时,后台运行的应用是否可以被清理。
进一步地,还可以检测是否满足预设清理条件,可以在检测到满足预设清理条件之后,清理所确定的可以清理的应用。该预设清理条件例如:用户发送的应用清理指令,或者电子设备的剩余电量(该剩余电量可以是剩余电量的百分比值,也可以是剩余电量的电容值)小于预设电量阈值,或者后台运行的应用的数量大于预设数量阈值,或者电子设备的可用内存小于预设内存阈值。
本实施例中,通过采集应用的多维特征信息作为样本,构建所述应用的样本总集,并为所述样本总集中的每个样本添加采集时间戳,然后对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用进行预测,可以提高预测的准确性,根据预测结果确定是否可以清理所述应用,以此实现了后台应用的自动清理,提高了电子设备的运行流畅度,降低了功耗。
进一步地,由于样本总集的每个样本中,包括了反映用户使用应用的行为习惯的多个特征信息,因此本申请实施例可以使得对对应应用的清理更加个性化。
进一步地,根据每个应用的多维特征信息构建样本总集并训练,获得针对每个应用的、每个采集时间戳对应的样本子集,采用每个应用的当前特征信息及专属的样本子集预测应用是否可清理,可以提高清理的准确度。
在一优选实施例中,提供了另一种后台应用清理方法,请一并参考图4a和图4b,本实施例的方法包括:
步骤S401、在历史时间段内,且应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
历史时间段,例如可以是过去1天、过去7天;预设频率,例如可以是每分钟采集一次、每小时采集一次。可以理解的是,一次采集的应用的多维特征数据构成一个样本,多个样本,构成所述样本总集。
应用的多维特征信息具有一定长度的维度,其每个维度上的参数均对应表征应用的一种特征信息,即该多维特征信息由多个特征信息构成。
该多个特征信息可以包括应用自身相关的特征信息,即应用的运行特征信息,例如:应用切入到后台的时长;应用切入到后台期间,电子设备的灭屏时长;应用进入前台的次数;应用处于前台的时间;应用进入后台的方式,例如:被主页键(home键)切换进入、被返回键切换进入,被其他应用切换进入等;应用的类型,包括一级(常用应用)、二级(其他应用)等。
该多个特征信息还可以包括应用所在的电子设备的相关特征信息,即电子设备的状态特征信息,例如:电子设备的灭屏时间、亮屏时间、当前电量,电子设备的无线网络连接状态,电子设备是否在充电状态等。
步骤S402、为所述样本总集中的每个样本添加采集时间戳。
样本的采集时间戳,表示样本的采集时间,每个样本都具有对应的采集时间戳,采集时间戳的具体表示方式可由采样时间段和采样频率决定。
例如:采样时间段为过去一天,采样频率为每分钟采集一次,则采集时间戳可由小时、分钟构成,比如12:01、17:20、19:35等;另外,由于一天包括1440(24*60)分钟,也可以直接用分钟表示采集时间戳,比如第1分钟、第2分钟……第1440分钟;在这种情况下,如果在过去的一天,应用一直处于运行状态,则将采集1440个样本,每个样本对应一个采集时间戳。再例如:采集时间段为过去一天,采样频率为每小时采集一次,则采集时间戳可由小时构成,比如1点、2点……24点;在这种情况下,如果在过去的一天,应用一直处于运行状态,则将采集24个样本,每个样本对应一个采集时间戳。
例如:采样时间段为过去七天(一周),采样频率为每分钟采集一次,则采集时间戳可由星期、小时、分钟构成,比如周一12:01、第三17:20、周日19:35等。再例如,采样时间段为过去七天(一周),采样频率为每小时采集一次,则采集时间戳可由星期、小时构成,比如周一1点、周四2点、周六24点等。
具体的,例如,本实施例所提及的应用为应用1,应用1的样本总集中包括N个样本,每个样本包括Q个维度的特征信息,比如Q为30,采样时间段为过去一天,采样频率是每小时,则应用1的样本总集及每个样本的采集时间戳可如下表1所示:
样本序号 特征信息1 特征信息2 特征信息… 特征信息Q 采集时间戳
1 x 11 x 12 x 1Q 2点
2 x 21 x 22   x 2Q 4点
N x N1 x N2 x NQ 23点
表1
步骤S403、对所述样本总集进行训练,得到每个采集时间戳对应的样本子集。
在训练的过程中,可以过滤掉样本总集中的噪点,构成精选样本集。
例如:样本总集中共N个样本,去噪后构成的精选样本集中包括M个样本,则M小于等于N,且M、N均为正整数。精选样本集中每个样本的采集时间戳与样本总集中对应样本的采集时间戳相同。
在一个具体的实施例中,精选样本集及其每个样本的采集时间戳可如下表2所示:
样本序号 特征信息1 特征信息2 特征信息… 特征信息Q 采集时间戳
1 x 11 x 12 x 1Q 2点
4 x 41 x 42   x 4Q 6点
M x M1 x M2 x MQ 22点
表2
具体的训练过程,可参阅上述实施例的描述,此处不再赘述。训练之后,得到每个采集时间戳对应的样本子集,每个采集时间戳对应的样本子集可如图4b所示。
步骤S404、当所述应用进入后台时,获取当前时间戳对应的样本子集。
例如,当前时间为6点,则可根据图4b获取6点对应的样本子集,即样本子集2。
步骤S405、判断所述应用的当前特征信息是否属于当前时间戳对应的样本子集,若属于,则执行步骤S406,否则,执行步骤S407。
所述应用的当前特征信息是在当前时刻采集的,所述当前时间戳即表示所述应用的当前特征信息的采集时间,所述应用的当前特征信息与构成样本时采集的所述应用的多维特征信息,具有相同的维度,二者在每个维度上对应的参数值可能相同,也可能不同。
具体地,可以统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的数量;若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
预设数量阈值可视实际需求自定义。例如,样本的特征信息的维度为30时,预设数量阈值可以为20,而所述应用的30维特征信息中,有超过20维的特征信息属于所述当前时间戳对应的样本子集时,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集。
步骤S406、确定预测结果为不可清理。
由于样本子集中的各个样本,是在所述应用为运行的状态下采集的,因此,若所述应用的当前特征信息属于当前时间戳对应的样本子集,则表明所述应用最好继续处于运行状态,则确定预测结果为不可清理,这种情况下,可以保持所述应用在后台运行的状态不变。
步骤S407、确定预测结果为可清理。
具体地,还可以检测是否满足预设清理条件,可以在检测到满足预设清理条件之后,清理所确定的可以清理的应用。该预设清理条件例如:用户发送的应用清理指令,或者电子设备的剩余电量(该剩余电量可以是剩余电量的百分比值,也可以是剩余电量的电容值)小于预设电量阈值,或者后台运行的应用的数量大于预设数量阈值,或者电子设备的可用内存小于预设内存阈值。
本实施例中,通过采集应用的多维特征信息作为样本,构建所述应用的样本总集,并为所述样本总集中的每个样本添加采集时间戳,然后对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用进行预测,可以提高预测的准确性,根据预测结果确定是否可以清理所述应用,以此实现了后台应用的自动清理,提高了电子设备的运行流畅度,降低了功耗。
本申请实施例还提供了一种后台应用清理装置,包括采集单元、添加单元、训练单元和预测单元,如下:
采集单元,用于采集应用的多维特征信息作为样本,构建所述应用的样本总集;
添加单元,用于为所述样本总集中的每个样本添加采集时间戳;
训练单元,用于对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
预测单元,用于当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
一实施例中,所述采集单元具体用于:
在历史时间段内,且所述应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
一实施例中,所述训练单元包括:
距离计算单元,用于计算所述样本总集中的任意一个样本与其他每个样本之间的距离;
子集构成单元,用于从所述样本总集中选取与所述任意一个样本的距离小于或等于预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
所述子集构成单元遍历所述样本总集中的每个样本,得到每个采集时间戳对应的样本子集。
一实施例中,所述距离计算单元基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
Figure PCTCN2018110466-appb-000003
d ij表示样本i与样本j之间的距离,x i表示样本i,x j表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征信息,x jk表示样本j的第k个特征信息。
一实施例中,所述装置还包括:
密度计算单元,用于根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度;
精选集构成单元,用于从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集;
所述子集构成单元还用于,从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
所述子集构成单元遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
一实施例中,所述密度计算单元具体用于:
针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于所述预设距离阈值的样本,则将所述任意一个样本的距离密度增加1;
遍历所述样本总集中的每个样本,得到每个样本的距离密度。
一实施例中,所述预测单元包括:
获取单元,用于获取当前时间戳对应的样本子集;
确定单元,用于判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集,若属于,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
一实施例中,所述确定单元判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集包括:
所述确定单元统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的数量;若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
一实施例中,所述应用的多维特征信息包括所述应用的运行特征信息和/或所述电子设 备的状态特征信息。
一实施例中,所述装置还包括:
清理单元,用于检测是否满足预设清理条件;若满足所述预设清理条件,则清理所确定的可以清理的应用。
在一优选实施例中,还提供一种后台应用清理装置,该后台应用清理装置应用于电子设备,如图5所示,该后台应用清理装置包括采集单元501、添加单元502、训练单元503和预测单元504,如下:
采集单元501,用于采集应用的多维特征信息作为样本,构建所述应用的样本总集;
添加单元502,用于为所述样本总集中的每个样本添加采集时间戳;
训练单元503,用于对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
预测单元504,用于当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
在一些实施例中,所述采集单元501具体用于:
在历史时间段内,且所述应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
在一些实施例中,如图6所示,所述训练单元503包括:
距离计算单元5031,用于计算所述样本总集中的任意一个样本与其他每个样本之间的距离;
子集构成单元5034,用于从所述样本总集中选取与所述任意一个样本的距离小于或等于预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
所述子集构成单元5034遍历所述样本总集中的每个样本,得到每个采集时间戳对应的样本子集。
在一些实施例中,所述距离计算单元5031基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
Figure PCTCN2018110466-appb-000004
d ij表示样本i与样本j之间的距离,x i表示样本i,x j表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征,x jk表示样本j的第k个特征。
在一些实施例中,如图6所示,所述装置还包括:
密度计算单元5032,用于根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度;
精选集构成单元5033,用于从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集;
所述子集构成单元5034还用于,从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
所述子集构成单元5034遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
在一些实施例中,所述密度计算单元5032具体用于:
针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于所述预设 距离阈值的样本,则将所述任意一个样本的距离密度增加1;
遍历所述样本总集中的每个样本,得到每个样本的距离密度。
在一些实施例中,如图6所示,所述预测单元504包括:
获取单元5041,用于获取当前时间戳对应的样本子集;
确定单元5042,用于判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集,若属于,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
在一些实施例中,所述确定单元5042判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集包括:
所述确定单元5042统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的数量;若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
在一些实施例中,所述应用的多维特征信息包括所述应用的运行特征信息和/或所述电子设备的状态特征信息。
在一些实施例中,如图6所示,所述装置还包括:
清理单元505,用于检测是否满足预设清理条件;若满足所述预设清理条件,则清理所确定的可以清理的应用。
由上可知,本实施例采用在电子设备中,由采集单元501采集应用的多维特征信息作为样本,构建所述应用的样本总集,并由添加单元502为所述样本总集中的每个样本添加采集时间戳,然后由训练单元503对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,当所述应用进入后台时,预测单元504利用当前时间戳对应的样本子集对所述应用进行预测,可以提高预测的准确性,根据预测结果确定是否可以清理所述应用,以此实现了后台应用的自动清理,提高了电子设备的运行流畅度,降低了功耗。
具体实施时,以上各个模块可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个模块的具体实施可参见前面的方法实施例,在此不再赘述。
本申请实施例还提供一种电子设备。请参阅图7,电子设备600包括处理器601以及存储器602。其中,处理器601与存储器602电性连接。
所述处理器600是电子设备600的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器602内的计算机程序,以及调用存储在存储器602内的数据,执行电子设备600的各种功能并处理数据,从而对电子设备600进行整体监控。
所述存储器602可用于存储软件程序以及模块,处理器601通过运行存储在存储器602的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器602可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器602可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器602还可以包括存储器控制器,以提供处理器601对存储器602的访问。
在本申请实施例中,电子设备600中的处理器601会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器602中,并由处理器601运行存储在存储器602中的计算机程序,从而实现各种功能,如下:
采集应用的多维特征信息作为样本,构建所述应用的样本总集;
为所述样本总集中的每个样本添加采集时间戳;
对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
在某些实施方式中,在采集应用的多维特征信息作为样本,构建所述应用的样本总集时,处理器601具体执行以下步骤:
在历史时间段内,且所述应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
在某些实施方式中,在对所述样本总集进行训练,得到每个采集时间戳对应的样本子集时,处理器601具体执行以下步骤:
计算所述样本总集中的任意一个样本与其他每个样本之间的距离;
从所述样本总集中选取与所述任意一个样本的距离小于或等于预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
遍历所述样本总集中的每个样本,得到每个采集时间戳对应的样本子集。
在某些实施方式中,处理器601基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
Figure PCTCN2018110466-appb-000005
d ij表示样本i与样本j之间的距离,x i表示样本i,x j表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征,x jk表示样本j的第k个特征。
在某些实施方式中,在计算所述样本总集中的任意一个样本与其他每个样本之间的距离之后,处理器601还用于执行以下步骤:
根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度;
从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集;
从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
在某些实施方式中,在根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度时,处理器601具体用于执行以下步骤:
针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于所述预设距离阈值的样本,则将所述任意一个样本的距离密度增加1;
遍历所述样本总集中的每个样本,得到每个样本的距离密度。
在某些实施方式中,在利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测时,处理器601具体用于执行以下步骤:
获取当前时间戳对应的样本子集;
判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集;
若属于,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
在某些实施方式中,在判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集时,处理器601具体用于执行以下步骤:
统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的 数量;
若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
在某些实施方式中,所述应用的多维特征信息包括所述应用的运行特征信息和/或所述电子设备的状态特征信息。
在某些实施方式中,处理器601还用于执行以下步骤:
检测是否满足预设清理条件;
若满足所述预设清理条件,则清理所确定的可以清理的应用。
由上述可知,本申请实施例的电子设备,通过采集应用的多维特征信息作为样本,构建所述应用的样本总集,并为所述样本总集中的每个样本添加采集时间戳,然后对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用进行预测,可以提高预测的准确性,根据预测结果确定是否可以清理所述应用,以此实现了后台应用的自动清理,提高了电子设备的运行流畅度,降低了功耗。
请一并参阅图8,在某些实施方式中,电子设备600还可以包括:显示器603、射频电路604、音频电路605以及电源606。其中,其中,显示器603、射频电路604、音频电路605以及电源606分别与处理器601电性连接。
所述显示器603可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器603可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。
所述射频电路604可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。
所述音频电路605可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。
所述电源606可以用于给电子设备600的各个部件供电。在一些实施例中,电源606可以通过电源管理***与处理器601逻辑相连,从而通过电源管理***实现管理充电、放电、以及功耗管理等功能。
尽管图8中未示出,电子设备600还可以包括摄像头、蓝牙模块等,在此不再赘述。
本申请实施例还提供一种存储介质,所述存储介质存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述任一实施例中的后台应用清理方法,比如:采集应用的多维特征信息作为样本,构建所述应用的样本总集;为所述样本总集中的每个样本添加采集时间戳;对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)、或者随机存取记忆体(Random Access Memory,RAM)等。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
需要说明的是,对本申请实施例的后台应用清理方法而言,本领域普通决策人员可以理解实现本申请实施例的后台应用清理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如后台应用清理方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。
对本申请实施例的后台应用清理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。
以上对本申请实施例所提供的一种后台应用清理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种后台应用清理方法,其中,包括:
    采集应用的多维特征信息作为样本,构建所述应用的样本总集;
    为所述样本总集中的每个样本添加采集时间戳;
    对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
    当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
  2. 根据权利要求1所述的后台应用清理方法,其中,采集应用的多维特征信息作为样本,构建所述应用的样本总集,包括:
    在历史时间段内,且所述应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
  3. 根据权利要求2所述的后台应用清理方法,其中,对所述样本总集进行训练,得到每个采集时间戳对应的样本子集,包括:
    计算所述样本总集中的任意一个样本与其他每个样本之间的距离;
    从所述样本总集中选取与所述任意一个样本的距离小于或等于预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
    遍历所述样本总集中的每个样本,得到每个采集时间戳对应的样本子集。
  4. 根据权利要求3所述的后台应用清理方法,其中,基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
    Figure PCTCN2018110466-appb-100001
    d ij表示样本i与样本j之间的距离,x i表示样本i,x j表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征信息,x jk表示样本j的第k个特征信息。
  5. 根据权利要求3所述的后台应用清理方法,其中,在计算所述样本总集中的任意一个样本与其他每个样本之间的距离之后,还包括:
    根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度;
    从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集;
    从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
    遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
  6. 根据权利要求5所述的后台应用清理方法,其中,根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度,包括:
    针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于所述预设距离阈值的样本,则将所述任意一个样本的距离密度增加1;
    遍历所述样本总集中的每个样本,得到每个样本的距离密度。
  7. 根据权利要求2至6任意一项所述的后台应用清理方法,其中,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,包括:
    获取当前时间戳对应的样本子集;
    判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集;
    若属于,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
  8. 根据权利要求7所述的后台应用清理方法,其中,判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集,包括:
    统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的数量;
    若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
  9. 根据权利要求1至6任意一项所述的后台应用清理方法,其中,所述应用的多维特征信息包括所述应用的运行特征信息和/或所述电子设备的状态特征信息。
  10. 根据权利要求1至6任意一项所述的后台应用清理方法,其中,所述方法还包括:
    检测是否满足预设清理条件;
    若满足所述预设清理条件,则清理所确定的可以清理的应用。
  11. 一种后台应用清理装置,其中,包括:
    采集单元,用于采集应用的多维特征信息作为样本,构建所述应用的样本总集;
    添加单元,用于为所述样本总集中的每个样本添加采集时间戳;
    训练单元,用于对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
    预测单元,用于当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
  12. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至10任一项所述的后台应用清理方法。
  13. 一种电子设备,包括处理器和存储器,所述存储器有计算机程序,其中,所述处理器通过调用所述计算机程序,从而执行以下步骤:
    采集应用的多维特征信息作为样本,构建所述应用的样本总集;
    为所述样本总集中的每个样本添加采集时间戳;
    对所述样本总集进行训练,得到每个采集时间戳对应的样本子集;
    当所述应用进入后台时,利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测,并根据预测结果确定是否可以清理所述应用。
  14. 根据权利要求13所述的电子设备,其中,在采集应用的多维特征信息作为样本,构建所述应用的样本总集时,所述处理器具体用于执行以下步骤:
    在历史时间段内,且所述应用为运行状态时,按照预设频率采集所述应用的多维特征信息作为样本,构建所述应用的样本总集。
  15. 根据权利要求14所述的电子设备,其中,在对所述样本总集进行训练,得到每个采集时间戳对应的样本子集时,所述处理器具体用于执行以下步骤:
    计算所述样本总集中的任意一个样本与其他每个样本之间的距离;
    从所述样本总集中选取与所述任意一个样本的距离小于或等于预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
    遍历所述样本总集中的每个样本,得到每个采集时间戳对应的样本子集。
  16. 根据权利要求15所述的电子设备,其中,所述处理器基于第一预设公式计算所述样本总集中的任意一个样本与其他每个样本之间的距离,所述第一预设公式为:
    Figure PCTCN2018110466-appb-100002
    d ij表示样本i与样本j之间的距离,x i表示样本i,x j 表示样本j,n表示样本的特征信息的维数,x ik表示样本i的第k个特征信息,x jk表示样本j的第k个特征信息。
  17. 根据权利要求15所述的电子设备,其中,在计算所述样本总集中的任意一个样本与其他每个样本之间的距离之后,所述处理器还用于执行以下步骤:
    根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度;
    从所述样本总集中选取距离密度大于所述预设密度阈值的样本,构成精选样本集;
    从所述精选样本集中选取与所述任意一个样本的距离小于或等于所述预设距离阈值的样本,将选取的样本与所述任意一个样本归为一个样本子集,将所述样本子集作为所述任意一个样本的采集时间戳对应的样本子集;
    遍历所述精选样本集中的每个样本,得到每个采集时间戳对应的样本子集。
  18. 根据权利要求17所述的电子设备,其中,在根据所述样本总集中的任意一个样本与其他每个样本之间的距离,计算每个样本的距离密度时,所述处理器具体用于执行以下步骤:
    针对所述任意一个样本,统计所述样本总集中与所述任意一个样本的距离大于所述预设距离阈值的样本,所述样本总集中每存在一个与所述任意一个样本的距离大于所述预设距离阈值的样本,则将所述任意一个样本的距离密度增加1;
    遍历所述样本总集中的每个样本,得到每个样本的距离密度。
  19. 根据权利要求14至18任意一项所述的电子设备,其中,在利用当前时间戳对应的样本子集对所述应用的当前特征信息进行预测时,所述处理器具体用于执行以下步骤:
    获取当前时间戳对应的样本子集;
    判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集;
    若属于,则确定预测结果为不可清理,若不属于,则确定预测结果为可清理。
  20. 根据权利要求19所述的电子设备,其中,在判断所述应用的当前特征信息是否属于所述当前时间戳对应的样本子集时,所述处理器具体用于执行以下步骤:
    统计所述应用的当前特征信息中,属于所述当前时间戳对应的样本子集的特征信息的数量;
    若统计的数量大于预设数量阈值,则确定所述应用的当前特征信息属于所述当前时间戳对应的样本子集,若统计的数量小于或等于预设数量阈值,则确定所述应用的当前特征信息不属于所述当前时间戳对应的样本子集。
PCT/CN2018/110466 2017-10-31 2018-10-16 后台应用清理方法、装置、存储介质及电子设备 WO2019085742A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711045112.9 2017-10-31
CN201711045112.9A CN107729087B (zh) 2017-10-31 2017-10-31 后台应用清理方法、装置、存储介质及电子设备

Publications (1)

Publication Number Publication Date
WO2019085742A1 true WO2019085742A1 (zh) 2019-05-09

Family

ID=61203468

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110466 WO2019085742A1 (zh) 2017-10-31 2018-10-16 后台应用清理方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN107729087B (zh)
WO (1) WO2019085742A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729087B (zh) * 2017-10-31 2019-08-06 Oppo广东移动通信有限公司 后台应用清理方法、装置、存储介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902357A (zh) * 2012-12-27 2014-07-02 富泰华工业(深圳)有限公司 应用程序管理***及方法
US20160078347A1 (en) * 2014-09-11 2016-03-17 Qualcomm Incorporated Methods and Systems for Aggregated Multi-Application Behavioral Analysis of Mobile Device Behaviors
CN105718027A (zh) * 2016-01-20 2016-06-29 努比亚技术有限公司 后台应用程序的管理方法及移动终端
CN106294902A (zh) * 2015-05-28 2017-01-04 阿里巴巴集团控股有限公司 预测移动应用程序页面性能的方法、装置及电子设备
CN106557146A (zh) * 2015-09-28 2017-04-05 北京金山安全软件有限公司 一种省电方法、装置及终端
CN107729087A (zh) * 2017-10-31 2018-02-23 广东欧珀移动通信有限公司 后台应用清理方法、装置、存储介质及电子设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160091786A (ko) * 2015-01-26 2016-08-03 삼성전자주식회사 사용자 관리 방법 및 사용자 관리 장치
CN106775809B (zh) * 2016-11-15 2020-02-07 北京安云世纪科技有限公司 一种移动终端内存清理的方法、装置及移动终端
CN107133094B (zh) * 2017-06-05 2021-11-02 努比亚技术有限公司 应用管理方法、移动终端及计算机可读存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902357A (zh) * 2012-12-27 2014-07-02 富泰华工业(深圳)有限公司 应用程序管理***及方法
US20160078347A1 (en) * 2014-09-11 2016-03-17 Qualcomm Incorporated Methods and Systems for Aggregated Multi-Application Behavioral Analysis of Mobile Device Behaviors
CN106294902A (zh) * 2015-05-28 2017-01-04 阿里巴巴集团控股有限公司 预测移动应用程序页面性能的方法、装置及电子设备
CN106557146A (zh) * 2015-09-28 2017-04-05 北京金山安全软件有限公司 一种省电方法、装置及终端
CN105718027A (zh) * 2016-01-20 2016-06-29 努比亚技术有限公司 后台应用程序的管理方法及移动终端
CN107729087A (zh) * 2017-10-31 2018-02-23 广东欧珀移动通信有限公司 后台应用清理方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN107729087A (zh) 2018-02-23
CN107729087B (zh) 2019-08-06

Similar Documents

Publication Publication Date Title
EP3289485B1 (en) Automatic demand-driven resource scaling for relational database-as-a-service
CN107832132B (zh) 应用控制方法、装置、存储介质及电子设备
WO2019062417A1 (zh) 应用清理方法、装置、存储介质及电子设备
WO2019062414A1 (zh) 应用程序管控方法、装置、存储介质及电子设备
US9247502B2 (en) Method and apparatus for power management on mobile devices and associated mobile devices
WO2019062342A9 (zh) 后台应用清理方法、装置、存储介质及电子设备
EP3690663A1 (en) Application cleaning method and apparatus, storage medium and electronic device
WO2019062405A1 (zh) 应用程序的处理方法、装置、存储介质及电子设备
EP3863323A1 (en) Communication network out-of-capacity predictions
CN107835311B (zh) 应用管理方法、装置、存储介质及电子设备
CN111478963B (zh) 消息推送方法、装置、电子设备及计算机可读存储介质
EP3374864A1 (en) Performance monitoring in a distributed storage system
WO2019085754A1 (zh) 应用清理方法、装置、存储介质及电子设备
CN107608778B (zh) 应用程序管控方法、装置、存储介质及电子设备
WO2016183936A1 (zh) 一种应用程序图标排列方法、装置、移动终端及存储介质
WO2022161325A1 (zh) 提示方法和电子设备
WO2019062419A1 (zh) 应用清理方法、装置、存储介质及电子设备
WO2019062404A1 (zh) 应用程序的处理方法、装置、存储介质及电子设备
WO2019062462A1 (zh) 应用控制方法、装置、存储介质以及电子设备
WO2019062341A1 (zh) 后台应用清理方法、装置、存储介质及电子设备
WO2019085742A1 (zh) 后台应用清理方法、装置、存储介质及电子设备
WO2019062409A1 (zh) 后台应用程序管控方法、存储介质及电子设备
CN108038050B (zh) 性能调整方法、装置、存储介质及电子设备
US20140122403A1 (en) Loading prediction method and electronic device using the same
CN107870811B (zh) 应用清理方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18872821

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

Country of ref document: EP

Kind code of ref document: A1