WO2019128598A1 - Application processing method, electronic device, and computer readable storage medium - Google Patents

Application processing method, electronic device, and computer readable storage medium Download PDF

Info

Publication number
WO2019128598A1
WO2019128598A1 PCT/CN2018/117694 CN2018117694W WO2019128598A1 WO 2019128598 A1 WO2019128598 A1 WO 2019128598A1 CN 2018117694 W CN2018117694 W CN 2018117694W WO 2019128598 A1 WO2019128598 A1 WO 2019128598A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
sample set
information gain
sample
classification
Prior art date
Application number
PCT/CN2018/117694
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 WO2019128598A1 publication Critical patent/WO2019128598A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • 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
    • 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/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Definitions

  • the present application relates to the field of data processing, and in particular, to an application processing method, an electronic device, and a computer readable storage medium.
  • the traditional method is to force the exit of the corresponding background application.
  • the traditional method is to select the length of the background in the background, the frequency of use, the duration of the application, etc., and select the longer duration of the background station and the application frequency.
  • a background application that is low or has a short duration forcibly exits the selected background application.
  • An application processing method, an electronic device, and a computer readable storage medium are provided according to various embodiments of the present application.
  • An application processing method includes: acquiring first feature data of each feature, wherein the first feature data is feature data of a corresponding feature at a predicted time; and acquiring is used to predict whether the user will use the preset time length a decision tree model of the target application, the start time of the preset duration is a predicted time; the first feature data is used as an input of the decision tree model, and the predicted result is output; and when the predicted result is not The target application is frozen when the target application is used within a preset duration.
  • An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following operations:
  • the first feature data is feature data of the corresponding feature at the predicted time; acquiring a decision tree model for predicting whether the user will use the target application within a preset duration, The starting time of the preset duration is a predicted time; the first feature data is used as an input of the decision tree model, and the predicted result is output; and when the predicted result is not used within a preset duration When the target application is described, the target application is frozen.
  • a computer readable storage medium having stored thereon a computer program that is executed by a processor to:
  • the first feature data is feature data of the corresponding feature at the predicted time; acquiring a decision tree model for predicting whether the user will use the target application within a preset duration, The starting time of the preset duration is a predicted time; the first feature data is used as an input of the decision tree model, and the predicted result is output; and when the predicted result is not used within a preset duration When the target application is described, the target application is frozen.
  • the decision tree model of the target application is preset, and the first feature data of each feature and the decision tree model of the target application are obtained, and the first feature data is used as an input of the decision tree model to obtain Whether the user output by the decision tree model uses the prediction result of the target application within a preset duration, and when the prediction result is that the target application is not used within the preset duration, the target application is frozen to limit the target.
  • the application's occupation of resources improves the accuracy of freezing the target application, which in turn increases the effectiveness of system resource release.
  • FIG. 1 is a schematic diagram showing the internal structure of an electronic device in an embodiment.
  • FIG. 2 is a partial block diagram of a system in an electronic device in an embodiment.
  • FIG. 3 is an application environment diagram of an application processing method in an embodiment.
  • FIG. 4 is a flow chart of an application processing method in one embodiment.
  • FIG. 5 is a flow chart of sample classification of a sample set according to an information gain rate classified by a feature according to a feature in one embodiment, and a decision tree model for predicting whether a user will use a target application within a preset duration.
  • Figure 6A is a schematic diagram of a decision tree in one embodiment.
  • Figure 6B is a schematic diagram of a decision tree in another embodiment.
  • Figure 6C is a schematic diagram of a decision tree in yet another embodiment.
  • FIG. 7 is a flow diagram of obtaining an information gain rate for a feature classification for a target sample set in one embodiment.
  • Figure 8 is a flow chart of an application processing method in another embodiment.
  • Figure 9 is a block diagram showing the structure of an application processing device in an embodiment.
  • Figure 10 is a block diagram showing the structure of an application processing device in another embodiment.
  • Figure 11 is a block diagram showing the structure of an application processing device in still another embodiment.
  • Figure 12 is a block diagram showing a portion of the structure of a handset in an embodiment.
  • first, second and the like may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another.
  • first feature data may be referred to as second feature data without departing from the scope of the present invention, and similarly, the second feature data may be referred to as first feature data.
  • Both the first feature data and the second feature data are feature data, but they are not the same feature data.
  • an internal structure diagram of an electronic device includes a processor, memory, and display screen connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory is used to store data, programs, and/or instruction codes, etc., and the memory stores at least one computer program, which can be executed by the processor to implement an application processing method suitable for an electronic device provided in the embodiments of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random storage memory (Random-Access-Memory, RAM).
  • the memory includes a non-volatile storage medium and an internal memory.
  • Non-volatile storage media stores operating systems, databases, and computer programs.
  • the database stores data related to an application processing method provided by the above various embodiments, for example, information such as the name of each process or application may be stored.
  • the computer program can be executed by a processor for implementing an application processing method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media.
  • the display screen can be a touch screen, such as a capacitive screen or an electronic screen, for displaying interface information of an application corresponding to the first process, and can also be used for detecting a touch operation applied to the display screen, and generating corresponding instructions, such as before execution. Switching instructions for background applications, etc.
  • the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied.
  • the specific electronic device may be It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the electronic device further includes a network interface connected through a system bus, and the network interface may be an Ethernet card or a wireless network card, etc., for communicating with an external electronic device, for example, for communicating with a server.
  • the network interface may be an Ethernet card or a wireless network card, etc.
  • the external electronic device for example, for communicating with a server.
  • the architecture of the electronic device includes a JAVA spatial layer 210, a local framework layer 220, and a kernel space layer 230.
  • the JAVA spatial layer 210 can include a freeze management application 212, by which the electronic device can implement a freeze policy for each application, and perform freezing and thawing management operations on the related applications of the background power consumption.
  • the resource priority and restriction management module 222 and the platform freeze management module 224 are included in the local framework layer 220.
  • the electronic device can maintain different applications in different priorities and different resource organizations through the resource priority and limit management module 222, and adjust the resource group of the application according to the requirements of the upper layer to achieve optimized performance and save power. effect.
  • the electronic device can allocate the tasks that can be frozen in the background to the frozen layer corresponding to the preset different levels according to the length of the entering freeze time through the platform freeze management module 224.
  • the frozen layer can include three, respectively: the CPU Limit sleep mode, CPU freeze sleep mode, process deep freeze mode.
  • the CPU restricts the sleep mode to limit the CPU resources occupied by the related processes, so that the related processes occupy less CPU resources, and the free CPU resources are tilted to other unfrozen processes, thereby limiting the occupation of CPU resources.
  • the kernel space layer 230 includes a UID management module 231, a Cgroup module 232, a Binder management module 233, a process memory recovery module 234, and a freeze timeout exit module 235.
  • the UID management module 231 is configured to implement an application-based User Identifier (UID) to manage resources of a third-party application or freeze. Compared with the Process Identifier (PID) for process management and control, it is easier to uniformly manage the resources of a user's application through UID.
  • the Cgroup module 232 is used to provide a complete set of Central Processing Unit (CPU), CPUSET, memory, input/output (I/O), and Net related resource restriction mechanisms.
  • the Binder management module 233 is used to implement the priority control of the background binder communication.
  • the interface module of the local framework layer 220 includes a binder interface developed to the upper layer, and the upper layer framework or application sends a resource restriction or frozen instruction to the resource priority and restriction management module 222 and the platform freeze management module 224 through the provided binder interface.
  • the process memory recovery module 234 is configured to implement the process deep freeze mode, so that when a third-party application is in a frozen state for a long time, the file area of the process is mainly released, thereby saving the memory module and speeding up the application next time. The speed at startup.
  • the freeze timeout exit module 235 is configured to resolve an exception generated by the freeze timeout scenario.
  • an electronic device may collect feature data of a preset feature for embodying a user behavior habit as a sample under different time periods. Forming a sample set, classifying the sample set according to the information gain rate of the feature classification for the sample, to construct a decision tree model for predicting whether the target application will be used within a preset duration; and then predicting the preset feature at the moment
  • the feature data is used as an input to the decision tree model to obtain a prediction result.
  • the prediction result is that the target application is not used within the preset duration when the prediction result is that the target application is not frozen, the target application is not frozen.
  • an application processing method is provided.
  • the embodiment is applied to the electronic device shown in FIG. 1 as an example for description.
  • the method includes:
  • Operation 402 Acquire first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time.
  • the feature data is data for characterizing the operational habits of the user's application to the electronic device.
  • the feature may be one or more dimensions of the device hardware and software features of the electronic device, the device usage state, and the user operation time duration.
  • the electronic device can bury the point in the preset path of the system, and detect the feature data of each feature in real time according to the preset sampling frequency.
  • the electronic device may also record the feature data of the relevant feature and the application identifier of the application at the startup time when the application is activated, and associate the application identifier with the recorded feature data.
  • the feature includes a current time period when the corresponding data is recorded, a current date category, an application identifier of the previous foreground application, an application identifier of the previous foreground application, a current wireless fidelity WiFi (WIreless Fidelity) connection status, The WiFi ID of the connected WiFi, the duration of the application staying in the background, the duration of the application during the background pause, the current plug-in status of the headset, the current charging status, the current battery level, the way the application is switched, the category of the application, and the application One or more of the characteristics such as the number of times to switch to the foreground.
  • WIreless Fidelity WIreless Fidelity
  • the date category may include a working day and a rest day, and the WiFi connection status includes the unconnected WiFi and the connected WiFi, and the WiFi identifier may be a Service Set Identifier (SSID) or a Basic Service Set Identifier (BSSID). Any of the types of information that can uniquely identify the WiFi; the category of the application includes a social application, a payment application, a game application, a tool application, and the like, and the classification of the application may include multiple types, and is not limited thereto.
  • the application switching means that the application switches from the foreground to the background or from the background to the foreground.
  • the switching manner may include an application switching formed by directly opening an application according to an application startup icon, an application switching formed by clicking an application notification message, and directly exiting the application. Application switching, etc.
  • the previous foreground application indicates the application that was running in the foreground at the moment when the feature was recorded.
  • the previous application indicates the application that was last running in the foreground at the time of recording the feature.
  • the first feature data refers to the feature data of the corresponding feature at the predicted time.
  • the target application for example, the first feature data may include the current time period and the current date category at the predicted time. , the previous foreground application name, the previous foreground application name, the current WiFi connection status, the WiFi identity of the connected WiFi, the duration of the target application staying in the background, the duration of the target application during the background pause, and the current headset plugging and unplugging One or more characteristics of the status, the current state of charge, the current battery level, the manner in which the target application is switched, the category of the target application, the number of times the target application switches to the foreground, and the like.
  • the predicted time may be the current time.
  • the electronic device may initiate a freeze instruction for one or more applications running in the background by freezing the management application 212, and the freeze instruction may begin to acquire the first feature data of each feature according to the instruction. .
  • the electronic device may trigger the application freeze instruction when detecting that the available resource is lower than a preset threshold, or may initiate a freeze instruction to the application when detecting that an application is switched to the background.
  • the application for which the freeze instruction is directed is the target application.
  • Operation 404 obtaining a decision tree model for predicting whether the user will use the target application within a preset duration; the starting time of the preset duration is the predicted time.
  • the decision tree model is a model for predicting whether the target application will be used within the preset duration.
  • the starting time of the preset duration is the predicted time, that is, whether the predicted target application will be used within the preset duration from the current time.
  • the preset duration can be any suitable length of time, and can be set according to an empirical value, such as 1 minute, 5 minutes, 10 minutes, or 30 minutes.
  • the target application is the application of the benefit measurement, wherein the target application may be one or more applications in the electronic device that are currently running in the background.
  • the electronic device presets a decision tree model corresponding to the target application, and obtains a decision tree model corresponding to the target application to predict whether the target application will be used by the user within a preset duration.
  • different decision tree models can be set correspondingly.
  • a corresponding decision tree model can be set for each application, or a corresponding decision tree model can be set for each type of application.
  • the first feature data is used as an input of the decision tree model, and the prediction result is output.
  • the electronic device may use the collected first feature data of the respective features at the predicted time as the data of the decision tree model, and run the decision tree model to obtain an output result of the decision tree.
  • the result of this data is the predicted result.
  • the prediction result includes that the target application will not be used within the preset duration or will be used within the preset duration.
  • the electronic device can freeze the target application.
  • the electronic device may send the prediction result to the platform freeze management module 224 as shown in FIG. 2, and when the platform freeze management module 224 receives the prediction result that does not use the target application within the preset duration, the The target application initiates a freeze operation, thereby limiting the resources that the target application can use, such as adopting any one of a CPU-limited sleep mode, a CPU freeze sleep mode, or a process deep freeze mode to freeze the target application.
  • the application processing method described above by setting a decision tree model of the target application in advance, and acquiring the first feature data of each feature and the decision tree model of the target application, using the first feature data as an input of the decision tree model, Whether the user output by the decision tree model uses the prediction result of the target application within a preset duration, and when the prediction result is that the target application is not used within the preset duration, the target application is frozen to limit The target application's occupation of resources. Since it is necessary to consume a certain amount of system resources when freezing the application, whether the target application is used within the preset duration by performing the prediction, and freezing when not in use, thereby reducing the user to freeze after the target application is frozen. The application is used within the preset duration, and the application needs to be thawed, which causes unnecessary freezing operations, improves the accuracy of freezing the target application, and thus improves the effectiveness of releasing system resources.
  • the method before the operation 402, the method further includes: acquiring preset second feature data of each feature as a sample, and generating a sample set, where the second feature data is a correspondence when the reference application is started before the predicted time Feature data of the feature, the reference application includes a target application; when the data volume of the sample set exceeds a preset threshold, the sample set is sample-classified according to the information gain rate of the feature classification for the sample set, and is generated for predicting whether the user is preset The decision tree model of the target application is used within the duration.
  • the second feature data is feature data of each feature recorded before the predicted time, and the second feature data has an association relationship with the application identifier of the corresponding reference application, that is, before the predicted time, the reference application is detected
  • the feature data of each feature ie, the second feature data
  • the second feature data is recorded at the startup time, and the second feature data is associated with the application identifier of the reference application.
  • the electronic device may collect the second feature data of each feature according to a preset frequency through a historical time period, and use the second feature recorded each time as a sample to form a sample set.
  • a decision tree model of each application requiring prediction is constructed based on the accumulated sample set.
  • the historical time period may be, for example, the past 7 days or 10 days;
  • the preset frequency may be, for example, collected every 10 minutes and collected every half hour. It can be understood that the multi-dimensional feature data collected at one time constitutes one sample, and multiple samples collected multiple times constitute a sample set.
  • each sample in the sample set can be marked, the application identification of the sample is marked, and the sample label of each sample is obtained.
  • the tag for each sample is the application ID of the corresponding association. Since the target application is targeted, the sample tag can be classified into a target application and a non-target application, that is, the sample category includes a "target application” and a "non-target application.”
  • the sample tag of the second feature data of the recorded feature is set as the "target application”
  • the sample tag of the second feature data of the recorded feature is activated when the non-target application is started. Set to "non-target app".
  • the value "1" may be used to indicate "target application”
  • the value "0" may be used to indicate "non-target application", and vice versa.
  • the preset threshold may be any suitable value preset, for example, may be 10000, that is, when the number of samples recorded exceeds 10000, the decision tree model is started. Alternatively, the larger the number of samples, the more accurate the decision tree model is constructed.
  • the electronic device may quantize the feature information in the feature data that is not directly represented by the value by a specific value. For example, for the feature of the current WiFi connection state, the value 1 may be used to indicate that Connect WiFi, use the value 0 to indicate that WiFi is not connected (or vice versa).
  • the embodiment of the present application may perform sample classification on the sample set based on the information gain rate of the feature classification for the sample set to construct a decision tree model for predicting whether the user will use the target application within a preset duration.
  • a decision tree model can be constructed based on the C4.5 algorithm.
  • the decision tree is a tree built on the basis of decision-making.
  • a decision tree is a predictive model that represents a mapping between object attributes and object values.
  • Each node represents an object, and each forked path in the tree represents a certain Possible attribute values, and each leaf node corresponds to the value of the object represented by the path from the root node to the leaf node.
  • the decision tree has only a single output. If there are multiple outputs, separate decision trees can be created to handle different outputs.
  • the C4.5 algorithm is a kind of decision tree. It is a series of algorithms used in the classification problem of machine learning and data mining. It is an important algorithm improved by ID3. Its goal is to supervise learning: Given a data set, each of these tuples can be described by a set of attribute values, each of which belongs to a class in a mutually exclusive category. The goal of C4.5 is to find a mapping from attribute values to categories by learning, and this mapping can be used to classify entities with unknown new categories.
  • ID3 (Iterative Dichotomiser 3, iterative binary tree 3 generation) is based on the Occam razor principle, that is, to do more with as few things as possible. In information theory, the smaller the expected information, the greater the information gain and the higher the purity.
  • the core idea of the ID3 algorithm is to measure the choice of attributes with information gain, and select the attribute with the largest information gain after splitting to split. The algorithm uses a top-down greedy search to traverse possible decision spaces.
  • the information gain rate may be defined as the ratio of the information gain of the feature to the sample classification and the split information of the feature to the sample classification.
  • the specific information gain rate acquisition method is described below.
  • the information gain is for one feature. It is to look at a feature t. What is the amount of information when the system has it and without it? The difference between the two is the amount of information that the feature brings to the system, that is, the information gain. .
  • the split information is used to measure the breadth and uniformity of the feature split data (such as the sample set), and the split information can be the entropy of the feature.
  • the sample set is sample-classified according to the information gain rate of the feature classification for the sample set, and a decision tree model for predicting whether the user will use the target application within a preset duration is generated.
  • the sample set is used as the node information of the root node of the decision tree; and the node information of the root node is determined as the target sample set to be classified currently.
  • sample set is taken as the target sample set to be classified currently.
  • classification of sample sets includes "target applications” and “non-target applications.”
  • Operation 502 obtaining an information gain rate of the feature classification for the target sample set.
  • Operation 503 selecting a sample from the target sample set as the division feature according to the information gain rate.
  • the partitioning feature is a feature selected from the features according to the information gain rate of each feature for the sample set classification, and is used to classify the sample set.
  • the feature according to the information gain rate there are various ways to select the feature according to the information gain rate. For example, in order to improve the accuracy of the sample classification, the feature corresponding to the maximum information gain rate may be selected as the division feature.
  • a gain rate threshold may also be set; when the maximum information gain rate is greater than the threshold, the electronic device selects a feature corresponding to the information gain rate as a division feature.
  • the maximum target information gain rate may be selected from the information gain rate; whether the target information gain rate is greater than a preset threshold; and when the target information gain rate is greater than the preset threshold, the feature corresponding to the target information gain rate is selected as the current division feature. .
  • the current node When the target information gain rate is not greater than the preset threshold, the current node may be used as a leaf node, and the sample with the largest number of samples may be selected as the output of the leaf node.
  • the sample category includes “target application” and “non-target application”. When the output is “target application”, it means that the target application will be used within the preset duration. When the output is “non-target application”, This means that the target application will not be used within the preset duration.
  • the preset threshold can be set according to actual needs, such as 0.9, 0.8, and the like.
  • the preset gain rate threshold is 0.8, since the maximum information gain rate is greater than the preset threshold, feature 1 can be used as the division feature.
  • the preset threshold is 1, then the maximum information gain rate is less than the preset threshold.
  • the current node may be used as a leaf node.
  • Operation 504 dividing the target sample set according to the dividing feature, and generating at least one sub-sample set.
  • the electronic device classifies the samples according to the division features in various ways.
  • the sample set may be divided based on the feature values of the divided features.
  • the electronic device may also acquire feature values of the feature set in the target sample set; and divide the target sample set according to the feature value.
  • an electronic device may divide a sample with the same feature value in a sample set into the same subsample set.
  • the feature values of the divided features include: 0, 1, 2, then, at this time, the samples whose feature values are 0 can be classified into one class, and the samples with the feature value 1 are classified into one class, and the feature values are The samples of 2 are classified into one category.
  • Operation 505 removing the dividing feature of the sample in each sub-sample set; generating a child node of the current node, and removing the sub-sample set after dividing the feature as the node information of the child node.
  • Operation 506 determining whether the child node satisfies the preset classification termination condition; when satisfied, performing operation 507, when not satisfied, updating the target sample set to the subsample set after removing the division feature, and returning to performing operation 502.
  • the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
  • the electronic device may use the child node as a leaf node, that is, stop the sample set classification of the child node, and set the output of the leaf node based on the category of the sample in the removed sub-sample set.
  • the output of a leaf node based on the category of the sample. For example, the category with the largest number of samples in the sample set can be removed as the output of the leaf node.
  • the preset classification termination condition may be set according to actual requirements.
  • the electronic device uses the current child node as a leaf node, and stops classifying the sample set corresponding to the child node;
  • the preset classification termination condition may include: whether the number of categories of the samples in the removed sub-sample set of the child node is a preset number, and when yes, determining that the child node meets the preset classification termination condition.
  • a decision tree model of the target application can be constructed, so that it is predicted according to the decision tree model whether the target application will be used within a preset duration.
  • sample set D For example, for sample set D ⁇ sample 1, sample 2...sample i...sample n ⁇ , where the sample includes several features A.
  • the current node acts as a leaf node, and the sample category with the largest number of samples is selected as the output of the leaf node.
  • the division feature A g in the subsample sets D1 and D2 is removed, that is, AA g .
  • the child nodes d 1 and d 2 of the root node d are generated with reference to FIG. 6A, and the sub-sample set D 1 is taken as the node information of the child node d 1 and the sub-sample set D2 is taken as the node information of the child node d2.
  • the above-mentioned sub-sample set corresponding to the child node is continued to be classified according to the information gain classification method.
  • the child node d 2 can be used as an example to calculate the relative features of the A 2 sample set.
  • the maximum information gain rate g R (D, A) max is selected, when the maximum information gain rate g R (D, A) max is greater than the preset threshold ⁇
  • the feature corresponding to the information gain rate g R (D, A) may be selected as a division feature A g (such as feature Ai+1), and D 2 is divided into several sub-sample sets based on the division feature A g , such as D 2 Divided into subsample sets D 21 , D 22 , D 23 , and then the divided features A g in the subsample sets D 21 , D 22 , D 23 are removed, and the child nodes d 21 , d 22 of the current node d 2 are generated, d 23 , the sample sets D 21 , D 22 , and D 23 after the division feature A g are removed as the node information of the child nodes d 21 , d 22 , and d 23 , respectively.
  • the above-mentioned information gain rate classification based manner can be used to construct a decision tree as shown in FIG. 6B, and the output of the leaf node of the decision tree includes using the target application within a preset duration or at a preset duration.
  • the target application will not be used within.
  • the output results "yes” and “no” can correspond to "target application” and “non-target application”, which means “the target application will be used within the preset duration” and "will not be used within the preset duration” Target application.”
  • the feature values of the corresponding divided features may be marked on the path between the nodes. For example, in the above process based on information gain classification, the feature values of the corresponding divided features may be marked on the path of the current node and its child nodes.
  • the feature values of the partition feature A g include: 0, 1 may mark 1 on the path between d 2 and d, mark 0 on the path between d 1 and d, and so on, at each division Then, the corresponding division feature value such as 0 or 1 can be marked on the path of the current node and its child nodes, and the decision tree as shown in FIG. 6C can be obtained.
  • the output results "yes” and “no” can correspond to "target application” and "non-target application", which means “the target application will be used within the preset duration” and “will not be within the preset duration" Use the target app.”
  • the information gain rate of the feature acquired for the target sample set classification includes:
  • Operation 702 obtaining an information gain of the feature classification for the target sample set.
  • the information gain represents the degree of uncertainty in the information of a class of a feature ("target application” or “non-target application”).
  • Operation 704 acquiring split information of the feature classification for the target sample set.
  • the split information is used to measure the breadth and uniformity of the feature split data (such as the sample set), and the split information can be the entropy of the feature.
  • Operation 706 acquiring an information gain rate of the feature classification for the target sample set according to the information gain and the split information.
  • the information gain rate can be the ratio of the information gain of the feature to the sample set classification and the split information of the feature to the sample classification.
  • the information gain rate can be obtained by dividing the obtained information gain by the corresponding split information.
  • the information gain of the feature classification for the target sample set is also the difference between empirical entropy and conditional entropy.
  • the electronic device can obtain the empirical entropy of the target sample classification; acquire the conditional entropy of the feature for the classification result of the target sample set; and obtain the information gain of the feature for the target sample set classification according to the conditional entropy and the empirical entropy.
  • the electronic device can obtain the first probability that the positive sample appears in the sample set and the second probability that the negative sample appears in the sample set, the positive sample is the sample whose sample category is “target application”, and the negative sample is the sample category is “non- A sample of the target application; the empirical entropy of the sample is obtained from the first probability and the second probability.
  • the sample includes a multi-dimensional feature, such as feature A.
  • the information gain rate of feature A for sample classification can be obtained by the following formula:
  • g R (D, A) is the information gain rate of feature A for sample set D classification
  • g(D, A) is the information gain of feature A for sample classification
  • H A (D) is the split information of feature A, That is, the entropy of feature A.
  • H(D) is the empirical entropy of the sample set D classification
  • A) is the conditional entropy of the feature A for the sample set D classification.
  • the sample size of the sample category is "target application” is j
  • the information gain is the difference between the information of the decision tree before and after the attribute selection.
  • the empirical entropy H(D) of the sample classification is:
  • the electronic device may divide the sample set into several sub-sample sets according to the feature A, and then obtain the information entropy of each sub-sample set classification, and the probability that each feature value of the feature A appears in the sample set, According to the information entropy and the probability, the divided information entropy, that is, the conditional entropy of the feature A i for the sample set classification result can be obtained.
  • conditional entropy of the sample feature A for the sample set D classification result can be calculated by the following formula:
  • n is the number of values of the feature A, that is, the number of feature value types.
  • p i is the probability that the sample whose A eigenvalue is the ith value appears in the sample set D
  • a i is the ith value of A.
  • the A eigenvalues of the samples in the subsample set D i are all the ith values.
  • d, e are positive integers and less than n.
  • conditional entropy of feature A for the classification result of sample set D is:
  • A) p 1 H(D
  • A A 1 )+p 2 H(D
  • A A 2 )+p 3 H(D
  • A A 3 )
  • a 1 ) is the information entropy of the subsample set D 1 classification, that is, the empirical entropy, which can be calculated by the above formula of empirical entropy.
  • the information gain of the feature A for the sample set D classification can be calculated, for example, by The formula is calculated:
  • the information gain of the feature A for the sample set D classification is: the difference between the empirical entropy H(D) and the conditional entropy H(D
  • the split information of the feature classification for the sample set is the entropy of the feature.
  • the probability of the distribution of the features can be obtained based on the probability of distribution of the samples in the target sample set.
  • H A (D) can be obtained by the following formula:
  • D i is a sample set in which the feature set D of the sample set D is the i-th kind.
  • the method before freezing the target application, the method further includes: detecting whether the target application belongs to the whitelist application, and if so, freezing the target application; otherwise, performing freezing on the target application.
  • detecting whether the target application belongs to the whitelist application may be performed in any process before the target application is frozen.
  • the whitelist of the freeze-free application is preset in the electronic device, and the application in the whitelist can be customized for the user, or can be set as the system default.
  • the whitelist records application information of an application that can be freed from freezing, such as an application identifier of a recordable application.
  • FIG. 8 another application processing method is provided, the method comprising:
  • Operation 801 Acquire second preset feature data of each feature as a sample, and generate a sample set.
  • the acquired features may include a plurality of features, as shown in Table 1 below, for the 14 dimensions acquired by the electronic device.
  • the number of feature information included in one sample may be more than the number of information shown in Table 1, or may be less than the number of information shown in Table 1, and the specific feature information may also be as shown in Table 1. Different, it is not specifically limited herein.
  • the electronic device may acquire the feature information of the plurality of features described above as a sample according to a preset frequency in the latest time period.
  • the multi-dimensional feature data collected at one time constitutes one sample, and multiple samples collected multiple times constitute a sample set.
  • the electronic device may bury a point in the preset path of the system, and when detecting that an application is activated, record the feature data of the relevant feature and the application identifier of the application at the startup time of the application, and identify the application identifier. Associated with the recorded feature data.
  • the electronic device may mark each sample in the sample set to obtain a sample label of each sample, and the sample label may be an application identifier of the corresponding application, or an application category to which the corresponding application belongs.
  • the sample tag may be classified into a "target application” or a “non-target application” with respect to the target application to be detected, or may be classified into "the same application type as the target application” or “different from the application type of the target application”. .
  • Operation 802 when the data volume of the sample set exceeds a preset threshold, using the sample set as the node information of the root node of the decision tree; determining the node information of the root node as the current target sample set to be classified.
  • the sample set of the root node is determined as the target sample set to be classified currently. For example, referring to FIG. 6A, for the sample set D ⁇ sample 1, sample 2, ... sample i ... sample n ⁇ , the electronic device can be made into the root node d of the decision tree, and the sample set D is taken as the node of the root node d information.
  • Operation 803 obtaining an information gain rate of the feature classification for the target sample set, and determining a maximum information gain rate from the information gain rate.
  • it may first pass the formula H(D
  • A) p 1 H(D
  • A A 1 )+p 2 H(D
  • A A 2 )+p 3 H(D
  • A A 3 ) Calculate the conditional entropy H(D
  • Operation 804 detecting whether the maximum information gain rate is greater than a preset threshold, and when the maximum information gain rate is greater than the preset threshold, performing operation 805; otherwise, performing operation 806.
  • the electronic device can determine whether the maximum information gain g R (D, A) max is greater than a preset threshold ⁇ , which can be set according to actual needs.
  • the sample corresponding to the maximum information gain rate is selected as the partitioning feature, and the target sample set is divided according to the partitioning feature to generate at least one subsample set.
  • the current node is taken as a leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
  • the electronic device may select the feature A g as the dividing feature.
  • the electronic device may divide the sample set into several sub-sample sets according to the number of feature values of the divided features, and the number of the sub-sample sets is the same as the number of feature values. For example, the electronic device may divide the samples in the sample set with the same feature value into the same subsample set.
  • the feature values of the divided features include: 0, 1, 2, then, at this time, the samples whose feature values are 0 can be classified into one class, and the samples with the feature value 1 are classified into one class, and the feature values are The samples of 2 are classified into one category.
  • the sample set D can be divided into D 1 ⁇ sample 1, sample 2, ... sample k ⁇ and D 2 ⁇ sample k+1 ... sample n ⁇ . Then, a sub-division of sample sets features D 1 and D 2 A g may be removed, i.e., AA g.
  • one subsample set corresponds to one child node.
  • the test map 6A generates the child nodes d1 and d2 of the root node d, and uses the subsample set D 1 as the node information of the child node d 1 and the subsample set D 2 as the node information of the child node d 2 .
  • the electronic device may further set the divided feature values corresponding to the child nodes on the path of the child node and the current node, so as to facilitate subsequent prediction whether the application is used, refer to FIG. 6C.
  • operation 808 it is determined whether the number of categories of the sample in the subsample set after removing the partition feature corresponding to the child node is a preset number, and if yes, performing operation 809; otherwise, updating the target sample set to the subsample after removing the partition feature Set and return to perform operation 803.
  • the electronic device may continue to classify the sub-sample set corresponding to the child node by using the above-mentioned information gain classification method, for example, the child node d 2 may be used as an example to calculate the A 2 sample set.
  • the information gain rate g R (D, A) of each feature relative to the sample classification, the maximum information gain rate g R (D, A) max is selected, when the maximum information gain rate g R (D, A) max is greater than the preset For the threshold ⁇ , the feature corresponding to the information gain rate g R (D, A) may be selected as the partitioning feature A g (such as the feature A i+1 ), and the D2 is divided into several sub-sample sets based on the partitioning feature Ag, if D2 is divided into subsample sets D 21 , D 22 , D 23 , and then the partition features A g in the subsample sets D 21 , D 22 , D 23 are removed, and the child nodes d 21 , d 22 of the current node d 2 are generated. And d 23 , the sample sets D 21 , D 22 , and D 23 after the division feature A g are removed as the node information of the child nodes d 21 , d 22 , and
  • the electronic device may use the category of the sample in the subsample set as the output of the leaf node. If, after the removal, the subsample set has only the sample of the category "target application”, then the electronic device can use the "target application” as the output of the leaf node.
  • the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
  • the electronic device may use the sample category with the largest number of samples in the sub-sample set D 1 as the leaf node. Output.
  • the maximum number of samples "target application” the electronic device may be an output of leaf nodes d 1 "target application” as.
  • Operation 810 acquiring first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time.
  • the electronic device can acquire the feature data of the feature at the predicted time when the time at which the target application needs to be predicted is used.
  • Operation 811 obtaining a decision tree model for predicting whether the user will use the target application within a preset duration, and the starting time of the preset duration is the predicted time.
  • Operation 812 the first feature data is used as an input of the decision tree model, and the prediction result is output.
  • the operation 813 is performed; otherwise, the operation 815 is performed.
  • the electronic device can obtain a pre-built decision tree model, and use the first feature data as an input of the model to obtain a corresponding output result.
  • operation 813 it is detected whether the target application belongs to the whitelist application.
  • operation 814 is performed.
  • operation 815 is performed.
  • Operation 814 freeing the target application from freezing.
  • Operation 815 freezing the target application.
  • the platform freeze management module 224 may initiate a freeze operation on the target application to perform resources for the target application. Restrictions, such as the CPU limit sleep mode, CPU freeze sleep mode or process deep freeze mode, etc., can freeze the target application.
  • the application processing method described above by constructing a decision tree model for predicting whether the target application is within a preset duration, and acquiring first feature data of each feature and a decision tree model of the target application, the first feature
  • the data is used as an input of the decision tree model to obtain whether the user output by the decision tree model uses the prediction result of the target application within a preset duration, when the prediction result is that the target application is not used within the preset duration , the target application is frozen to limit the target application's occupation of resources. Since it is necessary to consume a certain amount of system resources when freezing the application, whether the target application is used within the preset duration by performing the prediction, and freezing when not in use, thereby reducing the user to freeze after the target application is frozen.
  • the application is used within the preset duration, and the application needs to be thawed, which causes unnecessary freezing operations, improves the accuracy of freezing the target application, and thus improves the effectiveness of releasing system resources.
  • an application processing apparatus which includes a feature data acquisition module 902, a decision tree model acquisition module 904, a prediction module 906, and an application processing module 908.
  • the feature data obtaining module 902 is configured to acquire first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time;
  • the decision tree model obtaining module 904 is configured to obtain whether the user is predicted to be in the The decision tree model of the target application is used within the preset duration, and the starting time of the preset duration is the predicted time;
  • the prediction module 906 is configured to use the first feature data as an input of the decision tree model, and output the predicted result;
  • the application processing module 908 The target application is frozen when the predicted result is that the target application will not be used within the preset duration.
  • FIG. 10 another application processing device is provided as shown in FIG. 10, the device further comprising:
  • the decision tree construction module 910 is configured to acquire the second feature data of each feature as a sample, and generate a sample set, where the second feature data is feature data of the corresponding feature when the reference application is started before the predicted time, and the reference
  • the application includes a target application; when the data volume of the sample set exceeds a preset threshold, the sample set is sample-classified according to the information gain rate of the feature classification for the sample set, and the generated sample is used to predict whether the user will use the target application within the preset duration.
  • the decision tree construction module 910 is further configured to use the sample set as the node information of the root node of the decision tree; determine the node information of the root node as the target sample set to be classified; and acquire the feature for the target sample set.
  • Information gain rate according to the information gain rate, the sample is selected from the target sample set as a partition feature; the target sample set is divided according to the partition feature to generate at least one subsample set; the partition feature of each subsample set is removed; and the current node is generated.
  • a child node and removing the subsample set after dividing the feature as the node information of the child node; determining whether the child node satisfies the preset classification termination condition; when the child node does not satisfy the preset classification termination condition, updating the target sample set to The sub-sample set after the feature is removed is removed, and the information gain rate of the acquired feature classification for the target sample set is returned.
  • the child node satisfies the preset classification termination condition
  • the child node is used as the leaf node, and the sub-node is removed according to the de-divided feature.
  • the category of the sample set sets the output of the leaf node.
  • the decision tree construction module 910 is further configured to determine a maximum information gain rate from the information gain rate; when the maximum information gain rate is greater than a preset threshold, select a sample corresponding to the maximum information gain rate as the partition feature. When the maximum information gain rate is not greater than the preset threshold, the current node is taken as the leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
  • the decision tree construction module 910 is further configured to determine whether the number of categories of the sample in the subsample set after the partition feature is removed by the child node is a preset number; and the subsample set after the child node corresponding to remove the partition feature When the number of categories of the sample is a preset number, it is determined that the child node satisfies the preset classification termination condition.
  • the decision tree construction module 910 is further configured to acquire an information gain of the feature classification for the target sample set; acquire split information of the feature classification for the target sample set; and classify the target sample set according to the information gain and the split information acquisition feature. Information gain rate.
  • the decision tree building module 910 is also used to pass Calculating the information gain rate of the feature classification for the target sample set; where D represents the sample set, g(D, A) is the information gain of feature A for the sample set D classification, and H A (D) is the split information of feature A, g R (D, A) is the information gain rate of feature A for sample set D; g(D, A) is passed Calculated; where H(D) is the empirical entropy of the sample set D classification, H(D
  • yet another application processing device is provided, the device further comprising:
  • the application detection module 912 is configured to detect whether the target application belongs to a whitelist application.
  • the application processing module 908 is further configured to freeze the target application when the prediction result is that the target application is not used within the preset duration; when the prediction result is that the target application is used within the preset duration, or the target application belongs to white When the list is applied, the target application is free from freezing.
  • each module in the application processing device is for illustrative purposes only. In other embodiments, the application processing device may be divided into different modules as needed to complete all or part of the functions of the application processing device.
  • the various modules in the application processing device described above may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the electronic device, or may be stored in a memory in the electronic device in a software format, so that the processor calls to perform operations corresponding to the above modules.
  • each module in the application processing apparatus may be in the form of a computer program.
  • the computer program can run on an electronic device such as a terminal or a server.
  • the program module of the computer program can be stored on a memory of the electronic device.
  • the computer program is executed by the processor, the operation of the application processing method described in the embodiment of the present application is implemented.
  • modules in the application processing device described above may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules may be embedded in the hardware in the processor or in the memory in the server, or may be stored in the memory in the server, so that the processor calls the corresponding operations of the above modules.
  • the terms "module” and the like are intended to mean a computer-related entity, which may be hardware, a combination of hardware and software, software, or software in execution.
  • a module can be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
  • an application running on a server and a server can be a module.
  • One or more modules can reside within a process and/or a thread of execution, and a module can be located in a computer and/or distributed between two or more computers.
  • an electronic device including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the application processing provided by the above embodiments is implemented when the processor executes the computer program The operation of the method.
  • a computer readable storage medium having stored thereon a computer program for performing application processing as described in various embodiments of the present application when executed by a processor The operation of the method.
  • a computer program product comprising instructions, when executed on a computer, causes the computer to perform the application processing methods described in the various embodiments of the present application.
  • the embodiment of the present application also provides a computer device. As shown in FIG. 12, for the convenience of description, only the parts related to the embodiments of the present application are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment of the present application.
  • the computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking a computer device as a mobile phone as an example. :
  • FIG. 12 is a block diagram showing a part of a structure of a mobile phone related to a computer device according to an embodiment of the present application.
  • the mobile phone includes: a radio frequency (RF) circuit 1210, a memory 1220, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a wireless fidelity (WiFi) module 1270, and a processor 1280. And power supply 1290 and other components.
  • RF radio frequency
  • the RF circuit 1210 can be used for receiving and transmitting information during the transmission and reception of information or during the call.
  • the downlink information of the base station can be received and processed by the processor 1280.
  • the uplink data can also be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • RF circuitry 1210 can also communicate with the network and other devices via wireless communication.
  • the above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General Pack
  • the memory 1220 can be used to store software programs and modules, and the processor 1280 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 1220.
  • the memory 1220 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as an application of a sound playing function, an application of an image playing function, etc.);
  • the data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone.
  • memory 1220 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.
  • the input unit 1230 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset 1200.
  • the input unit 1230 may include a touch panel 1231 and other input devices 1232.
  • the touch panel 1231 which may also be referred to as a touch screen, can collect touch operations on or near the user (such as a user using a finger, a stylus, or the like on the touch panel 1231 or near the touch panel 1231. Operation) and drive the corresponding connection device according to a preset program.
  • the touch panel 1231 may include two parts of a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 1280 is provided and can receive commands from the processor 1280 and execute them.
  • the touch panel 1231 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 1230 may also include other input devices 1232.
  • other input devices 1232 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.).
  • the display unit 1240 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 1240 may include a display panel 1241.
  • the display panel 1241 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 1231 can cover the display panel 1241. When the touch panel 1231 detects a touch operation thereon or nearby, the touch panel 1231 transmits to the processor 1280 to determine the type of the touch event, and then the processor 1280 is The type of touch event provides a corresponding visual output on display panel 1241.
  • the touch panel 1231 and the display panel 1241 are used as two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 1231 and the display panel 1241 may be integrated. Realize the input and output functions of the phone.
  • the handset 1200 can also include at least one type of sensor 1250, 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 1241 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1241 and/or when the mobile phone moves to the ear. Or backlight.
  • the motion sensor may include an acceleration sensor, and the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
  • the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
  • Audio circuitry 1260, speaker 1261, and microphone 1262 can provide an audio interface between the user and the handset.
  • the audio circuit 1260 can transmit the converted electrical data of the received audio data to the speaker 1261, and convert it into a sound signal output by the speaker 1261; on the other hand, the microphone 1262 converts the collected sound signal into an electrical signal, by the audio circuit 1260. After receiving, it is converted into audio data, and then processed by the audio data output processor 1280, transmitted to another mobile phone via the RF circuit 1210, or outputted to the memory 1220 for subsequent processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone through the WiFi module 1270 can help users to send and receive e-mail, browse the web and access streaming media, etc. It provides users with wireless broadband Internet access.
  • FIG. 12 shows the WiFi module 1270, it will be understood that it does not belong to the essential configuration of the handset 1200 and may be omitted as needed.
  • the processor 1280 is a control center for the handset that connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 1220, and invoking data stored in the memory 1220, The phone's various functions and processing data, so that the overall monitoring of the phone.
  • processor 1280 can include one or more processing units.
  • the processor 1280 can integrate an application processor and a modem, wherein the application processor primarily processes an operating system, a user interface, an application, etc.; the modem primarily processes wireless communications. It will be appreciated that the above described modem may also not be integrated into the processor 1280.
  • the processor 1280 can integrate an application processor and a baseband processor, and the baseband processor and other peripheral chips can form a modem.
  • the handset 1200 also includes a power source 1290 (such as a battery) that powers the various components.
  • the power source can be logically coupled to the processor 1280 via a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the handset 1200 can also include a camera, a Bluetooth module, and the like.
  • the processor included in the mobile phone implements the application processing method described above when executing a computer program stored in the memory.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM), which acts as an external cache.
  • RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM Link (Synchlink) DRAM
  • SLDRAM Memory Bus
  • Rambus Direct RAM
  • RDRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

