Electric quantity optimization method and device, electronic equipment and storage medium

By screening the process to be optimized based on factors such as process call level and historical usage records in an intelligent device, and performing intelligent cleaning, the problem of the mistaken removal of important processes in the existing technology is solved, and the intelligent and efficient optimization of the equipment power is achieved.

CN119861805APending Publication Date: 2025-04-22IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411791758.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art cleans up processes by limiting process data, resulting in the incorrect clearance of important processes, affecting the equipment's operating performance and user experience.

Method used

By filtering out the basic process set based on the call level of each process in the device to be optimized, and taking into account the historical usage records of the device, the user interaction status of the basic process and resource occupation information, intelligently and accurately filtering out the optimized processes that do not affect the normal operation of the system, forming the process set to be optimized, and intelligently cleaning it based on the power of the process to be optimized.

Benefits of technology

It effectively avoids the problem of accidentally cleaning up important processes, reduces the total power consumption of the equipment, and ensures the equipment's operating performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119861805A_ABST
    Figure CN119861805A_ABST
Patent Text Reader

Abstract

The invention provides an electric quantity optimization method and device, electronic equipment and a storage medium, and the method comprises the steps: filtering processes in to-be-optimized equipment according to the call level of each process in the to-be-optimized equipment, and obtaining a basic process set; according to the historical use record of the to-be-optimized equipment, the user interaction state information corresponding to each basic process in the basic process set and the resource occupation information of each basic process, filtering the basic processes in the basic process set to obtain a to-be-optimized process set; and optimizing the electric quantity of the to-be-optimized equipment according to the electric quantity of each to-be-optimized process in the to-be-optimized process set. According to the invention, the process which does not affect the normal operation of the system is intelligently cleaned, so that the intelligent electric quantity optimization of the equipment is realized, and the operation performance of the equipment and the user experience are improved and guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a power optimization method, device, electronic equipment and storage medium. Background Art

[0002] With the increasing application of intelligent devices in daily life, from smartphones, smart wearable devices to smart home systems, these devices have become an indispensable part of people's daily lives. However, the operation of these devices is highly dependent on battery power. Therefore, power optimization is of great significance to improving the user experience of intelligent devices, extending the service life of devices, and promoting sustainable development.

[0003] In the related art, a certain number of processes are usually cleared by limiting process data to optimize the power of intelligent devices, which causes important processes to be mistakenly cleared, thereby affecting the device's operating performance and user experience.

[0004] Therefore, there is an urgent need to provide a power optimization method, device, electronic device and storage medium to solve the above problems. Summary of the invention

[0005] The present invention provides a power optimization method, device, electronic device and storage medium, which are used to solve the defect that the power optimization of intelligent equipment is achieved by clearing a certain number of processes by limiting process data in the prior art, resulting in the inability to effectively guarantee the equipment operation performance and user experience, and to achieve intelligent power optimization of the equipment to improve the equipment operation performance and user experience.

[0006] The present invention provides a power optimization method, comprising: According to the call level of each process in the device to be optimized, the processes in the device to be optimized are filtered to obtain a basic process set; According to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set and the resource occupation information of each basic process, the basic processes in the basic process set are filtered to obtain the process set to be optimized; The power of the device to be optimized is optimized according to the power of each process to be optimized in the process set to be optimized.

[0007] According to a power optimization method provided by the present invention, the basic processes in the basic process set are filtered according to the historical usage records of the device to be optimized, the user interaction state information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process to obtain the process set to be optimized, including: Determining at least one first process to be filtered among the multiple processes of the device to be optimized according to the historical usage record; Determining at least one second process to be filtered from a plurality of basic processes in the basic process set according to the user interaction state information; Determining at least one third process to be filtered from a plurality of basic processes in the basic process set according to the resource occupation information; The first processes to be filtered, the second processes to be filtered, and the third processes to be filtered are filtered from the basic process set to obtain the process set to be optimized.

[0008] According to a power optimization method provided by the present invention, determining at least one first process to be filtered from multiple processes of the device to be optimized according to the historical usage record includes: In the historical usage records, the usage frequency of each process in the device to be optimized in each historical period is obtained; In each of the historical time periods, the processes are sorted in descending order of usage frequency to obtain a sorting index value of each of the processes in each of the historical time periods; Among the multiple processes of the device to be optimized, processes whose sorting position index values ​​in multiple historical time periods are all less than or equal to a preset index value are obtained as the first processes to be filtered.

[0009] According to a power optimization method provided by the present invention, determining at least one second process to be filtered from a plurality of basic processes in the basic process set according to the user interaction state information includes: According to the user interaction state information, determining whether each of the basic processes is a target foreground process; the target foreground process includes at least one of a process required for current user interaction, a visible process, and a process with a component display function deployed at the front end; Among the multiple basic processes in the basic process set, a basic process whose judgment result is the target foreground process is obtained as the second process to be filtered.

