Resource management method, device and equipment and computer readable storage medium
By allocating points to terminal applications and managing resources based on points, the problems of inflexible resource management and poor user experience in the prior art are solved, and quantitative management and flexible control of terminal resources are realized.
Patent Information
- Application Number
- CN202311723565.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-17
AI Technical Summary
When managing terminal resources, the existing technology cannot effectively quantify and flexibly control resource consumption, resulting in poor user experience, and simply and crudely close applications that consume more resources or restrict resource use, which cannot meet the flexible and changeable user needs.
By assigning application points to each application for the target resource, ensure that the sum of application points and system points is equal to the total amount of target resources. When applying the function that requires the target resource to be used, determine whether the remaining points are sufficient to pay the resource deduction and consumption. If sufficient, use is allowed, otherwise it is prohibited.
Quantitative management of terminal resources is realized, and the resource consumption of applications is restricted through the points mechanism, unnecessary resource waste is avoided, and the flexibility of resource use and user experience is improved.
Smart Images

Figure CN120162228A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technologies, and particularly to a resource management method, apparatus, device, and computer-readable storage medium. Background Art
[0002] In related technologies, when a terminal detects that a running application consumes a large amount of resources, it can directly close the application to control the resources, especially for applications running in the background.
[0003] However, directly closing the application to avoid excessive resource consumption will result in fewer resident applications, slower response, and poor user experience.
[0004] Moreover, in related technologies, resources cannot be quantified, and the control method is not intelligent enough. Simply and crudely closing applications that consume a large amount of resources or restricting resource usage will result in inflexible resource management and poor user experience. Summary of the Invention
[0005] To overcome the problems existing in related technologies, the present disclosure provides a resource management method, apparatus, device, and computer-readable storage medium, which can solve the above problems.
[0006] According to a first aspect of an embodiment of the present disclosure, a resource management method is provided. Each application is respectively assigned an application score for a target resource, and the sum of the application scores is equal to the total system score. The total system score corresponds to the total amount of the target resource on the terminal. The method includes:
[0007] When any application needs to use a target function that consumes the target resource, determine whether the remaining application score of the any application is greater than or equal to the resource deduction amount for the target function, and determine whether the remaining system score is greater than or equal to the resource consumption amount for the target function;
[0008] If both determinations are yes, allow the any application to use the target function, and reduce the remaining application score of the any application by the resource deduction amount for the target function, and reduce the remaining system score by the resource consumption amount for the target function;
[0009] Otherwise, prohibit the any application from using the target function.
[0010] According to a second aspect of an embodiment of the present disclosure, a resource management apparatus is provided. Each application is respectively assigned an application score for a target resource, and the sum of the application scores is equal to the total system score. The total system score corresponds to the total amount of the target resource on the terminal. The apparatus includes:
[0011] A determination unit, configured to determine whether the remaining application points of any application are greater than or equal to the resource deduction amount for the target function, and determine whether the remaining system points are greater than or equal to the resource consumption amount for the target function when any application needs to use a target function that consumes target resources;
[0012] A usage unit, configured to, if both determinations are affirmative, allow any application to use the target function, and reduce the remaining application points of any application by the resource deduction amount for the target function, and reduce the remaining system points by the resource consumption amount for the target function;
[0013] A prohibition unit, configured to, otherwise, prohibit any application from using the target function.
[0014] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor and a memory;
[0015] The memory is used to store a computer program;
[0016] The processor is configured to execute the resource management method as described in the first aspect by calling the computer program.
[0017] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the resource management method as described in the first aspect.
[0018] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
[0019] The present disclosure quantifies the total amount of resources on the terminal using points. By allocating points to each application, when any application uses a function that consumes target resources, it must reduce the resource deduction amount from the application points and reduce the resource consumption amount from the system points. The function is allowed to be used only when both the application points and the system points can cover the consumption. Otherwise, the application is prohibited from using the function. The present disclosure uses points to quantify the target resources, allocates points to the application, and sets the usage rules of the points to limit the application's use of the target resources, thereby achieving a more reasonable use of the target resources and avoiding unnecessary waste.
[0020] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Description of the Drawings
[0021] The drawings here are incorporated into the specification and constitute a part of the present disclosure, showing embodiments that conform to the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0022] Figure 1 It is a schematic flowchart of a resource management method shown according to an exemplary embodiment of the present disclosure.
[0023] Figure 2 It is a schematic diagram of the resource deduction amount corresponding to the running state of an application shown according to an exemplary embodiment of the present disclosure.
[0024] Figure 3 It is a schematic diagram of the resource deduction amount and resource consumption amount corresponding to the holding state of a target resource shown according to an exemplary embodiment of the present disclosure.
[0025] Figure 4 It is a schematic flowchart of a resource management method shown according to an exemplary embodiment of the present disclosure.
[0026] Figure 5 It is a schematic flowchart of a resource management method shown according to an exemplary embodiment of the present disclosure.
[0027] Figure 6 It is a block diagram of a resource management device shown according to an exemplary embodiment of the present disclosure.
[0028] Figure 7 It is a schematic block diagram of a device for a resource management device shown according to an exemplary embodiment of the present disclosure. Detailed implementation manners
[0029] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0030] The terms used in the present disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. The singular forms "a", "the", and "said" used in the present disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0031] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0032] Figure 1 FIG. is a schematic flowchart of a resource management method shown according to an embodiment of the present disclosure. The resource management method may be executed by a terminal. Each application running on the terminal is respectively allocated application points for a target resource, and the sum of the application points is equal to the total system points, and the total system points correspond to the total amount of the target resource on the terminal. This resource management method can be used to manage resources in the terminal. The terminal includes, but is not limited to, communication devices such as mobile phones, tablet computers, wearable devices, sensors, and Internet of Things devices. Resources include, but are not limited to, battery power, computing resources of a processor, storage resources, and network resources.
[0033] As Figure 1 shown, the resource management method includes:
[0034] In step S101, when any application needs to use a target function that consumes a target resource, it is determined whether the remaining application points of the any application are greater than or equal to the resource deduction amount for the target function, and it is determined whether the remaining system points are greater than or equal to the resource consumption amount for the target function;
[0035] In step S102, if both are determined to be yes, then allow the any application to use the target function, and reduce the remaining application points of the any application by the resource deduction amount for the target function, and reduce the remaining system points by the resource consumption amount for the target function;
[0036] In step S103, otherwise, prohibit the any application from using the target function.
[0037] In some embodiments, the target resource includes at least one of the following: battery power, computing resources of a processor, storage resources, and network resources.
[0038] It should be noted that the target resource may include any finite resource that will be consumed when an application on the terminal runs, and the present disclosure does not limit this.
[0039] For ease of understanding, battery power is used as an example in the following embodiments.
[0040] In some embodiments, the total system points can be determined according to the total amount of the target resource on the terminal, and then the application points can be allocated to each application according to the determined total system points.
[0041] There is a correlation between the system points and the amount of the target resource.
[0042] For example, the target resource can be the battery power. When the battery power is 100%, 1% of the power corresponds to 10 points, so the total system points are 1000 points. There are 10 applications that need to consume this target resource, then the 1000 points are allocated to these 10 applications respectively, and the points of each application are 100 points.
[0043] In some embodiments, any application needs to consume the target resource when using the target function.
[0044] The target function can be other functional modules in the terminal, such as the task scheduler (Job Scheduler), the clock module (alarm), the location module (location), the Bluetooth module (Bluetooth), the broadcast scheduler (Broadcast), the sensor module (Sensor), and network traffic, etc.
[0045] Any functional module that needs to consume the target resource when used can be the target function.
[0046] In some embodiments, the preset resource deduction amount and resource consumption amount can be set for the target function that will consume the target resource when used.
[0047] Specifically, the resource consumption amount can be determined according to the corresponding relationship between the points and the amount of the target resource and the amount of the target resource consumed by the target function within a unit time (or when using the target function once), and then the resource deduction amount can be determined according to the determined resource consumption amount.
[0048] Still taking the battery power as an example, if 1% of the power corresponds to 10 points, the corresponding resource consumption amount and resource deduction amount can be determined according to the target resource consumption amount of each functional module within a unit time.
[0049] For example, within 2 time units, the task scheduler module will consume 1% of the power, then the corresponding resource consumption amount of the task scheduler module within 1 time unit can be 5 points. Generally, the resource deduction amount can also be set to 5 points. If the current state of the terminal does not encourage each application to use the task scheduler module, the resource deduction amount corresponding to the application points can be set to 7 points, so that each application needs to pay more points when using the target function. If the amount of the current target resource of the terminal is relatively sufficient and each application is encouraged to use the target function, the corresponding resource deduction amount can be set to 4 points.
[0050] The terminal can make each application restrictively use the target resource by setting appropriate resource deduction amounts and resource consumption amounts.
[0051] In some embodiments, if any application needs to use the target function, the remaining points of the application must be reduced by the resource deduction amount of the target function, and the remaining points of the system must be reduced by the resource consumption amount of the target function.
[0052] Therefore, if the remaining points of any application and the remaining points of the system can both support reducing the resource deduction amount and resource consumption amount corresponding to the target function, any application can use the target function; conversely, if at least one of the remaining points of the application and the remaining points of the system is insufficient to reduce the corresponding resource deduction amount or resource consumption amount, it indicates that the total amount of the target resource used by the application has exceeded the allocation, and / or the total amount of the target resource remaining in the terminal does not support the use of the target function.
[0053] For example, if the target function is the function corresponding to the task scheduling module, if an application uses the task scheduling module for 1 time unit, the remaining points of the application need to be reduced by 5 points, and the total points of the system need to be reduced by 5 points. The application can use the target function only when the remaining points of the application and the total points of the system can pay the cost of using the target function. If the remaining points of the application are 3 points and are insufficient to be reduced by 5 points, the application is prohibited from using the target function at this time.
[0054] Through the method of the present disclosure, the target resource can be quantified. When an application needs to use the target function, by determining whether the remaining points of the application and the remaining points of the system can support the consumption of using the target function, the application can be made to restrictively use the target resource, which can not only prevent some applications from consuming too much resources, but also flexibly manage the target resource by adjusting the resource deduction amount and resource consumption amount, and control the behavior of the application.
[0055] In some embodiments, the method further includes: determining the value of the resource deduction amount for the target function according to the running state of the any application on the terminal; and / or, determining the values of the resource deduction amount and resource consumption amount for the target function according to the holding state of the target resource on the terminal.
[0056] In the method proposed by the present disclosure, when any application uses the target function, the resource deduction amount needs to be paid by the application points, and the resource consumption amount needs to be paid by the system points. Therefore, by determining different resource deduction amounts and resource consumption amounts, the restriction of the application behavior can be realized, and the management of the resources of the terminal can be realized.
[0057] In some embodiments, when any application can be perceived by the user, the resource deduction amount corresponding to the running state of the application is less, and when any application cannot be perceived by the user, the resource deduction amount corresponding to the running state of the application is more.
[0058] If the application needs to use the target function when the user cannot perceive it, more resource deduction amount needs to be paid for the application points to proceed, so as to avoid the reduction of the target resources caused by the application using the target function under unnecessary circumstances.
[0059] If the application needs to use the target function when the user can perceive it, it can indicate that the user needs the application to use the target function. At this time, the application points can only reduce a relatively small resource deduction amount, reducing the restriction on the application using the target function through the application points.
[0060] In some embodiments, determining the value of the resource deduction amount for the target function according to the running state of any application on the terminal includes: when any application is a background process, the value of the resource deduction amount is a preset first value; when any application is a background service process, making the value of the resource deduction amount equal to the average value of the first value and the resource consumption value; when any application is a foreground service process, comparing the resource deduction amount and the resource consumption amount, if the resource consumption amount is less than the resource deduction amount, making the value of the resource deduction amount equal to the resource consumption amount; when any application is a foreground process, the value of the resource deduction amount is a second value, where the second value is greater than or equal to 0 and less than the first value.
[0061] Figure 2 It is a schematic diagram of the resource deduction amount corresponding to the running state of an application shown according to an embodiment of the present disclosure.
[0062] In some embodiments, the value of the resource deduction amount for the target function is determined according to the running state of any application on the terminal.
[0063] Among them, the running state of the application on the terminal may include: background process, background service process, foreground service process, and foreground process. The values of the resource deduction amounts corresponding to each running state are respectively as Figure 2 shown. When the application is a background process, the resource deduction amount is a preset larger first value; when the application is a background service process, the resource deduction amount is the average value of the resource deduction amount and the resource consumption amount; when the application is a foreground service process, the resource deduction amount is the smaller value of the resource deduction amount and the resource consumption amount; when the application is a foreground process, the resource deduction amount is a preset smaller second value.
[0064] In some embodiments, if the values of the resource deductions for the same application using the same target function in different running states are sorted in descending order, then the value of the resource deduction in the running state of the background process is greater than the value of the resource deduction in the running state of the background service process, which is greater than the value of the resource deduction in the running state of the foreground service process, which is greater than the value of the resource deduction in the running state of the foreground process and is greater than or equal to 0.
[0065] For the user, the probability of interaction between the application in the foreground process and the user is relatively high, and the user's demand for using the application in the foreground is also higher. Therefore, when in the foreground process, the corresponding resource deduction is less, and the restriction on the application consuming the target resource is also correspondingly less. For an application in the background, the probability of interaction between the user and the application in the background process is relatively low, and the perception brought by the application in the background process using the target function to the user is also less. Therefore, when the application is in the background process, the corresponding resource deduction is more, so that the restriction on the application in the background process using the target resource is more, avoiding the application in the background consuming a large amount of target resources without the user's perception.
[0066] In some embodiments, the second value may be 0.
[0067] The second value being 0 means that the application in the foreground process may not control the target resource during the use of the target function, so as to avoid the situation where the user hopes that the application in the foreground executes the target function, but the application cannot use the target function because the remaining points of the application are not enough to pay for the resource deduction.
[0068] In some embodiments, the method further includes: rewarding application points to the application running in the background when the application running in the background provides interaction information to the user by publishing an interruption notification.
[0069] Some applications running in the background can provide interaction information to the user, and for these applications, more target resources can be allocated to them in the form of rewarding application points.
[0070] In some embodiments, the interruption notification includes a visual interruption and an auditory interruption.
[0071] The event types of the visual interruption published by the application may include: popping up a notification message on the display interface of the terminal, displaying a floating window, making the display interface or the flashlight of the terminal flash, etc., which can enable the user to visually perceive that an application in the background has used the target function.
[0072] The event types of the auditory interruption published by the application may include: emitting a prompt sound effect, playing audio, etc., which can enable the user to auditorily perceive that an application in the background has used the target function.
[0073] In some embodiments, an upper limit of the reward points obtained by the application within a preset duration may be defined.
[0074] To prevent the application from obtaining excessive reward points, which may lead to an imbalance in the management of the target resources.
[0075] For example, when the application in the background uses the target function once, the resource deduction amount for the application points reduction is 5 points, and for each pop-up notification triggered by the application, 2 points will be rewarded to the application. Within one day, the maximum rewarded points cannot exceed 50 points. If the total amount of rewarded points within the preset duration reaches or exceeds 50 points, the event types of the terminal notifications triggered by the application subsequently within the preset duration will no longer trigger reward points.
[0076] In some embodiments, determining the values of the resource deduction amount and the resource consumption amount for the target function according to the holding state of the target resources on the terminal includes:
[0077] When the terminal is in a state of continuously replenishing the target resources, set both the resource deduction amount and the resource consumption amount to 0;
[0078] When the terminal ends replenishing the target resources, set both the resource deduction amount value and the resource consumption amount value to preset values;
[0079] When the remaining amount of the target resources on the terminal is lower than a preset ratio, increase the value of the resource consumption amount.
[0080] Figure 3 It is a schematic diagram of the resource deduction amount and the resource consumption amount corresponding to the holding state of a target resource shown according to an embodiment of the present disclosure.
[0081] In some embodiments, determine the values of the resource deduction amount and the resource consumption amount for the target function according to the holding state of the target resources on the terminal.
[0082] Among them, the holding state of the target resources on the terminal may include: the terminal is continuously replenishing the target resources, the terminal has just ended replenishing the target resources, and the remaining amount of the target resources on the terminal is lower than a preset ratio, that is, the remaining amount of the target resources is low.
[0083] In some embodiments, the holding state of the target resources on the terminal may respectively correspond to different values of the resource deduction amount and the resource consumption amount.
[0084] Such as Figure 3As shown, when the terminal is in a state of continuously replenishing the target resource, both the resource deduction amount and the resource consumption amount are set to 0; the terminal is replenishing the target resource, so in this state, the use of the target resource can be unrestricted. Even if the target resource is consumed by an application, it will be quickly replenished. Therefore, both the resource deduction amount and the resource consumption amount can be set to 0.
[0085] When the terminal finishes replenishing the target resource, both the resource deduction amount and the resource consumption amount are set to preset values; that is, after finishing replenishing the target resource, the use of the target resource starts to be controlled.
[0086] When the remaining amount of the target resource on the terminal is lower than a preset ratio, the value of the resource consumption amount is increased; to avoid the target resource being completely consumed in a short time, the value of the resource consumption amount can be appropriately increased to reserve a part of the target resource for the necessary consumption of the terminal. It should be noted that this is only one embodiment provided by the present disclosure, and this embodiment does not affect the embodiments corresponding to other holding states.
[0087] Still taking the battery power as an example. When the terminal is in a charging state and can continuously replenish the battery power, both the resource deduction amount and the resource consumption amount are 0; when the terminal finishes the charging state and is in a discharging state, both the resource deduction amount and the resource consumption amount return to the preset values; when the terminal is in the Light Idle mode, the resource consumption amount is increased to 1.1 times the preset value; when the terminal is in the Deep Idle mode, the resource consumption amount is increased to 1.2 times the preset value; when the terminal is in the power-saving mode, the resource consumption amount is increased to 1.5 times the preset value.
[0088] In some embodiments, in response to the satisfaction of the integral allocation condition of the target resource, application integrals are respectively allocated to each application according to the total amount of the target resource; wherein, the integral allocation condition includes at least one of the following: the terminal finishes replenishing the target resource; the terminal receives an integral allocation instruction; the remaining amount of the target resource on the terminal decreases to a preset value.
[0089] After the integral allocation condition is satisfied, application integrals are respectively allocated to each application.
[0090] In some embodiments, when the terminal completes the installation of a new application, application integrals are allocated to the new application.
[0091] Other application points allocated to other applications in the last allocation can be additionally allocated to the new application and re-allocated when the conditions for the next point allocation are met. For example, if the application points allocated to each application in the last allocation are 100, after the new application is installed, without modifying the remaining points of the current system and the remaining points of other applications, 100 application points are additionally allocated to the new application, and re-allocated together with other applications when the conditions for the next point allocation are met.
[0092] Allocating additional application points to an application without modifying the remaining points of the current system and the remaining points of other applications can avoid restrictions on the consumption of target resources by other applications, so that other applications still retain the remaining application points.
[0093] In some embodiments, an allocation of application points for each application can also be triggered additionally after the new application is installed.
[0094] The terminal can determine the total amount of target resources and then determine the total system points, and re-allocate the application points to each application.
[0095] In some embodiments, when the target resources on the terminal have a full value, in response to the satisfaction of the point allocation condition of the target resources, the terminal can determine the current amount of the target resources on the terminal, and determine the ratio of the application points allocated to each application according to the ratio relationship between the current amount and the full value, and then determine the allocated application points.
[0096] For example, if the full value of the target resources is 100%, then when originally allocating 100 application points to each application corresponding to the full value, when the current amount of the target resources remains 80%, only 80 application points are allocated to each application.
[0097] In some embodiments, the use of target resources by each application can be restricted by increasing the values of the resource deduction amount and the resource consumption amount and reducing the points allocated to each application, or the use restriction of the target resources can be relaxed by reducing the values of the resource deduction amount and the resource consumption amount and increasing the points allocated to each application.
[0098] In some embodiments, the method further includes: determining a target consumption speed based on the total amount of the target resources and the target usage duration; if the actual consumption speed of the target resources is greater than the target consumption speed within the current period, adjusting the application points allocated to each application to control the consumption of the target resources to reach the target usage duration.
[0099] By determining the target consumption speed for the target resources, when the actual consumption speed does not match the target consumption speed, adjusting the point control strategy, so as to control the consumption of the target resources to reach the target usage duration by restricting or relaxing the use of the target resources.
[0100] When the actual consumption speed is greater than the target consumption speed, adjust the application points allocated to each application. For example, the originally scheduled target resource weight of 100% can be used for 7 days. However, if the actual consumption speed is too fast during the current period, when triggering the allocation of application points to each application, the 100 points originally scheduled to be allocated to each application will be proportionally reduced to 80 points actually allocated, so as to limit the use of the target resource by the application and thus extend the actual usage duration to reach the target usage duration.
[0101] In some embodiments, it is possible to determine whether the consumption of the target resource by the terminal in the historical period has reached the target usage duration. If the target usage duration is reached, increase the allocated application points; if the target usage duration is not reached, decrease the allocated application points.
[0102] For example, if the actual usage duration of the target resource by the terminal reaches the target usage duration of 40 hours within 7 days, when allocating application points to each application, the ratio will be increased to 1.02 proportionally, so that each application can use more target functions to consume more target resources during the current period, achieving the full utilization of the target resource. If the actual usage duration does not reach the target usage duration of 40 hours, the ratio of the allocated application points will be decreased to 0.98 to achieve the management of the target resource.
[0103] The following introduces a specific embodiment of the present disclosure.
[0104] Figure 4 It is a schematic flowchart of a resource management method shown according to an embodiment of the present disclosure. As Figure 4 shown.
[0105] In step S401, determine the total amount of the target resource. The target resource can be the battery power of the terminal, and the current total battery power is 100%.
[0106] In step S402, determine the total system points. Determine the total system points according to the total amount of the target resource. If 1% of the battery power corresponds to 10 points, then the current total system points are 1000 points.
[0107] In step S403, allocate application points to each application. According to the value of the total system points, allocate application points to each application so that the sum of the application points of each application is equal to the total system points. If there are 10 applications to be allocated on the terminal, allocate the total system points of 1000 points to these 10 applications, and each application can be allocated 100 application points.
[0108] After each application is respectively allocated application points for the target resource, the quantification of the target resource is completed, which is convenient for implementing the resource management method proposed by the present disclosure.
[0109] Figure 5 It is a schematic flowchart of a resource management method shown according to an embodiment of the present disclosure. As Figure 5 shown.
[0110] In step S500, the application needs to use the target function. It is possible to determine the target function that the application needs to use, such as including Job Scheduler, alarm, etc.
[0111] In step S501, determine the resource deduction amount and resource consumption amount corresponding to the target function. The target function presets the resource deduction amount and resource consumption amount under standard conditions, which can be adjusted according to the running state of the application and the holding state of resources on the terminal. Taking alarm as an example, the standard resource deduction amount and resource consumption amount are both 10 points. Currently, the application is in the background process state, and the resource deduction amount remains unchanged at 10 points. However, since the remaining amount of the target resource on the terminal is lower than the preset ratio, the resource consumption amount is additionally increased to 15 points.
[0112] In step S502, determine whether the system points are sufficient to pay the resource consumption amount and whether the application points are sufficient to pay the resource deduction amount; if both are sufficient to pay, execute step S503A, and if either is not sufficient to pay, execute step S503B. In the case where the system points are 200 points and the application points are 50 points, both are sufficient to pay, and step S503A is executed.
[0113] In step S503A, the application uses the target function. It is possible to trigger the execution of the alarm of the application.
[0114] In step S504, update the remaining points of the application and the remaining points of the system. The remaining points of the application are obtained by subtracting 10 points from 50 points to get 40 points; the remaining points of the system are obtained by subtracting 15 points from 200 points to get 185 points. It should be noted that an integral pool can be set on the terminal to trigger the update of the points of all applications and record the corresponding events of using the target function as a bill.
[0115] The terminal can adjust the integral distribution strategy and the total integral through self-learning according to the data recorded in the bill.
[0116] In the case where any application triggers bonus points, if the total bonus points of the application within the preset duration have not exceeded the upper limit, increase the points of the application. For example, after step S503A, if the application uses the target function to publish an event type of an interruption notice, 2 points are rewarded to the application. If the interruption notice of the application is viewed by the user, or the user triggers an interaction operation with the widget of the application, 2 more points are rewarded.
[0117] In step S502, when the system score is 200 points and the application score is 5 points, the application score is insufficient to pay for the resource deduction amount, so step S503B is executed.
[0118] In step S503B, the application is prohibited from using the target function. Since the application score is insufficient to pay for the resource deduction amount, it indicates that the application has used target resources exceeding the allocated limit. Therefore, the application is prohibited from continuing to use the target function that consumes the target resources. When the target function is alarm, the alarm of the application can be reset.
[0119] The present disclosure quantifies the target resources and assigns corresponding application scores to each application, so that when each application needs to use the target function, it must make the application score pay for the resource deduction amount and make the system score pay for the resource consumption amount, otherwise it cannot use the target function. The application score is used to limit the excessive consumption of the target resources by the application, and the system score is used to control the total amount of the target resources on the system, which is convenient for the management of the target resources.
[0120] Corresponding to the embodiment of the resource management method of the present disclosure, the present disclosure also provides an embodiment of a corresponding resource management device.
[0121] Please refer to Figure 6 , Figure 6 which is a block diagram of a resource management device in an embodiment of the present disclosure. As Figure 6 shown, the resource management device is configured in a terminal. Each application running on the terminal is respectively assigned an application score for the target resources. The sum of the application scores is equal to the total system score, and the total system score corresponds to the total amount of the target resources on the terminal. The device includes:
[0122] A judgment unit 610, configured to judge whether the remaining application score of any application is greater than or equal to the resource deduction amount for the target function and whether the remaining system score is greater than or equal to the resource consumption amount for the target function when any application needs to use the target function that consumes the target resources;
[0123] A use unit 620, configured to, if both are determined to be yes, allow any application to use the target function, and reduce the remaining application score of any application by the resource deduction amount of the target function and reduce the remaining system score by the resource consumption amount of the target function;
[0124] A prohibition unit 630, configured to otherwise prohibit any application from using the target function.
[0125] In some embodiments, the device is further configured to: determine the value of the resource deduction for the target function according to the running state of any of the applications on the terminal; and / or, determine the values of the resource deduction and resource consumption for the target function according to the holding state of the target resource on the terminal.
[0126] In some embodiments, the determining the value of the resource deduction for the target function according to the running state of any of the applications on the terminal includes: when any of the applications is a background process, the value of the resource deduction is a preset first value; when any of the applications is a background service process, making the value of the resource deduction equal to the average of the first value and the value of the resource consumption; when any of the applications is a foreground service process, comparing the resource deduction and the resource consumption, and if the resource consumption is less than the resource deduction, making the value of the resource deduction equal to the value of the resource consumption; when any of the applications is a foreground process, the value of the resource deduction is a second value, where the second value is greater than or equal to 0 and less than the first value.
[0127] In some embodiments, the device is further configured to: when an application running in the background provides interactive information to the user by publishing an interruption notice, award application points to the application running in the background.
[0128] In some embodiments, the determining the values of the resource deduction and resource consumption for the target function according to the holding state of the target resource on the terminal includes: when the terminal is continuously replenishing the target resource, making both the value of the resource deduction and the value of the resource consumption be 0; when the terminal finishes replenishing the target resource, making both the value of the resource deduction and the value of the resource consumption be preset values; when the remaining amount of the target resource on the terminal is lower than a preset ratio, increasing the value of the resource consumption.
[0129] In some embodiments, in response to the satisfaction of the integral distribution condition of the target resource, application points are respectively allocated to each application according to the total amount of the target resource; where the integral distribution condition includes at least one of the following: the terminal finishes replenishing the target resource; the terminal receives an integral distribution instruction; the remaining amount of the target resource on the terminal decreases to a preset value.
[0130] In some embodiments, the device is further configured to: determine a target consumption speed based on the total amount of the target resource and the target usage duration; if the actual consumption speed of the target resource is greater than the target consumption speed in the current period, adjust the application points allocated to each application to control the consumption of the target resource to reach the target usage duration.
[0131] In some embodiments, the target resources include at least one of the following: battery power, computing resources of a processor, storage resources, and network resources.
[0132] For the specific implementation process of the functions and roles of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method, which will not be elaborated here.
[0133] An embodiment of the present disclosure also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method for alleviating delay in any of the above embodiments by calling the computer program.
[0134] An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and characterized in that when the program is executed by a processor, it implements the method for alleviating delay in any of the above embodiments.
[0135] Figure 7 FIG. 13 is a schematic block diagram of a resource management device 700 according to an embodiment of the present disclosure. For example, the device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0136] Refer to Figure 7 , the device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.
[0137] The processing component 702 generally controls the overall operation of the device 700, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above information receiving method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0138] The memory 704 is configured to store various types of data to support the operation of the device 700. Examples of such data include instructions for any application or method operating on the device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0139] The power supply component 706 provides power to various components of the device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 700.
[0140] The multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0141] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC) that is configured to receive external audio signals when the device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 further includes a speaker for outputting audio signals.
[0142] The I / O interface 712 provides an interface between the processing component 702 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.
[0143] The sensor assembly 714 includes one or more sensors for providing a status assessment of various aspects of the device 700. For example, the sensor assembly 714 can detect the on / off state of the device 700, the relative positioning of components, such as the display and keypad of the device 700. The sensor assembly 714 can also detect a change in the position of the device 700 or a component of the device 700, the presence or absence of user contact with the device 700, the orientation or acceleration / deceleration of the device 700, and the temperature change of the device 700. The sensor assembly 714 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0144] The communication component 716 is configured to facilitate communication between the device 700 and other devices in a wired or wireless manner. The device 700 can access a wireless network based on communication standards, such as WiFi, 2G, 3G, 4G LTE, 5G NR, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0145] In an exemplary embodiment, the device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described information receiving method.
[0146] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions that can be executed by a processor 720 of the device 700 to complete the above-described information receiving method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0147] Other embodiments of the present disclosure will be readily apparent to those skilled in the art in view of the specification and practice of the disclosure herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and examples are only illustrative, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0148] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
[0149] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. The term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0150] The methods and devices provided by the embodiments of the present disclosure have been introduced in detail above. Specific examples are used herein to elaborate on the principles and implementation manners of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure; at the same time, for those of ordinary skill in the art, according to the idea of the present disclosure, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present disclosure.
Claims
1. A resource management method, characterized in that, Each application is respectively allocated application points for the target resource, the sum of the application points is equal to the total system points, and the total system points correspond to the total amount of the target resource on the terminal. The method includes: When any application needs to use the target function that consumes the target resource, determine whether the remaining application points of the any application are greater than or equal to the resource deduction amount for the target function, and determine whether the remaining system points are greater than or equal to the resource consumption amount for the target function; If both are determined to be yes, allow the any application to use the target function, and reduce the remaining application points of the any application by the resource deduction amount of the target function, and reduce the remaining system points by the resource consumption amount of the target function; Otherwise, prohibit the any application from using the target function.
2. The method according to claim 1, characterized in that, The method further includes: Determine the value of the resource deduction amount for the target function according to the running state of the any application on the terminal; and / or, Determine the values of the resource deduction amount and the resource consumption amount for the target function according to the holding state of the target resource on the terminal.
3. The method according to claim 2, characterized in that, The determining the value of the resource deduction amount for the target function according to the running state of the any application on the terminal includes: When the any application is a background process, the value of the resource deduction amount is a preset first value; When the any application is a background service process, make the value of the resource deduction amount equal to the average value of the first value and the value of the resource consumption amount; When the any application is a foreground service process, compare the resource deduction amount and the resource consumption amount. If the resource consumption amount is less than the resource deduction amount, make the value of the resource deduction amount equal to the value of the resource consumption amount; When the any application is a foreground process, the value of the resource deduction amount is a second value, where the second value is greater than or equal to 0 and less than the first value.
4. The method according to claim 1, characterized in that, The method further includes: When an application running in the background provides interactive information to the user by publishing an interruption notification, reward the application running in the background with application points.
5. The method according to claim 2, characterized in that, The determining the values of the resource deduction amount and the resource consumption amount for the target function according to the holding state of the target resource on the terminal includes: When the terminal is continuously replenishing the target resource, make the values of the resource deduction amount and the resource consumption amount both 0; When the terminal ends replenishing the target resource, make the values of the resource deduction amount and the resource consumption amount both preset values; When the remaining amount of the target resource on the terminal is lower than a preset ratio, increase the value of the resource consumption amount.
6. The method according to claim 1, characterized in that, In response to the integral allocation condition of the target resource being satisfied, allocate application points to each application respectively according to the total amount of the target resource; wherein, the integral allocation condition includes at least one of the following: The terminal ends replenishing the target resource; The terminal receives an integral allocation instruction; The remaining amount of the target resource on the terminal is reduced to a preset value.
7. The method according to claim 6, characterized in that, The method further includes: Determine a target consumption speed based on the total amount of the target resource and the target usage duration; If the actual consumption rate of the target resource in the current cycle is greater than the target consumption rate, adjust the application points allocated to each application to control the consumption of the target resource to reach the target usage duration.
8. The method according to claim 1, characterized in that, The target resource includes at least one of the following: Battery power, computing resources of the processor, storage resources, network resources.
9. A resource management device, characterized in that, Each application is respectively allocated application points for the target resource, and the sum of the application points is equal to the total system points. The total system points correspond to the total amount of the target resource on the terminal. The device includes: A judgment unit, configured to, when any application needs to use a target function that consumes the target resource, judge whether the remaining application points of the any application are greater than or equal to the resource deduction amount for the target function, and judge whether the remaining system points are greater than or equal to the resource consumption amount for the target function; A usage unit, configured to, if both judgments are affirmative, allow the any application to use the target function, and reduce the remaining application points of the any application by the resource deduction amount of the target function, and reduce the remaining system points by the resource consumption amount of the target function; A prohibition unit, configured to otherwise prohibit the any application from using the target function.
10. An electronic device, characterized in that, Includes: A processor, a memory; The memory is used to store a computer program; The processor is used to execute the resource management method according to any one of claims 1-8 by calling the computer program.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, it implements the resource management method according to any one of claims 1-8.