An application processing method, comprising: acquiring first feature data of each feature, the first feature data being feature data of a corresponding feature during a moment of prediction; acquiring a decision tree model for use in predicting whether a user will use a target application during a preset time period; using the first feature data as an input for the decision tree model, and outputting the prediction result; when the prediction result is that the user will not use the target application during the preset time period, freezing the target application.

Description

应用处理方法、电子设备、计算机可读存储介质Application processing method, electronic device, computer readable storage medium
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年12月29日提交中国专利局、申请号为2017114844409、发明名称为“应用处理方法和装置、电子设备、计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on Dec. 29, 2017, the Chinese Patent Application No. 2017114844409, entitled "Application Processing Method and Apparatus, Electronic Apparatus, Computer Readable Storage Medium", the entire contents of which are hereby incorporated by reference. This is incorporated herein by reference.
技术领域Technical field
本申请涉及数据处理领域,特别是涉及一种应用处理方法、电子设备、计算机可读存储介质。The present application relates to the field of data processing, and in particular, to an application processing method, an electronic device, and a computer readable storage medium.
背景技术Background technique
随着移动通信技术的发展,移动操作系统中都提供了对后台应用进行资源限制的方法。传统的操作系统中,当系统资源使用率过高时,会对部分的后台应用进行强制退出处理,以回收一些资源给前台应用使用。With the development of mobile communication technologies, mobile operating systems provide a method for resource limitation of background applications. In the traditional operating system, when the system resource usage rate is too high, part of the background application is forced to exit processing to recover some resources for the foreground application.
针对是否要对相应的后台应用进行强制退出,传统方法是通过按照每个后台应用在后台长驻的时长,应用使用频率、使用时长等因素,选取后台长驻的时长较长、应用使用频率较低或使用时长较短的后台应用,对选取的后台应用进行强制退出。针对传统的方法,还是会存在相应的后台应用刚被查杀不久,短时间内用户又要使用该应用,因而系统需要再次加载回收后的资源,导致回收的准确性不高。The traditional method is to force the exit of the corresponding background application. The traditional method is to select the length of the background in the background, the frequency of use, the duration of the application, etc., and select the longer duration of the background station and the application frequency. A background application that is low or has a short duration, forcibly exits the selected background application. For the traditional method, there will still be a corresponding background application that has just been checked and killed. In a short time, the user has to use the application again, so the system needs to load the recovered resources again, resulting in low accuracy of recycling.
发明内容Summary of the invention
根据本申请的各种实施例提供一种应用处理方法、电子设备、计算机可读存储介质。An application processing method, an electronic device, and a computer readable storage medium are provided according to various embodiments of the present application.
一种应用处理方法,包括:获取每个特征的第一特征数据,所述第一特征数据为对应特征在预测时刻下的特征数据;获取用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,所述预设时长的起始时刻为预测时刻;将所述第一特征数据作为所述决策树模型的输入,输出预测结果;及当所述预测结果为不会在预设时长之内使用所述目标应用时,对所述目标应用进行冻结。An application processing method includes: acquiring first feature data of each feature, wherein the first feature data is feature data of a corresponding feature at a predicted time; and acquiring is used to predict whether the user will use the preset time length a decision tree model of the target application, the start time of the preset duration is a predicted time; the first feature data is used as an input of the decision tree model, and the predicted result is output; and when the predicted result is not The target application is frozen when the target application is used within a preset duration.
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下操作:An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following operations:
获取每个特征的第一特征数据,所述第一特征数据为对应特征在预测时刻下的特征数据;获取用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,所述预设时长的起始时刻为预测时刻;将所述第一特征数据作为所述决策树模型的输入,输出预测结果;及当所述预测结果为不会在预设时长之内使用所述目标应用时,对所述目标应用进行冻结。Acquiring first feature data of each feature, the first feature data is feature data of the corresponding feature at the predicted time; acquiring a decision tree model for predicting whether the user will use the target application within a preset duration, The starting time of the preset duration is a predicted time; the first feature data is used as an input of the decision tree model, and the predicted result is output; and when the predicted result is not used within a preset duration When the target application is described, the target application is frozen.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行以下操作:A computer readable storage medium having stored thereon a computer program that is executed by a processor to:
获取每个特征的第一特征数据,所述第一特征数据为对应特征在预测时刻下的特征数据;获取用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,所述预设时长的起始时刻为预测时刻;将所述第一特征数据作为所述决策树模型的输入,输出预测结果;及当所述预测结果为不会在预设时长之内使用所述目标应用时,对所述目标应用进行冻结。Acquiring first feature data of each feature, the first feature data is feature data of the corresponding feature at the predicted time; acquiring a decision tree model for predicting whether the user will use the target application within a preset duration, The starting time of the preset duration is a predicted time; the first feature data is used as an input of the decision tree model, and the predicted result is output; and when the predicted result is not used within a preset duration When the target application is described, the target application is frozen.
本申请实施例,通过预先设置了目标应用的决策树模型,并获取每个特征的第一特征数据以及该目标应用的决策树模型,将该第一特征数据作为决策树模型的输入,以得到决策树模型所输出的用户是否会在预设时长之内使用该目标应用的预测结果,当该预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结,以限制目标应用对资源的占用,提高了对目标应用进行冻结的精准性,进而也提高了对系统资源释放的有效性。In the embodiment of the present application, the decision tree model of the target application is preset, and the first feature data of each feature and the decision tree model of the target application are obtained, and the first feature data is used as an input of the decision tree model to obtain Whether the user output by the decision tree model uses the prediction result of the target application within a preset duration, and when the prediction result is that the target application is not used within the preset duration, the target application is frozen to limit the target. The application's occupation of resources improves the accuracy of freezing the target application, which in turn increases the effectiveness of system resource release.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features, objects, and advantages of the invention will be apparent from the description and appended claims.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为一个实施例中电子设备的内部结构示意图。FIG. 1 is a schematic diagram showing the internal structure of an electronic device in an embodiment.
图2为一个实施例中电子设备中的系统的部分框架示意图。2 is a partial block diagram of a system in an electronic device in an embodiment.
图3为一个实施例中应用处理方法的应用环境图。FIG. 3 is an application environment diagram of an application processing method in an embodiment.
图4为一个实施例中应用处理方法的流程图。4 is a flow chart of an application processing method in one embodiment.
图5为一个实施例中根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用目标应用的决策树模型的流程图。FIG. 5 is a flow chart of sample classification of a sample set according to an information gain rate classified by a feature according to a feature in one embodiment, and a decision tree model for predicting whether a user will use a target application within a preset duration.
图6A为一个实施例中决策树的示意图。Figure 6A is a schematic diagram of a decision tree in one embodiment.
图6B为另一个实施例中一种决策树的示意图。Figure 6B is a schematic diagram of a decision tree in another embodiment.
图6C为又一个实施例中决策树的示意图。Figure 6C is a schematic diagram of a decision tree in yet another embodiment.
图7为一个实施例中获取特征对于目标样本集分类的信息增益率的流程图。7 is a flow diagram of obtaining an information gain rate for a feature classification for a target sample set in one embodiment.
图8为另一个实施例中应用处理方法的流程图。Figure 8 is a flow chart of an application processing method in another embodiment.
图9为一个实施例中应用处理装置的结构框图。Figure 9 is a block diagram showing the structure of an application processing device in an embodiment.
图10为另一个实施例中应用处理装置的结构框图。Figure 10 is a block diagram showing the structure of an application processing device in another embodiment.
图11为又一个实施例中应用处理装置的结构框图。Figure 11 is a block diagram showing the structure of an application processing device in still another embodiment.
图12为一个实施例中手机的部分结构的框图。Figure 12 is a block diagram showing a portion of the structure of a handset in an embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
可以理解,本发明所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本发明的范围的情况下,可以将第一特征数据称为第二特征数据,且类似地,可将第二特征数据称为第一特征数据。第一特征数据和第二特征数据两者都是特征数据,但其不是同一特征数据。It will be understood that the terms "first", "second" and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, the first feature data may be referred to as second feature data without departing from the scope of the present invention, and similarly, the second feature data may be referred to as first feature data. Both the first feature data and the second feature data are feature data, but they are not the same feature data.
在一个实施例中,如图1所示,提供了一种电子设备的内部结构示意图。该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的应用处理方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统、数据库和计算机程序。该数据库中存储有用于实现以上各个实施例所提供的一种应用处理方法相关的数据,比如可存储有每个进程或应用的名称等信息。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种应用处理方法。内存储器为非易失性存储介质中的操作系统、数据库和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示第一进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。In one embodiment, as shown in FIG. 1, an internal structure diagram of an electronic device is provided. The electronic device includes a processor, memory, and display screen connected by a system bus. The processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory is used to store data, programs, and/or instruction codes, etc., and the memory stores at least one computer program, which can be executed by the processor to implement an application processing method suitable for an electronic device provided in the embodiments of the present application. The memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random storage memory (Random-Access-Memory, RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. Non-volatile storage media stores operating systems, databases, and computer programs. The database stores data related to an application processing method provided by the above various embodiments, for example, information such as the name of each process or application may be stored. The computer program can be executed by a processor for implementing an application processing method provided by various embodiments of the present application. The internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media. The display screen can be a touch screen, such as a capacitive screen or an electronic screen, for displaying interface information of an application corresponding to the first process, and can also be used for detecting a touch operation applied to the display screen, and generating corresponding instructions, such as before execution. Switching instructions for background applications, etc.
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该电子设备还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用于与外部的电子设备进行通信,比如可用于同服务器进行通信。再比如该电子设备上并不存在通过系统总线连接的显示器,或者可连接外部显示设备。A person skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may be It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements. For example, the electronic device further includes a network interface connected through a system bus, and the network interface may be an Ethernet card or a wireless network card, etc., for communicating with an external electronic device, for example, for communicating with a server. For example, there is no display connected through the system bus on the electronic device, or an external display device can be connected.
在一个实施例中,如图2所示,提供了一种电子设备的部分架构图。其中,该电子设备的架构系统中包括JAVA空间层210、本地框架层220以及内核(Kernel)空间层230。JAVA空间层210上可包含冻结管理 应用212,电子设备可通过该冻结管理应用212来实现对各个应用的冻结策略,对后台耗电的相关应用做冻结和解冻等管理操作。本地框架层220中包含资源优先级和限制管理模块222和平台冻结管理模块224。电子设备可通过资源优先级和限制管理模块222实时维护不同的应用处于不同优先级和不同资源的组织中,并根据上层的需求来调整应用程序的资源组别从而达到优化性能,节省功耗的作用。电子设备可通过平台冻结管理模块224将后台可以冻结的任务按照进入冻结时间的长短,分配到对应预设的不同层次的冻结层,可选地,该冻结层可包括三个,分别是:CPU限制睡眠模式、CPU冻结睡眠模式、进程深度冻结模式。其中,CPU限制睡眠模式是指对相关进程所占用的CPU资源进行限制,使相关进程占用较少的CPU资源,将空余的CPU资源向其它未被冻结的进程倾斜,限制了对CPU资源的占用,也相应限制了进程对网络资源以及I/O接口资源的占用;CPU冻结睡眠模式是指禁止相关进程使用CPU,而保留对内存的占用,当禁止使用CPU资源时,相应的网络资源以及I/O接口资源也被禁止使用;进程深度冻结模式是指除禁止使用CPU资源之外,进一步对相关进程所占用的内存资源进行回收,回收的内存可供其它进程使用。内核空间层230中包括UID管理模块231、Cgroup模块232、Binder管控模块233、进程内存回收模块234以及冻结超时退出模块235。其中,UID管理模块231用于实现基于应用的用户身份标识(User Identifier,UID)来管理第三方应用的资源或进行冻结。相比较于基于进程身份标识(Process Identifier,PID)来进行进程管控,通过UID更便于统一管理一个用户的应用的资源。Cgroup模块232用于提供一套完善的中央处理器(Central Processing Unit,CPU)、CPUSET、内存(memory)、输入/输出(input/output,I/O)和Net相关的资源限制机制。Binder管控模块233用于实现后台binder通信的优先级的控制。其中,本地框架层220的接口模块包含开发给上层的binder接口,上层的框架或者应用通过提供的binder接口来发送资源限制或者冻结的指令给资源优先级和限制管理模块222和平台冻结管理模块224。进程内存回收模块234用于实现进程深度冻结模式,这样能当某个第三方应用长期处于冻结状态的时候,会主要释放掉进程的文件区,从而达到节省内存的模块,也加快该应用在下次启动时的速度。冻结超时退出模块235用于解决出现冻结超时场景产生的异常。通过上述的架构,可实现本申请各个实施例中的应用处理方法。In one embodiment, as shown in FIG. 2, a partial architectural diagram of an electronic device is provided. The architecture of the electronic device includes a JAVA spatial layer 210, a local framework layer 220, and a kernel space layer 230. The JAVA spatial layer 210 can include a freeze management application 212, by which the electronic device can implement a freeze policy for each application, and perform freezing and thawing management operations on the related applications of the background power consumption. The resource priority and restriction management module 222 and the platform freeze management module 224 are included in the local framework layer 220. The electronic device can maintain different applications in different priorities and different resource organizations through the resource priority and limit management module 222, and adjust the resource group of the application according to the requirements of the upper layer to achieve optimized performance and save power. effect. The electronic device can allocate the tasks that can be frozen in the background to the frozen layer corresponding to the preset different levels according to the length of the entering freeze time through the platform freeze management module 224. Optionally, the frozen layer can include three, respectively: the CPU Limit sleep mode, CPU freeze sleep mode, process deep freeze mode. The CPU restricts the sleep mode to limit the CPU resources occupied by the related processes, so that the related processes occupy less CPU resources, and the free CPU resources are tilted to other unfrozen processes, thereby limiting the occupation of CPU resources. It also limits the occupation of network resources and I/O interface resources by the process; CPU freeze sleep mode refers to prohibiting related processes from using the CPU, while preserving the occupation of memory, when prohibiting the use of CPU resources, the corresponding network resources and I The /O interface resource is also forbidden; the process deep freeze mode means that in addition to prohibiting the use of CPU resources, the memory resources occupied by the related processes are further recovered, and the recovered memory can be used by other processes. The kernel space layer 230 includes a UID management module 231, a Cgroup module 232, a Binder management module 233, a process memory recovery module 234, and a freeze timeout exit module 235. The UID management module 231 is configured to implement an application-based User Identifier (UID) to manage resources of a third-party application or freeze. Compared with the Process Identifier (PID) for process management and control, it is easier to uniformly manage the resources of a user's application through UID. The Cgroup module 232 is used to provide a complete set of Central Processing Unit (CPU), CPUSET, memory, input/output (I/O), and Net related resource restriction mechanisms. The Binder management module 233 is used to implement the priority control of the background binder communication. The interface module of the local framework layer 220 includes a binder interface developed to the upper layer, and the upper layer framework or application sends a resource restriction or frozen instruction to the resource priority and restriction management module 222 and the platform freeze management module 224 through the provided binder interface. . The process memory recovery module 234 is configured to implement the process deep freeze mode, so that when a third-party application is in a frozen state for a long time, the file area of the process is mainly released, thereby saving the memory module and speeding up the application next time. The speed at startup. The freeze timeout exit module 235 is configured to resolve an exception generated by the freeze timeout scenario. Through the above architecture, the application processing method in various embodiments of the present application can be implemented.
在一个实施例中,如图3所示,为一个实施例中应用处理方法的应用场景示意图,电子设备可采集不同时间段下,用于体现用户行为习惯的预设特征的特征数据作为样本,形成样本集,根据特征对于样本分类的信息增益率对样本集进行样本分类,以构建出预测是否会在预设时长之内使用目标应用的决策树模型;然后将预测时刻下的预设特征的特征数据作为该决策树模型的输入,得到预测结果。当预测结果为当预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结,否则,不冻结目标应用。In an embodiment, as shown in FIG. 3, which is a schematic diagram of an application scenario in which an application processing method is used in an embodiment, an electronic device may collect feature data of a preset feature for embodying a user behavior habit as a sample under different time periods. Forming a sample set, classifying the sample set according to the information gain rate of the feature classification for the sample, to construct a decision tree model for predicting whether the target application will be used within a preset duration; and then predicting the preset feature at the moment The feature data is used as an input to the decision tree model to obtain a prediction result. When the prediction result is that the target application is not used within the preset duration when the prediction result is that the target application is not frozen, the target application is not frozen.
在一个实施例中,如图4所示,提供了一种应用处理方法,本实施例以该方法应用于如图1所示的电子设备为例进行说明。该方法包括:In an embodiment, as shown in FIG. 4, an application processing method is provided. The embodiment is applied to the electronic device shown in FIG. 1 as an example for description. The method includes:
操作402,获取每个特征的第一特征数据,第一特征数据为对应特征在预测时刻下的特征数据。Operation 402: Acquire first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time.
特征数据为用于体现用户对电子设备的应用的操作习惯的特征的数据。该特征可为电子设备的设备软硬件特征、设备使用状态、用户对应用操作时间时长等其中一种或多种维度。电子设备可以在系统的预设路径下埋点,按照预设的采样频率实时检测每个特征的特征数据。电子设备也可以在检测到启动了某一应用时,记录在该应用在启动时刻下,相关特征的特征数据以及该应用的应用标识,将该应用标识与记录的特征数据进行关联。The feature data is data for characterizing the operational habits of the user's application to the electronic device. The feature may be one or more dimensions of the device hardware and software features of the electronic device, the device usage state, and the user operation time duration. The electronic device can bury the point in the preset path of the system, and detect the feature data of each feature in real time according to the preset sampling frequency. The electronic device may also record the feature data of the relevant feature and the application identifier of the application at the startup time when the application is activated, and associate the application identifier with the recorded feature data.
可选地,该特征包括在记录对应数据时的当前时间段、当前日期类别、上一个前景应用的应用标识、上上一个前景应用的应用标识、当前无线保真WiFi(WIreless Fidelity)连接状态、连接的WiFi的WiFi标识、应用在后台停留的时长、应用在后台停留期间灭屏的时长、当前耳机的插拔状态、当前充电状态、当前电池电量、应用被切换的方式、应用的类别、应用切换到前台的次数等其中一种或多种特征。其中,日期类别可包括工作日和休息日,WiFi连接状态包括未连接WiFi和已连接WiFi,WiFi标识可为服务集标识SSID(Service Set Identifier)或基本服务集标识BSSID(Basic Service Set Identifier)等其中任意种可唯一标识WiFi的信息;应用的类别包括社交应用、支付应用、游戏应用、工具类应用等类别,应用的分类方式可包括多种,并不局限于此。应用切换表示应用从前台切换到后台或者从后台切换到前台,切换方式可包括直接根据应用的启动图标打开应用而形成的应用切换、点击应用的通知消息而形成的应 用切换、直接退出应用而形成的应用切换等。上一个前景应用表示在记录该特征的时刻,在上一次处于前台运行的应用,上上一个应用表示在记录该特征的时刻,上上一次处于前台运行的应用。Optionally, the feature includes a current time period when the corresponding data is recorded, a current date category, an application identifier of the previous foreground application, an application identifier of the previous foreground application, a current wireless fidelity WiFi (WIreless Fidelity) connection status, The WiFi ID of the connected WiFi, the duration of the application staying in the background, the duration of the application during the background pause, the current plug-in status of the headset, the current charging status, the current battery level, the way the application is switched, the category of the application, and the application One or more of the characteristics such as the number of times to switch to the foreground. The date category may include a working day and a rest day, and the WiFi connection status includes the unconnected WiFi and the connected WiFi, and the WiFi identifier may be a Service Set Identifier (SSID) or a Basic Service Set Identifier (BSSID). Any of the types of information that can uniquely identify the WiFi; the category of the application includes a social application, a payment application, a game application, a tool application, and the like, and the classification of the application may include multiple types, and is not limited thereto. The application switching means that the application switches from the foreground to the background or from the background to the foreground. The switching manner may include an application switching formed by directly opening an application according to an application startup icon, an application switching formed by clicking an application notification message, and directly exiting the application. Application switching, etc. The previous foreground application indicates the application that was running in the foreground at the moment when the feature was recorded. The previous application indicates the application that was last running in the foreground at the time of recording the feature.
第一特征数据是指在预测时刻下,对应特征的特征数据,当该特征涉及到应用时,则为目标应用、比如,第一特征数据可包括在预测时刻下的当前时间段、当前日期类别、上一个前景应用名字、上上一个前景应用名字、当前WiFi连接状态、连接的WiFi的WiFi标识、目标应用在后台停留的时长、目标应用在后台停留期间灭屏的时长、当前耳机的插拔状态、当前充电状态、当前电池电量、目标应用被切换的方式、目标应用的类别、目标应用切换到前台的次数等其中一种或多种特征。其中,预测时刻可为当前时刻。The first feature data refers to the feature data of the corresponding feature at the predicted time. When the feature relates to the application, the target application, for example, the first feature data may include the current time period and the current date category at the predicted time. , the previous foreground application name, the previous foreground application name, the current WiFi connection status, the WiFi identity of the connected WiFi, the duration of the target application staying in the background, the duration of the target application during the background pause, and the current headset plugging and unplugging One or more characteristics of the status, the current state of charge, the current battery level, the manner in which the target application is switched, the category of the target application, the number of times the target application switches to the foreground, and the like. The predicted time may be the current time.
在一个实施例中,电子设备可通过冻结管理应用212来来发起针对处于后台运行的一个或多个应用的冻结指令,该冻结指令可并根据该指令开始执行获取每个特征的第一特征数据。其中,电子设备可以在检测到可用资源低于预设阈值时,触发该应用冻结指令,或者可在检测到某一应用被切换到后台时,对该应用发起冻结指令。冻结指令所针对的应用即为目标应用。In one embodiment, the electronic device may initiate a freeze instruction for one or more applications running in the background by freezing the management application 212, and the freeze instruction may begin to acquire the first feature data of each feature according to the instruction. . The electronic device may trigger the application freeze instruction when detecting that the available resource is lower than a preset threshold, or may initiate a freeze instruction to the application when detecting that an application is switched to the background. The application for which the freeze instruction is directed is the target application.
操作404,获取用于预测用户是否会在预设时长之内使用目标应用的决策树模型;预设时长的起始时刻为预测时刻。 Operation 404, obtaining a decision tree model for predicting whether the user will use the target application within a preset duration; the starting time of the preset duration is the predicted time.
决策树模型为用于预测目标应用是否会在预设时长之内是否会被使用到的模型。预设时长的起始时刻为预测时刻,即预测目标应用是否会在从当前时刻起,在预设时长之内是否会被使用。预设时长可为任意合适的时长,可根据经验值而设置,比如可为1分钟、5分钟、10分钟或30分钟等。目标应用即为待遇测的应用,其中,该目标应用可为电子设备中,当前处于后台运行的一个或多个应用。The decision tree model is a model for predicting whether the target application will be used within the preset duration. The starting time of the preset duration is the predicted time, that is, whether the predicted target application will be used within the preset duration from the current time. The preset duration can be any suitable length of time, and can be set according to an empirical value, such as 1 minute, 5 minutes, 10 minutes, or 30 minutes. The target application is the application of the benefit measurement, wherein the target application may be one or more applications in the electronic device that are currently running in the background.
在一个实施例中,电子设备预设了与目标应用对应的决策树模型,并获取与目标应用对应的决策树模型,以预测该目标应用是否会在预设时长之内被用户使用到。针对不同的应用,可对应设置不同的决策树模型,比如,则可针对每个应用设置一个对应的决策树模型,或者针对每个类型的应用,设置对应的决策树模型。In one embodiment, the electronic device presets a decision tree model corresponding to the target application, and obtains a decision tree model corresponding to the target application to predict whether the target application will be used by the user within a preset duration. For different applications, different decision tree models can be set correspondingly. For example, a corresponding decision tree model can be set for each application, or a corresponding decision tree model can be set for each type of application.
操作406,将第一特征数据作为决策树模型的输入,输出预测结果。 Operation 406, the first feature data is used as an input of the decision tree model, and the prediction result is output.
电子设备可将采集到的各个特征在在预测时刻下的第一特征数据作为该决策树模型的数据,并运行该决策树模型,以得到决策树的输出结果。该数据结果即为预测结果。其中,预测结果包括目标应用不会在预设时长之内被使用到或者会在预设时长之内使用到。The electronic device may use the collected first feature data of the respective features at the predicted time as the data of the decision tree model, and run the decision tree model to obtain an output result of the decision tree. The result of this data is the predicted result. Among them, the prediction result includes that the target application will not be used within the preset duration or will be used within the preset duration.
操作408,当预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结。 Operation 408, when the predicted result is that the target application is not used within the preset duration, the target application is frozen.
当测到预测结果为不会在预设时长之内使用到时,电子设备可以对目标应用进行冻结。可选地,电子设备可以将预测结果发送至如图2中所示的平台冻结管理模块224,平台冻结管理模块224接收到不会在预设时长之内使用目标应用的预测结果时,可以对该目标应用发起冻结操作,进而对目标应用可使用的资源进行限制,比如采取CPU限制睡眠模式、CPU冻结睡眠模式或进程深度冻结模式等其中的任意一种模式对目标应用进行冻结。When the predicted result is that it is not used within the preset duration, the electronic device can freeze the target application. Optionally, the electronic device may send the prediction result to the platform freeze management module 224 as shown in FIG. 2, and when the platform freeze management module 224 receives the prediction result that does not use the target application within the preset duration, the The target application initiates a freeze operation, thereby limiting the resources that the target application can use, such as adopting any one of a CPU-limited sleep mode, a CPU freeze sleep mode, or a process deep freeze mode to freeze the target application.
上述的应用处理方法,通过预先设置了目标应用的决策树模型,并获取每个特征的第一特征数据以及该目标应用的决策树模型,将该第一特征数据作为决策树模型的输入,以得到决策树模型所输出的用户是否会在预设时长之内使用该目标应用的预测结果,当该预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结,以限制目标应用对资源的占用。由于对应用冻结时也需要消耗一定的系统资源,通过进行预测是否会在预设时长之内使用目标应用,在不使用时则进行冻结,从而降低在对目标应用进行冻结以后,用户又会在预设时长之内使用到该应用,而需要对该应用进行解冻,而造成多余的冻结操作,提高了对目标应用进行冻结的精准性,进而也提高了对系统资源释放的有效性。The application processing method described above, by setting a decision tree model of the target application in advance, and acquiring the first feature data of each feature and the decision tree model of the target application, using the first feature data as an input of the decision tree model, Whether the user output by the decision tree model uses the prediction result of the target application within a preset duration, and when the prediction result is that the target application is not used within the preset duration, the target application is frozen to limit The target application's occupation of resources. Since it is necessary to consume a certain amount of system resources when freezing the application, whether the target application is used within the preset duration by performing the prediction, and freezing when not in use, thereby reducing the user to freeze after the target application is frozen. The application is used within the preset duration, and the application needs to be thawed, which causes unnecessary freezing operations, improves the accuracy of freezing the target application, and thus improves the effectiveness of releasing system resources.
在一个实施例中,在操作402之前,还包括:获取预设的每个特征的第二特征数据作为样本,生成样本集,第二特征数据为在预测时刻之前,启动了参考应用时的对应特征的特征数据,参考应用包括目标应用;当样本集的数据量超过预设阈值时,根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用目标应用的决策树模型。In an embodiment, before the operation 402, the method further includes: acquiring preset second feature data of each feature as a sample, and generating a sample set, where the second feature data is a correspondence when the reference application is started before the predicted time Feature data of the feature, the reference application includes a target application; when the data volume of the sample set exceeds a preset threshold, the sample set is sample-classified according to the information gain rate of the feature classification for the sample set, and is generated for predicting whether the user is preset The decision tree model of the target application is used within the duration.
其中,第二特征数据为在预测时刻之前而记录的每个特征的特征数据,该第二特征数据与对应参考 应用的应用标识具有关联关系,即在该预测时刻之前,在检测到参考应用被启动时,则记录在启动时刻下,每个特征的特征数据(即第二特征数据),并将该第二特征数据与该参考应用的应用标识建立关联关系。The second feature data is feature data of each feature recorded before the predicted time, and the second feature data has an association relationship with the application identifier of the corresponding reference application, that is, before the predicted time, the reference application is detected At startup, the feature data of each feature (ie, the second feature data) is recorded at the startup time, and the second feature data is associated with the application identifier of the reference application.
电子设备可通过历史时间段,按照预设频率采集每个特征的第二特征数据,将每次记录到的第二特征作为样本,从而形成样本集。当积累的样本集的数据量超过预设阈值时,则开始根据所积累的样本集来构建各个需要预测的应用的决策树模型。历史时间段,例如可以是过去7天、10天;预设频率,例如可以是每10分钟采集一次、每半小时采集一次。可以理解的是,一次采集的多维特征数据构成一个样本,多次采集的多个样本构成样本集。The electronic device may collect the second feature data of each feature according to a preset frequency through a historical time period, and use the second feature recorded each time as a sample to form a sample set. When the amount of data of the accumulated sample set exceeds a preset threshold, then a decision tree model of each application requiring prediction is constructed based on the accumulated sample set. The historical time period may be, for example, the past 7 days or 10 days; the preset frequency may be, for example, collected every 10 minutes and collected every half hour. It can be understood that the multi-dimensional feature data collected at one time constitutes one sample, and multiple samples collected multiple times constitute a sample set.
在构成样本集之后,可以对样本集中的每个样本进行标记,标记样本的应用标识,得到每个样本的样本标签。对每个样本的标记即为对应关联的应用标识。由于针对的是目标应用,因而该样本标签可分类属于目标应用和非目标应用,也即样本类别包括“目标应用”和“非目标应用”。即将在该目标应用被启动时,所记录到的特征的第二特征数据的样本标签设置为“目标应用”,针对非目标应用被启动时,所记录到的特征的第二特征数据的样本标签设置为“非目标应用”。可选地,可以用数值“1”表示“目标应用”,用数值“0”表示“非目标应用”,反之亦可。After constituting the sample set, each sample in the sample set can be marked, the application identification of the sample is marked, and the sample label of each sample is obtained. The tag for each sample is the application ID of the corresponding association. Since the target application is targeted, the sample tag can be classified into a target application and a non-target application, that is, the sample category includes a "target application" and a "non-target application." When the target application is started, the sample tag of the second feature data of the recorded feature is set as the "target application", and the sample tag of the second feature data of the recorded feature is activated when the non-target application is started. Set to "non-target app". Alternatively, the value "1" may be used to indicate "target application", and the value "0" may be used to indicate "non-target application", and vice versa.
预设阈值可为预设的任意合适的数值,比如可为10000,即当记录到的样本数量超过10000时,则开始构建决策树模型。可选地,样本数量越大,则构建的决策树模型相对越准确。The preset threshold may be any suitable value preset, for example, may be 10000, that is, when the number of samples recorded exceeds 10000, the decision tree model is started. Alternatively, the larger the number of samples, the more accurate the decision tree model is constructed.
在一种实施例中,为便于样本分类,电子设备可以将特征数据中未用数值直接表示的特征信息用具体的数值量化出来,例如,针对当前WiFi连接状态这一特征,可用数值1表示已连接WiFi,用数值0表示未连接WiFi(反之亦可)。In an embodiment, to facilitate sample classification, the electronic device may quantize the feature information in the feature data that is not directly represented by the value by a specific value. For example, for the feature of the current WiFi connection state, the value 1 may be used to indicate that Connect WiFi, use the value 0 to indicate that WiFi is not connected (or vice versa).
本申请实施例可以基于特征对于样本集分类的信息增益率对样本集进行样本分类,以构建预测用户是否会在预设时长之内使用目标应用的决策树模型。比如,可以基于C4.5算法来构建决策树模型。The embodiment of the present application may perform sample classification on the sample set based on the information gain rate of the feature classification for the sample set to construct a decision tree model for predicting whether the user will use the target application within a preset duration. For example, a decision tree model can be constructed based on the C4.5 algorithm.
其中,决策树是一种依托决策而建立起来的一种树。在机器学习中,决策树是一种预测模型,代表的是一种对象属性与对象值之间的一种映射关系,每一个节点代表某个对象,树中的每一个分叉路径代表某个可能的属性值,而每一个叶子节点则对应从根节点到该叶子节点所经历的路径所表示的对象的值。决策树仅有单一输出,如果有多个输出,可以分别建立独立的决策树以处理不同的输出。Among them, the decision tree is a tree built on the basis of decision-making. In machine learning, a decision tree is a predictive model that represents a mapping between object attributes and object values. Each node represents an object, and each forked path in the tree represents a certain Possible attribute values, and each leaf node corresponds to the value of the object represented by the path from the root node to the leaf node. The decision tree has only a single output. If there are multiple outputs, separate decision trees can be created to handle different outputs.
其中,C4.5算法是决策树的一种,它是一系列用在机器学习和数据挖掘的分类问题中的算法,是由ID3改进后的一种重要算法。它的目标是监督学习:给定一个数据集,其中的每一个元组都能用一组属性值来描述,每一个元组属于一个互斥的类别中的某一类。C4.5的目标是通过学习,找到一个从属性值到类别的映射关系,并且这个映射能用于对新的类别未知的实体进行分类。Among them, the C4.5 algorithm is a kind of decision tree. It is a series of algorithms used in the classification problem of machine learning and data mining. It is an important algorithm improved by ID3. Its goal is to supervise learning: Given a data set, each of these tuples can be described by a set of attribute values, each of which belongs to a class in a mutually exclusive category. The goal of C4.5 is to find a mapping from attribute values to categories by learning, and this mapping can be used to classify entities with unknown new categories.
ID3(Iterative Dichotomiser 3,迭代二叉树3代)是基于奥卡姆剃刀原理的,即用尽量用较少的东西做更多的事。在信息论中,期望信息越小,那么信息增益就越大,从而纯度就越高。ID3算法的核心思想就是以信息增益来度量属性的选择,选择分裂后信息增益最大的属性进行分裂。该算法采用自顶向下的贪婪搜索遍历可能的决策空间。ID3 (Iterative Dichotomiser 3, iterative binary tree 3 generation) is based on the Occam razor principle, that is, to do more with as few things as possible. In information theory, the smaller the expected information, the greater the information gain and the higher the purity. The core idea of the ID3 algorithm is to measure the choice of attributes with information gain, and select the attribute with the largest information gain after splitting to split. The algorithm uses a top-down greedy search to traverse possible decision spaces.
本申请实施例中,信息增益率可以定义为:特征对于样本分类的信息增益、与特征对于样本分类的分裂信息之比。具体地的信息增益率获取方式参考下面的描述。In the embodiment of the present application, the information gain rate may be defined as the ratio of the information gain of the feature to the sample classification and the split information of the feature to the sample classification. The specific information gain rate acquisition method is described below.
信息增益是针对一个一个特征而言的,就是看一个特征t,系统有它和没有它时的信息量各是多少,两者的差值就是这个特征给系统带来的信息量,即信息增益。The information gain is for one feature. It is to look at a feature t. What is the amount of information when the system has it and without it? The difference between the two is the amount of information that the feature brings to the system, that is, the information gain. .
分裂信息用来衡量特征分裂数据(如样本集)的广度和均匀程度,该分裂信息可以为特征的熵。The split information is used to measure the breadth and uniformity of the feature split data (such as the sample set), and the split information can be the entropy of the feature.
在一个实施例中,如图5所示,根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用目标应用的决策树模型,包括:In one embodiment, as shown in FIG. 5, the sample set is sample-classified according to the information gain rate of the feature classification for the sample set, and a decision tree model for predicting whether the user will use the target application within a preset duration is generated. include:
操作501,将样本集作为决策树的根节点的节点信息;将根节点的节点信息确定为当前待分类的目标样本集。 Operation 501, the sample set is used as the node information of the root node of the decision tree; and the node information of the root node is determined as the target sample set to be classified currently.
即在开始构建的情况下,将该样本集作为当前待分类的目标样本集。样本集的分类包括“目标应用”和“非目标应用”。That is, in the case of starting construction, the sample set is taken as the target sample set to be classified currently. The classification of sample sets includes "target applications" and "non-target applications."
操作502,获取特征对于目标样本集分类的信息增益率。 Operation 502, obtaining an information gain rate of the feature classification for the target sample set.
操作503,根据信息增益率从目标样本集中选取样本作为划分特征。 Operation 503, selecting a sample from the target sample set as the division feature according to the information gain rate.
划分特征为根据各特征对于样本集分类的信息增益率从特征中选取的特征,用于对样本集分类。其中,根据信息增益率选取划分特征的方式有多种,比如为了提升样本分类的精确性,可以选取最大信息增益率对应的特征为划分特征。The partitioning feature is a feature selected from the features according to the information gain rate of each feature for the sample set classification, and is used to classify the sample set. Among them, there are various ways to select the feature according to the information gain rate. For example, in order to improve the accuracy of the sample classification, the feature corresponding to the maximum information gain rate may be selected as the division feature.
在一个实施例中,为了提升决策树模型的决策准确性,还可以设置一个增益率阈值;当最大的信息增益率大于该阈值时,电子设备选取该信息增益率对应的特征为划分特征。可从信息增益率中选取最大的目标信息增益率;判断目标信息增益率是否大于预设阈值;当目标信息增益率大于预设阈值时,则选取目标信息增益率对应的特征作为当前的划分特征。In an embodiment, in order to improve the decision accuracy of the decision tree model, a gain rate threshold may also be set; when the maximum information gain rate is greater than the threshold, the electronic device selects a feature corresponding to the information gain rate as a division feature. The maximum target information gain rate may be selected from the information gain rate; whether the target information gain rate is greater than a preset threshold; and when the target information gain rate is greater than the preset threshold, the feature corresponding to the target information gain rate is selected as the current division feature. .
当目标信息增益率不大于预设阈值时,可以将当前节点作为叶子节点,并选取样本数量最多的样本分类作为该叶子节点的输出。其中,样本类别包括“目标应用”和“非目标应用”,当输出的为“目标应用”时,即表示会在预设时长之内使用到目标应用,当输出为“非目标应用”时,即表示不会在预设时长之内使用到目标应用。其中,预设阈值可以根据实际需求设定,如0.9、0.8等等。例如,当特征1对于样本分类的信息增益率0.9为最大信息增益时,预设增益率阈值为0.8时,由于最大信息增益率大于预设阈值,此时,可以将特征1作为划分特征。又例如,当预设阈值为1时,那么最大信息增益率小于预设阈值,此时,可以将当前节点作为叶子节点。When the target information gain rate is not greater than the preset threshold, the current node may be used as a leaf node, and the sample with the largest number of samples may be selected as the output of the leaf node. The sample category includes “target application” and “non-target application”. When the output is “target application”, it means that the target application will be used within the preset duration. When the output is “non-target application”, This means that the target application will not be used within the preset duration. The preset threshold can be set according to actual needs, such as 0.9, 0.8, and the like. For example, when the information gain rate of feature 1 for the sample classification is 0.9, the preset gain rate threshold is 0.8, since the maximum information gain rate is greater than the preset threshold, feature 1 can be used as the division feature. For another example, when the preset threshold is 1, then the maximum information gain rate is less than the preset threshold. At this time, the current node may be used as a leaf node.
操作504,根据划分特征对目标样本集进行划分,生成至少一个子样本集。 Operation 504, dividing the target sample set according to the dividing feature, and generating at least one sub-sample set.
电子设备根据划分特征对样本进行分类划分的方式有多种,比如,可以基于划分特征的特征值来对样本集进行划分。电子设备也可以获取目标样本集中划分特征的特征值;根据特征值对目标样本集进行划分。比如,电子设备可以将样本集中划分特征值相同的样本划分到同一子样本集中。譬如,划分特征的特征值包括:0、1、2,那么此时,可以划分特征的特征值为0的样本归为一类、将特征值为1的样本归为一类、将特征值为2的样本归为一类。The electronic device classifies the samples according to the division features in various ways. For example, the sample set may be divided based on the feature values of the divided features. The electronic device may also acquire feature values of the feature set in the target sample set; and divide the target sample set according to the feature value. For example, an electronic device may divide a sample with the same feature value in a sample set into the same subsample set. For example, the feature values of the divided features include: 0, 1, 2, then, at this time, the samples whose feature values are 0 can be classified into one class, and the samples with the feature value 1 are classified into one class, and the feature values are The samples of 2 are classified into one category.
操作505,去除每个子样本集中样本的划分特征;生成当前节点的子节点,并将去除划分特征后的子样本集作为子节点的节点信息。 Operation 505, removing the dividing feature of the sample in each sub-sample set; generating a child node of the current node, and removing the sub-sample set after dividing the feature as the node information of the child node.
操作506,判断子节点是否满足预设分类终止条件;当满足时,则执行操作507,当不满足时,则将目标样本集更新为去除划分特征后的子样本集,并返回执行操作502。 Operation 506, determining whether the child node satisfies the preset classification termination condition; when satisfied, performing operation 507, when not satisfied, updating the target sample set to the subsample set after removing the division feature, and returning to performing operation 502.
操作507,将子节点作为叶子节点,根据去除划分特征后的子样本集的类别设置叶子节点的输出。In operation 507, the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
当子节点满足预设分类终止条件时,电子设备可以将子节点作为叶子节点,即停止对该子节点的样本集分类,并且可以基于去除后子样本集中样本的类别设置该叶子节点的输出。基于样本的类别设置叶子节点的输出的方式有多种。比如,可以去除后样本集中样本数量最多的类别作为该叶子节点的输出。When the child node satisfies the preset classification termination condition, the electronic device may use the child node as a leaf node, that is, stop the sample set classification of the child node, and set the output of the leaf node based on the category of the sample in the removed sub-sample set. There are several ways to set the output of a leaf node based on the category of the sample. For example, the category with the largest number of samples in the sample set can be removed as the output of the leaf node.
其中,预设分类终止条件可以根据实际需求设定,当子节点满足预设分类终止条件时,电子设备将当前子节点作为叶子节点,停止对子节点对应的样本集进行分词分类;当子节点不满足预设分类终止条件时,电子设备可以继续对子节点对应的额样本集进行分类。比如,预设分类终止条件可以包括:子节点的去除后子样本集合中样本的类别数量是否为预设数量,当是时,则确定子节点满足预设分类终止条件。The preset classification termination condition may be set according to actual requirements. When the child node satisfies the preset classification termination condition, the electronic device uses the current child node as a leaf node, and stops classifying the sample set corresponding to the child node; When the preset classification termination condition is not met, the electronic device may continue to classify the sample set corresponding to the child node. For example, the preset classification termination condition may include: whether the number of categories of the samples in the removed sub-sample set of the child node is a preset number, and when yes, determining that the child node meets the preset classification termination condition.
通过上述方法,可构建出目标应用的决策树模型,使得根据该决策树模型预测是否会在预设时长之内使用该目标应用。Through the above method, a decision tree model of the target application can be constructed, so that it is predicted according to the decision tree model whether the target application will be used within a preset duration.
举例来说,对于样本集D{样本1、样本2……样本i……样本n},其中样本包括若干特征A。For example, for sample set D{sample 1, sample 2...sample i...sample n}, where the sample includes several features A.
首先,对样本集中所有样本进行初始化,然后,生成一个根节点d,并将样本集D作为该根节点d的节点信息,如参考图6A。First, all samples in the sample set are initialized, then a root node d is generated, and the sample set D is taken as the node information of the root node d, as described with reference to FIG. 6A.
计算各特征如特征A对于样本集分类的信息增益率g R(D,A)1、g R(D,A)2……g R(D,A)m;选取最大的信息增益率g R(D,A)max。 Calculate the information gain rate g R (D, A)1, g R (D, A) 2, ... g R (D, A) m of each feature such as feature A for the sample set; select the maximum information gain rate g R (D, A) max.
当最大的信息增益率g R(D,A)max小于预设阈值ε时,当前的节点作为叶子节点,并选取样本数量最多的样本类别作为叶子节点的输出。 When the maximum information gain rate g R (D, A)max is less than the preset threshold ε, the current node acts as a leaf node, and the sample category with the largest number of samples is selected as the output of the leaf node.
当最大的信息增益率g R(D,A)max大于预设阈值ε时,可以选取信息增益g R(D,A)max对应的特征作为 划分特征A g,根据特征A g对样本集D{样本1、样本2……样本i……样本n}进行划分,具体地,对A g的每一个取值a i,依照A g=a i将D划分为若干个非空集合D i,作为当前节点的子节点。如将样本集划分成两个子样本集D 1{样本1、样本2……样本k}和D 2{样本k+1……样本n}。 When the maximum information gain rate g R (D, A)max is greater than the preset threshold ε, the feature corresponding to the information gain g R (D, A) max may be selected as the partitioning feature A g , and the sample set D according to the feature A g {sample 1, sample 2 sample I ...... ...... sample n} be divided, in particular, for each value of a g a i, in accordance with the a g = a i to D is divided into several non-empty set D I, As a child of the current node. For example, the sample set is divided into two subsample sets D 1 {sample 1, sample 2 ... sample k} and D 2 {sample k+1 ... sample n}.
将子样本集D1和D2中划分特征A g去除即A-A g。参考图6A生成根节点d的子节点d 1和d 2,并将子样本集D 1作为子节点d 1的节点信息、将子样本集D2作为子节点d2的节点信息。 The division feature A g in the subsample sets D1 and D2 is removed, that is, AA g . The child nodes d 1 and d 2 of the root node d are generated with reference to FIG. 6A, and the sub-sample set D 1 is taken as the node information of the child node d 1 and the sub-sample set D2 is taken as the node information of the child node d2.
接着,对于每个子节点,对于每个子节点,以A-A g作为特征,子节点的D i作为数据集,递归调用上述步,构建子树,直到满足预设分类终止条件为止。 Next, for each child node, for each child node, AA g is taken as the feature, and the D i of the child node is used as the data set, and the above steps are recursively called to construct the subtree until the preset classification termination condition is satisfied.
以子节点d 1为例,判断子节点是否满足预设分类终止条件,若是,则将当前的子节点d 1作为叶子节点,并根据子节点d 1对应的子样本集中样本的类别设置该叶子节点输出。 Taking the child node d 1 as an example, determining whether the child node satisfies the preset classification termination condition, and if so, using the current child node d 1 as a leaf node, and setting the leaf according to the category of the sample in the subsample set corresponding to the child node d 1 Node output.
当子节点不满足预设分类终止条件时,采用上述基于信息增益分类的方式,继续对子节点对应的子样本集进行分类,如以子节点d 2为例可以计算A 2样本集中各特征相对于样本分类的信息增益率g R(D,A),选取最大的信息增益率g R(D,A)max,当最大的信息增益率g R(D,A)max大于预设阈值ε时,可以选取该信息增益率g R(D,A)对应的特征为划分特征A g(如特征Ai+1),基于划分特征A g将D 2划分成若干子样本集,如可以将D 2划分成子样本集D 21、D 22、D 23,然后,将子样本集D 21、D 22、D 23中的划分特征A g去除,并生成当前节点d 2的子节点d 21、d 22、d 23,将去除划分特征A g后的样本集D 21、D 22、D 23分别作为子节点d 21、d 22、d 23的节点信息。 When the child node does not satisfy the preset classification termination condition, the above-mentioned sub-sample set corresponding to the child node is continued to be classified according to the information gain classification method. For example, the child node d 2 can be used as an example to calculate the relative features of the A 2 sample set. For the information gain rate g R (D, A) of the sample classification, the maximum information gain rate g R (D, A) max is selected, when the maximum information gain rate g R (D, A) max is greater than the preset threshold ε The feature corresponding to the information gain rate g R (D, A) may be selected as a division feature A g (such as feature Ai+1), and D 2 is divided into several sub-sample sets based on the division feature A g , such as D 2 Divided into subsample sets D 21 , D 22 , D 23 , and then the divided features A g in the subsample sets D 21 , D 22 , D 23 are removed, and the child nodes d 21 , d 22 of the current node d 2 are generated, d 23 , the sample sets D 21 , D 22 , and D 23 after the division feature A g are removed as the node information of the child nodes d 21 , d 22 , and d 23 , respectively.
依次类推,利用上述的基于信息增益率分类的方式可以构成出如图6B所示的决策树,该决策树的叶子节点的输出包括在预设时长之内会使用到目标应用或者在预设时长之内不会使用到目标应用。其中,输出结果“是”和“否”可对应表示“目标应用”和“非目标应用”,即表示“会在预设时长之内使用目标应用”和“不会在预设时长之内使用目标应用”。By analogy, the above-mentioned information gain rate classification based manner can be used to construct a decision tree as shown in FIG. 6B, and the output of the leaf node of the decision tree includes using the target application within a preset duration or at a preset duration. The target application will not be used within. Among them, the output results "yes" and "no" can correspond to "target application" and "non-target application", which means "the target application will be used within the preset duration" and "will not be used within the preset duration" Target application."
在一种实施例中,为了提升利用决策树进行预测的速度和效率,还可以在节点之间的路径上标记相应的划分特征的特征值。比如,在上述基于信息增益分类的过程中,可以在当前节点与其子节点路径上标记相应划分特征的特征值。In one embodiment, in order to improve the speed and efficiency of prediction using the decision tree, it is also possible to mark the feature values of the corresponding divided features on the path between the nodes. For example, in the above process based on information gain classification, the feature values of the corresponding divided features may be marked on the path of the current node and its child nodes.
例如,划分特征A g的特征值包括:0、1时,可以在d 2与d之间的路径上标记1,在d 1与d之间的路径上标记0,依次类推,在每次划分后,便可以在当前节点与其子节点的路径上标记相应的划分特征值如0或1,便可以得到如图6C所示的决策树。同样地,输出结果“是”和“否”可对应表示“目标应用”和“非目标应用”,即表示“会在预设时长之内使用目标应用”和“不会在预设时长之内使用目标应用”。 For example, the feature values of the partition feature A g include: 0, 1 may mark 1 on the path between d 2 and d, mark 0 on the path between d 1 and d, and so on, at each division Then, the corresponding division feature value such as 0 or 1 can be marked on the path of the current node and its child nodes, and the decision tree as shown in FIG. 6C can be obtained. Similarly, the output results "yes" and "no" can correspond to "target application" and "non-target application", which means "the target application will be used within the preset duration" and "will not be within the preset duration" Use the target app."
在一个实施例中,如图7所示,获取特征对于目标样本集分类的信息增益率包括:In one embodiment, as shown in FIG. 7, the information gain rate of the feature acquired for the target sample set classification includes:
操作702,获取特征对于目标样本集分类的信息增益。 Operation 702, obtaining an information gain of the feature classification for the target sample set.
信息增益表示某个特征的类(“目标应用”或“非目标应用”)的信息的不确定性减少程度。The information gain represents the degree of uncertainty in the information of a class of a feature ("target application" or "non-target application").
操作704,获取特征对于目标样本集分类的分裂信息。 Operation 704, acquiring split information of the feature classification for the target sample set.
分裂信息用来衡量特征分裂数据(如样本集)的广度和均匀程度,该分裂信息可以为特征的熵。The split information is used to measure the breadth and uniformity of the feature split data (such as the sample set), and the split information can be the entropy of the feature.
操作706,根据信息增益与分裂信息获取特征对于目标样本集分类的信息增益率。 Operation 706, acquiring an information gain rate of the feature classification for the target sample set according to the information gain and the split information.
信息增益率可为特征对于样本集分类的信息增益、与特征对于样本分类的分裂信息之比。可根据获取的信息增益与对应的分裂信息相除,得到信息增益率。The information gain rate can be the ratio of the information gain of the feature to the sample set classification and the split information of the feature to the sample classification. The information gain rate can be obtained by dividing the obtained information gain by the corresponding split information.
特征对于目标样本集分类的信息增益还为经验熵与条件熵之间的差值。电子设备可以获取目标样本分类的经验熵;获取特征对于目标样本集分类结果的条件熵;根据条件熵和经验熵,获取特征对于目标样本集分类的信息增益。其中,电子设备可以获取正样本在样本集中出现的第一概率、以及负样本在样本集中出现的第二概率,正样本为样本类别为“目标应用”的样本,负样本为样本类别为“非目标应用”的样本;根据第一概率和第二概率获取样本的经验熵。The information gain of the feature classification for the target sample set is also the difference between empirical entropy and conditional entropy. The electronic device can obtain the empirical entropy of the target sample classification; acquire the conditional entropy of the feature for the classification result of the target sample set; and obtain the information gain of the feature for the target sample set classification according to the conditional entropy and the empirical entropy. Wherein, the electronic device can obtain the first probability that the positive sample appears in the sample set and the second probability that the negative sample appears in the sample set, the positive sample is the sample whose sample category is “target application”, and the negative sample is the sample category is “non- A sample of the target application; the empirical entropy of the sample is obtained from the first probability and the second probability.
在一个实施例中,例如,对于样本集D{样本1、样本2……样本i……样本n},样本包括多维特征,如特征A。特征A对于样本分类的信息增益率可以通过以下公式得到:In one embodiment, for example, for a sample set D{sample 1, sample 2...sample i...sample n}, the sample includes a multi-dimensional feature, such as feature A. The information gain rate of feature A for sample classification can be obtained by the following formula:
Figure PCTCN2018117694-appb-000001
Figure PCTCN2018117694-appb-000001
其中,g R(D,A)为特征A对于样本集D分类的信息增益率,g(D,A)为特征A对于样本分类的信息增益,H A(D)为特征A的分裂信息,即特征A的熵。 Where g R (D, A) is the information gain rate of feature A for sample set D classification, g(D, A) is the information gain of feature A for sample classification, and H A (D) is the split information of feature A, That is, the entropy of feature A.
其中,g R(D,A)可以通过以下公式得到: Where g R (D, A) can be obtained by the following formula:
Figure PCTCN2018117694-appb-000002
Figure PCTCN2018117694-appb-000002
H(D)为样本集D分类的经验熵,H(D|A)为特征A对于样本集D分类的条件熵。H(D) is the empirical entropy of the sample set D classification, and H(D|A) is the conditional entropy of the feature A for the sample set D classification.
如果样本类别为“目标应用”的样本数量为j,“非目标应用”的样本数量为n-j;此时,正样本在样本集D中的出现概率p 1=j/n,负样本在样本集D中的出现概率p 2=n-j/n。然后,基于以下经验熵的计算公式,计算出样本分类的经验熵H(D): If the sample size of the sample category is "target application" is j, the number of samples of "non-target application" is nj; at this time, the probability of occurrence of the positive sample in sample set D is p 1 = j / n, and the sample of negative sample is in the sample set The probability of occurrence in D is p 2 =nj/n. Then, based on the following empirical entropy calculation formula, the empirical entropy H(D) of the sample classification is calculated:
Figure PCTCN2018117694-appb-000003
Figure PCTCN2018117694-appb-000003
在决策树分类问题中,信息增益就是决策树在进行属性选择划分前和划分后信息的差值。本实施中,样本分类的经验熵H(D)为:In the decision tree classification problem, the information gain is the difference between the information of the decision tree before and after the attribute selection. In this implementation, the empirical entropy H(D) of the sample classification is:
H(D)=p 1log p 1+p 2log p 2 H(D)=p 1 log p 1 +p 2 log p 2
在一种实施例中,电子设备可以根据特征A将样本集划分成若干子样本集,然后,获取各子样本集分类的信息熵,以及该特征A的各特征值在样本集中出现的概率,根据该信息熵以及该概率便可以得到划分后的信息熵,即该特征A i对于样本集分类结果的条件熵。 In an embodiment, the electronic device may divide the sample set into several sub-sample sets according to the feature A, and then obtain the information entropy of each sub-sample set classification, and the probability that each feature value of the feature A appears in the sample set, According to the information entropy and the probability, the divided information entropy, that is, the conditional entropy of the feature A i for the sample set classification result can be obtained.
例如,对于样本特征A,该样本特征A对于样本集D分类结果的条件熵可以通过以下公式计算得到:For example, for sample feature A, the conditional entropy of the sample feature A for the sample set D classification result can be calculated by the following formula:
Figure PCTCN2018117694-appb-000004
Figure PCTCN2018117694-appb-000004
其中,n为特征A的取值种数,即特征值类型数量。此时,p i为A特征值为第i种取值的样本在样本集D中出现的概率,A i为A的第i种取值。(D|A=A i)为子样本集D i分类的经验熵,该子样本集D i中样本的A特征值均为第i种取值。 Where n is the number of values of the feature A, that is, the number of feature value types. At this time, p i is the probability that the sample whose A eigenvalue is the ith value appears in the sample set D, and A i is the ith value of A. (D|A=A i ) is the empirical entropy of the subsample set D i classification, and the A eigenvalues of the samples in the subsample set D i are all the ith values.
例如,以特征A的取值种数为3,即A 1、A 2、A 3为例,此时,可以特征A将样本集D{样本1、样本2……样本i……样本n}划分成三个子样本集,特征值为A 1的D 1{样本1、样本2……样本d}、特征值为A 2的D 2{样本d+1……样本e}、特征值为A3的D3{样本e+1……样本n}。d、e均为正整数,且小于n。 For example, taking the value of the feature A as 3, that is, A 1 , A 2 , and A 3 as an example, at this time, the feature set A can be a sample set D {sample 1, sample 2, ... sample i ... sample n} is divided into three sub-sample set, wherein the value of {D a 1 1 sample 1 sample 2 ...... sample d}, wherein a value of 2 a D 2 {d + 1 ...... sample sample e}, wherein A3 is D3 {sample e+1...sample n}. d, e are positive integers and less than n.
此时,特征A对于样本集D分类结果的条件熵为:At this time, the conditional entropy of feature A for the classification result of sample set D is:
H(D|A)=p 1H(D|A=A 1)+p 2H(D|A=A 2)+p 3H(D|A=A 3) H(D|A)=p 1 H(D|A=A 1 )+p 2 H(D|A=A 2 )+p 3 H(D|A=A 3 )
其中,p 1=D 1/D,p 2=D2/D,p 2=D 3/D; Wherein p 1 = D 1 /D, p 2 = D2 / D, p 2 = D 3 / D;
H(D|A 1)为子样本集D 1分类的信息熵,即经验熵,可以通过上述经验熵的计算公式计算得到。 H(D|A 1 ) is the information entropy of the subsample set D 1 classification, that is, the empirical entropy, which can be calculated by the above formula of empirical entropy.
在得到样本分类的经验熵H(D),以及特征A对于样本集D分类结果的条件熵H(D|A)后,便可以计算出特征A对于样本集D分类的信息增益,如通过以下公式计算得到:After obtaining the empirical entropy H(D) of the sample classification and the conditional entropy H(D|A) of the feature A for the sample set D classification result, the information gain of the feature A for the sample set D classification can be calculated, for example, by The formula is calculated:
Figure PCTCN2018117694-appb-000005
Figure PCTCN2018117694-appb-000005
也即特征A对于样本集D分类的信息增益为:经验熵H(D)与特征A对于样本集D分类结果的条件熵H(D|A)的差值。That is, the information gain of the feature A for the sample set D classification is: the difference between the empirical entropy H(D) and the conditional entropy H(D|A) of the feature A for the sample set D classification result.
其中,特征对于样本集分类的分裂信息为特征的熵。可以基于特征的取值在目样本集中的样本分布概率得到。比如,H A(D)可以通过如下公式得到: The split information of the feature classification for the sample set is the entropy of the feature. The probability of the distribution of the features can be obtained based on the probability of distribution of the samples in the target sample set. For example, H A (D) can be obtained by the following formula:
Figure PCTCN2018117694-appb-000006
为特征A的取值类别,或种数。
Figure PCTCN2018117694-appb-000006
Is the value category of feature A, or the number of species.
其中,D i为样本集D特征A为第i种的样本集。 Where D i is a sample set in which the feature set D of the sample set D is the i-th kind.
在一个实施例中,在对目标应用进行冻结之前,还包括检测目标应用是否属于白名单应用,若是,则对目标应用免冻结;否则,执行对目标应用进行冻结。In one embodiment, before freezing the target application, the method further includes: detecting whether the target application belongs to the whitelist application, and if so, freezing the target application; otherwise, performing freezing on the target application.
其中,检测目标应用是否属于白名单应用可在对目标应用冻结之前的任意过程中执行。电子设备中预设了免冻结的应用的白名单,白名单中的应用可为用户自定义设置,或者可为系统默认设置。该白名单中记录了可以免冻结的应用的应用信息,比如可记录应用的应用标识。当目标应用处于该免冻结名单时,电子设备则不对目标应用进行冻结,当目标应用不在白名单中,且预测结果为不会在预设时长之内使用目标应用时,电子设备才对目标应用进行冻结。通过进一步设置白名单,进一步提高了对应用冻结的准确性。Wherein, detecting whether the target application belongs to the whitelist application may be performed in any process before the target application is frozen. The whitelist of the freeze-free application is preset in the electronic device, and the application in the whitelist can be customized for the user, or can be set as the system default. The whitelist records application information of an application that can be freed from freezing, such as an application identifier of a recordable application. When the target application is in the freeze-free list, the electronic device does not freeze the target application, and when the target application is not in the white list, and the predicted result is that the target application is not used within the preset duration, the electronic device applies to the target application. Freeze. By further setting up the whitelist, the accuracy of the application freeze is further improved.
在一个实施例中,如图8所示,提供了另一种应用处理方法,该方法包括:In one embodiment, as shown in FIG. 8, another application processing method is provided, the method comprising:
操作801,获取预设的每个特征的第二特征数据作为样本,生成样本集。Operation 801: Acquire second preset feature data of each feature as a sample, and generate a sample set.
获取的特征可包括多种,如下表1所示,为电子设备所获取的14个维度的特征。实际中,一个样本所包含的特征信息的数量,可以多于比表1所示信息的数量,也可以少于表1所示信息的数量,所取的具体特征信息也可以与表1所示不同,此处不作具体限定。The acquired features may include a plurality of features, as shown in Table 1 below, for the 14 dimensions acquired by the electronic device. In practice, the number of feature information included in one sample may be more than the number of information shown in Table 1, or may be less than the number of information shown in Table 1, and the specific feature information may also be as shown in Table 1. Different, it is not specifically limited herein.
维度Dimension 特征信息Characteristic information
11 当前时间段Current time period
22 当前日期类别Current date category
33 一个前景应用名称a foreground app name
44 上上一个前景应用名称Previous foreground application name
55 应用在后台停留的时长How long the app stays in the background
66 应用在后台停留期间灭屏的时长The length of time the app is off during the background pause
77 当前耳机的插拔状态Current plug-in status
88 当前充电状态Current state of charge
99 当前电池电量Current battery level
1010 应用被切换的方式How the app is switched
1111 应用的类别App category
1212 应用切换到前台的次数The number of times the app switches to the foreground
1313 当前WiFi连接状态Current WiFi connection status
1414 连接的WiFi的SSID或BSSIDConnected WiFi SSID or BSSID
表1Table 1
电子设备可预先在最近时间段内,按照预设频率采集上述的多个特征的特征信息,作为样本。一次采集的多维特征数据构成一个样本,多次采集的多个样本构成样本集。其中,电子设备可在系统的预设路径下埋点,在检测到启动了某一应用时,记录在该应用在启动时刻下,相关特征的特征数据以及该应用的应用标识,将该应用标识与记录的特征数据进行关联。The electronic device may acquire the feature information of the plurality of features described above as a sample according to a preset frequency in the latest time period. The multi-dimensional feature data collected at one time constitutes one sample, and multiple samples collected multiple times constitute a sample set. The electronic device may bury a point in the preset path of the system, and when detecting that an application is activated, record the feature data of the relevant feature and the application identifier of the application at the startup time of the application, and identify the application identifier. Associated with the recorded feature data.
在构成样本集之后,电子设备可以对样本集中的每个样本进行标记,得到每个样本的样本标签,该样本标签可为对应应用的应用标识,或对应应用所属的应用类别。相对于待检测的目标应用,该样本标签可分为“目标应用”或“非目标应用”,或者可为分为“与目标应用的应用类型相同”,或者“与目标应用的应用类型不同”。After constituting the sample set, the electronic device may mark each sample in the sample set to obtain a sample label of each sample, and the sample label may be an application identifier of the corresponding application, or an application category to which the corresponding application belongs. The sample tag may be classified into a "target application" or a "non-target application" with respect to the target application to be detected, or may be classified into "the same application type as the target application" or "different from the application type of the target application". .
操作802,当样本集的数据量超过预设阈值时,将样本集作为决策树的根节点的节点信息;将根节点的节点信息确定为当前待分类的目标样本集。 Operation 802, when the data volume of the sample set exceeds a preset threshold, using the sample set as the node information of the root node of the decision tree; determining the node information of the root node as the current target sample set to be classified.
即确定根节点的样本集作为当前待分类的目标样本集。比如,参考图6A,对于样本集D{样本1、样本2……样本i……样本n},电子设备可以先生成决策树的根节点d,并将样本集D作为该根节点d的节点 信息。That is, the sample set of the root node is determined as the target sample set to be classified currently. For example, referring to FIG. 6A, for the sample set D{sample 1, sample 2, ... sample i ... sample n}, the electronic device can be made into the root node d of the decision tree, and the sample set D is taken as the node of the root node d information.
操作803,获取特征对于目标样本集分类的信息增益率,从信息增益率中确定最大的信息增益率。Operation 803, obtaining an information gain rate of the feature classification for the target sample set, and determining a maximum information gain rate from the information gain rate.
在一个实施例中,可首先通过公式H(D|A)=p 1H(D|A=A 1)+p 2H(D|A=A 2)+p 3H(D|A=A 3)计算出特征A对于样本集D分类结果的条件熵H(D|A),再通过
Figure PCTCN2018117694-appb-000007
计算出特征A对于样本集D分类的信息增益g(D,A),然后按照过
Figure PCTCN2018117694-appb-000008
计算特征对于目标样本集分类的信息增益率g R(D,A)。
In one embodiment, it may first pass the formula H(D|A)=p 1 H(D|A=A 1 )+p 2 H(D|A=A 2 )+p 3 H(D|A=A 3 ) Calculate the conditional entropy H(D|A) of the feature A for the classification result of the sample set D, and then pass
Figure PCTCN2018117694-appb-000007
Calculate the information gain g(D,A) of feature A for sample set D classification, and then follow
Figure PCTCN2018117694-appb-000008
The information gain rate g R (D, A) of the feature classification for the target sample set is calculated.
操作804,检测最大的信息增益率是否大于预设阈值,当最大的信息增益率大于预设阈值时,则执行操作805,否则,执行操作806。 Operation 804, detecting whether the maximum information gain rate is greater than a preset threshold, and when the maximum information gain rate is greater than the preset threshold, performing operation 805; otherwise, performing operation 806.
例如,电子设备可以判断最大的信息增益g R(D,A)max是否大于预设的阈值ε,该阈值ε可以根据实际需求设定。 For example, the electronic device can determine whether the maximum information gain g R (D, A) max is greater than a preset threshold ε, which can be set according to actual needs.
操作805,选取最大的信息增益率对应的样本作为划分特征,根据划分特征对目标样本集进行划分,生成至少一个子样本集。In operation 805, the sample corresponding to the maximum information gain rate is selected as the partitioning feature, and the target sample set is divided according to the partitioning feature to generate at least one subsample set.
操作806,将当前节点作为叶子节点,并选取样本数量最多的样本分类作为叶子节点的输出。 Operation 806, the current node is taken as a leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
比如,当最大的信息增益g R(D,A)max对应的特征为特征A g时,电子设备可以选取特征A g为划分特征。 For example, when the feature corresponding to the maximum information gain g R (D, A) max is the feature A g , the electronic device may select the feature A g as the dividing feature.
具体地,电子设备可以根据划分特征的特征值种数将样本集划分成若干子样本集,子样本集的数量与特征值种数相同。例如,电子设备可以将样本集中划分特征值相同的样本划分到同一子样本集中。譬如,划分特征的特征值包括:0、1、2,那么此时,可以划分特征的特征值为0的样本归为一类、将特征值为1的样本归为一类、将特征值为2的样本归为一类。Specifically, the electronic device may divide the sample set into several sub-sample sets according to the number of feature values of the divided features, and the number of the sub-sample sets is the same as the number of feature values. For example, the electronic device may divide the samples in the sample set with the same feature value into the same subsample set. For example, the feature values of the divided features include: 0, 1, 2, then, at this time, the samples whose feature values are 0 can be classified into one class, and the samples with the feature value 1 are classified into one class, and the feature values are The samples of 2 are classified into one category.
比如,划分特征i的取值有两种时,可以将样本集D划分成D 1{样本1、样本2……样本k}和D 2{样本k+1……样本n}。然后,可以将子样本集D 1和D 2中的划分特征A g去除,即A-A gFor example, when there are two values of the partitioning feature i, the sample set D can be divided into D 1 {sample 1, sample 2, ... sample k} and D 2 {sample k+1 ... sample n}. Then, a sub-division of sample sets features D 1 and D 2 A g may be removed, i.e., AA g.
操作807,去除每个子样本集中样本的划分特征,生成当前节点的子节点,并将去除划分特征后的子样本集作为子节点的节点信息。 Operation 807, the division feature of the sample in each sub-sample set is removed, the child node of the current node is generated, and the sub-sample set after the division feature is removed is used as the node information of the child node.
其中,一个子样本集对应一个子节点。例如,考图6A生成根节点d的子节点d1和d2,并将子样本集D 1作为子节点d 1的节点信息、将子样本集D 2作为子节点d 2的节点信息。 Among them, one subsample set corresponds to one child node. For example, the test map 6A generates the child nodes d1 and d2 of the root node d, and uses the subsample set D 1 as the node information of the child node d 1 and the subsample set D 2 as the node information of the child node d 2 .
在一种实施例中,电子设备还可以将子节点对应的划分特征值设置子节点与当前节点的路径上,便于后续进行是否会使用到应用的预测,参考图6C。In an embodiment, the electronic device may further set the divided feature values corresponding to the child nodes on the path of the child node and the current node, so as to facilitate subsequent prediction whether the application is used, refer to FIG. 6C.
操作808,判断子节点对应的去除划分特征后的子样本集中样本的类别数量是否为预设数量,当是时,则执行操作809,否则,将目标样本集更新为去除划分特征后的子样本集,并返回执行操作803。In operation 808, it is determined whether the number of categories of the sample in the subsample set after removing the partition feature corresponding to the child node is a preset number, and if yes, performing operation 809; otherwise, updating the target sample set to the subsample after removing the partition feature Set and return to perform operation 803.
当子节点不满足预设分类终止条件时,电子设备可以采用上述基于信息增益分类的方式,继续对子节点对应的子样本集进行分类,如以子节点d 2为例可以计算A 2样本集中各特征相对于样本分类的信息增益率g R(D,A),选取最大的信息增益率g R(D,A)max,当最大的信息增益率g R(D,A)max大于预设阈值ε时,可以选取该信息增益率g R(D,A)对应的特征为划分特征A g(如特征A i+1),基于划分特征Ag将D2划分成若干子样本集,如可以将D2划分成子样本集D 21、D 22、D 23,然后,将子样本集D 21、D 22、D 23中的划分特征A g去除,并生成当前节点d 2的子节点d 21、d 22、d 23,将去除划分特征A g后的样本集D 21、D 22、D 23分别作为子节点d 21、d 22、d23的节点信息。 When the child node does not meet the preset classification termination condition, the electronic device may continue to classify the sub-sample set corresponding to the child node by using the above-mentioned information gain classification method, for example, the child node d 2 may be used as an example to calculate the A 2 sample set. The information gain rate g R (D, A) of each feature relative to the sample classification, the maximum information gain rate g R (D, A) max is selected, when the maximum information gain rate g R (D, A) max is greater than the preset For the threshold ε, the feature corresponding to the information gain rate g R (D, A) may be selected as the partitioning feature A g (such as the feature A i+1 ), and the D2 is divided into several sub-sample sets based on the partitioning feature Ag, if D2 is divided into subsample sets D 21 , D 22 , D 23 , and then the partition features A g in the subsample sets D 21 , D 22 , D 23 are removed, and the child nodes d 21 , d 22 of the current node d 2 are generated. And d 23 , the sample sets D 21 , D 22 , and D 23 after the division feature A g are removed as the node information of the child nodes d 21 , d 22 , and d23 , respectively.
如果子节点满足该预设分类终止条件,那么,电子设备可以将子样本集中样本的类别作为该叶子节点的输出。如去除后子样本集中只有类别为“目标应用”的样本时,那么,电子设备可以将“目标应用”作为该叶子节点的输出。If the child node satisfies the preset classification termination condition, the electronic device may use the category of the sample in the subsample set as the output of the leaf node. If, after the removal, the subsample set has only the sample of the category "target application", then the electronic device can use the "target application" as the output of the leaf node.
操作809,将子节点作为叶子节点,根据去除划分特征后的子样本集的类别设置叶子节点的输出。In operation 809, the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
例如,在子节点d 1的子样本集D 1分类时,如果最大信息增益小与预设阈值,此时,电子设备可以将子样本集D 1中样本数量最多的样本类别作为该叶子节点的输出。如“目标应用”的样本数量最多,则电子设备可以将“目标应用”作为叶子节点d 1的输出。 For example, when the sub-sample set D 1 of the child node d 1 is classified, if the maximum information gain is small and the preset threshold, the electronic device may use the sample category with the largest number of samples in the sub-sample set D 1 as the leaf node. Output. The maximum number of samples "target application", the electronic device may be an output of leaf nodes d 1 "target application" as.
操作810,获取每个特征的第一特征数据,第一特征数据为对应特征在预测时刻下的特征数据。 Operation 810, acquiring first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time.
在构建完决策树模型后,电子设备可以获取需要预测是否会使用目标应用的时刻,采集在该预测时刻下的特征的特征数据。After the decision tree model is constructed, the electronic device can acquire the feature data of the feature at the predicted time when the time at which the target application needs to be predicted is used.
操作811,获取用于预测用户是否会在预设时长之内使用目标应用的决策树模型,预设时长的起始时刻为预测时刻。 Operation 811, obtaining a decision tree model for predicting whether the user will use the target application within a preset duration, and the starting time of the preset duration is the predicted time.
操作812,将第一特征数据作为决策树模型的输入,输出预测结果,当预测结果为不会在预设时长之内使用目标应用时,执行操作813,否则,执行操作815。 Operation 812, the first feature data is used as an input of the decision tree model, and the prediction result is output. When the prediction result is that the target application is not used within the preset duration, the operation 813 is performed; otherwise, the operation 815 is performed.
电子设备可获取预先构建好的决策树模型,将该第一特征数据作为该模型的输入,得到相应的输出结果。The electronic device can obtain a pre-built decision tree model, and use the first feature data as an input of the model to obtain a corresponding output result.
操作813,检测目标应用是否属于白名单应用,当目标应用属于白名单应用时,则执行操作814,当目标应用不属于白名单应用时,执行操作815。In operation 813, it is detected whether the target application belongs to the whitelist application. When the target application belongs to the whitelist application, operation 814 is performed. When the target application does not belong to the whitelist application, operation 815 is performed.
操作814,对目标应用免冻结。 Operation 814, freeing the target application from freezing.
操作815,对目标应用进行冻结。 Operation 815, freezing the target application.
当预测结果为不会在预设时长之内使用目标应用,且目标应用不在白名单中时,可通过平台冻结管理模块224可对该目标应用发起冻结操作,以对目标应用可使用的资源进行限制,比如可采取CPU限制睡眠模式、CPU冻结睡眠模式或进程深度冻结模式等其中的任意一种模式对目标应用进行冻结。When the predicted result is that the target application is not used within the preset duration, and the target application is not in the whitelist, the platform freeze management module 224 may initiate a freeze operation on the target application to perform resources for the target application. Restrictions, such as the CPU limit sleep mode, CPU freeze sleep mode or process deep freeze mode, etc., can freeze the target application.
上述的应用处理方法,通过构建用于预测是否会在预设时长之内目标应用的决策树模型,并获取每个特征的第一特征数据以及该目标应用的决策树模型,将该第一特征数据作为决策树模型的输入,以得到决策树模型所输出的用户是否会在预设时长之内使用该目标应用的预测结果,当该预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结,以限制目标应用对资源的占用。由于对应用冻结时也需要消耗一定的系统资源,通过进行预测是否会在预设时长之内使用目标应用,在不使用时则进行冻结,从而降低在对目标应用进行冻结以后,用户又会在预设时长之内使用到该应用,而需要对该应用进行解冻,而造成多余的冻结操作,提高了对目标应用进行冻结的精准性,进而也提高了对系统资源释放的有效性。The application processing method described above, by constructing a decision tree model for predicting whether the target application is within a preset duration, and acquiring first feature data of each feature and a decision tree model of the target application, the first feature The data is used as an input of the decision tree model to obtain whether the user output by the decision tree model uses the prediction result of the target application within a preset duration, when the prediction result is that the target application is not used within the preset duration , the target application is frozen to limit the target application's occupation of resources. Since it is necessary to consume a certain amount of system resources when freezing the application, whether the target application is used within the preset duration by performing the prediction, and freezing when not in use, thereby reducing the user to freeze after the target application is frozen. The application is used within the preset duration, and the application needs to be thawed, which causes unnecessary freezing operations, improves the accuracy of freezing the target application, and thus improves the effectiveness of releasing system resources.
应该理解的是,虽然图4、图5、图7和图8的流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,图4、图5、图7和图8中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the operations in the flowcharts of FIGS. 4, 5, 7, and 8 are sequentially displayed in accordance with the indication of the arrows, these operations are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these operations is not strictly limited, and the operations may be performed in other sequences. Moreover, at least some of the operations in FIGS. 4, 5, 7, and 8 may include multiple sub-operations or multiple stages, which are not necessarily performed at the same time, but may be at different times. Execution, the order of execution of these sub-operations or phases is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of sub-operations or phases of other operations or other operations.
在一个实施例中,如图9所示,提供了一种应用处理装置,该装置包括特征数据获取模块902、决策树模型获取模块904、预测模块906以及应用处理模块908。其中,特征数据获取模块902用于获取每个特征的第一特征数据,第一特征数据为对应特征在预测时刻下的特征数据;决策树模型获取模块904用于获取用于预测用户是否会在预设时长之内使用目标应用的决策树模型,预设时长的起始时刻为预测时刻;预测模块906用于将第一特征数据作为决策树模型的输入,输出预测结果;应用处理模块908用于当预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结。In one embodiment, as shown in FIG. 9, an application processing apparatus is provided, which includes a feature data acquisition module 902, a decision tree model acquisition module 904, a prediction module 906, and an application processing module 908. The feature data obtaining module 902 is configured to acquire first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time; the decision tree model obtaining module 904 is configured to obtain whether the user is predicted to be in the The decision tree model of the target application is used within the preset duration, and the starting time of the preset duration is the predicted time; the prediction module 906 is configured to use the first feature data as an input of the decision tree model, and output the predicted result; the application processing module 908 The target application is frozen when the predicted result is that the target application will not be used within the preset duration.
在一个实施例中,如图10所示提供了另一种应用处理装置,该装置还包括:In one embodiment, another application processing device is provided as shown in FIG. 10, the device further comprising:
决策树构建模块910,用于获取预设的每个特征的第二特征数据作为样本,生成样本集,第二特征数据为在预测时刻之前,启动了参考应用时的对应特征的特征数据,参考应用包括目标应用;当样本集的数据量超过预设阈值时,根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用目标应用的决策树模型。The decision tree construction module 910 is configured to acquire the second feature data of each feature as a sample, and generate a sample set, where the second feature data is feature data of the corresponding feature when the reference application is started before the predicted time, and the reference The application includes a target application; when the data volume of the sample set exceeds a preset threshold, the sample set is sample-classified according to the information gain rate of the feature classification for the sample set, and the generated sample is used to predict whether the user will use the target application within the preset duration. Decision tree model.
在一个实施例中,决策树构建模块910还用于将样本集作为决策树的根节点的节点信息;将根节点 的节点信息确定为当前待分类的目标样本集;获取特征对于目标样本集分类的信息增益率;根据信息增益率从目标样本集中选取样本作为划分特征;根据划分特征对目标样本集进行划分,生成至少一个子样本集;去除每个子样本集中样本的划分特征;生成当前节点的子节点,并将去除划分特征后的子样本集作为子节点的节点信息;判断子节点是否满足预设分类终止条件;当子节点不满足预设分类终止条件时,则将目标样本集更新为去除划分特征后的子样本集,并返回执行获取特征对于目标样本集分类的信息增益率;当子节点满足预设分类终止条件时,则将子节点作为叶子节点,根据去除划分特征后的子样本集的类别设置叶子节点的输出。In an embodiment, the decision tree construction module 910 is further configured to use the sample set as the node information of the root node of the decision tree; determine the node information of the root node as the target sample set to be classified; and acquire the feature for the target sample set. Information gain rate; according to the information gain rate, the sample is selected from the target sample set as a partition feature; the target sample set is divided according to the partition feature to generate at least one subsample set; the partition feature of each subsample set is removed; and the current node is generated. a child node, and removing the subsample set after dividing the feature as the node information of the child node; determining whether the child node satisfies the preset classification termination condition; when the child node does not satisfy the preset classification termination condition, updating the target sample set to The sub-sample set after the feature is removed is removed, and the information gain rate of the acquired feature classification for the target sample set is returned. When the child node satisfies the preset classification termination condition, the child node is used as the leaf node, and the sub-node is removed according to the de-divided feature. The category of the sample set sets the output of the leaf node.
在一个实施例中,决策树构建模块910还用于从信息增益率中确定最大的信息增益率;当最大的信息增益率大于预设阈值时,选取最大的信息增益率对应的样本作为划分特征;当最大的信息增益率不大于预设阈值时,将当前节点作为叶子节点,并选取样本数量最多的样本分类作为叶子节点的输出。In an embodiment, the decision tree construction module 910 is further configured to determine a maximum information gain rate from the information gain rate; when the maximum information gain rate is greater than a preset threshold, select a sample corresponding to the maximum information gain rate as the partition feature. When the maximum information gain rate is not greater than the preset threshold, the current node is taken as the leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
在一个实施例中,决策树构建模块910还用于判断子节点对应的去除划分特征后的子样本集中样本的类别数量是否为预设数量;当子节点对应的去除划分特征后的子样本集中样本的类别数量为预设数量时,则确定子节点满足预设分类终止条件。In an embodiment, the decision tree construction module 910 is further configured to determine whether the number of categories of the sample in the subsample set after the partition feature is removed by the child node is a preset number; and the subsample set after the child node corresponding to remove the partition feature When the number of categories of the sample is a preset number, it is determined that the child node satisfies the preset classification termination condition.
在一个实施例中,决策树构建模块910还用于获取特征对于目标样本集分类的信息增益;获取特征对于目标样本集分类的分裂信息;根据信息增益与分裂信息获取特征对于目标样本集分类的信息增益率。In an embodiment, the decision tree construction module 910 is further configured to acquire an information gain of the feature classification for the target sample set; acquire split information of the feature classification for the target sample set; and classify the target sample set according to the information gain and the split information acquisition feature. Information gain rate.
在一个实施例中,决策树构建模块910还用于通过
Figure PCTCN2018117694-appb-000009
计算特征对于目标样本集分类的信息增益率;其中,D表示样本集,g(D,A)为特征A对于样本集D分类的信息增益,H A(D)为特征A的分裂信息,g R(D,A)为特征A对于样本集D分类的信息增益率;g(D,A)通过
Figure PCTCN2018117694-appb-000010
计算得到;其中,H(D)为样本集D分类的经验熵,H(D|A)为特征A对于样本集D分类的条件熵,n为特征A的样本取值种类数,p i为特征A取第i种取值的样本在样本集中出现的概率,n和i均为大于零的正整数。
In one embodiment, the decision tree building module 910 is also used to pass
Figure PCTCN2018117694-appb-000009
Calculating the information gain rate of the feature classification for the target sample set; where D represents the sample set, g(D, A) is the information gain of feature A for the sample set D classification, and H A (D) is the split information of feature A, g R (D, A) is the information gain rate of feature A for sample set D; g(D, A) is passed
Figure PCTCN2018117694-appb-000010
Calculated; where H(D) is the empirical entropy of the sample set D classification, H(D|A) is the conditional entropy of feature A for the sample set D classification, and n is the number of sample values of feature A, p i is The probability that the feature A takes the sample of the i-th value in the sample set, n and i are positive integers greater than zero.
在一个实施例中,如图11所示,提供了又一种应用处理装置,该装置还包括:In one embodiment, as shown in FIG. 11, yet another application processing device is provided, the device further comprising:
应用检测模块912,用于检测目标应用是否属于白名单应用。The application detection module 912 is configured to detect whether the target application belongs to a whitelist application.
应用处理模块908还用于当预测结果为不会在预设时长之内使用目标应用时,对目标应用进行冻结;当预测结果为会在预设时长之内使用目标应用,或目标应用属于白名单应用时,对目标应用免冻结。The application processing module 908 is further configured to freeze the target application when the prediction result is that the target application is not used within the preset duration; when the prediction result is that the target application is used within the preset duration, or the target application belongs to white When the list is applied, the target application is free from freezing.
上述应用处理装置中各个模块的划分仅用于举例说明,在其他实施例中,可将应用处理装置按照需要划分为不同的模块,以完成上述应用处理装置的全部或部分功能。The division of each module in the application processing device is for illustrative purposes only. In other embodiments, the application processing device may be divided into different modules as needed to complete all or part of the functions of the application processing device.
关于应用处理装置的具体限定可以参见上文中对于应用处理方法的限定,在此不再赘述。上述应用处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific definitions of the application processing device, reference may be made to the above definition of the application processing method, and details are not described herein again. The various modules in the application processing device described above may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the electronic device, or may be stored in a memory in the electronic device in a software format, so that the processor calls to perform operations corresponding to the above modules.
本申请实施例中提供的应用处理装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器等电子设备上运行。该计算机程序构成的程序模块可存储在电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述的应用处理方法的操作。The implementation of each module in the application processing apparatus provided in the embodiments of the present application may be in the form of a computer program. The computer program can run on an electronic device such as a terminal or a server. The program module of the computer program can be stored on a memory of the electronic device. When the computer program is executed by the processor, the operation of the application processing method described in the embodiment of the present application is implemented.
上述应用处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于服务器中的处理器中,也可以以软件形式存储于服务器中的存储器中,以便于处理器调用执行以上各个模块对应的操作。如在本申请中所使用的,术语“模块”等旨在表示计算机相关的实体,它可以是硬件、硬件和软件的组合、软件、或者执行中的软件。例如,模块可以是但不限于是,在处理器上运行的进程、处理器、对象、可执行码、执行的线程、程序和/或计算机。作为说明,运行在服务器上的应用程序和服务器都可以是模块。一个或多个模块可以驻留在进程和/或执行的线程中, 并且,模块可以位于一个计算机内和/或分布在两个或更多的计算机之间。The various modules in the application processing device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in the hardware in the processor or in the memory in the server, or may be stored in the memory in the server, so that the processor calls the corresponding operations of the above modules. As used in this application, the terms "module" and the like are intended to mean a computer-related entity, which may be hardware, a combination of hardware and software, software, or software in execution. For example, a module can be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a server and a server can be a module. One or more modules can reside within a process and/or a thread of execution, and a module can be located in a computer and/or distributed between two or more computers.
在一个实施例中,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述各实施例所提供的应用处理方法的操作。In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the application processing provided by the above embodiments is implemented when the processor executes the computer program The operation of the method.
在一个实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序对处理器执行时,实现本申请各实施例中所描述的应用处理方法的操作。In one embodiment, there is also provided a computer readable storage medium having stored thereon a computer program for performing application processing as described in various embodiments of the present application when executed by a processor The operation of the method.
在一个实施例中,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行本申请各实施例中所描述的应用处理方法。In one embodiment, a computer program product comprising instructions, when executed on a computer, causes the computer to perform the application processing methods described in the various embodiments of the present application.
本申请实施例还提供了一种计算机设备。如图12所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该计算机设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备,以计算机设备为手机为例:The embodiment of the present application also provides a computer device. As shown in FIG. 12, for the convenience of description, only the parts related to the embodiments of the present application are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment of the present application. The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking a computer device as a mobile phone as an example. :
图12为与本申请实施例提供的计算机设备相关的手机的部分结构的框图。参考图12,手机包括:射频(Radio Frequency,RF)电路1210、存储器1220、输入单元1230、显示单元1240、传感器1250、音频电路1260、无线保真(wireless fidelity,WiFi)模块1270、处理器1280、以及电源1290等部件。本领域技术人员可以理解,图12所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 12 is a block diagram showing a part of a structure of a mobile phone related to a computer device according to an embodiment of the present application. Referring to FIG. 12, the mobile phone includes: a radio frequency (RF) circuit 1210, a memory 1220, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a wireless fidelity (WiFi) module 1270, and a processor 1280. And power supply 1290 and other components. It will be understood by those skilled in the art that the structure of the handset shown in FIG. 12 does not constitute a limitation to the handset, and may include more or less components than those illustrated, or some components may be combined, or different components may be arranged.
其中,RF电路1210可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器1280处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1210还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 1210 can be used for receiving and transmitting information during the transmission and reception of information or during the call. The downlink information of the base station can be received and processed by the processor 1280. The uplink data can also be sent to the base station. Generally, RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 1210 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.
存储器1220可用于存储软件程序以及模块,处理器1280通过运行存储在存储器1220的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1220可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器1220可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 1220 can be used to store software programs and modules, and the processor 1280 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 1220. The memory 1220 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as an application of a sound playing function, an application of an image playing function, etc.); The data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone. Moreover, memory 1220 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.
输入单元1230可用于接收输入的数字或字符信息,以及产生与手机1200的用户设置以及功能控制有关的键信号输入。具体地,输入单元1230可包括触控面板1231以及其他输入设备1232。触控面板1231,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1231上或在触控面板1231附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板1231可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1280,并能接收处理器1280发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1231。除了触控面板1231,输入单元1230还可以包括其他输入设备1232。具体地,其他输入设备1232可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。The input unit 1230 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset 1200. Specifically, the input unit 1230 may include a touch panel 1231 and other input devices 1232. The touch panel 1231, which may also be referred to as a touch screen, can collect touch operations on or near the user (such as a user using a finger, a stylus, or the like on the touch panel 1231 or near the touch panel 1231. Operation) and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 1231 may include two parts of a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information. The processor 1280 is provided and can receive commands from the processor 1280 and execute them. In addition, the touch panel 1231 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1231, the input unit 1230 may also include other input devices 1232. Specifically, other input devices 1232 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.).
显示单元1240可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1240可包括显示面板1241。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1241。在一个实施例中,触控面板1231可覆盖显示面板1241,当触控面板1231检测到在其上或附近的触摸操作后,传送给处理器1280以确定触摸事件的类型,随后处理器1280根据触摸事件的类型在显示面板1241上提供 相应的视觉输出。虽然在图12中,触控面板1231与显示面板1241是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板1231与显示面板1241集成而实现手机的输入和输出功能。The display unit 1240 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone. The display unit 1240 may include a display panel 1241. In one embodiment, the display panel 1241 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. In one embodiment, the touch panel 1231 can cover the display panel 1241. When the touch panel 1231 detects a touch operation thereon or nearby, the touch panel 1231 transmits to the processor 1280 to determine the type of the touch event, and then the processor 1280 is The type of touch event provides a corresponding visual output on display panel 1241. Although in FIG. 12, the touch panel 1231 and the display panel 1241 are used as two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 1231 and the display panel 1241 may be integrated. Realize the input and output functions of the phone.
手机1200还可包括至少一种传感器1250,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1241的亮度,接近传感器可在手机移动到耳边时,关闭显示面板1241和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。The handset 1200 can also include at least one type of sensor 1250, 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 1241 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1241 and/or when the mobile phone moves to the ear. Or backlight. The motion sensor may include an acceleration sensor, and the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
音频电路1260、扬声器1261和传声器1262可提供用户与手机之间的音频接口。音频电路1260可将接收到的音频数据转换后的电信号,传输到扬声器1261,由扬声器1261转换为声音信号输出;另一方面,传声器1262将收集的声音信号转换为电信号,由音频电路1260接收后转换为音频数据,再将音频数据输出处理器1280处理后,经RF电路1210可以发送给另一手机,或者将音频数据输出至存储器1220以便后续处理。 Audio circuitry 1260, speaker 1261, and microphone 1262 can provide an audio interface between the user and the handset. The audio circuit 1260 can transmit the converted electrical data of the received audio data to the speaker 1261, and convert it into a sound signal output by the speaker 1261; on the other hand, the microphone 1262 converts the collected sound signal into an electrical signal, by the audio circuit 1260. After receiving, it is converted into audio data, and then processed by the audio data output processor 1280, transmitted to another mobile phone via the RF circuit 1210, or outputted to the memory 1220 for subsequent processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块1270可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图12示出了WiFi模块1270,但是可以理解的是,其并不属于手机1200的必须构成,可以根据需要而省略。WiFi is a short-range wireless transmission technology. The mobile phone through the WiFi module 1270 can help users to send and receive e-mail, browse the web and access streaming media, etc. It provides users with wireless broadband Internet access. Although FIG. 12 shows the WiFi module 1270, it will be understood that it does not belong to the essential configuration of the handset 1200 and may be omitted as needed.
处理器1280是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1220内的软件程序和/或模块,以及调用存储在存储器1220内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器1280可包括一个或多个处理单元。在一个实施例中,处理器1280可集成应用处理器和调制解调器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调器主要处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1280中。比如,该处理器1280可集成应用处理器和基带处理器,基带处理器与和其它外围芯片等可组成调制解调器。手机1200还包括给各个部件供电的电源1290(比如电池),优选的,电源可以通过电源管理系统与处理器1280逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The processor 1280 is a control center for the handset that connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 1220, and invoking data stored in the memory 1220, The phone's various functions and processing data, so that the overall monitoring of the phone. In one embodiment, processor 1280 can include one or more processing units. In one embodiment, the processor 1280 can integrate an application processor and a modem, wherein the application processor primarily processes an operating system, a user interface, an application, etc.; the modem primarily processes wireless communications. It will be appreciated that the above described modem may also not be integrated into the processor 1280. For example, the processor 1280 can integrate an application processor and a baseband processor, and the baseband processor and other peripheral chips can form a modem. The handset 1200 also includes a power source 1290 (such as a battery) that powers the various components. Preferably, the power source can be logically coupled to the processor 1280 via a power management system to manage functions such as charging, discharging, and power management through the power management system.
在一个实施例中,手机1200还可以包括摄像头、蓝牙模块等。In one embodiment, the handset 1200 can also include a camera, a Bluetooth module, and the like.
在本申请实施例中,该手机所包括的处理器执行存储在存储器上的计算机程序时实现上述所描述的应用处理方法。In the embodiment of the present application, the processor included in the mobile phone implements the application processing method described above when executing a computer program stored in the memory.
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database or other medium used herein may include non-volatile and/or volatile memory. Suitable non-volatile memories can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as an external cache. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization. Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the claims. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (24)

  1. 一种应用处理方法,包括:An application processing method includes:
    获取每个特征的第一特征数据,所述第一特征数据为对应特征在预测时刻下的特征数据;Obtaining first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time;
    获取用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,所述预设时长的起始时刻为预测时刻;Obtaining a decision tree model for predicting whether the user will use the target application within a preset duration, where the starting time of the preset duration is a predicted moment;
    将所述第一特征数据作为所述决策树模型的输入,输出预测结果;及Using the first feature data as an input of the decision tree model, and outputting a prediction result; and
    当所述预测结果为不会在预设时长之内使用所述目标应用时,对所述目标应用进行冻结。When the predicted result is that the target application is not used within a preset duration, the target application is frozen.
  2. 根据权利要求1所述的方法,其特征在于,在所述获取预设的每个特征的第一特征数据之前,还包括:The method according to claim 1, wherein before the acquiring the first feature data of each feature preset, the method further comprises:
    获取预设的每个特征的第二特征数据作为样本,生成样本集,所述第二特征数据为在预测时刻之前,启动了参考应用时的对应特征的特征数据,所述参考应用包括所述目标应用;及Obtaining a second feature data of each feature as a sample, and generating a sample set, where the second feature data is feature data of a corresponding feature when the reference application is started before the predicted time, the reference application includes the Target application; and
    当所述样本集的数据量超过预设阈值时,根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型。When the data volume of the sample set exceeds a preset threshold, classifying the sample set according to the information gain rate of the feature classification for the sample set, and generating a method for predicting whether the user will use the target application within a preset duration Decision tree model.
  3. 根据权利要求2所述的方法,其特征在于,所述根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,包括:The method according to claim 2, wherein the sample grouping is performed on the sample set according to the information gain rate of the feature classification for the sample set, and generating is used to predict whether the user will use the target application within a preset time duration. Decision tree model, including:
    将所述样本集作为决策树的根节点的节点信息;Using the sample set as node information of a root node of the decision tree;
    将所述根节点的节点信息确定为当前待分类的目标样本集;Determining the node information of the root node as a target sample set to be classified currently;
    获取特征对于目标样本集分类的信息增益率;Obtaining the information gain rate of the feature classification for the target sample set;
    根据所述信息增益率从所述目标样本集中选取样本作为划分特征;Selecting a sample from the target sample set as a division feature according to the information gain rate;
    根据所述划分特征对所述目标样本集进行划分,生成至少一个子样本集;And dividing the target sample set according to the dividing feature to generate at least one sub-sample set;
    去除每个所述子样本集中样本的划分特征;Removing the partitioning features of the samples in each of the subsample sets;
    生成当前节点的子节点,并将去除划分特征后的子样本集作为所述子节点的节点信息;Generating a child node of the current node, and removing the subsample set after dividing the feature as node information of the child node;
    判断所述子节点是否满足预设分类终止条件;Determining whether the child node meets a preset classification termination condition;
    当所述子节点不满足预设分类终止条件时,则将所述目标样本集更新为所述去除划分特征后的子样本集,并返回执行获取特征对于目标样本集分类的信息增益率;及And when the child node does not satisfy the preset classification termination condition, updating the target sample set to the sub-sample set after the dividing feature is removed, and returning an information gain rate of performing the acquiring feature for the target sample set classification;
    当所述子节点满足所述预设分类终止条件时,则将所述子节点作为叶子节点,根据所述去除划分特征后的子样本集的类别设置所述叶子节点的输出。When the child node satisfies the preset classification termination condition, the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述信息增益率从所述目标样本集中选取样本作为划分特征,包括:The method according to claim 3, wherein the selecting a sample from the target sample set according to the information gain rate as a dividing feature comprises:
    从所述信息增益率中确定最大的信息增益率;Determining a maximum information gain rate from the information gain rate;
    当所述最大的信息增益率大于预设阈值时,选取所述最大的信息增益率对应的样本作为划分特征;及When the maximum information gain rate is greater than a preset threshold, selecting a sample corresponding to the maximum information gain rate as a partitioning feature; and
    当所述最大的信息增益率不大于预设阈值时,将当前节点作为叶子节点,并选取样本数量最多的样本分类作为所述叶子节点的输出。When the maximum information gain rate is not greater than a preset threshold, the current node is taken as a leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
  5. 根据权利要求3所述的方法,其特征在于,所述判断所述子节点是否满足预设分类终止条件,包括:The method according to claim 3, wherein the determining whether the child node satisfies a preset classification termination condition comprises:
    判断所述子节点对应的去除划分特征后的子样本集中样本的类别数量是否为预设数量;及Determining whether the number of categories of samples in the subsample set after removing the partition feature corresponding to the child node is a preset number; and
    当所述子节点对应的去除划分特征后的子样本集中样本的类别数量为所述预设数量时,则确定所述子节点满足预设分类终止条件。And determining, when the number of categories of the sample of the subsample set in the sub-node corresponding to the de-divided feature is the preset quantity, determining that the sub-node satisfies the preset classification termination condition.
  6. 根据权利要求3至5中任一项所述的方法,其特征在于,所述获取特征对于目标样本集分类的信息增益率,包括:The method according to any one of claims 3 to 5, wherein the information gain rate of the acquisition feature for the target sample set classification comprises:
    获取特征对于目标样本集分类的信息增益;Acquiring the information gain of the feature classification for the target sample set;
    获取特征对于目标样本集分类的分裂信息;及Obtaining split information of the feature classification for the target sample set; and
    根据所述信息增益与所述分裂信息获取特征对于目标样本集分类的信息增益率。And an information gain rate classified by the information gain and the split information acquisition feature for the target sample set according to the information gain.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述信息增益与所述分裂信息获取特征对于目标样本集分类的信息增益率,包括:The method according to claim 6, wherein the information gain rate classified according to the information gain and the split information acquisition feature for the target sample set comprises:
    通过
    Figure PCTCN2018117694-appb-100001
    计算特征对于目标样本集分类的信息增益率;
    by
    Figure PCTCN2018117694-appb-100001
    Calculating the information gain rate of the feature classification for the target sample set;
    其中,D表示样本集,g(D,A)为特征A对于样本集D分类的信息增益,H A(D)为特征A的分裂信息,g R(D,A)为特征A对于样本集D分类的信息增益率; Where D represents the sample set, g(D, A) is the information gain of feature A for sample set D classification, H A (D) is the split information of feature A, and g R (D, A) is feature A for the sample set Information gain rate of the D classification;
    所述g(D,A)通过
    Figure PCTCN2018117694-appb-100002
    计算得到;
    The g(D, A) passes
    Figure PCTCN2018117694-appb-100002
    Calculated
    其中,H(D)为样本集D分类的经验熵,H(D|A)为特征A对于样本集D分类的条件熵,n为特征A的样本取值种类数,p i为特征A取第i种取值的样本在样本集中出现的概率,n和i均为大于零的正整数。 Where H(D) is the empirical entropy of the sample set D classification, H(D|A) is the conditional entropy of the feature A for the sample set D classification, n is the number of sample values of the feature A, and p i is the feature A The probability that the sample of the i-th value appears in the sample set, n and i are positive integers greater than zero.
  8. 根据权利要求1所述的方法,其特征在于,在所述对所述目标应用进行冻结之前,还包括:The method according to claim 1, wherein before the freezing of the target application, the method further comprises:
    检测所述目标应用是否属于白名单应用,当所述目标应用属于白名单应用时,则对所述目标应用免冻结;当所述目标应用不属于所述白名单应用时,执行所述对所述目标应用进行冻结。Detecting whether the target application belongs to a whitelist application, and when the target application belongs to a whitelist application, freezes the target application; and when the target application does not belong to the whitelist application, executing the opposite The target application is frozen.
  9. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following operations:
    获取每个特征的第一特征数据,所述第一特征数据为对应特征在预测时刻下的特征数据;Obtaining first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time;
    获取用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,所述预设时长的起始时刻为预测时刻;Obtaining a decision tree model for predicting whether the user will use the target application within a preset duration, where the starting time of the preset duration is a predicted moment;
    将所述第一特征数据作为所述决策树模型的输入,输出预测结果;及Using the first feature data as an input of the decision tree model, and outputting a prediction result; and
    当所述预测结果为不会在预设时长之内使用所述目标应用时,对所述目标应用进行冻结。When the predicted result is that the target application is not used within a preset duration, the target application is frozen.
  10. 根据权利要求9所述的电子设备,其特征在于,所述处理器在执行所述获取预设的每个特征的第一特征数据之前,还执行如下操作:The electronic device according to claim 9, wherein the processor further performs the following operations before performing the acquiring the first feature data of each feature preset:
    获取预设的每个特征的第二特征数据作为样本,生成样本集,所述第二特征数据为在预测时刻之前,启动了参考应用时的对应特征的特征数据,所述参考应用包括所述目标应用;及Obtaining a second feature data of each feature as a sample, and generating a sample set, where the second feature data is feature data of a corresponding feature when the reference application is started before the predicted time, the reference application includes the Target application; and
    当所述样本集的数据量超过预设阈值时,根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型。When the data volume of the sample set exceeds a preset threshold, classifying the sample set according to the information gain rate of the feature classification for the sample set, and generating a method for predicting whether the user will use the target application within a preset duration Decision tree model.
  11. 根据权利要求10所述的电子设备,其特征在于,所述处理器执行所述根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型时,还执行如下操作:The electronic device according to claim 10, wherein the processor performs sample classification on the sample set according to an information gain rate of the feature classification for the sample set, and generates a method for predicting whether the user will be at a preset duration When the decision tree model of the target application is used, the following operations are also performed:
    将所述样本集作为决策树的根节点的节点信息;Using the sample set as node information of a root node of the decision tree;
    将所述根节点的节点信息确定为当前待分类的目标样本集;Determining the node information of the root node as a target sample set to be classified currently;
    获取特征对于目标样本集分类的信息增益率;Obtaining the information gain rate of the feature classification for the target sample set;
    根据所述信息增益率从所述目标样本集中选取样本作为划分特征;Selecting a sample from the target sample set as a division feature according to the information gain rate;
    根据所述划分特征对所述目标样本集进行划分,生成至少一个子样本集;And dividing the target sample set according to the dividing feature to generate at least one sub-sample set;
    去除每个所述子样本集中样本的划分特征;Removing the partitioning features of the samples in each of the subsample sets;
    生成当前节点的子节点,并将去除划分特征后的子样本集作为所述子节点的节点信息;Generating a child node of the current node, and removing the subsample set after dividing the feature as node information of the child node;
    判断所述子节点是否满足预设分类终止条件;Determining whether the child node meets a preset classification termination condition;
    当所述子节点不满足预设分类终止条件时,则将所述目标样本集更新为所述去除划分特征后的子样本集,并返回执行获取特征对于目标样本集分类的信息增益率;及And when the child node does not satisfy the preset classification termination condition, updating the target sample set to the sub-sample set after the dividing feature is removed, and returning an information gain rate of performing the acquiring feature for the target sample set classification;
    当所述子节点满足所述预设分类终止条件时,则将所述子节点作为叶子节点,根据所述去除划分特征后的子样本集的类别设置所述叶子节点的输出。When the child node satisfies the preset classification termination condition, the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
  12. 根据权利要求11所述的电子设备,其特征在于,所述处理器执行所述根据所述信息增益率从 所述目标样本集中选取样本作为划分特征时,还执行如下操作:The electronic device according to claim 11, wherein when the processor performs the selecting a sample from the target sample set according to the information gain rate as a dividing feature, the processor further performs the following operations:
    从所述信息增益率中确定最大的信息增益率;Determining a maximum information gain rate from the information gain rate;
    当所述最大的信息增益率大于预设阈值时,选取所述最大的信息增益率对应的样本作为划分特征;及When the maximum information gain rate is greater than a preset threshold, selecting a sample corresponding to the maximum information gain rate as a partitioning feature; and
    当所述最大的信息增益率不大于预设阈值时,将当前节点作为叶子节点,并选取样本数量最多的样本分类作为所述叶子节点的输出。When the maximum information gain rate is not greater than a preset threshold, the current node is taken as a leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
  13. 根据权利要求11所述的电子设备,其特征在于,所述处理器执行所述判断所述子节点是否满足预设分类终止条件时,还执行如下操作:The electronic device according to claim 11, wherein when the processor performs the determining whether the child node satisfies a preset classification termination condition, the processor further performs the following operations:
    判断所述子节点对应的去除划分特征后的子样本集中样本的类别数量是否为预设数量;及Determining whether the number of categories of samples in the subsample set after removing the partition feature corresponding to the child node is a preset number; and
    当所述子节点对应的去除划分特征后的子样本集中样本的类别数量为所述预设数量时,则确定所述子节点满足预设分类终止条件。And determining, when the number of categories of the sample of the subsample set in the sub-node corresponding to the de-divided feature is the preset quantity, determining that the sub-node satisfies the preset classification termination condition.
  14. 根据权利要求11至13中任一项所述的电子设备,其特征在于,所述处理器执行所述获取特征对于目标样本集分类的信息增益率时,还执行如下操作:The electronic device according to any one of claims 11 to 13, wherein when the processor performs the information gain rate of the acquisition feature for the target sample set classification, the following operations are also performed:
    获取特征对于目标样本集分类的信息增益;Acquiring the information gain of the feature classification for the target sample set;
    获取特征对于目标样本集分类的分裂信息;及Obtaining split information of the feature classification for the target sample set; and
    根据所述信息增益与所述分裂信息获取特征对于目标样本集分类的信息增益率。And an information gain rate classified by the information gain and the split information acquisition feature for the target sample set according to the information gain.
  15. 根据权利要求14所述的电子设备,其特征在于,所述处理器执行所述根据所述信息增益与所述分裂信息获取特征对于目标样本集分类的信息增益率时,还执行如下操作:The electronic device according to claim 14, wherein the processor performs the following operations when performing the information gain rate according to the information gain and the split information acquisition feature for the target sample set:
    通过
    Figure PCTCN2018117694-appb-100003
    计算特征对于目标样本集分类的信息增益率;
    by
    Figure PCTCN2018117694-appb-100003
    Calculating the information gain rate of the feature classification for the target sample set;
    其中,D表示样本集,g(D,A)为特征A对于样本集D分类的信息增益,HA(D)为特征A的分裂信息,gR(D,A)为特征A对于样本集D分类的信息增益率;Where D is the sample set, g(D, A) is the information gain of feature A for the sample set D, HA(D) is the split information of feature A, gR(D, A) is the feature A, and sample D is classified. Information gain rate;
    所述g(D,A)通过
    Figure PCTCN2018117694-appb-100004
    计算得到;
    The g(D, A) passes
    Figure PCTCN2018117694-appb-100004
    Calculated
    其中,H(D)为样本集D分类的经验熵,H(D|A)为特征A对于样本集D分类的条件熵,n为特征A的样本取值种类数,pi为特征A取第i种取值的样本在样本集中出现的概率,n和i均为大于零的正整数。Where H(D) is the empirical entropy of the sample set D classification, H(D|A) is the conditional entropy of the feature A for the sample set D classification, n is the number of sample values of the feature A, and pi is the feature A. The probability that a sample of i values appears in the sample set, n and i are positive integers greater than zero.
  16. 根据权利要求9所述的电子设备,其特征在于,所述处理器在执行所述对所述目标应用进行冻结之前,还执行如下操作:The electronic device according to claim 9, wherein the processor further performs the following operations before performing the freezing of the target application:
    检测所述目标应用是否属于白名单应用,当所述目标应用属于白名单应用时,则对所述目标应用免冻结;当所述目标应用不属于所述白名单应用时,执行所述对所述目标应用进行冻结。Detecting whether the target application belongs to a whitelist application, and when the target application belongs to a whitelist application, freezes the target application; and when the target application does not belong to the whitelist application, executing the opposite The target application is frozen.
  17. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行如下操作:A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by the processor as follows:
    获取每个特征的第一特征数据,所述第一特征数据为对应特征在预测时刻下的特征数据;Obtaining first feature data of each feature, where the first feature data is feature data of the corresponding feature at the predicted time;
    获取用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型,所述预设时长的起始时刻为预测时刻;Obtaining a decision tree model for predicting whether the user will use the target application within a preset duration, where the starting time of the preset duration is a predicted moment;
    将所述第一特征数据作为所述决策树模型的输入,输出预测结果;及Using the first feature data as an input of the decision tree model, and outputting a prediction result; and
    当所述预测结果为不会在预设时长之内使用所述目标应用时,对所述目标应用进行冻结。When the predicted result is that the target application is not used within a preset duration, the target application is frozen.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述处理器在执行所述获取预设的每个特征的第一特征数据之前,还执行如下操作:The computer readable storage medium according to claim 17, wherein the processor further performs the following operations before performing the acquiring the first feature data of each feature preset:
    获取预设的每个特征的第二特征数据作为样本,生成样本集,所述第二特征数据为在预测时刻之前,启动了参考应用时的对应特征的特征数据,所述参考应用包括所述目标应用;及Obtaining a second feature data of each feature as a sample, and generating a sample set, where the second feature data is feature data of a corresponding feature when the reference application is started before the predicted time, the reference application includes the Target application; and
    当所述样本集的数据量超过预设阈值时,根据特征对于样本集分类的信息增益率对样本集进行样 本分类,生成用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型。When the data volume of the sample set exceeds a preset threshold, classifying the sample set according to the information gain rate of the feature classification for the sample set, and generating a method for predicting whether the user will use the target application within a preset duration Decision tree model.
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述处理器执行所述根据特征对于样本集分类的信息增益率对样本集进行样本分类,生成用于预测用户是否会在预设时长之内使用所述目标应用的决策树模型时,还执行如下操作:The computer readable storage medium according to claim 18, wherein the processor performs sample classification on the sample set according to an information gain rate of the feature classification for the sample set, and generates a prediction for whether the user is predicting When using the decision tree model of the target application within the duration, the following operations are also performed:
    将所述样本集作为决策树的根节点的节点信息;Using the sample set as node information of a root node of the decision tree;
    将所述根节点的节点信息确定为当前待分类的目标样本集;Determining the node information of the root node as a target sample set to be classified currently;
    获取特征对于目标样本集分类的信息增益率;Obtaining the information gain rate of the feature classification for the target sample set;
    根据所述信息增益率从所述目标样本集中选取样本作为划分特征;Selecting a sample from the target sample set as a division feature according to the information gain rate;
    根据所述划分特征对所述目标样本集进行划分,生成至少一个子样本集;And dividing the target sample set according to the dividing feature to generate at least one sub-sample set;
    去除每个所述子样本集中样本的划分特征;Removing the partitioning features of the samples in each of the subsample sets;
    生成当前节点的子节点,并将去除划分特征后的子样本集作为所述子节点的节点信息;Generating a child node of the current node, and removing the subsample set after dividing the feature as node information of the child node;
    判断所述子节点是否满足预设分类终止条件;Determining whether the child node meets a preset classification termination condition;
    当所述子节点不满足预设分类终止条件时,则将所述目标样本集更新为所述去除划分特征后的子样本集,并返回执行获取特征对于目标样本集分类的信息增益率;及And when the child node does not satisfy the preset classification termination condition, updating the target sample set to the sub-sample set after the dividing feature is removed, and returning an information gain rate of performing the acquiring feature for the target sample set classification;
    当所述子节点满足所述预设分类终止条件时,则将所述子节点作为叶子节点,根据所述去除划分特征后的子样本集的类别设置所述叶子节点的输出。When the child node satisfies the preset classification termination condition, the child node is used as a leaf node, and the output of the leaf node is set according to the category of the subsample set after the division feature is removed.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述处理器执行所述根据所述信息增益率从所述目标样本集中选取样本作为划分特征时,还执行如下操作:The computer readable storage medium according to claim 19, wherein the processor further performs the following operations when performing the selecting a sample from the target sample set according to the information gain rate as a dividing feature:
    从所述信息增益率中确定最大的信息增益率;Determining a maximum information gain rate from the information gain rate;
    当所述最大的信息增益率大于预设阈值时,选取所述最大的信息增益率对应的样本作为划分特征;及When the maximum information gain rate is greater than a preset threshold, selecting a sample corresponding to the maximum information gain rate as a partitioning feature; and
    当所述最大的信息增益率不大于预设阈值时,将当前节点作为叶子节点,并选取样本数量最多的样本分类作为所述叶子节点的输出。When the maximum information gain rate is not greater than a preset threshold, the current node is taken as a leaf node, and the sample with the largest number of samples is selected as the output of the leaf node.
  21. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述处理器执行所述判断所述子节点是否满足预设分类终止条件时,还执行如下操作:The computer readable storage medium according to claim 19, wherein when the processor performs the determining whether the child node satisfies a preset classification termination condition, the processor further performs the following operations:
    判断所述子节点对应的去除划分特征后的子样本集中样本的类别数量是否为预设数量;及Determining whether the number of categories of samples in the subsample set after removing the partition feature corresponding to the child node is a preset number; and
    当所述子节点对应的去除划分特征后的子样本集中样本的类别数量为所述预设数量时,则确定所述子节点满足预设分类终止条件。And determining, when the number of categories of the sample of the subsample set in the sub-node corresponding to the de-divided feature is the preset quantity, determining that the sub-node satisfies the preset classification termination condition.
  22. 根据权利要求19至21中任一项所述的计算机可读存储介质,其特征在于,所述处理器执行所述获取特征对于目标样本集分类的信息增益率时,还执行如下操作:The computer readable storage medium according to any one of claims 19 to 21, wherein when the processor performs the information gain rate of the acquisition feature for the target sample set classification, the following operations are also performed:
    获取特征对于目标样本集分类的信息增益;Acquiring the information gain of the feature classification for the target sample set;
    获取特征对于目标样本集分类的分裂信息;及Obtaining split information of the feature classification for the target sample set; and
    根据所述信息增益与所述分裂信息获取特征对于目标样本集分类的信息增益率。And an information gain rate classified by the information gain and the split information acquisition feature for the target sample set according to the information gain.
  23. 根据权利要求22所述的计算机可读存储介质,其特征在于,所述处理器执行所述根据所述信息增益与所述分裂信息获取特征对于目标样本集分类的信息增益率时,还执行如下操作:The computer readable storage medium according to claim 22, wherein the processor performs the following information gain ratio according to the information gain and the split information acquisition feature for a target sample set, and further performs the following operating:
    通过
    Figure PCTCN2018117694-appb-100005
    计算特征对于目标样本集分类的信息增益率;
    by
    Figure PCTCN2018117694-appb-100005
    Calculating the information gain rate of the feature classification for the target sample set;
    其中,D表示样本集,g(D,A)为特征A对于样本集D分类的信息增益,HA(D)为特征A的分裂信息,gR(D,A)为特征A对于样本集D分类的信息增益率;Where D is the sample set, g(D, A) is the information gain of feature A for the sample set D, HA(D) is the split information of feature A, gR(D, A) is the feature A, and sample D is classified. Information gain rate;
    所述g(D,A)通过
    Figure PCTCN2018117694-appb-100006
    计算得到;
    The g(D, A) passes
    Figure PCTCN2018117694-appb-100006
    Calculated
    其中,H(D)为样本集D分类的经验熵,H(D|A)为特征A对于样本集D分类的条件熵,n为特征A的样本取值种类数,pi为特征A取第i种取值的样本在样本集中出现的概率,n和i均为大于零的正 整数。Where H(D) is the empirical entropy of the sample set D classification, H(D|A) is the conditional entropy of the feature A for the sample set D classification, n is the number of sample values of the feature A, and pi is the feature A. The probability that a sample of i values appears in the sample set, n and i are positive integers greater than zero.
  24. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述处理器在执行所述对所述目标应用进行冻结之前,还执行如下操作:The computer readable storage medium according to claim 17, wherein the processor further performs the following operations before performing the freezing of the target application:
    检测所述目标应用是否属于白名单应用,当所述目标应用属于白名单应用时,则对所述目标应用免冻结;当所述目标应用不属于所述白名单应用时,执行所述对所述目标应用进行冻结。Detecting whether the target application belongs to a whitelist application, and when the target application belongs to a whitelist application, freezes the target application; and when the target application does not belong to the whitelist application, executing the opposite The target application is frozen.