[0010] According to a power optimization method provided by the present invention, the step of determining the process required for the current user interaction includes: According to the user interaction state information, determining whether each of the basic processes meets a first preset condition; the first preset condition includes at least one of executing at least one user interaction task, running a service bound to the user interaction task, having a service that executes a lifecycle callback, and having a component that executes receiving broadcasts; The basic process that meets the first preset condition is used as the process required for the current user interaction.

[0011] According to a power optimization method provided by the present invention, the step of determining the visible process includes: According to the user interaction state information, determining whether each of the basic processes meets a second preset condition; the second preset condition includes running a service bound to a visible task, and / or running a service that is not a front-end task and is visible to the user; The basic process that meets the second preset condition is used as the visible process.

[0012] According to a power optimization method provided by the present invention, determining at least one third process to be filtered from a plurality of basic processes in the basic process set according to the resource occupancy information includes: Determine whether each of the basic processes is a target background process according to the resource occupation information; the target background process includes a process currently occupied by the backend and / or a process associated with a peripheral component currently running on the backend; Among the multiple basic processes in the basic process set, a basic process whose judgment result is that it is the target background process is obtained as the third process to be filtered.

[0013] According to a power optimization method provided by the present invention, filtering the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set includes: According to the call level of each process in the device to be optimized, obtaining the process type of each process in the device to be optimized; Filtering processes whose process type is a system-level type from multiple processes in the device to be optimized to obtain an initial process set; Sorting the initial processes in the initial process set in order of power from large to small; According to the sorting result, the storage position of each of the initial processes in the initial process set is updated to obtain the basic process set.

[0014] According to a power optimization method provided by the present invention, the basic processes in the basic process set are filtered according to the historical usage records of the device to be optimized, the user interaction state information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process to obtain the process set to be optimized, including: Obtaining the storage location of each of the basic processes in the location configuration information of the basic process set; According to the historical usage records, the user interaction state information and the resource occupancy information, and according to the storage location of each of the basic processes, the basic processes in the basic process set are filtered in sequence to obtain the process set to be optimized.

[0015] According to a power optimization method provided by the present invention, the step of obtaining the power of each process to be optimized includes: According to the categories of the modules in the processes to be optimized, determining the power statistics model corresponding to the modules; Calculating the power consumption of each module according to the power consumption statistical model; The power of each process to be optimized is calculated based on the sum of the power of all modules in each process to be optimized.

[0016] The present invention also provides a power optimization device, comprising: A first filtering module, configured to filter the processes in the device to be optimized according to the call level of each process in the device to be optimized, to obtain a basic process set; A second filtering module is used to filter the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process, so as to obtain a process set to be optimized; The optimization module is used to optimize the power of the device to be optimized according to the power of each process to be optimized in the process set to be optimized.

[0017] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the power optimization methods described above is implemented.

[0018] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the power optimization method described in any one of the above methods is implemented.

[0019] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned power optimization methods.

[0020] The power optimization method, device, electronic device and storage medium provided by the present invention first filter out the basic process set according to the call level of each process in the device to be optimized, and then comprehensively consider the historical usage records of the device, the user interaction status of the basic process and the resource occupancy information, intelligently and accurately screen out the processes to be optimized that do not affect the normal operation of the system, form a process set to be optimized, and intelligently clean up each process to be optimized according to the power of the process to be optimized, so as to reduce the power required for the operation of some processes that do not affect the normal operation of the system by cleaning the process, thereby reducing the total power consumption of the device to be optimized, thereby effectively avoiding the problem of important processes being mistakenly cleaned, thereby ensuring the operating performance of the device and the user experience while achieving intelligent and efficient optimization of the device power. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 This is one of the flow charts of the power optimization method provided by the present invention.

[0023] Figure 2 This is the second flow chart of the power optimization method provided by the present invention.

[0024] Figure 3 It is a schematic diagram of the distribution of hardware modules in the process provided by the present invention.

[0025] Figure 4 It is a structural schematic diagram of the power optimization device provided by the present invention.

[0026] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] With the continuous development and stability of intelligent devices, various intelligent devices have been widely used in various living spaces, from smart phones, smart wearable devices to smart home systems. These intelligent devices rely on operating systems, such as the Android system, which consumes a lot of power during operation. Many intelligent devices, such as mobile phones and smart wearable devices, require external charging. In this scenario, battery life is particularly important. Therefore, power optimization is of great significance to improving the user experience of intelligent devices, extending the service life of devices, and promoting sustainable development.

[0029] In the related art, a certain number of processes are usually cleared by limiting process data to optimize the power of intelligent devices, which causes important processes to be mistakenly cleared, thereby affecting the device's operating performance and user experience.

