Application program processing method and device, electronic equipment and computer readable storage medium
A technology of application programs and electronic equipment, which is applied in the computer field and can solve problems such as occupying memory and hardware
Pending Publication Date: 2019-07-09
GUANGDONG OPPO MOBILE TELECOMM CORP LTD
5 Cites 0 Cited by
AI-Extracted Technical Summary
Problems solved by technology
However, since the application program still exists in the smart device, it...
Method used
[0052] The target application program refers to an application program that requires resource limitation processing, and the resource limitation processing refers to a process of limiting the resources of the electronic device used by the application program. For example, limit the amount of memory an application can occupy at runtime to no more than 4% of total memory. Historical running data can reflect the user's habit of using applications in the past. According to the historical running data, the target application that occupies more resources can be obtained, and the target application is subjected to resource limitation processing to reduce the excessive occupation of resources by the target application.
[0081] In the embodiment provided by this application, performing resource restriction processing on the target application program according to the second resource restriction policy includes: when it is detected that the target application program is switched from the foreground to the background, start timing; if the timing duration exceeds the second If the duration threshold is set, the target application is controlled to enter the frozen state. The target application program in the frozen state cannot continue to run, which can reduce the resource occupation of the electronic device by the target application program. The frozen target application program can also be woken up, and the user or system can set the wake-up conditions.
[0091] In one embodiment, as shown in FIG. 6, a partial architecture diagram of an electronic device is provided. Wherein, the architecture system of the electronic device includes a JAVA space layer 61 , a local framework layer 62 and a kernel (Kernel) space layer 63 . The JAVA space layer 61 may include a policy application 610, through which the electronic device can initiate a freezing and unfreezing policy for each application, so as to implement freezing and unfreezing operations for each application in the electronic device. For example, the policy application 610 is used to determine the application program that consumes power in the background, and initiates a freezing operation for the application program that consumes power in the background. The local framework layer 62 includes a resource priority and restrictio...
Abstract
The invention provides an application program processing method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring a user image corresponding to a user using electronic equipment through a camera, and obtaining a user identifier according to the user image; according to the user identifier, obtaining the average running timelength of the electronic equipment and historical running data of all application programs installed in the electronic equipment, wherein the average running time length represents the average running time length of the electronic equipment within the unit time length; obtaining a resource limiting strategy according to the average running time length, and obtaining a target application program according to the historical running data; and carrying out resource limiting processing on the target application program according to the resource limiting strategy. According to the application program processing method and device, the electronic equipment and the computer readable storage medium, the electronic equipment can control the application program more accurately.
Application Domain
Program initiation/switchingResource allocation +1
Technology Topic
User identifierElectronic equipment +2
Image
Examples
- Experimental program(1)
Example Embodiment
[0035] In order to make the purpose, technical solutions, and advantages of this application clearer, the following further describes the application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the application, but not to limit the application.
[0036] It can be understood that the terms "first", "second", etc. used in this application can be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element. For example, without departing from the scope of this application, the first client may be referred to as the second client, and similarly, the second client may be referred to as the first client. Both the first client and the second client are clients, but they are not the same client.
[0037] figure 1 It is a schematic diagram of the application environment of the application processing method in an embodiment. Such as figure 1 As shown, the application environment includes a client 102 and a server 104. An application can be installed on the client 102, and then user images are collected through a camera, and the user identification is obtained according to the user image; the average running time of the client 102 and the historical running data of each application installed in the client 102 are obtained according to the user identification. The average running time represents the average running time of the client 102 in a unit time; the resource restriction strategy is obtained according to the average running time, and the target application is obtained according to historical running data; the target application is subjected to resource restriction processing according to the resource restriction strategy. Among them, the client 102 is an electronic device located at the outermost periphery of a computer network and mainly used for inputting user information and outputting processing results. For example, it may be a personal computer, a mobile terminal, a personal digital assistant, a wearable electronic device, etc. The server 104 is a device used to respond to service requests and provide computing services at the same time. For example, it may be one or more computers. It is understandable that in other embodiments provided in this application, the application environment of the application processing method may only include the client 102.
[0038] Such as figure 2 As shown, a schematic diagram of the internal structure of an electronic device is provided. The electronic device includes a processor, a memory, and a display screen connected through a system bus. Among them, 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 at least one computer program is stored in the memory, and the computer program can be executed by the processor to implement the application processing method suitable for electronic devices provided in the embodiments of the present application . The memory may include non-volatile storage media such as magnetic disks, optical disks, read-only memory (Read-Only Memory, ROM), or random-access-memory (Random-Access-Memory, RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program may be executed by a processor to implement an application program processing method provided by each embodiment of the present application. The internal memory provides a cached operating environment for the operating system and computer programs in the non-volatile storage medium. The display screen can be a touch screen, such as a capacitive screen or an electronic screen, used to display the interface information of the application corresponding to the foreground process, and can also be used to detect touch operations on the display screen and generate corresponding instructions, such as performing front and back Application switching instructions, etc.
[0039] Those skilled in the art can understand, figure 2 The structure shown in is only a block diagram of a part of the structure related to the solution of the application, and does not constitute a limitation on the electronic device to which the solution of the application is applied. The specific electronic device may include more or Fewer parts, or combine some parts, or have a different arrangement of parts. For example, the electronic device also includes a network interface connected via a system bus. The network interface can be an Ethernet card or a wireless network card, etc., for communicating with external electronic devices, for example, for communicating with a server.
[0040] image 3 It is a flowchart of an application processing method in an embodiment. The application processing method in this embodiment can run on figure 1 Take the terminal or server as an example in the description. Such as image 3 As shown, the application processing method includes step 302 to step 308. among them:
[0041] Step 302: Collect a user image corresponding to a user who uses the electronic device through a camera, and obtain a user identification based on the user image.
[0042] In one embodiment, cameras can be installed on the electronic device, and the number of cameras installed is not limited. For example, one, two, or more than two cameras can be installed on the electronic device. The camera may include a front camera and a rear camera. When a user uses an electronic device, he can collect a user image through a camera. The generated user image can be displayed on the display screen of the electronic device or not on the display screen of the electronic device, which is not performed in this embodiment. limited. The collected user images may include, but are not limited to, the user's face. The electronic device can recognize the user's face in the user's image and perform matching based on the face to obtain the corresponding user identification.
[0043] It is understandable that the user ID refers to a unique ID that distinguishes different users. The user ID is pre-stored in the electronic device, and the user ID and the user information are correspondingly established. User information refers to user-related information, which can be identified through user images. For example, the user information may include the user's face, iris, facial features and other information. When a user uses an electronic device, the user's image can be captured through a camera installed on the electronic device. The user information can be identified according to the user image, and then the corresponding user identification can be obtained according to the user information. For example, the user's iris is recognized based on the user's image, and then the corresponding user identification is obtained based on the user's iris.
[0044] Step 304: Obtain the average running time of the electronic device and the historical running data of each application installed in the electronic device according to the user identification. The average running time represents the average running time of the electronic device in the unit time.
[0045] Application (APP) refers to software written for a certain application purpose in an electronic device, and the electronic device can implement services to users' needs through the application. For example, users can play games through game applications, watch videos through video applications, and play music through music applications. Applications can be divided into foreground applications and background applications according to their running status. The foreground application program refers to the application program running in the foreground of the electronic device, and the foreground application program can be displayed in the foreground and interact with the user. A background application program refers to an application program running in the background of an electronic device, and a background application program generally cannot be displayed in the foreground and can interact with the user.
[0046] Generally, the application operation of an application program is jointly completed by one or more processes. A process is a running activity of a program on a certain data set in a computer, and is the basic unit of the system for resource allocation and scheduling. At the same time, a process can correspond to one or more threads. A thread is a single sequential control flow in the program and a relatively independent and schedulable execution unit in the process. The process may include a foreground process and a background process. The foreground process is a process running in the foreground of the electronic device, and the background process is a process running in the background of the electronic device. The electronic device can control the switching between the foreground process and the background process, the foreground process can be switched to the background operation, and the background process can also be switched to the foreground operation. Specifically, the process can be managed through a process pool, and the process identifiers corresponding to one or more processes can be stored in the process pool. Process ID is used to uniquely identify a process. The process pool may include a foreground process pool and a background process pool. The foreground process pool includes a process identifier corresponding to the foreground process, and the background process pool includes a process identifier corresponding to the background process. When a change in the running status of the foreground process and the background process is detected, the process pool will add or delete the changed process ID accordingly. For example, the process identifier of process A is "0123". When it is detected that process A has changed from a background process to a foreground process, the process identifier "0123" of process A can be removed from the background process pool and added to the foreground process In the pool.
[0047] In one embodiment, the state of the electronic device can be divided into a standby state and a working state. In the standby state, the electronic device does not perform any substantial operations on the file or program. Only in the working state, the electronic device can The program is processed. The average operating time indicates the average operating time of the electronic device in the unit time, and the unit time can be set in advance. For example, the average operating time may be the average operating time of the statistical electronic equipment per day, or it may be the average operating time of the electronic equipment within one month. Specifically, the electronic device records the work start time and the work end time each time it enters the working state during operation, and then can calculate the work duration of each work according to the recorded work start time and work end time.
[0048] When calculating the average operating time, you can obtain the operating data of the electronic device during the statistical period, and then calculate the operating time based on the operating data. The statistical period refers to the period of time used to count the average operating time, and the operating data refers to the data generated during the operation of the electronic device, and can include the start time and the end time of the work. According to the running data in the statistical period, the running time in each unit of time in the statistical period can be calculated, and the average running time can be calculated according to the obtained running time in each unit of time. For example, if the current time is 15:30:00 on December 25, 2017, the statistical period can be the operating data of the previous month, that is, the time from 15:30:00 on November 25, 2017 to December 25, 2017 Operating data of electronic equipment within 15:30:00 on the day. Then calculate the daily running time in this month based on the running data, and then average the daily running time to get the average running time.
[0049] During the running of the application, the electronic device can record the data generated by the application. The historical running data is the data generated during the historical running of the application before the current moment. For example, the historical running data may include the power consumption of the electronic device during the running of the application from the time of installation to the current moment, or the duration of each running of the application, the moment when the application is started, and the moment when the application is closed. Historical operating data can reflect the user's operating habits of the application, thereby reflecting the user's characteristics. Learning based on historical operating data can analyze the most frequently used applications.
[0050] In the embodiment provided in this application, when a user uses an electronic device, he can perform identity authentication through a camera installed on the electronic device. After passing the identity authentication, the electronic device stores the data generated during the operation corresponding to the user ID . In this way, the data of different users using electronic devices can be distinguished. Obtaining the average operating time of the electronic device and the historical operating data of each application installed in the electronic device according to the user identification is to obtain the average operating time and historical operating data corresponding to the user identification.
[0051] Step 306: Obtain the resource restriction strategy according to the average running time, and obtain the target application according to the historical running data.
[0052] The target application refers to an application that requires resource restriction processing, and the resource restriction processing refers to processing that restricts the resources of the electronic device used by the application. For example, limit the memory occupied by the application when it is running cannot exceed 4% of the total memory. Historical operating data can reflect the user's past habits of using applications. Based on historical operating data, target applications that take up more resources can be obtained, and the target applications are subject to resource restriction processing to reduce excessive resource occupation by the target applications.
[0053] The resource limit strategy refers to a strategy used to limit the resources of the target application, and the average running time can reflect the length of time the user uses the electronic device. The resource limit processing strategy for the target application can be obtained according to the running time. Generally, the longer the average running time is, the more the user is dependent on the electronic device, and the deeper the target application can be set for resource restriction processing. For example, if the average running time of an electronic device exceeds 8 hours, when the target application is subjected to resource restriction processing, it can be controlled that the target application can only occupy up to 5% of the resources in the electronic device when it is running; If the average running time exceeds 4 hours, then when the target application is subjected to resource restriction processing, it can be controlled that the target application can only occupy up to 10% of the resources in the electronic device when it is running.
[0054] Step 308: Perform resource restriction processing on the target application according to the resource restriction strategy.
[0055] Resources refer to the software or hardware resources that electronic devices must use when processing application events, such as the CPU (Central Processing Unit, central processing unit), memory, hardware, network resources, IO (Input-Output) of electronic devices , Input and output) and so on. Resource restriction processing refers to processing that restricts the resources occupied by the application. The resource restriction processing can be, but is not limited to, controlling the application program to enter the frozen state or the resource restriction state, and the application program in the frozen state is not closed, but not running temporarily. If the application program is in a frozen state, the application program does not occupy processor resources, but still occupies resources such as memory and hardware of the electronic device. The resource restriction state refers to a state in which the resources of the electronic device used by the application program are restricted during operation. For example, the CPU occupancy rate used by the control application when it is running cannot exceed 5%.
[0056] In the application processing method of the foregoing embodiment, the user identification can be obtained according to the user image collected by the camera, and the average running time of the electronic device and the historical running data of the application can be obtained according to the user identification. Then obtain the resource restriction strategy according to the average running time, and obtain the target application according to the historical running data. Finally, the target application is subjected to resource restriction processing according to the acquired resource restriction strategy. In this way, it is possible to control the operation of the application in the electronic device according to the user's usage habits of the electronic device, and to do different processing for different users, so that the electronic device can more accurately control the application, and improve the user of the electronic device. Viscosity.
[0057] Figure 4 It is a flowchart of an application processing method in another embodiment. The application processing method in this embodiment can run on figure 1 Take the terminal or server as an example in the description. Such as Figure 4 As shown, the application processing method includes steps 402 to 416. among them:
[0058] Step 402: Perform face detection on the user image to obtain a target face image in the user image.
[0059] Face Detection (Face Detection, FD) refers to the process of detecting the faces contained in an image. The faces contained in the image can be extracted through face detection to obtain the position and size of the face in the image. Specifically, the user's face can be detected according to the face detection model. The face detection model refers to an algorithm model that performs face detection processing on the image. The commonly used face detection model is to first extract the features of the image, and then classify and learn the extracted features to obtain a face image.
[0060] After the user image is subjected to face detection, the face image in the user image can be extracted. It is understandable that when a user uses an electronic device, there may be multiple face images in the collected user image. After performing face detection, the area of each face image can be obtained, and the face image with the largest area is used as the target face image. It is understandable that the user image is composed of several pixels, and the detected face image is composed of some pixels in the user image, so the area of the face image can be represented by the number of pixels contained .
[0061] Step 404: Match the target face image with the face image in the face database, and obtain the user ID corresponding to the matched face image.
[0062] In the embodiment provided in this application, after obtaining the target face image, the target face image can be matched with the face image in the face database. One or more face images are stored in the face database, and each face image establishes a corresponding relationship with the user ID. The electronic device can traverse the face images in the face database, and match each face image with the target face image. If there is a face image that matches the target face image, obtain the user ID corresponding to the face image that matches the target face image in the face database.
[0063] Step 406: Obtain the average running time of the electronic device and the historical running data of each application installed in the electronic device according to the user ID. The average running time represents the average running time of the electronic device in a unit time.
[0064] Step 408: Obtain the user dependence degree according to the average running time, and obtain the resource restriction policy according to the user dependence degree. The user dependence degree is used to indicate the user's dependence on the electronic device.
[0065] The degree of user dependence is used to indicate the degree of dependence of the user on the electronic device, which can include, but is not limited to, the degree of dependence of the first level, the degree of dependence of the second level and the degree of dependence of the third level. The corresponding relationship between the average running time and the degree of user dependency is established in advance, and then the corresponding user-dependent program is obtained according to the average running time. Among them, the first level of dependence is higher than the second level of dependence, and the second level of dependence is higher than the third level of dependence. For example, the average running time can be expressed as the average running time of the mobile phone every day. If the user’s average running time per day is more than 8 hours, the corresponding user dependency is the first level of dependency; if the user’s average running time per day is between 4 and 8 hours, the corresponding user dependence is the second level of dependence; if the average user runs for less than 4 hours per day, the corresponding user dependence is the third level of dependence.
[0066] Generally, the first level of dependence indicates the user's heavy dependence on electronic devices, the second level of dependence indicates the user's general dependence on electronic devices, and the third level of dependence indicates the user's light dependence on electronic devices. The corresponding relationship between the degree of user dependence and the resource restriction strategy is established in advance, and then the corresponding resource restriction strategy is obtained according to the degree of user dependence. For example, when the user dependency is the first level of dependency, if the target application runs in the foreground for more than 2 hours, the target application running in the foreground is frozen.
[0067] In one embodiment, the value range of the average operating time of the electronic device may be divided into two or more time intervals, and then the corresponding relationship between each time interval and the degree of user dependence is established, and then the corresponding relationship To obtain the degree of user dependence on electronic devices. Then, obtaining the user dependency level according to the average running time may specifically include: determining the target time interval within which the average running time falls, and obtaining the corresponding user dependency level according to the target time interval. For example, the unit duration for calculating the average operating time can be three days, then the average operating time can be expressed as the average operating time of the electronic device every three days, and the value range of the average operating time is 0 to 72 hours. Divide the value range of the average running time into three time intervals, which can be divided into three time intervals: [0,12], [12,36], [36,72], and the corresponding user dependence is the first Level of dependence, second level of dependence and third level of dependence. Assuming that the current average running time of the electronic device is 24 hours, then the user dependency level corresponding to the user is the second level of dependency.
[0068] Obtaining the resource restriction strategy according to the degree of user dependence may specifically include: when the degree of user dependence is the first degree of dependence, then obtaining the first resource restriction strategy and the second resource restriction strategy; when the degree of user dependence is the second degree of dependence, obtaining The second resource restriction strategy, in which the first level of dependence is higher than the second level of dependence. Obtain the corresponding resource restriction strategy according to the degree of user dependence, and perform resource restriction processing on the target application according to the resource restriction strategy.
[0069] In the embodiment provided in this application, the resource restriction strategy is divided into a first resource restriction strategy and a second resource restriction strategy. The first resource restriction strategy refers to controlling the target application to enter the resource restriction state according to the foreground running time of the target application. Strategy, the second resource restriction strategy refers to a strategy for controlling the target application to enter a frozen state according to the duration of the target application switching to the background. If the user's degree of dependence is the first degree of dependence, it indicates that the user's frequency of using the electronic device is too high, and resource restriction processing can be performed on both the foreground and background operations of the target application. When the user's degree of dependence is the second degree of dependence, indicating that the user's frequency of use of the electronic device is normal, only the background running of the target application can be resource restricted, that is, the second resource restriction strategy is obtained, and the second resource restriction strategy is adopted .
[0070] In addition, when the degree of user dependence is the third level of dependence, the target application may not be subjected to resource restriction processing, or the target application may be subjected to resource restriction processing according to the third resource restriction processing strategy. Specifically, if the user dependence degree is the third-level dependence degree, the third resource restriction strategy is acquired.
[0071] Step 410: Obtain the target application according to the historical running data.
[0072] In the embodiments provided in this application, historical operating data may refer to the power consumption and/or operating frequency of each application program. Then step 410 may specifically include at least one of the following methods: obtaining an application whose power consumption exceeds the power threshold as a target application; sorting the application according to the power consumption, and obtaining it from the sorted applications The application with the specified number of bits is used as the target application; the application with the operating frequency exceeding the frequency threshold is obtained as the target application; the applications are sorted according to the operating frequency, and the application with the specified number of bits is obtained from the sorted applications As the target application.
[0073] Power consumption refers to the power consumption of electronic devices during the historical operation of the application. The higher the power consumption of the application, the more frequently the user uses the application. According to the power consumption of the application, the user's usage habits of the application can be analyzed. The power threshold can be pre-set by the user or the system, and applications that consume more power than the power threshold are considered to be the most frequently used applications by the user, and then the most frequently used applications by the user can be used as the target application. It is also possible to sort each application according to power consumption, and then obtain the application with a specified number of bits from the sorted application as the target application. For example, each application program is sorted in descending order according to power consumption, and then the top three applications of the sorted application program are obtained as the target application program.
[0074] During the operation of the electronic device, the power consumption of each application is counted. Generally, the longer the running time of the application, the higher the resource occupancy rate and the higher the power consumption. For example, in the Android system, there is a Service in the framework layer that is specifically used to count electricity: BatteryStatsSerive. The BatteryStatsSerive service can be created in ActivityManagerService. The ActivityManagerService stores the data of each module in the electronic device in the batterystats.bin file in the system directory, and then analyzes the power data through the data analyzer BatteryStatsImpl to realize the statistics of power consumption.
[0075] The running frequency can refer to the number of times the application runs in a unit time, or it can refer to the average time the application runs in a unit time. The higher the running frequency of the application, the higher the frequency of the user's use of the application. According to the running frequency of the application, the user's usage habits of the application can be analyzed. Specifically, the frequency threshold can be pre-set by the user or the system. The application running frequency higher than the frequency threshold is considered to be the application most frequently used by the user, and then the application most frequently used by the user is used as the target application for resource restriction deal with. It is also possible to sort each application according to the running frequency, and then obtain the application with a specified number of digits from the sorted application as the target application. For example, the applications are sorted in descending order according to the running frequency, and then the top three applications are obtained from the sorted applications as the target application.
[0076] Step 412: Perform resource restriction processing on the target application according to the resource restriction strategy.
[0077] The resource restriction strategy includes a first resource restriction strategy and a second resource restriction strategy, and step 412 includes at least one of the following methods: performing resource restriction processing on the target application according to the first resource restriction strategy; The application performs resource restriction processing.
[0078] Performing resource restriction processing on the target application according to the first resource restriction strategy includes: obtaining the foreground running time of the target application; the current running time exceeds the first duration threshold, and then controlling the target application to enter the resource restriction state. The resource occupancy rate of the electronic device when the application is in the resource limited state is less than the occupancy threshold. When the target application is in the resource limited state, the resource occupancy rate of the electronic device by the target application cannot exceed the occupancy threshold. It can control the operating efficiency of the target application in the foreground and reduce the user's dependence on electronic equipment. For example, control the CPU occupancy rate of the target application program at runtime not to exceed 5%, so as to reduce the excessive consumption of the CPU by the target application program and reduce the user's dependence on the mobile phone. In the mobile phone system, cgroups (controlgroups, control groups) can be used to control the CPU, memory, IO and other resource occupancy rates of the target application program, that is, control the acquired target application program to enter the resource limit state.
[0079] It is also possible to control the target application to enter the resource restriction state according to the total resource occupancy rate of the electronic device, where the total resource occupancy rate refers to the ratio of the occupied resources to the total resources in the electronic device. When the foreground running time of the target application exceeds the first duration threshold, the total resource occupancy rate of the electronic device is obtained, and the target application is controlled to enter the resource limit state according to the total resource occupancy rate. Specifically, the correspondence between the total resource occupancy rate and the resource limit level can be established in advance, and the resource occupancy rate of the target application on the electronic device cannot exceed the occupancy rate threshold when the target application is in the resource limit state. At different resource limit levels, the occupancy thresholds corresponding to the target application are different. Obtain the total resource occupancy rate of the electronic device, and obtain the resource limit level according to the total resource occupancy rate; control the target application to enter the resource limit state corresponding to the resource limit level. For example, divide the total resource occupancy rate of electronic equipment into three occupancy levels: 50%-60%, 60%-80%, 80%-100%, and then correspond to light resource restriction level, normal resource restriction level, and depth respectively There are three levels of resource restriction level, and the corresponding resource restriction level can be obtained according to the total resource occupancy rate. Different resource restriction levels correspond to different occupancy rate thresholds. It can be understood that the occupancy rate thresholds corresponding to different resources may be different. For example, the CPU usage threshold may be 5%, and the memory usage threshold may be 10%.
[0080] In other embodiments, it is also possible to control the occupation of resources according to the application priority of the target application, establish the corresponding relationship between the application priority and the resource restriction level in advance, and then control the access to resources according to the application priority of the target application The resource restriction level of the restricted state. Specifically, it may include: the current station running time exceeds the first duration threshold, obtaining the application priority corresponding to the target application; obtaining the corresponding resource restriction level according to the application priority; controlling the target application to enter the resource restriction state corresponding to the resource restriction level.
[0081] In the embodiment provided in this application, performing resource restriction processing on the target application according to the second resource restriction strategy includes: starting timing when it is detected that the target application is switched from the foreground to the background; if the timing duration exceeds the second duration threshold, Then control the target application to enter the frozen state. The target application that enters the frozen state cannot continue to run, which can reduce the resource occupation of the electronic device by the target application. The frozen target application can also be awakened, and the user or the system can set the wake-up conditions.
[0082] In addition, step 412 may further include: performing resource restriction processing on the target application according to the third resource restriction strategy. Specifically, when it is detected that the target application is switched from the foreground to the background, the timing is started; if the timing duration exceeds the third duration threshold, the target application is controlled to enter the frozen state. Wherein, the second duration threshold is less than the third duration threshold.
[0083] In the Android system, there are many ways to freeze and wake up applications. Taking one of them as an example, it can be achieved through the pm (package manager, package management) command. In the pm command, the application can be set to a frozen state by the freezing command pmdisable[–user USER_ID]PACKAGE_OR_COMPONENT, and then the application can also be unfrozen The command pm enable[–user USER_ID]PACKAGE_OR_COMPONENT wakes up applications that are in the frozen state. Use the frozen list query command pm list packages-d to get the list of applications that are in the frozen state to view the applications in the frozen state. It is understandable that this application uses the Android operating system as an example to describe the application processing method, but the application processing method of this application is not limited to being implemented in the Android system, and can also be applied to IOS (IPhone Operating System), Symbian, Windows, MAC OS (Macintosh Operating System) and other operating systems.
[0084] Step 414: Obtain the restriction duration from the time when the resource restriction processing is performed on the target application to the current time.
[0085] After performing resource restriction processing on the target application, the electronic device starts a timer, and then starts timing through the timer. The electronic device can establish a corresponding timer for each target application, and when each target application performs resource restriction processing, it can time according to the corresponding timer. The corresponding relationship between the target application identifier of the target application and the timing identifier of the timer is established in advance, and the timer is searched and started to start timing through the timing identifier corresponding to the target application identifier. Taking the Android system as an example, the system can define a timer in advance. When the target application is detected to be awakened, the target application identifier searches for the corresponding timer, and clears the timer through timer.setBase(SystemClock.elapsedRealtime()) , And then start the timer through the timer.start() function to start timing.
[0086] Step 416: If the limited duration exceeds the limited duration threshold, restore the target application to a normal running state.
[0087] When the restricted duration exceeds the restricted duration threshold, the target application is restored to a normal operating state. If the target application is in the resource restriction state, the electronic device's resource restriction on the target application is released. If the target application is in the frozen state, the target application is awakened from the frozen state. After returning to the normal operating state, the target application's use of electronic device resources is no longer restricted.
[0088] Figure 5 It is a schematic diagram of the resource limit state of an application in an embodiment. Such as Figure 5 As shown, the resources of the electronic device include CPU, memory, IO, network resources, etc. The state of the application program can be divided into a normal running state, a resource limit state, and a frozen state. Among them, the resource restriction state can be divided into a light resource restriction state, a normal resource restriction state, and a deep resource restriction state. In different resource restriction states, the corresponding available resources 502 and unavailable resources 504 are different. From a light resource restriction state, a normal resource restriction state to a deep resource restriction state, the available resources 502 are decreasing. In the normal running state, the available resources 502 of the application program are 100%.
[0089] The application processing method provided in the foregoing embodiment can obtain a user identification based on a user image collected by a camera, and obtain the average operating time of the electronic device and historical operating data of the application based on the user identification. Obtain the user dependent program according to the average operating time of the electronic device, obtain the first resource restriction strategy and the second resource restriction strategy according to the degree of user dependence, and obtain the target application according to historical operation data. Then, perform resource restriction processing on the target application according to the acquired first resource restriction strategy and the second resource restriction strategy. In this way, it is possible to control the operation of the application in the electronic device according to the user's usage habits of the electronic device, and to do different processing for different users, so that the electronic device can more accurately control the application, and improve the user of the electronic device. Viscosity. In addition, after resource restriction processing is performed on the target application, the target application is restored to a normal running state to avoid affecting the normal operation of the application.
[0090] It should be understood that although image 3 with Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly restricted in order, and these steps can be executed in other orders. and, image 3 with Figure 4 At least part of the steps in may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the order of execution of these sub-steps or stages is not necessarily It is performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0091] In one embodiment, such as Image 6 As shown, a partial architecture diagram of an electronic device is provided. Wherein, the architecture system of the electronic device includes a JAVA space layer 61, a local framework layer 62, and a kernel space layer 63. The JAVA space layer 61 may include a policy application 610, and the electronic device can initiate a freezing and unfreezing strategy for each application through the policy application 610, so as to realize the freezing and unfreezing operation of each application in the electronic device. For example, the policy application 610 is used to determine the application that consumes power in the background, and initiate a freeze operation for the application that consumes power in the background. The local framework layer 62 includes a resource priority and restriction management module 620 and a platform freeze management module 622. The electronic device can maintain the priority of the application program and the corresponding resource group in real time through the resource priority and limit management module 620, and adjust the priority and resource group of the application program according to the needs of the upper layer, so as to optimize performance and save power consumption. effect. The electronic device can use the platform freeze management module 622 to assign the tasks that can be frozen in the background to the corresponding preset freezing layers according to the length of the freezing time. Optionally, the freezing layer may include: CPU limit sleep mode, CPU Freeze sleep mode, process deep freeze mode. The kernel space layer 63 includes a UID management module 630, a Cgroup module 632, a timeout freeze exit module 634, a Binder management control module 636, and a process memory recovery module 638. Among them, the UID management module 630 can manage or freeze the resources of the third-party application based on the User Identifier (UID) of the application. Compared with the process management and control based on the Process Identifier (PID), the UID is more convenient to uniformly manage the resources of a user's application. The Cgroup module 632 is used to provide a complete set of central processing unit (CPU), CPUSET, memory (memory), input/output (input/output, I/O), and Net-related resource restriction mechanisms. The timeout freeze exit module 634 is used to solve the abnormality caused by the freeze timeout scenario. The Binder management and control module 636 is used to implement priority control of the background binder communication. The process memory recovery module 638 is used to implement the deep freeze mode of the process. When the third-party application is in a frozen state for a long time, it can release the file area of the process, thereby achieving a memory-saving module and also speeding up the application's next startup. speed. Through the foregoing architecture, the application processing method in each embodiment of the present application can be implemented.
[0092] Figure 7 It is a schematic diagram of the structure of an application processing device in an embodiment. Such as Figure 7 As shown, the application processing apparatus 700 includes an identification acquisition module 702, a data acquisition module 704, a strategy acquisition module 706, and an application processing module 708. among them:
[0093] The identification acquisition module 702 is configured to collect a user image corresponding to a user using an electronic device through a camera, and acquire a user identification according to the user image.
[0094] The data acquisition module 704 is configured to acquire the average running time of the electronic device and the historical running data of each application installed in the electronic device according to the user identification, and the average running time indicates that the electronic device is in the unit The average running time in the duration.
[0095] The strategy obtaining module 706 is configured to obtain a resource restriction strategy according to the average running time, and obtain a target application according to the historical running data.
[0096] The application processing module 708 is configured to perform resource restriction processing on the target application according to the resource restriction strategy.
[0097] The application processing apparatus of the foregoing embodiment can obtain a user identification according to a user image collected by a camera, and obtain an average running time of the electronic device and historical running data of the application according to the user identification. Then obtain the resource restriction strategy according to the average running time, and obtain the target application according to the historical running data. Finally, the target application is subjected to resource restriction processing according to the acquired resource restriction strategy. In this way, it is possible to control the operation of the application in the electronic device according to the user's usage habits of the electronic device, and to do different processing for different users, so that the electronic device can more accurately control the application, and improve the user of the electronic device. Viscosity.
[0098] Figure 8 It is a schematic structural diagram of an application processing device in another embodiment. Such as Figure 8 As shown, the application processing device 800 includes an identification acquisition module 802, a data acquisition module 804, a strategy acquisition module 806, an application processing module 808, and an application recovery module 810. among them:
[0099] The identification acquisition module 802 is configured to collect a user image corresponding to a user using the electronic device through a camera, and acquire a user identification according to the user image.
[0100] The data acquisition module 804 is configured to acquire the average running time of the electronic device and the historical running data of each application installed in the electronic device according to the user identification, and the average running time indicates that the electronic device is in the unit The average running time in the duration.
[0101] The strategy obtaining module 806 is configured to obtain a resource restriction strategy according to the average running time, and obtain a target application according to the historical running data.
[0102] The application processing module 808 is configured to perform resource restriction processing on the target application according to the resource restriction policy.
[0103] The application recovery module 810 is configured to obtain the limited duration from the time when the resource restriction processing is performed on the target application to the current moment; if the limited duration exceeds the limited duration threshold, restore the target application to a normal running state .
[0104] The application processing apparatus provided in the foregoing embodiment can obtain a user identification according to a user image collected by a camera, and obtain the average running time of the electronic device and the historical running data of the application according to the user identification. Obtain the resource restriction strategy according to the average operation time of the electronic device, and obtain the target application according to the historical operation data. Then, the target application is subjected to resource restriction processing according to the obtained resource restriction strategy. In this way, it is possible to control the operation of the application in the electronic device according to the user's usage habits of the electronic device, and to do different processing for different users, so that the electronic device can more accurately control the application, and improve the user of the electronic device. Viscosity. In addition, after resource restriction processing is performed on the target application, the target application is restored to a normal running state to avoid affecting the normal operation of the application.
[0105] In one embodiment, the identification acquisition module 802 is further configured to perform face detection on the user image, acquire a target face image in the user image; compare the target face image with the face in the face database The images are matched, and the user ID corresponding to the matched face image is obtained.
[0106] In one embodiment, the policy obtaining module 806 is further configured to obtain a user dependency level according to the average running time, and obtain a resource restriction policy according to the user dependency level, and the user dependency level is used to indicate the user's reliance on the electronic device The degree of dependence.
[0107] In one embodiment, the strategy acquisition module 806 is further configured to determine the target duration interval into which the average running duration falls, and acquire the corresponding user dependency degree according to the target duration interval.
[0108] In one embodiment, the policy obtaining module 806 is further configured to obtain the first resource restriction policy and the second resource restriction policy when the user dependency is the first level of dependency; when the user dependency is the second level Depending on the degree of dependence, a second resource restriction strategy is obtained, wherein the first level of dependence is higher than the second level of dependence.
[0109] In one embodiment, the policy acquisition module 806 is further configured to perform resource restriction processing on the target application according to the first resource restriction strategy; and/or perform resource restriction processing on the target application according to the second resource restriction strategy Resource restriction processing.
[0110] In one embodiment, the policy acquisition module 806 is further configured to acquire the application programs whose power consumption exceeds the power threshold as target applications; sort the applications according to the power consumption, and perform the sorting Obtain the application program with a specified number of bits as the target application program; obtain the application program whose running frequency exceeds the frequency threshold as the target application program; and/or sort the application programs according to the running frequency, and after sorting Obtain the application with the specified number of digits as the target application.
[0111] In one embodiment, the application processing module 808 is further configured to obtain the foreground running time of the target application; when the foreground running time exceeds a first duration threshold, control the target application to enter the resource limit state.
[0112] In one embodiment, the application processing module 808 is further configured to start timing when it is detected that the target application is switched from the foreground to the background; if the timing duration exceeds the second duration threshold, control the target application to enter the frozen state .
[0113] The division of the modules in the application processing device is only for illustration. 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.
[0114] The implementation of each module in the application program processing apparatus provided in the embodiment of the present application may be in the form of a computer program. The computer program can be run on a terminal or server. The program module constituted by the computer program can be stored in the memory of the terminal or server. When the computer program is executed by the processor, it realizes the steps of the method described in the embodiments of the present application.
[0115] The embodiment of the present application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which when the computer-executable instructions are executed by one or more processors, cause the processors to execute the application programs provided in the foregoing embodiments Approach.
[0116] A computer program product containing instructions, when it runs on a computer, causes the computer to execute the application program processing method provided in the foregoing embodiments.
[0117] The embodiment of the present application also provides an electronic device. Such as Picture 9 As shown, for ease of description, only the parts related to the embodiments of the present application are shown. For specific technical details that are not disclosed, please refer to the method part of the embodiments of the present application. The electronic device can be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a car computer, a wearable device, etc., taking the electronic device as a mobile phone as an example :
[0118] Picture 9 It is a block diagram of a part of the structure of a mobile phone related to the electronic device provided in the embodiment of the present application. reference Picture 9 The mobile phone includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, a processor 980, and a power supply 990 and other parts. Those skilled in the art can understand, Picture 9 The structure of the mobile phone shown does not constitute a limitation on the mobile phone, and may include more or less components than shown, or a combination of some components, or a different component arrangement.
[0119] Among them, the RF circuit 910 can be used for receiving and sending signals during the process of receiving and sending information or talking. After receiving the downlink information of the base station, it can be processed by the processor 980; it can also send uplink data to the base station. Generally, the RF circuit includes, but is 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, the RF circuit 910 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can 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). Access, CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Email, Short Messaging Service (SMS), etc.
[0120] The memory 920 may be used to store software programs and modules. The processor 980 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, an application program required by at least one function (such as an application program for a sound playback function, an application program for an image playback function, etc.), etc.; The data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone. In addition, the memory 920 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0121] The input unit 930 may be used to receive inputted numeric or character information, and generate key signal input related to user settings and function control of the mobile phone 900. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, which can also be called a touch screen, can collect user touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 931 or near the touch panel 931 Operation), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 931 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, and detects the 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 it into contact coordinates, and then sends it To the processor 980, and can receive and execute the commands sent by the processor 980. In addition, the touch panel 931 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 931, the input unit 930 may also include other input devices 932. Specifically, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.).
[0122] The display unit 940 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941. In one embodiment, the display panel 941 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. In one embodiment, the touch panel 931 can cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, it transmits it to the processor 980 to determine the type of the touch event. The type of touch event provides a corresponding visual output on the display panel 941. Although in Picture 9 The touch panel 931 and the display panel 941 are used as two independent components to realize the input and input functions of the mobile phone. However, in some embodiments, the touch panel 931 and the display panel 941 can be integrated to realize the input of the mobile phone. And output function.
[0123] The mobile phone 900 may also include at least one sensor 950, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 941 according to the brightness of the ambient light. The proximity sensor can close the display panel 941 and/or when the mobile phone is moved to the ear. Or backlight. Motion sensors can include acceleration sensors. The acceleration sensors can detect the magnitude of acceleration in various directions. When stationary, the magnitude and direction of gravity can be detected. It can be used to identify mobile phone gestures (such as horizontal and vertical screen switching) and vibration recognition related functions (such as Pedometer, percussion), etc.; in addition, the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc.
[0124] The audio circuit 960, the speaker 961 and the microphone 962 may provide an audio interface between the user and the mobile phone. The audio circuit 960 can transmit the electric signal converted from the received audio data to the speaker 961, and the speaker 961 converts it into a sound signal for output; on the other hand, the microphone 962 converts the collected sound signal into an electric signal, and the audio circuit 960 After being received, it is converted into audio data, and then processed by the audio data output processor 980, and then sent to another mobile phone via the RF circuit 910, or the audio data is output to the memory 920 for subsequent processing.
[0125] WiFi is a short-distance wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 970. It provides users with wireless broadband Internet access. although Picture 9 The WiFi module 970 is shown, but it is understandable that it is not a necessary component of the mobile phone 900 and can be omitted as required.
[0126] The processor 980 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes by running or executing software programs and/or modules stored in the memory 920, and calling data stored in the memory 920. Various functions and processing data of the mobile phone can be used to monitor the mobile phone as a whole. In one embodiment, the processor 980 may include one or more processing units. In one embodiment, the processor 980 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application program, etc.; the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 980.
[0127] The mobile phone 900 also includes a power source 990 (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the processor 980 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
[0128] In an embodiment, the mobile phone 900 may also include a camera, a Bluetooth module, and so on.
[0129] In the embodiment of the present application, the processor 980 included in the electronic device implements the steps of the application program processing method provided in the foregoing embodiment when the computer program stored in the memory is executed.
[0130] Any reference to memory, storage, database or other media used in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which acts as external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0131] The above-mentioned embodiments only express several implementation manners of the present application, and their description is relatively specific and detailed, but they should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.