PCT/CN2018/117694 2017-12-29 2018-11-27 Application processing method, electronic device, and computer readable storage medium WO2019128598A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711484440.9 2017-12-29
CN201711484440.9A CN109992367A (en) 2017-12-29 2017-12-29 Application processing method and device, electronic equipment, computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2019128598A1 true WO2019128598A1 (en) 2019-07-04

Family

ID=67066384

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/117694 WO2019128598A1 (en) 2017-12-29 2018-11-27 Application processing method, electronic device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN109992367A (en)
WO (1) WO2019128598A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491572B (en) * 2019-09-12 2022-01-21 华为技术有限公司 Method and device for predicting connection state between terminals and analysis equipment
CN111708427B (en) * 2020-05-29 2022-07-22 广州三星通信技术研究有限公司 Method for managing terminal and terminal
CN112130991A (en) * 2020-08-28 2020-12-25 北京思特奇信息技术股份有限公司 Application program control method and system based on machine learning
CN112390388B (en) * 2020-11-25 2022-06-14 创新奇智(青岛)科技有限公司 Model training method, aeration value estimation method and device and electronic equipment
CN112256354B (en) * 2020-11-25 2023-05-16 Oppo(重庆)智能科技有限公司 Application starting method and device, storage medium and electronic equipment
CN112330069A (en) * 2020-11-27 2021-02-05 上海眼控科技股份有限公司 Early warning removing method and device, electronic equipment and storage medium
CN113627932B (en) * 2021-08-11 2024-02-27 中国银行股份有限公司 Method and device for controlling waiting time of terminal application account in network-free state
CN114416600B (en) * 2022-03-29 2022-06-28 腾讯科技(深圳)有限公司 Application detection method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105868222A (en) * 2015-09-17 2016-08-17 乐视网信息技术(北京)股份有限公司 Task scheduling method and device
CN106250532A (en) * 2016-08-04 2016-12-21 广州优视网络科技有限公司 Application recommendation method, device and server
CN106294743A (en) * 2016-08-10 2017-01-04 北京奇虎科技有限公司 The recommendation method and device of application function

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7016887B2 (en) * 2001-01-03 2006-03-21 Accelrys Software Inc. Methods and systems of classifying multiple properties simultaneously using a decision tree
CN105389193B (en) * 2015-12-25 2019-04-26 北京奇虎科技有限公司 Accelerated processing method, device and system, the server of application
CN106793031B (en) * 2016-12-06 2020-11-10 常州大学 Smart phone energy consumption optimization method based on set competitive optimization algorithm
CN107133094B (en) * 2017-06-05 2021-11-02 努比亚技术有限公司 Application management method, mobile terminal and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105868222A (en) * 2015-09-17 2016-08-17 乐视网信息技术(北京)股份有限公司 Task scheduling method and device
CN106250532A (en) * 2016-08-04 2016-12-21 广州优视网络科技有限公司 Application recommendation method, device and server
CN106294743A (en) * 2016-08-10 2017-01-04 北京奇虎科技有限公司 The recommendation method and device of application function