[0030] In this regard, the present embodiment provides a power optimization method by intelligently filtering some necessary processes, such as foreground processes (i.e., processes visible to the user), processes that the user is accustomed to using (i.e., processes that are used frequently and are ranked high in frequency of use), and processes that have not reappeared in the foreground for a period of time but are occupied by the back end or processes associated with peripheral components occupied by the back end (such as processes for volume adjustment), and intelligently cleaning and disinfecting unnecessary processes remaining after screening, thereby reducing the power consumption of unnecessary processes in the device to be optimized, so as to ensure the smoothness of device use, the performance of the device, and the improvement of user experience without the user noticing, while optimizing and reducing the power consumption of the device.

[0031] Figure 1 This is one of the flow charts of the power optimization method provided by the present invention; the method can be applied to various scenarios where power optimization is required, such as smart window large screen, etc., and this embodiment does not specifically limit this. The following takes the smart window large screen as an example to describe the method provided by this embodiment.

[0032] It should be noted that since each classroom in the school is usually equipped with a smart window large screen, and these large screens have common requirements for functional management, such as unified upgrades of software versions, updates of new functions, and batch installation of new software. In order to meet these unified management needs, the centralized control background came into being. On this basis, the power optimization method provided in this embodiment can be uniformly deployed and installed through a centralized control platform in the form of software to achieve centralized management of the power consumption of multiple offline smart window large-screen devices, thereby not only improving management efficiency, but also effectively saving power resources for schools and large-screen users, and promoting the rational use of energy.

[0033] like Figure 1 As shown, the method includes step 110 , step 120 and step 130 .

[0034] Step 110: Filter the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set.

[0035] The devices to be optimized here are intelligent devices that require power optimization, including but not limited to smart window screens, mobile phones, tablet computers, laptops, PDAs, vehicle-mounted electronic devices, wearable devices, super mobile personal computers, netbooks or personal digital assistants, etc., and this embodiment does not make specific limitations.

[0036] Optionally, when it is necessary to optimize the power of the device to be optimized, the calling level of each process in the device to be optimized can be loaded and obtained to determine the cleaning preconditions according to the calling level of each process, and based on the cleaning preconditions, determine the necessary processes of the first stage, that is, the processes that affect the normal operation of the device, and filter the necessary processes of this stage from the multiple processes in the device to be optimized to form a basic process set; the basic process set includes the cleanable processes of the first stage, and by cleaning such processes, the power consumption of the device to be optimized can be optimized and reduced.

[0037] The methods for obtaining the basic process set here include directly storing the filtered cleanable processes into the process set in a random order to obtain the corresponding basic process set; or sorting the filtered cleanable processes in a certain order, such as the order corresponding to the power consumption from large to small, and storing them in the process set to obtain the corresponding basic process set, so that the cleanable processes can be filtered again in sequence according to the order in the future, so as to give priority to cleaning the cleanable processes with larger power consumption, thereby reserving more power for other important processes, thereby improving resource utilization performance and further improving device performance.

[0038] The cleaning preconditions here include the pre-judgment conditions of necessary processes, such as treating processes whose calling levels are lower than the set values ​​as necessary processes and / or treating processes of the target type corresponding to the calling level of the processes, such as system-level processes, as necessary processes, etc. This implementation does not make specific limitations on this.

[0039] Step 120, filtering the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process to obtain a process set to be optimized.

[0040] Optionally, after obtaining the basic process set, in order to avoid important processes from being mistakenly cleared, the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupancy information of each basic process can be further loaded and obtained, so as to further obtain the necessary processes of the second stage based on the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupancy information of each basic process, and filter the necessary processes of this stage from the basic process set to form a process set to be optimized; the process set to be optimized contains the cleanable processes of the second stage, that is, the processes that are finally determined to be cleaned, and by cleaning such processes, the power consumption of the device to be optimized can be optimized and reduced.

[0041] The historical usage record here refers to the record generated when the device to be optimized is used historically; it may at least include the usage time and usage frequency of each process, which is not specifically limited in this embodiment. By analyzing the historical usage records, low-frequency processes can be used as cleanable processes during the screening process, so as to optimize and reduce the power consumption of the device to be optimized by cleaning such processes.

[0042] User interaction status information refers to information that has an impact on the user interaction status. During the screening process, processes that do not affect the user interaction status can be treated as cleanable processes, so as to optimize and reduce the power consumption of the device to be optimized by cleaning such processes.

[0043] Resource usage information refers to the background resource usage. During the screening process, processes that do not affect the normal operation of the background can be treated as cleanable processes. By cleaning such processes, the power consumption of the device to be optimized can be optimized and reduced.

[0044] Here, the second stage filtering can be to perform multiple logical judgments based on the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupancy information of each basic process to determine the necessary processes for the second stage, and filter the necessary processes for this stage from the basic process set; or, the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupancy information of each basic process are input into the machine learning model to identify the necessary processes for the second stage through the machine learning model, and filter the necessary processes for this stage from the basic process set, etc. This embodiment does not specifically limit this.

[0045] Step 130 , optimizing the power of the device to be optimized according to the power of each process to be optimized in the process set to be optimized.

