Resource management method and device, electronic equipment and storage medium
By using resource management models in electronic devices, combining system status, application operation and user operation data, adaptive resource management strategies are generated, and the problem of insufficient resource management accuracy in the existing technology is solved, and more flexible and accurate resources are achieved manage.
Patent Information
- Application Number
- CN202411468385.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-18
AI Technical Summary
When the prior art manages resources in electronic devices, the adoption of fixed strategies leads to insufficient accuracy of resource management and is unable to effectively respond to the needs of different applications and user operations.
By obtaining the current system status data of the electronic device, application operation data and user operation data, these data are input into the trained resource management model, a resource management strategy is obtained, and resource management is carried out based on this strategy.
It realizes the flexibility and accuracy of electronic device resource management, and the resource management strategy can be adapted to the running applications and the actual operations of users, improving the smoothness of the system and user experience.
Smart Images

Figure CN119473574A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and more specifically, to a resource management method, device, electronic equipment, and storage medium. Background Art
[0002] With the rapid advancement of technology and living standards, electronic devices (such as smartphones and tablets) have become commonplace in people's lives. While electronic devices are operating, their resources (computing resources, memory resources, etc.) are limited. Therefore, corresponding mechanisms exist within these devices for resource management, such as memory recycling based on system status. However, related resource management techniques typically employ fixed strategies, resulting in limited accuracy in resource management. Summary of the Invention
[0003] This application proposes a resource management method, device, electronic device and storage medium, which can manage resources more flexibly and accurately.
[0004] In a first aspect, an embodiment of the present application provides a resource management method applied to an electronic device, the method comprising: obtaining the current system status data, application running data, and user operation data of the electronic device; inputting the current system status data, application running data, and user operation data into a trained resource management model to obtain a resource management policy output by the resource management model; and performing resource management on the electronic device based on the resource management policy.
[0005] In the second aspect, an embodiment of the present application provides a resource management device, which is applied to an electronic device, and the device includes: a data acquisition module, a policy acquisition module and a device management module, wherein the data acquisition module is used to obtain the current system status data, application running data and user operation data of the electronic device; the policy acquisition module is used to input the current system status data, application running data and user operation data into a trained resource management model to obtain the resource management policy output by the resource management model; the device management module is used to perform resource management on the electronic device based on the resource management policy.
[0006] In a third aspect, an embodiment of the present application provides an electronic device comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the resource management method provided in the first aspect above.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which program code is stored. The program code can be called by a processor to execute the resource management method provided in the first aspect above.
[0008] The solution provided by this application obtains the current system status data, application operation data, and user operation data of the electronic device, inputs the current system status data, application operation data, and user operation data into a trained resource management model, and obtains a resource management policy output by the resource management model. Based on the resource management policy, resource management of the electronic device is performed. As a result, resource management of the electronic device can be achieved by combining not only system status data but also application operation data and user operation data, so that the resource management policy can adapt to the running applications and the actual user operations, thereby enabling more flexible and accurate resource management. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A flow chart of a resource management method according to an embodiment of the present application is shown.
[0011] Figure 2 A flow chart of a resource management method according to another embodiment of the present application is shown.
[0012] Figure 3 A schematic diagram of a resource management model provided in an embodiment of the present application is shown.
[0013] Figure 4 A flow chart of a resource management method according to another embodiment of the present application is shown.
[0014] Figure 5 A flow chart of a resource management method according to another embodiment of the present application is shown.
[0015] Figure 6 A schematic diagram of an application classification model provided in an embodiment of the present application is shown.
[0016] Figure 7 A block diagram of a resource management device according to an embodiment of the present application is shown.
[0017] Figure 8It is a block diagram of an electronic device for executing the resource management method according to an embodiment of the present application.
[0018] Figure 9 It is a storage unit for storing or carrying program codes for implementing the resource management method according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to enable people skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0020] Electronic devices often require extensive system resource allocation and scheduling, such as memory allocation and processor power allocation when launching applications (apps). When resources are plentiful, this resource allocation can be completed quickly. However, when resources are limited, such as when memory is scarce, continuing to request memory will wake up the corresponding thread (such as the kswapd thread) to reclaim memory. This type of thread consumes a lot of computing resources, causing system lag and affecting the user experience.
[0021] To avoid lags when allocating resources, resources are usually freed up first. Taking the memory swap process as an example, when memory is insufficient, anonymous pages in the memory will be compressed into zram. When the available memory is further reduced, the anonymous pages in zram will be swapped into the flash memory (it is also possible to swap the anonymous pages directly into the external flash memory without going through zram). These anonymous pages belong to an inactive app. When the app becomes active again, they need to be quickly pulled back from the flash memory to the main memory. This is also called the "swap in" process. If this process is slow, it will cause system lag and affect the system experience.
[0022] In the related art, there are many ways to determine the need for resource pre-allocation. For example, in the above-mentioned Swap in process, when the user re-clicks on an APP whose memory page has been swapped out, the pre-loading mechanism will be triggered, that is, most anonymous pages will be restored from flash to zram, ready to be called again, to avoid page faults (page faults) causing a large number of input / output (I / O) requests, thereby blocking the program and causing jams. However, the resource pre-allocation methods in the related art all adopt fixed strategies, and there will still be situations where the requested resources are too intensive, which will cause jams.
[0023] In response to the above problems, the inventors have proposed the resource management method, device, electronic device and storage medium provided in the embodiments of the present application. By obtaining the current system status data, application running data and user operation data of the electronic device, the current system status data, application running data and user operation data are input into the trained resource management model to obtain the resource management policy output by the resource management model. Based on the resource management policy, the electronic device is managed for resources. In this way, when the electronic device performs resource management, it can be achieved that not only the system status data is combined, but also the application running data and user operation data are combined, so that the resource management policy can adapt to the running application and the actual operation of the user, thereby enabling more flexible and accurate resource management. Among them, the specific resource management method is described in detail in the subsequent embodiments.
[0024] The resource management method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0025] See also Figure 1 , Figure 1 A schematic diagram of a resource management method according to an embodiment of the present application is shown. In a specific embodiment, the resource management method is applied to Figure 7 The resource management device 500 and the electronic device 100 ( Figure 8 ). The following will take electronic devices as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic devices used in this embodiment can be smart phones, tablet computers, smart watches, e-books, laptop computers, etc., and are not limited here. Figure 1 The process shown is described in detail, and the resource management method may specifically include the following steps:
[0026] Step S110: Acquire current system status data, application running data, and user operation data of the electronic device.
[0027] In an embodiment of the present application, when performing resource management, the electronic device may obtain current system status data, application operation data, and user operation data at the current moment, so as to perform resource management based on the system status data, application operation data, and user operation data. System status data may refer to various data describing the current operating status, performance, configuration, etc. of the system; application operation data may refer to data that can characterize the characteristics and status of running applications; and user operation data may refer to data that can reflect the user's operating behavior when the application is running.
[0028] In some embodiments, the system status data may include the usage status of the processor and the usage status of the memory. The usage status of the processor may include the usage rate, load, frequency, etc. of the central processing unit (CPU), and the usage status of the memory may include the memory occupancy rate, available memory, zRAM free size, etc. Of course, the system status data may also include the usage status of hard disk and other storage devices, network status, network configuration, battery power, power connection status, and other data. It can be understood that the system status data can reflect the overall resource usage of the electronic device, and therefore provide a basis for resource management of the electronic device to avoid lag during operation.
[0029] In some embodiments, application operation data includes application information, operation status, and resource usage parameters of the currently running application. The application information of the application may include basic information of the application, an application description, and other information. Basic information may include information such as the application name, version, and storage space occupied. The application description may be a brief description of the application's functions, uses, and features. Of course, the application information may also include other information, such as the application category. It is understandable that application operation data can reflect the application's demand for electronic device resources. Therefore, the above application operation data can be obtained to perform resource management based on the application operation data.
[0030] In one possible implementation, the electronic device may utilize an application management function in an operating system to obtain detailed information of the running application from installed applications, thereby obtaining the application information. Of course, the electronic device may also obtain the application information of the application through other means, for example, by obtaining the application information of the application from an application store.
[0031] In the above method, the running state of the application may include the foreground running state and the background running state, and the resource occupancy state of the application may be the memory resources, computing resources, etc. occupied by the application. For example, it may include the memory size occupied by the application and the corresponding CPU occupancy rate. The foreground running state refers to the state in which the electronic device displays the application interface of the application on the screen. When the application is running in the foreground, the user can see the application interface of the application on the screen; the background running state, which is opposite to the foreground running state, refers to the state in which the electronic device does not display the application interface of the application on the screen, and the user cannot interact with the application interface of the application. However, the application will still occupy the system resources of the electronic device when it is running in the background.
[0032] In some embodiments, the user operation data may include screen touch data, which may include the frequency of touch operations, such as the frequency of sliding operations and clicking operations. It is understandable that the screen touch data may reflect the user's usage of the application currently running in the foreground and the user's habits. Different user usage and user habits will require different resources. Therefore, when managing resources on the electronic device, the user operation data may be obtained to more accurately manage resources, so that when the user uses the application, the resources allocated by the electronic device can match the user's usage and habits.
[0033] Step S120: inputting the current system status data, application running data and user operation data into the trained resource management model to obtain the resource management policy output by the resource management model.
[0034] In an embodiment of the present application, after the electronic device obtains the current system status data, application running data, and user operation data of the electronic device, it can perform resource management based on the obtained system status data, application running data, and user operation data. Among them, the electronic device can input the current system status data, application running data, and user operation data into a trained resource management model, thereby obtaining a resource management policy output by the resource management model. The resource management policy output by the resource management model matches the current system status data, application running data, and user operation data of the electronic device. After the electronic device performs resource management based on the resource management policy, it can ensure that the electronic device can operate smoothly under the current system status data, application running data, and user operation data.
[0035] In some embodiments, a pre-trained resource management model may be stored in the electronic device. This resource management model may be pre-trained based on collected historical system status data, application operation data, and user operation data. The system status data, application operation data, and user operation data at each moment are annotated with a management policy label, with different management policy labels representing different resource management policies. The resource management model may be a support vector machine (SVM), a neural network, a naive Bayes classifier, or the like, and the specific model type of the resource management model is not limited.
[0036] In a possible implementation, the above resource management model can be trained in the following manner: different system status data, application operation data and user operation data can be obtained in advance through testing, and the resource management policy adapted thereto can be annotated with the management policy label corresponding to the adapted resource management policy for each set of system status data, application operation data and user operation data, thereby obtaining a sample data set; when the resource management model is trained based on the sample data set, the system status data, application operation data and user operation data can be input into the initial model to obtain the output result of the initial model, and the target loss value of the initial model can be determined based on the output result and the management policy label; after determining the target loss value corresponding to the initial model, the initial model can be iteratively trained based on the target loss value to obtain the final resource management model. The initial model can be a neural network, a Softmax logistic regression model, a support vector machine, etc., and the specific initial model can be not limited; when determining the target loss value, the loss value can be determined based on the difference between the output result and the annotated management policy label.
[0037] When iteratively training the initial model based on the target loss value, the model parameters of the initial model can be adjusted based on the calculated target loss value. System status data, application operation data, and user operation data are repeatedly input into the initial model to obtain the output of the initial model. Based on the output results and the management policy label, the target loss value of the initial model can be determined. Based on the calculated target loss value, the model parameters of the initial model can be adjusted until the training end conditions are met, thereby obtaining a trained resource management model. The training end conditions for iterative training may include: the number of iterative training iterations reaching the target number; or the total loss value of the initial model meeting the set conditions.
[0038] Of course, the specific training method for the resource management model described above is not limited. For example, unsupervised training can be implemented through reinforcement learning to obtain the resource management model. Unsupervised training involves using an unlabeled dataset—that is, the data lacks explicit labels or results, and the model must learn patterns and regularities from this data.
[0039] Step S130: performing resource management on the electronic device based on the resource management policy.
[0040] In the embodiment of the present application, after the electronic device determines the above resource management policy, it can perform resource management according to the above resource management policy. Among them, the above resource management policy indicates the resource management operation that the electronic device needs to perform. Based on the resource management policy, the electronic device can perform the resource management operation corresponding to the resource management policy, thereby ensuring that the electronic device can operate smoothly under the current system status data, application operation data and user operation data.
[0041] In some embodiments, the above resource management strategy may include at least one of memory recycling, migrating processing tasks to other processor cores, adjusting the operating frequency of the processor, and adjusting the screen refresh rate of the electronic device. Among them, memory recycling refers to the process in which the operating system or application releases and reallocates memory resources to other processes or tasks that require memory resources when it detects that the memory resources are no longer in use; migrating processing tasks to other processor cores refers to migrating the corresponding processing tasks from the current processor core to other processor cores, such as migrating processing tasks in the large core to the small core; adjusting the operating frequency of the processor refers to increasing or decreasing the operating frequency of the processor; adjusting the screen refresh rate of the electronic device refers to increasing or decreasing the screen refresh rate. Of course, the resource management strategy may also include other strategies, such as time slice rotation, priority scheduling, etc.
[0042] In a possible implementation, the adjustment operations corresponding to the same resource management policy can also be divided into adjustments of different degrees of adjustment. For example, for memory recycling, it can include: recycling memory until the free memory is 1 / 10 of the total memory, recycling memory until the free memory is 2 / 10 of the total memory, recycling memory until the free memory is 3 / 10 of the total memory, recycling memory until the free memory is 4 / 10 of the total memory, etc. For example, reducing the load of the processor can include: reducing the load of the large core to 50%, 40%, 30% of the maximum value, etc., thereby freeing up large core resources to cope with upcoming large tasks, or to reduce power consumption.
[0043] The resource management method provided in the embodiments of the present application obtains the current system status data, application running data, and user operation data of the electronic device, inputs the current system status data, application running data, and user operation data into a trained resource management model, obtains a resource management policy output by the resource management model, and performs resource management on the electronic device based on the resource management policy. As a result, resource management of the electronic device can be achieved by combining not only the system status data but also the application running data and user operation data, so that the resource management policy can adapt to the running applications and the actual operations of the user, thereby enabling more flexible and accurate resource management.
[0044] See also Figure 2 , Figure 2 A schematic diagram of a resource management method according to another embodiment of the present invention is shown. The resource management method is applied to the above electronic device. Figure 2 The process shown is described in detail, and the resource management method may specifically include the following steps:
[0045] Step S210: Acquire system status data, application operation data, and user operation data of the electronic device during historical operation.
[0046] In an embodiment of the present application, a method for training a resource management model is provided. It is worth noting that the resource management model can be trained in advance, and then the trained resource management model can be used each time resource management is required, without the need to train the resource management model each time resource management is required. When training the resource management model, system status data, application operation data, and user operation data from the electronic device during historical operation can be obtained.
[0047] Step S220: Obtain the historical device operation status after resource management of the electronic device using the historical resource management strategy, wherein the historical resource management strategy is output by the reinforcement learning model based on the input system status data, application operation data, and user operation data during the historical operation.
[0048] In an embodiment of the present application, during the training phase for the resource management model, the system status data, application operation data, and user operation data of the electronic device during operation can be obtained and recorded. The system status data, application operation data, and user operation data recorded each time can be used as a set of status data. After each set of status data is obtained, the set of status data can be input into the reinforcement learning model, and the reinforcement learning model can output a resource management strategy based on the input set of status data; the electronic device can perform resource management based on the resource management strategy, and after performing resource management, the electronic device can obtain the device operation status (as a historical device operation status). The device operation status may include the operation smoothness of the application, power consumption, etc.
[0049] Among them, reinforcement learning (RL), also known as reinforcement learning, evaluation learning or enhanced learning, is one of the paradigms and methodologies of machine learning. It is used to describe and solve the problem of how an agent maximizes rewards or achieves specific goals through learning strategies during its interaction with the environment. The learning strategy is the behavioral rules used by the agent in reinforcement learning, and the learning strategy is usually a neural network.
[0050] Step S230: Based on the historical device operating status, the system status data during the historical operation, the application operation data, and the user operation data, the reinforcement learning model is trained to obtain the resource management model.
[0051] In an embodiment of the present application, after the electronic device obtains the above-mentioned historical device operating status, the system status data during the historical operation, the application operating data, the user operation data and the corresponding device operating status, it can train the reinforcement learning model based on the historical device operating status, the system status data during the historical operation, the application operating data and the user operation data to obtain a resource management model.
[0052] The mathematical framework of the reinforcement learning model is Markov Decision Processes (MDPs). For example, see Figure 3 The reinforcement learning model can be a Deep Deterministic Policy Gradient (DDPG) model. The reinforcement learning model can be a model based on the Actor-Critic algorithm. The reinforcement learning model includes an actor network (i.e., policy network) and a critic network (i.e., value network). The reinforcement learning model can generate multiple agents, each of which independently explores the environment and receives rewards from the environment to update the reinforcement learning model. The policy network is responsible for giving actions in the current state, and the value network is responsible for predicting the total benefits (i.e., long-term benefits) that can be obtained from the current state to the end moment. Training the reinforcement learning model usually involves multiple interactions between the agent and the environment to obtain the actions, states, and rewards for each interaction. These multiple sets of (actions, states, and rewards) are then used as training data to train the agent once. The above process is then used to train the agent for the next round until convergence conditions are met. Intelligent agent is a very important concept in the field of artificial intelligence. Any independent entity that can think and interact with the environment can be abstracted as an intelligent agent. In reinforcement learning, the main method is to guide the intelligent agent to obtain the maximum expected benefit through continuous exploration through incentive mechanisms.
[0053] In some embodiments, a reward value can be determined based on the historical device operating status, and then a reinforcement learning model can be trained based on the reward value, the historical device operating status, the system status data during historical operation, the application operation data, and the user operation data to obtain a resource management model.
[0054] Among them, the reinforcement learning model can use the reward value obtained each time, the historical device operating status, the system status data during historical operation, the application operation data, and the user operation data as a sample, and then conduct the next exploration to obtain the next sample, splice the current sample at the end of the historical sample to obtain a sample sequence. After multiple explorations, the reinforcement learning model is trained using the current sample sequence.
[0055] Based on this, the optimized policy network can be used to determine actions with better effects. Actions with better effects usually refer to actions that can generate more reward values, and the reward values are usually related to the task goals defined by the agent. In an embodiment of the present application, after resource management is performed based on the resource management policy output by the reinforcement learning model according to the input historical runtime system status data, application operation data, and user operation data, if the device operation status represents that the application running in the foreground is running smoothly and the power consumption is lower, more positive rewards are given. If the device operation status represents that the application running in the foreground is stuck, a negative reward is given. Therefore, after the reinforcement learning model is trained, the resource management policy determined by the output of the reinforcement learning model can be executed, so that the electronic device can ensure the smooth operation of the application and low power consumption after resource management based on the resource management policy.
[0056] In a possible implementation, during the training process, if the current training round has reached the total training round of the reinforcement learning model, the training of the reinforcement learning model can be stopped, and the trained reinforcement learning model can be used as the resource management model.
[0057] For example, through the above method, the resource management model can learn the usage of the currently running application and user habits. For example, in the same short video application, some users may only watch short videos and scroll more frequently. At this time, it is also necessary to schedule processors and other resources relatively frequently to ensure smoothness; while some users may watch long videos, that is, they will stay on a video interface for a longer time. At this time, the use of various resources is relatively smooth.
[0058] Step S240: Acquire the current system status data, application running data, and user operation data of the electronic device.
[0059] Step S250: input the current system status data, application running data and user operation data into the trained resource management model to obtain the resource management policy output by the resource management model.
[0060] Step S260: performing resource management on the electronic device based on the resource management policy.
[0061] In the embodiment of the present application, steps S240 to S260 can refer to the contents of other embodiments and will not be repeated here.
[0062] The resource management method provided in the embodiment of the present application can realize that when an electronic device performs resource management, it not only combines system status data, but also combines application running data and user operation data, so that the resource management strategy can adapt to the running application and the actual operation of the user, thereby enabling more flexible and accurate resource management; in addition, the embodiment of the present application also provides a training method for the resource management model, which is trained by reinforcement learning to obtain a resource management model, so that the resource management model can output a resource management strategy that is more in line with the user's operating behavior and habits, thereby more accurately managing resources.
[0063] See also Figure 4 , Figure 4 A schematic diagram of a resource management method according to another embodiment of the present application is shown. The resource management method is applied to the above electronic device. Figure 4 The process shown is described in detail, and the resource management method may specifically include the following steps:
[0064] Step S310: Acquire the current system status data, application running data, and user operation data of the electronic device.
[0065] In the embodiment of the present application, step S310 can refer to the content of the aforementioned embodiment and will not be repeated here.
[0066] Step S320: Determine the current operating scenario of the electronic device.
[0067] In an embodiment of the present application, considering that the demand for resources of an electronic device is different in different operation scenarios, in order to more accurately manage resources for each operation scenario, the current operation scenario of the electronic device can be determined, so that the resource management strategy can be determined by using the corresponding resource management model according to the current operation scenario. The above operation scenarios can be divided according to the application program and the application interface. For example, for a live broadcast application, there are live broadcast scenarios with relatively high audience participation and live broadcast scenarios with relatively low audience participation. In the live broadcast scenario with relatively high audience participation, the screen refresh rate required is relatively high because of the need to frequently display live interactive information such as gift giving and barrage. In the live broadcast scenario with low audience participation, a high screen refresh rate is not required. Therefore, for the live broadcast application, the above live broadcast scenarios with relatively high audience participation and relatively low audience participation can be divided.
[0068] In some embodiments, the electronic device can obtain application information of the target application currently running in the foreground, determine the current interface of the target application, and then determine the current operating scenario of the electronic device based on the obtained application information of the target application and the current interface.
[0069] In one possible implementation, the electronic device may input the application information of the target application and the interface image of the current interface into a pre-trained scene recognition model to obtain a scene recognition result output by the scene recognition model, and the scene recognition result represents the recognized operating scenario. The scene recognition model may be trained based on a large amount of sample data annotated with scene labels, where the sample data may be application information and interface images, and the scene labels are used to represent the operating scenario. The scene recognition model may be a support vector machine, a neural network, a naive Bayes classifier, etc., and the specific model type of the scene recognition model may not be limited.
[0070] Step S330: Input the current system status data, application operation data and user operation data into the resource management model corresponding to the current operation scenario to obtain the resource management policy output by the resource management model. Different resource management models correspond to different operation scenarios.
[0071] In an embodiment of the present application, after determining the current operating scenario, a resource management model corresponding to the current operating scenario can be determined from multiple resource management models, and then the above current system status data, application operation data, and user operation data are input into the resource management model corresponding to the current operating scenario to obtain a corresponding resource management policy. Different operating scenarios correspond to different resource management models. Thus, it is possible to determine a resource management policy for the current operating scenario using the resource management model corresponding to the current operating scenario, thereby further improving the accuracy of resource management.
[0072] In some embodiments, for each operation scenario, the system status data, application operation data, and user operation data of the electronic device in the historical operation scenario can be obtained, and the historical device operation status after resource management of the electronic device using the historical resource management strategy can be obtained. The historical resource management strategy is output by the reinforcement learning model based on the input historical system status data, application operation data, and user operation data in the operation scenario. Then, the reinforcement learning model can be trained based on the above historical device operation status, system status data, application operation data, and user operation data during historical operation to obtain a resource management model for the operation scenario.
[0073] Step S340: performing resource management on the electronic device based on the resource management policy.
[0074] In the embodiment of the present application, step S340 can refer to the contents of other embodiments and will not be repeated here.
[0075] The resource management method provided in the embodiment of the present application can realize that when an electronic device performs resource management, it not only combines system status data, but also combines application operation data and user operation data, so that the resource management strategy can adapt to the running application and the actual operation of the user, thereby enabling more flexible and accurate resource management; in addition, when determining the resource management strategy using the resource management model, the resource management strategy is determined by determining the current operation scenario and using the resource management model corresponding to the current operation scenario, thereby further improving the accuracy of resource management.
[0076] See also Figure 5 , Figure 5 A schematic diagram of a resource management method according to another embodiment of the present application is shown. The resource management method is applied to the above electronic device. Figure 5 The process shown is described in detail, and the resource management method may specifically include the following steps:
[0077] Step S410: Acquire current system status data, application running data, and user operation data of the electronic device.
[0078] In some embodiments, application execution data includes application information of currently running applications, and the application information may include application type. It is understandable that due to the large number of applications, if a single application is used as input, the training workload during model training is large, so the application information may include application type. The specific classification criteria for application types are not limited, and for example, they can be classified into video, game, daily use, large-scale task, and other categories.
[0079] In a possible implementation, when determining the above application types, the electronic device may input the application name, running status, and resource occupancy parameters of the running application into a trained application classification model to obtain the application type output by the application classification model.
[0080] Optionally, a reinforcement learning model ML_C can be trained to output the application type of the application based on the application name, running status, and resource usage parameters of the input application. ML_C can be implemented through a multi-layer MLP classification model. When training ML_C, every time a new application is installed, the application name, running status, and resource usage parameters of the application can be collected for a period of time, and then input into ML_C to classify it and obtain the classification results. Finally, this data can be used as a new dataset to update the model. For example, please refer to Figure 6, the application data such as the application name, running status and resource occupancy parameters of the application are input into the application classification model for running training. After passing through the input layer and the hidden layer, the output layer can output the probability of each category, and according to the probability of each category, determine the category with the highest probability as the application type of the application.
[0081] Step S420: Input the current system status data, application operation data, and user operation data into the trained resource management model to obtain the resource management policy output by the resource management model.
[0082] In some embodiments, considering that if a resource management model is continuously used to determine a resource management policy during the operation of an electronic device, it will result in greater power consumption and occupy more resources, therefore, after obtaining the current system status data, application operation data, and user operation data, it is possible to determine whether the target data in the system status data meets the target change condition based on the system status data; if the target change condition is met, the current system status data, application operation data, and user operation data can be input into the trained resource management model to obtain the resource management policy output by the resource management model; if the target change condition is not met, the current system status data, application operation data, and user operation data can be omitted from being input into the trained resource management model. The target data can be key data in the system status data, such as CPU occupancy, remaining available memory, etc.; the target change condition can be that the change amplitude is greater than the target amplitude.
[0083] Step S430: performing resource management on the electronic device based on the resource management policy.
[0084] In the embodiment of the present application, step S430 can refer to the content of the aforementioned embodiment and will not be repeated here.
[0085] Step S440: updating the resource management model based on the device operation status of the electronic device, the current system status data, application operation data, and user operation data.
[0086] In an embodiment of the present application, after performing resource management based on a determined resource management policy, the electronic device can determine the device operating status of the electronic device and then update the resource management model based on the device operating status of the electronic device, the current system status data, the application operating data, and the user operation data. In other words, the system status data, application operating data, and user operation data obtained this time, as well as the resource management policy and device operating status determined this time, can be used as new sample data to update and train the resource management model, thereby further improving the accuracy of the resource management model in determining the resource management policy.
[0087] The resource management method provided in the embodiment of the present application can realize that when an electronic device performs resource management, it not only combines system status data, but also combines application running data and user operation data, so that the resource management strategy can adapt to the running applications and the actual operations of the users, thereby enabling more flexible and accurate resource management; in addition, after performing resource management according to the determined resource management strategy, the resource management model is further updated according to the data obtained this time, thereby further improving the accuracy of the resource management model in determining the resource management strategy.
[0088] See also Figure 7 , which shows a structural block diagram of a resource management device 500 provided in an embodiment of the present application. The resource management device 500 applies the above-mentioned electronic device, and the resource management device 500 includes: a data acquisition module 510, a policy acquisition module 520 and a device management module 530. Among them, the data acquisition module 510 is used to obtain the current system status data, application running data and user operation data of the electronic device; the policy acquisition module 520 is used to input the current system status data, application running data and user operation data into the trained resource management model to obtain the resource management policy output by the resource management model; the device management module 530 is used to perform resource management on the electronic device based on the resource management policy.
[0089] In some embodiments, the resource management device 500 may further include a model training module. The model training module may be configured to obtain system status data, application operation data, and user operation data of the electronic device during historical operation; obtain historical device operation status after resource management of the electronic device using a historical resource management strategy, where the historical resource management strategy is output by a reinforcement learning model based on the input system status data, application operation data, and user operation data during the historical operation; and train the reinforcement learning model based on the historical device operation status, the system status data, application operation data, and user operation data during the historical operation to obtain the resource management model.
[0090] In one possible implementation, the model training module can also be used to determine a reward value based on the historical device operating status; and to train the reinforcement learning model based on the reward value, the historical device operating status, the system status data during the historical operation, the application operation data, and the user operation data to obtain the resource management model.
[0091] In some embodiments, the system status data includes the usage status of the processor and the usage status of the memory, the application running data includes the application information, running status and resource occupancy parameters of the currently running application, and the user operation data includes screen touch data.
[0092] In a possible implementation, the application information includes an application type, and the application type is obtained in the following manner:
[0093] The application name, running status and resource occupancy parameters of the application program are input into the application classification model that is being trained, and the application type output by the application classification model is obtained.
[0094] In some embodiments, the policy acquisition module 520 can be specifically used to: determine the current operating scenario of the electronic device; input the current system status data, application operating data, and user operation data into the resource management model corresponding to the current operating scenario, and obtain the resource management policy output by the resource management model. Different operating scenarios correspond to different resource management models.
[0095] In a possible implementation, the policy acquisition module 520 may also be configured to determine the current running scenario of the electronic device based on application information of a target application currently running in the foreground and a current interface of the target application.
[0096] In some embodiments, the resource management strategy includes at least one of performing memory recycling, migrating processing tasks to other processor cores, adjusting the operating frequency of the processor, and adjusting the screen refresh rate of the electronic device.
[0097] In a possible implementation, the resource management apparatus 500 may further include a model updating module. The model updating module may be configured to update the resource management model based on the device operating state of the electronic device, the current system state data, application operating data, and user operation data after performing resource management on the electronic device based on the resource management policy.
[0098] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0099] In several embodiments provided in this application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0100] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0101] In summary, the solution provided by this application obtains the current system status data, application operation data, and user operation data of an electronic device, inputs the current system status data, application operation data, and user operation data into a trained resource management model, obtains a resource management policy output by the resource management model, and then performs resource management on the electronic device based on the resource management policy. This allows resource management of the electronic device to be implemented by integrating not only the system status data but also the application operation data and user operation data, enabling the resource management policy to adapt to the running applications and the actual user operations, thereby enabling more flexible and accurate resource management.
[0102] Please refer to Figure 8 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 can be an electronic device capable of running applications, such as a smartphone, a tablet computer, a smart watch, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to execute the method described in the aforementioned method embodiment.
[0103] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the electronic device 100. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, and accesses data stored in the memory 120 to perform various functions and process data within the electronic device 100. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communications chip.
[0104] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the electronic device 100 during use (such as a phone book, audio and video data, chat history data), etc.
[0105] Please refer to Figure 9 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program code, which can be called by a processor to execute the method described in the above method embodiment.
[0106] The computer-readable storage medium 800 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 for executing any of the method steps described above. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in a suitable form.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application 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 cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource management method, characterized in that: Applied to electronic equipment, the method comprises: Acquiring current system status data, application running data, and user operation data of the electronic device; Inputting the current system status data, application operation data, and user operation data into a trained resource management model to obtain a resource management policy output by the resource management model; Based on the resource management policy, resource management is performed on the electronic device.
2. The method according to claim 1, characterized in that The resource management model is trained in the following way: Acquire system status data, application operation data, and user operation data of the electronic device during historical operation; Acquire a historical device operation state after resource management of the electronic device using a historical resource management strategy, wherein the historical resource management strategy is output by a reinforcement learning model based on input system state data, application operation data, and user operation data during the historical operation; Based on the historical device operation status, the system status data during the historical operation, the application operation data and the user operation data, the reinforcement learning model is trained to obtain the resource management model.
3. The method according to claim 2, characterized in that The training of the reinforcement learning model based on the historical device operation status, the system status data during the historical operation, the application operation data, and the user operation data to obtain the resource management model includes: Determining a reward value based on the historical device operating status; The reinforcement learning model is trained based on the reward value, the historical device operation status, the system status data during the historical operation, the application operation data and the user operation data to obtain the resource management model.
4. The method according to claim 1, characterized in that: The system status data includes the usage status of the processor and the usage status of the memory, the application running data includes the application information, running status and resource occupation parameters of the currently running application program, and the user operation data includes screen touch data.
5. The method according to claim 4, characterized in that The application information includes an application type, and the application type is obtained in the following manner: The application name, running status and resource occupancy parameters of the application program are input into the application classification model in the running training to obtain the application type output by the application classification model.
6. The method according to claim 1, characterized in that The inputting the current system status data, application operation data and user operation data into the trained resource management model to obtain the resource management policy output by the resource management model includes: Determining a current operating scenario of the electronic device; The current system status data, application operation data and user operation data are input into the resource management model corresponding to the current operation scenario to obtain the resource management policy output by the resource management model. Different resource management models correspond to different operation scenarios.
7. The method according to claim 6, characterized in that The determining the current operating scenario of the electronic device includes: Based on the application information of the target application currently in the foreground running state and the current interface of the target application, the current running scene of the electronic device is determined.
8. The method according to any one of claims 1 to 7, characterized in that: The resource management strategy includes at least one of memory recycling, migrating processing tasks to other processor cores, adjusting the operating frequency of the processor, and adjusting the screen refresh rate of the electronic device.
9. The method according to any one of claims 1 to 7, characterized in that: After performing resource management on the electronic device based on the resource management policy, the method further includes: The resource management model is updated based on the device operation status of the electronic device, the current system status data, application operation data and user operation data.
10. A resource management device, characterized in that: Applied to electronic equipment, the device comprises: a data acquisition module, a policy acquisition module and a device management module, wherein: The data acquisition module is used to acquire the current system status data, application running data and user operation data of the electronic device; The policy acquisition module is used to input the current system status data, application operation data and user operation data into the trained resource management model to obtain the resource management policy output by the resource management model; The device management module is used to perform resource management on the electronic device based on the resource management policy.
11. An electronic device, characterized in that: include: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 9.
Citation Information
Cited By
Low-power-consumption dynamic adjustment method and system based on multi-objective optimization decision
CN121541768A