Also Published As

Publication number Publication date
CN109992367A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
WO2019128598A1 (en) Application processing method, electronic device, and computer readable storage medium
US11244672B2 (en) Speech recognition method and apparatus, and storage medium
CN107679559B (en) Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN109992398B (en) Resource management method, resource management device, mobile terminal and computer-readable storage medium
WO2019128546A1 (en) Application program processing method, electronic device, and computer readable storage medium
CN107368400B (en) CPU monitoring method and device, computer readable storage medium and mobile terminal
CN107704070B (en) Application cleaning method and device, storage medium and electronic equipment
CN112703714B (en) Application processing method and device, computer equipment and computer readable storage medium
CN109992364B (en) Application freezing method and device, computer equipment and computer readable storage medium
CN108108455B (en) Destination pushing method and device, storage medium and electronic equipment
WO2019137252A1 (en) Memory processing method, electronic device, and computer-readable storage medium
CN110032266B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
WO2019062416A1 (en) Application cleaning method and apparatus, storage medium and electronic device
CN111222563A (en) Model training method, data acquisition method and related device
WO2019128574A1 (en) Information processing method and device, computer device and computer readable storage medium
CN109992425B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
WO2019128569A1 (en) Method and apparatus for freezing application, and storage medium and terminal
CN109375995B (en) Application freezing method and device, storage medium and electronic equipment
WO2019137187A1 (en) Resource management method and apparatus, mobile terminal and computer-readable storage medium
CN109726726B (en) Event detection method and device in video
CN109429229B (en) Method, device and computer readable storage medium for acquiring network access information
CN110007968B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
CN110046030B (en) Application program processing method and device, electronic equipment and computer readable storage medium
WO2019128570A1 (en) Method and apparatus for freezing application, and storage medium and terminal

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

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

Country of ref document: EP

Kind code of ref document: A1