[0046] Optionally, after obtaining the set of processes to be optimized, the cleaning priority of each process to be optimized can be determined in order from large to small in terms of power consumption, and each process to be optimized can be cleaned up in turn in the device to be optimized based on the cleaning priority. By cleaning the processes, the power required to run some processes that do not affect the normal operation of the system (i.e., the processes to be optimized) can be reduced, thereby reducing the total power consumption of the device to be optimized.

[0047] The cleaning here can be to establish a service corresponding to the process disinfecting method (such as the KillAPP method) in the system core service class in advance, so that during the required process cleaning process, the process disinfecting interface can be called in the service corresponding to the process disinfecting method, so as to intelligently and flexibly clean each process to be optimized in the device to be optimized in turn, thereby reducing the total power consumption of the device to be optimized.

[0048] The method provided in this embodiment first filters out the basic process set according to the call level of each process in the device to be optimized, and then comprehensively considers the historical usage records of the device, the user interaction status of the basic process and the resource occupancy information, intelligently and accurately screens out the processes to be optimized that do not affect the normal operation of the system, forms a process set to be optimized, and intelligently cleans up each process to be optimized according to the power of the process to be optimized, so as to reduce the power required for the operation of some processes that do not affect the normal operation of the system by cleaning the process, thereby reducing the total power consumption of the device to be optimized, thereby effectively avoiding the problem of important processes being mistakenly cleaned, thereby ensuring the device operation performance and user experience while achieving intelligent and efficient optimization of device power.

[0049] Figure 2 FIG. 2 is a flow chart of the power optimization method provided by the present invention; Figure 2 As shown, in some embodiments, step 120 specifically includes: Step 121, determining at least one first process to be filtered from multiple processes of the device to be optimized according to the historical usage record; Step 122, determining at least one second process to be filtered from a plurality of basic processes in the basic process set according to the user interaction state information; Step 123, determining at least one third process to be filtered from a plurality of basic processes in the basic process set according to the resource occupation information; Step 124 , filtering each of the first processes to be filtered, each of the second processes to be filtered, and each of the third processes to be filtered from the basic process set to obtain the process set to be optimized.

[0050] Optionally, in the process filtering process of the second stage, the frequently used processes can be screened and determined from multiple processes of the device to be optimized as the first process to be filtered based on historical usage records, so as to avoid affecting the device performance by maintaining the normal operation of such processes.

[0051] In addition, based on the user interaction status information, a process that affects the user interaction status can be determined from multiple basic processes in the basic process set as the second process to be filtered, so as to avoid affecting the device performance by retaining the normal operation of such process.

[0052] In addition, based on the resource occupancy information, the process that affects the normal operation of the backend can be determined from the multiple basic processes in the basic process set as the third process to be filtered, so as to avoid affecting the device performance by retaining the normal operation of such process.

[0053] Then, the first process to be filtered, the second process to be filtered, and the third process to be filtered are filtered out from the basic process set to obtain a process set to be optimized formed by the final cleanable processes.

[0054] Here, filtering may be performed on the first process to be filtered, the second process to be filtered and the third process to be filtered simultaneously, or may be performed on the first process to be filtered, the second process to be filtered and the third process to be filtered sequentially in order, which is not specifically limited in this embodiment.

[0055] The method provided in this embodiment comprehensively considers the historical usage records, user interaction status information and resource occupancy information of the device to be optimized, and accurately determines the first process to be filtered (a process used frequently), the second process to be filtered (a process that affects the user interaction status) and the third process to be filtered (a process that affects the normal operation of the backend) from multiple processes, and filters these processes from the basic process set to obtain a set of processes to be optimized, thereby avoiding the risk of important processes being mistakenly cleared, thereby achieving more accurate power optimization while ensuring the device operating performance and user experience.

[0056] In some embodiments, step 121 specifically includes: In the historical usage records, the usage frequency of each process in the device to be optimized in each historical period is obtained; In each of the historical time periods, the processes are sorted in descending order of usage frequency to obtain a sorting index value of each of the processes in each of the historical time periods; Among the multiple processes of the device to be optimized, processes whose sorting position index values ​​in multiple historical time periods are all less than or equal to a preset index value are obtained as the first processes to be filtered.

[0057] Optionally, during the filtering process, the user habits may be intelligently memorized to memorize the processes that the user has recently operated frequently and not be cleaned up, that is, a memory process set is formed by collecting the processes that the user is accustomed to using and the number of times the recent active processes are frequently used, thereby retaining the processes that the user is accustomed to using, thereby achieving intelligent process cleaning, ensuring humanized cleaning, and meeting the actual needs of users. The specific implementation steps include: Since the historical usage records are obtained by collecting the usage of each process at regular intervals by the task process, the historical usage records can be parsed to obtain the usage frequency of each process in the device to be optimized in each historical period.

[0058] After obtaining the usage frequency, each process can be sorted in descending order of usage frequency to obtain the sorting index value of each process in each historical period. And among the multiple processes of the device to be optimized, select and determine the processes whose sorting position index values ​​in multiple historical periods are less than or equal to the preset index value, that is, the processes with the highest number of frequent uses. Such processes are the processes that users frequently use more habitually. Taking such processes as the first process to be filtered can effectively ensure that such processes are not cleaned up. Therefore, by filtering and intelligently memorizing user habits, the normal operation of the processes that users have recently operated frequently is guaranteed without affecting the normal use of users, thereby ensuring the operating performance of the device and the user experience.

[0059] The preset index value here can be set according to actual needs. For example, it can be set to 10 to keep the top 10 processes with the highest usage frequency in multiple historical periods from being cleaned up.

[0060] In some embodiments, step 122 specifically includes: According to the user interaction state information, determining whether each of the basic processes is a target foreground process; the target foreground process includes at least one of a process required for current user interaction, a visible process, and a process with a component display function deployed at the front end; Among the multiple basic processes in the basic process set, a basic process whose judgment result is the target foreground process is obtained as the second process to be filtered.

[0061] Optionally, the target foreground process is a process visible to the user, including but not limited to at least one of the following processes: (1) The process required for the current user interaction, that is, the process that is interacting with the user; (2) Visual process, that is, the process that serves the foreground visualization (such as input method); (3) A process with component display function deployed on the front end, that is, a process that displays components on the notification bar status bar and runs in the background. For example, a process corresponding to a music player retreats to the background, but a component block for audio control is displayed on the notification bar to control the previous and next songs. This is a process with component display function deployed on the front end.

[0062] Exemplarily, in some embodiments, the step of determining the process required for the current user interaction includes: According to the user interaction state information, determining whether each of the basic processes meets a first preset condition; the first preset condition includes at least one of executing at least one user interaction task, running a service bound to the user interaction task, having a service that executes a lifecycle callback, and having a component that executes receiving broadcasts; The basic process that meets the first preset condition is used as the process required for the current user interaction.

[0063] Optionally, for the determination of the process required for the current user interaction, if any basic process is determined to satisfy at least one of the following first preset conditions according to the user interaction state information, it is considered to be the process required for the current user interaction, and then it is determined to be the target foreground process, and it is used as the second process to be filtered: (1) At least one user interaction task is being executed, that is, an activity that interacts with the user is running, such as the onResume() method of the Activity object has been called; (2) A service bound to a user interaction task is running, that is, a service is hosted, which is bound to a user interaction activity; (3) There is a service that executes lifecycle callbacks, that is, there is a Service object that executes its lifecycle callbacks, such as executing onCreate(), onStart(), onDestory() and other callback functions; (4) There is at least one component that executes the broadcast reception, that is, the BroadcastReceiver object executes its onReceive() method.

[0064] Exemplarily, in some embodiments, the step of determining the visual process includes: According to the user interaction state information, determining whether each of the basic processes meets a second preset condition; the second preset condition includes running a service bound to a visible task and / or running a non-front-end task and a service visible to the user; The basic process that meets the second preset condition is used as the visible process.

[0065] Among them, the visible process does not have any foreground components, but can still affect the user's visualization on the screen.

[0066] Optionally, for the determination of the visible process, if any basic process is determined to meet at least one of the following second preset conditions according to the user interaction state information, it is considered to be a visible process, and then it is determined to be the target foreground process and used as the second process to be filtered: (1) A service that is running a non-frontend task and is visible to the user, that is, it hosts an Activity that is not in the foreground, but is still visible to the user, such as its onPause() method has been called; for example, if a foreground Activity is still visible after a dialog box (of another process) is running, such as when an input method pops up, then it is determined that a service bound to a visible task is running; (2) A service that is bound to a visible task is running, that is, a service is hosted that is bound to a visible Activity.

[0067] Optionally, since the target foreground processes are all processes that affect the user's interaction status; therefore, in the power optimization process, in order to avoid affecting the user's normal interaction functions, such processes are used as the second process to be filtered to effectively ensure that such processes are not cleared. By filtering the target foreground processes, the normal operation of the processes that affect the user's normal interaction functions can be guaranteed without affecting the user's normal interaction, thereby ensuring the device's operating performance and user experience.

[0068] In some embodiments, step 123 specifically includes: Determine whether each of the basic processes is a target background process according to the resource occupation information; the target background process includes a process currently occupied by the backend and / or a process associated with a peripheral component currently running on the backend; Among the multiple basic processes in the basic process set, a basic process whose judgment result is that it is the target background process is obtained as the third process to be filtered.

[0069] Optionally, when it is determined based on the resource occupancy information that any basic process is a process being occupied by the backend, and / or a process associated with a peripheral component running on the backend, the basic process is determined to be the target background process. Since the target background process is a background process that is using some processes or occupying processes that are being used by peripheral users, and is a process that affects the normal operation of the background, it is necessary to filter it as the third process to be filtered, thereby ensuring that it is not cleared, ensuring the normal operation of the background, and thereby improving device performance.

[0070] In some embodiments, step 110 specifically includes: According to the call level of each process in the device to be optimized, obtaining the process type of each process in the device to be optimized; Filtering processes whose process type is a system-level type from multiple processes in the device to be optimized to obtain an initial process set; Sorting the initial processes in the initial process set in order of power from large to small; According to the sorting result, the storage position of each of the initial processes in the initial process set is updated to obtain the basic process set.

[0071] The calling level here is used to limit the calling priority level of different processes, such as being divided by the process priority adjustment value (Activity Manager App Adjacency, ADJ), etc. The lower the ADJ value, the higher the priority level of the process, and the more important it is to the system operation. Exemplarily, the calling priority levels of different processes can be expressed as Table 1.

[0072] Optionally, a process category filtering function can be added to the service corresponding to the locking method (such as updateOomAdjLocked method) used to update the process priority in the memory recovery mechanism in the system core service class, so that the call level of each process in the device to be optimized can be obtained through the service, and the numerical value corresponding to the call level of each process in the device to be optimized can be compared with the preset value, so as to determine the process type of each process through the comparison result. And according to the process type, the system-level type of process is selected, and the system-level type of process is filtered out from the multiple processes in the device to be optimized to retain the application-level type of process, thereby forming an initial process set.

[0073] The preset value here can be determined according to the performance of the process. As shown in Table 1, the preset value can be set to 0. When the value corresponding to the call level of any process is greater than or equal to 0, the process type of the process is determined to be application level. When the value corresponding to the call level of any process is less than 0, the process type of the process is determined to be system level. The system level process is filtered out from the multiple processes in the device to be optimized to retain the application level type processes, thereby forming an initial process set.

[0074] Table 1 Data table of process call priority In addition, the power of each initial process in the initial process set can be obtained, and the initial processes in the initial process set can be sorted in order from large to small in power; and, according to the sorting result, the storage location of each initial process in the initial process set is updated to obtain a basic process set; wherein, the basic processes in the basic process set are arranged in order from large to small in power, so that the processes with larger power can be further cleaned up, judged and cleaned up in priority in the future, thereby optimizing the device's memory usage and power endurance to the maximum extent.

[0075] The method provided in this embodiment determines the process type according to the calling level of each process in the device to be optimized, filters out system-level processes to ensure the normal operation of system-level applications, and sorts the remaining application-level processes from large to small according to power consumption and updates the storage location, and finally obtains a basic process set sorted by power priority to ensure that processes with larger power consumption are given priority for further cleaning judgment and cleaning, thereby ensuring the normal operation of the device while maximally optimizing the device's memory usage and power endurance.

[0076] In some embodiments, step 120 further includes: Obtaining the storage location of each of the basic processes in the location configuration information of the basic process set; According to the historical usage records, the user interaction state information and the resource occupancy information, and according to the storage location of each of the basic processes, the basic processes in the basic process set are filtered in sequence to obtain the process set to be optimized.

[0077] Optionally, since the basic processes in the basic process set are arranged in order according to the size of the power consumption, the location configuration information of the basic process set may be parsed to obtain the storage location of each basic process.

[0078] According to the storage location of each basic process, the basic processes in the basic process set are filtered in turn according to historical usage records, user interaction status information and resource usage information to obtain the process set to be optimized, so as to ensure that the processes with larger power consumption are filtered, judged and cleaned first, thereby optimizing the memory usage and power endurance of the device to the maximum extent. For the specific filtering steps here, please refer to Figure 2 As shown, no further details will be given here.

[0079] In some embodiments, the step of obtaining the power of the process to be optimized in step 130 includes: According to the categories of the modules in the processes to be optimized, determining the power statistics model corresponding to the modules; Calculating the power consumption of each module according to the power consumption statistical model; The power of each process to be optimized is calculated based on the sum of the power of all modules in each process to be optimized.

[0080] Alternatively, the amount of electricity of each component can usually be obtained by multiplying power by time. The specific calculation formula is as follows: Electricity = power × time; Among them, power can be calculated based on the product of voltage and current, that is, power = voltage × current. In intelligent devices, components are generally sensitive to current, while voltage is basically constant, so current is directly used instead of calculating power.

[0081] Accordingly, since each process to be optimized contains multiple modules, the power of each module can be summed to obtain the power of each process to be optimized. The specific calculation formula is as follows: Process power = SUM (module power × module running time); Among them, the modules here can refer to various hardware modules and software modules, which usually have different types. Therefore, when calculating the power of each module, the power statistical model corresponding to each module can be obtained according to the category of each module, so as to calculate the power of each module separately through the power statistical model corresponding to each module, thereby summing up the power of each module calculated based on this model to obtain the power of each process to be optimized.

[0082] It should be noted that the power acquisition steps of the above process are not only applicable to the process to be optimized, but also to other processes, such as basic processes, etc. For details, please refer to the above content to acquire the power of various processes.

[0083] The following describes the power acquisition steps of different hardware modules in detail using specific examples.

[0084] Figure 3 is a schematic diagram of the distribution of hardware modules in the process provided by the present invention; Figure 3 As shown, the hardware modules can be divided according to the working characteristics of each module to obtain the following classification: The first category specifically divides basic modules such as camera modules, flash modules, player modules and sensor modules whose working power and rated power are basically consistent into the first category; since the working power of the hardware modules of the first category is stable, the power statistical model of the hardware modules of the first category can be obtained by calculating the product of the power of each module and the operating time to obtain the corresponding power.

[0085] The second classification can specifically classify data communication modules with variable working power, such as wireless network communication modules, mobile communication modules and Bluetooth modules, into the second category; since the working power of the second category of hardware modules is variable and can be divided into multiple stages, such as when the signal of the wireless network communication module is relatively weak, the wireless network communication module needs to work at a relatively high power level to maintain the data link; therefore, the power statistical model of the second category of hardware modules can be to calculate the power in a step-by-step manner according to the working power of the hardware modules at different times.

[0086] The third category may specifically classify control modules with complex working power, such as central processing unit (CPU) modules and screen modules, into the third category.

[0087] In addition to the fact that each core unit of the CPU module needs to calculate power in a step-by-step manner like the data module, each cluster (referred to as Cluster, generally a cluster contains one or more core units with the same specifications) of the CPU module also has additional power consumption, and the processor chip of the entire CPU module also has power consumption. In addition, the power consumption of the CPU module must also consider power losses such as overclocking and information entropy loss of logical operation. In order to simplify the calculation, the power statistical model of the CPU module can be determined as: CPU power = SUM (power consumption of each core unit) + power consumption of each cluster + chip power consumption.

[0088] The power statistics model of the screen module can be obtained by calculating the holding time of the screen lock of the process, increasing the statistical time of the CPU module of the process by a fixed coefficient, and calculating the screen power consumption according to the calculation method of the CPU module, thereby obtaining the power of the screen module.

[0089] It should be noted that the power of each module in each process, such as rated power and multi-level power, can be obtained through the process power file (such as power_profile.xml file) provided by the manufacturer.

[0090] The method provided in this embodiment determines the corresponding power statistical model according to the category of each module in the process to be optimized, then calculates the power of each module based on the model, and finally summarizes the power of each process. This technology realizes the accurate statistics and evaluation of the power of the process to be optimized, thereby effectively guiding the formulation and implementation of power optimization strategies.

[0091] The power optimization device provided by the present invention is described below. The power optimization device described below and the power optimization method described above can be referenced to each other.

[0092] Figure 4 is a schematic diagram of the structure of the power optimization device provided by the present invention; Figure 4 As shown, the device comprises: The first filtering module 410 is used to filter the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set; The second filtering module 420 is used to filter the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process, so as to obtain a process set to be optimized; The optimization module 430 is used to optimize the power of the device to be optimized according to the power of each process to be optimized in the process set to be optimized.

[0093] The device provided in this embodiment first filters out the basic process set according to the call level of each process in the device to be optimized, and then comprehensively considers the historical usage records of the device, the user interaction status of the basic process and the resource occupancy information, intelligently and accurately screens out the processes to be optimized that do not affect the normal operation of the system, forms a process set to be optimized, and intelligently cleans up each process to be optimized according to the power of the process to be optimized. By cleaning the process, the power required for the operation of some processes that do not affect the normal operation of the system is reduced, thereby reducing the total power consumption of the device to be optimized, thereby effectively avoiding the problem of important processes being mistakenly cleaned, thereby ensuring the device operation performance and user experience while achieving intelligent and efficient optimization of device power.

[0094] The device provided by the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific processes and detailed contents, which will not be repeated here.

[0095] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the power optimization method, which includes: filtering the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set; filtering the basic processes in the basic process set according to the historical use record of the device to be optimized, the user interaction state information corresponding to each basic process in the basic process set and the resource occupation information of each basic process to obtain a process set to be optimized; optimizing the power of the device to be optimized according to the power of each process to be optimized in the process set.

[0096] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0097] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the power optimization method provided by the above methods, and the method includes: filtering the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set; filtering the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupancy information of each basic process in the basic process set to obtain a process set to be optimized; optimizing the power of the device to be optimized according to the power of each process to be optimized in the process set.

[0098] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the power optimization method provided by the above-mentioned methods, the method comprising: filtering the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set; filtering the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupancy information of each basic process in the basic process set to obtain a process set to be optimized; optimizing the power of the device to be optimized according to the power of each process to be optimized in the process set.

[0099] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0100] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A power optimization method, characterized in that: include: According to the call level of each process in the device to be optimized, the processes in the device to be optimized are filtered to obtain a basic process set; According to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set and the resource occupation information of each basic process, the basic processes in the basic process set are filtered to obtain the process set to be optimized; The power of the device to be optimized is optimized according to the power of each process to be optimized in the process set to be optimized.

2. The power optimization method according to claim 1, characterized in that: The filtering of the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process to obtain the process set to be optimized includes: Determining at least one first process to be filtered among the multiple processes of the device to be optimized according to the historical usage record; Determining at least one second process to be filtered from a plurality of basic processes in the basic process set according to the user interaction state information; Determining at least one third process to be filtered from a plurality of basic processes in the basic process set according to the resource occupation information; The first processes to be filtered, the second processes to be filtered, and the third processes to be filtered are filtered from the basic process set to obtain the process set to be optimized.

3. The power optimization method according to claim 2, characterized in that: The step of determining at least one first process to be filtered from among the multiple processes of the device to be optimized according to the historical usage record comprises: In the historical usage records, the usage frequency of each process in the device to be optimized in each historical period is obtained; In each of the historical time periods, the processes are sorted in descending order of usage frequency to obtain a sorting index value of each of the processes in each of the historical time periods; Among the multiple processes of the device to be optimized, processes whose sorting position index values ​​in multiple historical time periods are all less than or equal to a preset index value are obtained as the first processes to be filtered.

4. The power optimization method according to claim 2, characterized in that: The step of determining at least one second process to be filtered from a plurality of basic processes in the basic process set according to the user interaction state information includes: According to the user interaction state information, determining whether each of the basic processes is a target foreground process; the target foreground process includes at least one of a process required for current user interaction, a visible process, and a process with a component display function deployed at the front end; Among the multiple basic processes in the basic process set, a basic process whose judgment result is the target foreground process is obtained as the second process to be filtered.

5. The power optimization method according to claim 4, characterized in that: The step of determining the process required for the current user interaction includes: According to the user interaction state information, determining whether each of the basic processes meets a first preset condition; the first preset condition includes at least one of executing at least one user interaction task, running a service bound to the user interaction task, having a service that executes a lifecycle callback, and having a component that executes receiving broadcasts; The basic process that meets the first preset condition is used as the process required for the current user interaction.

6. The power optimization method according to claim 4, characterized in that: The step of determining the visual process includes: According to the user interaction state information, determining whether each of the basic processes meets a second preset condition; the second preset condition includes running a service bound to a visible task, and / or running a service that is not a front-end task and is visible to the user; The basic process that meets the second preset condition is used as the visible process.

7. The power optimization method according to claim 2, characterized in that: The step of determining at least one third process to be filtered from a plurality of basic processes in the basic process set according to the resource occupation information includes: Determine whether each of the basic processes is a target background process according to the resource occupation information; the target background process includes a process currently occupied by the backend and / or a process associated with a peripheral component currently running on the backend; Among the multiple basic processes in the basic process set, a basic process whose judgment result is that it is the target background process is obtained as the third process to be filtered.

8. The power optimization method according to any one of claims 1 to 7, characterized in that: The filtering of the processes in the device to be optimized according to the call level of each process in the device to be optimized to obtain a basic process set includes: According to the call level of each process in the device to be optimized, obtaining the process type of each process in the device to be optimized; Filtering processes whose process type is a system-level type from multiple processes in the device to be optimized to obtain an initial process set; Sorting the initial processes in the initial process set in order of power from large to small; According to the sorting result, the storage position of each of the initial processes in the initial process set is updated to obtain the basic process set.

9. The power optimization method according to claim 8, characterized in that: The filtering of the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process to obtain the process set to be optimized includes: Obtaining the storage location of each of the basic processes in the location configuration information of the basic process set; According to the historical usage records, the user interaction state information and the resource occupancy information, and according to the storage location of each of the basic processes, the basic processes in the basic process set are filtered in sequence to obtain the process set to be optimized.

10. The power optimization method according to any one of claims 1 to 7, characterized in that: The step of obtaining the power of each process to be optimized includes: According to the categories of the modules in the processes to be optimized, determining the power statistics model corresponding to the modules; Calculating the power consumption of each module according to the power consumption statistical model; The power of each process to be optimized is calculated based on the sum of the power of all modules in each process to be optimized.

11. A power optimization device, characterized in that: include: A first filtering module, configured to filter the processes in the device to be optimized according to the call level of each process in the device to be optimized, to obtain a basic process set; A second filtering module is used to filter the basic processes in the basic process set according to the historical usage records of the device to be optimized, the user interaction status information corresponding to each basic process in the basic process set, and the resource occupation information of each basic process, so as to obtain a process set to be optimized; The optimization module is used to optimize the power of the device to be optimized according to the power of each process to be optimized in the process set to be optimized.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the power optimization method according to any one of claims 1 to 10 is implemented.

13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the power optimization method according to any one of claims 1 to 10 is implemented.