Resource adjustment method, storage medium and intelligent equipment

Through the dynamic resource adjustment method, the actual frame rate of mobile applications is obtained and task utilization is clamped, which solves the problem of power consumption balance of task performance on mobile platforms, and achieves smooth user experience and reasonable power consumption management.

CN120104294APending Publication Date: 2025-06-06WEILAI MOBILE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311650536.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The prior art is difficult to achieve performance power balance for tasks with high requirements for frame rate and response time on mobile platforms.

Method used

By obtaining the actual frame rate of the current application, obtaining the clamping parameters of the task utilization based on the actual frame rate, and performing dynamic resource adjustments, including adjusting the CPU utilization and task utilization to achieve a balance of performance power consumption.

Benefits of technology

The performance power balance of tasks with high frame rate and response time requirements is achieved, ensuring a smooth experience for users while avoiding excessive power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104294A_ABST
    Figure CN120104294A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer information processing, and particularly provides a resource adjustment method, a storage medium and intelligent equipment. The objective of the invention is to solve the problem that performance and power consumption balance is difficult to achieve for tasks with high frame rate and response time requirements. In order to achieve the purpose, the resource adjustment method comprises the steps of obtaining an actual frame rate of a current application; in response to the fact that the actual frame rate is smaller than a preset target frame rate, obtaining a clamping parameter of a task utilization rate based on the actual frame rate; and performing dynamic resource adjustment based on the clamping parameters. And the clamping parameters and the actual frame rate of the application form a feedback cycle, dynamic resource adjustment is achieved, and great flexibility is achieved. According to the embodiment of the invention, the lowest performance point required by the display link can be dynamically increased, so that frame loss and power consumption loss are avoided, the requirements of specific applications or scenes are met, and a user can obtain smooth experience. The problem that it is difficult to achieve performance and power consumption balance for tasks with high requirements for the frame rate and the response time is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer information processing, and specifically provides a resource adjustment method, a storage medium and an intelligent device. Background Art

[0002] The current mobile platform is developing rapidly, and the demand for high-performance computing tasks such as graphics applications, games and multimedia processing is growing. The above applications have put forward higher requirements for the reasonable allocation of system resources, which must meet performance requirements and balance power consumption.

[0003] Existing technologies include load balancing, priority scheduling, and associated task groups, but they have limitations in user space information perception and real-time performance allocation. For graphics applications with high frame rates and response times, it is difficult to achieve a satisfactory performance-power balance.

[0004] Although there are some task scheduling and dynamic resource adjustment methods in the prior art, these methods have not been fully integrated into the resource management mechanism to achieve a balance between performance and power consumption, nor have they fully utilized the information in user space and kernel space that affects resource allocation decisions.

[0005] Accordingly, the art needs a new resource adjustment solution to solve the above problems. Summary of the invention

[0006] In order to overcome the above-mentioned defects, the present application is proposed to provide a resource adjustment method, a storage medium and an intelligent device to solve or at least partially solve the problem that it is difficult to achieve a performance and power consumption balance for tasks with high requirements on frame rate and response time.

[0007] In a first aspect, the present application provides a resource adjustment method, comprising:

[0008] Get the actual frame rate of the current application;

[0009] In response to the actual frame rate being less than a preset target frame rate, obtaining a clamping parameter of the task utilization based on the actual frame rate;

[0010] Dynamic resource adjustment is performed based on the clamping parameters.

[0011] In a technical solution of the above resource adjustment method, obtaining the actual frame rate of the current application includes:

[0012] Get the frame rate information of the current application in the preset time window;

[0013] The frame rate information is filtered to obtain an actual frame rate of the current application.

[0014] In a technical solution of the resource adjustment method, the clamping parameter for obtaining the task utilization rate based on the actual frame rate includes:

[0015] Acquire a clamping parameter of the task utilization of the current application based on the actual frame rate and a plurality of preset thresholds;

[0016] The clamping parameters include a clamping upper limit parameter and a clamping lower limit parameter.

[0017] In a technical solution of the above resource adjustment method, the dynamic resource adjustment based on the clamping parameter includes:

[0018] Adjusting CPU utilization and task utilization of the current application based on the clamping parameters;

[0019] Dynamic resource adjustment is performed based on the adjusted CPU utilization and task utilization.

[0020] In a technical solution of the above resource adjustment method, adjusting the CPU utilization and the task utilization of the current application based on the clamping parameter includes:

[0021] According to the clamping parameters, the CPU utilization and the task utilization of the current application are adjusted through a resource limitation mechanism.

[0022] In a technical solution of the above resource adjustment method, the dynamic resource adjustment based on the adjusted CPU utilization and task utilization includes:

[0023] Based on the adjusted CPU utilization, the task scheduling component is used to schedule the current application tasks;

[0024] Based on the adjusted task utilization, the frequency adjustment component adjusts the CPU frequency.

[0025] In a technical solution of the above resource adjustment method, the method further includes:

[0026] Perform task scheduling for the current application based on at least one scheduling strategy among PELT, WALT, and EAS;

[0027] The CPU frequency is adjusted based on at least one frequency adjustment strategy in Schedutil and WALT_Governer.

[0028] In a technical solution of the resource adjustment method, the obtaining of the actual frame rate of the current application further includes:

[0029] Re-obtain the actual frame rate of the current application at a preset interval.

[0030] In a second aspect, the present application provides a computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the resource adjustment method described in any one of the technical solutions of the above-mentioned resource adjustment method.

[0031] In a third aspect, the present application provides a smart device, including:

[0032] at least one processor;

[0033] and, a memory communicatively coupled to the at least one processor;

[0034] The memory stores a computer program, and when the computer program is executed by the at least one processor, the resource adjustment method described in any one of the technical solutions of the resource adjustment method is implemented.

[0035] The above one or more technical solutions of this application have at least one or more of the following Beneficial effects:

[0036] In the technical solution of the present application, the clamping parameters of the task utilization and the actual frame rate of the application form a feedback loop, and the dynamic resource adjustment has great flexibility. The minimum performance point required by the display link can be dynamically increased to ensure that there is no frame loss and no power consumption loss, so as to ensure that the requirements of specific applications or scenarios are met and users have a smooth experience. It solves the problem that it is difficult to achieve a balance between performance and power consumption for tasks with high requirements on frame rate and response time. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The disclosure of the present application will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the drawings are used to represent similar components, among which:

[0038] Figure 1 It is a schematic diagram of the main steps of a resource adjustment method according to an embodiment of the present application;

[0039] Figure 2 is a detailed step flow chart of a resource adjustment method according to an embodiment of the present application;

[0040] Figure 3 It is a main structural block diagram of an intelligent device for executing the resource adjustment method of the present application;

[0041] Figure 4 It is a software structure diagram of a smart device in one embodiment of the present application. DETAILED DESCRIPTION

[0042] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.

[0043] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.

[0044] The present application provides a resource adjustment method. The resource adjustment method can be applied to terminal devices such as mobile phones and tablet computers, and the terminal devices can use the Android system. The technical solution involved in the present application will be described using the Android system as an example.

[0045] See attached Figure 1 , Figure 1 FIG. 1 is a schematic diagram of the main steps of a resource adjustment method according to an embodiment of the present application. Figure 1 As shown, the resource adjustment method in the embodiment of the present application mainly includes the following steps S11 to S13.

[0046] Step S11, obtaining the actual frame rate of the current application.

[0047] The frame rate refers to the number of frames displayed per second in videos, animations, games or other continuous image display scenarios, abbreviated as FPS (Frames Per Second). It is an important parameter for evaluating the smoothness of visual experience and graphics performance.

[0048] For rendering frames of graphics applications, games, multimedia applications and other applications, the frame rate is particularly important for graphics processing capabilities, smoothness and user experience.

[0049] The actual frame rate is the frame rate data actually monitored by the current application.

[0050] In one embodiment of the present application, obtaining the actual frame rate of the current application includes:

[0051] Obtain the frame rate information of the current application in a preset time window; filter the frame rate information to obtain the actual frame rate of the current application.

[0052] Among them, the frame rate information of the current application in the preset time window can be obtained based on the SurfaceFlinger (display synthesizer) module. SurfaceFlinger is an important module in the Android system, responsible for processing and synthesizing graphic data in the display system, and managing the rendering of the graphic display layer. Rendering is the process of converting virtual scenes or data into visual images.

[0053] The system framework layer is the main source of frame information collection. For example, the Android system can insert a stake in the Surfaceflinger service to obtain the start time and end time of frame rendering to obtain the actual frame rate of the current application.

[0054] The filtering of the frame rate information may include smoothing and outlier removal; in addition, the average or weighted average may be calculated based on the filtered frame rate information to obtain the actual frame rate of the current application. The actual frame rate may provide a more reliable representation of the frame rate level and frame drop situation of the current application.

[0055] Exemplarily, a frame rate monitoring service may be used to obtain the actual frame rate of the current application.

[0056] Step S12: in response to the actual frame rate being less than a preset target frame rate, obtaining a clamping parameter of the task utilization based on the actual frame rate.

[0057] The target frame rate refers to the expected frame rate set in a specific application or system. The target frame rate can be obtained from the refresh rate, application, and historical frame rate prediction learning; the refresh rate refers to the number of times a display device (such as a TV, computer monitor, mobile phone screen, etc.) redraws the image on the screen per second.

[0058] In this embodiment, before adjusting the resources, the target frame rate may be preset based on the above sources, or may be preset by those skilled in the art as needed.

[0059] In the field of image processing, frame drops refer to the loss of some frames during rendering or playback, which breaks the order of images or videos and may cause visual and user experience problems. Frame drops usually occur in real-time rendering or playback applications, such as video games, video players, etc.

[0060] If the actual frame rate of the current application is lower than the target frame rate, it is considered that there is a risk of frame drop.

[0061] In one embodiment of the present application, the clamping parameter for obtaining the task utilization based on the actual frame rate includes:

[0062] Acquire a clamping parameter of a task utilization rate corresponding to the current application based on the actual frame rate and a plurality of preset thresholds;

[0063] The clamping parameters include a clamping upper limit parameter and a clamping lower limit parameter.

[0064] Specifically, the plurality of preset thresholds correspond to a plurality of preset clamping parameters; by comparing the actual frame rate with the plurality of preset thresholds, the degree of frame drop of the current application can be determined. The smaller the actual frame rate, the more serious the degree of frame drop.

[0065] Task utilization clamping is a resource management strategy that limits the resources occupied by tasks in the system by setting upper and lower limits of task utilization to balance performance and power consumption. Task utilization refers to the percentage of CPU time occupied by a task in the system. It reflects the degree of utilization of system resources by the task, especially CPU resources.

[0066] The decision-making system needs to adjust the upper and lower utilization parameters of the system, foreground process, and a single critical task according to the frame rate performance to determine whether the task should be considered as a more important task or a lighter task when allocating resources.

[0067] Therefore, after determining the frame drop degree of the current application, the clamping parameter of the task utilization corresponding to the current application is matched according to the preset clamping parameter corresponding to the preset threshold. The clamping parameter, i.e., the limit range of the task utilization, includes a clamping upper limit parameter and a clamping lower limit parameter.

[0068] These two parameters will correct the calculation of task utilization, so that tasks with a larger lower limit can run in a high-performance state to speed up task processing, and tasks with a smaller upper limit can run in a high-efficiency state to save system power consumption.

[0069] Step S13: Dynamically adjust resources based on the clamping parameters.

[0070] In one embodiment of the present application, the dynamic resource adjustment based on the clamping parameter includes:

[0071] Adjusting CPU utilization and task utilization of the current application based on the clamping parameters;

[0072] Dynamic resource adjustment is performed based on the adjusted CPU utilization and task utilization.

[0073] CPU utilization refers to the degree of CPU utilization when executing a specific task or process, usually expressed as a percentage. It represents the ratio of the time the CPU uses to execute tasks to the total time in a certain period of time. High CPU utilization means that the CPU is busy executing tasks, while low CPU utilization means that the CPU is not fully utilized or is relatively idle.

[0074] Specifically, the execution module sends down the upper and lower limit parameters of the task utilization through the system interface and sysfs (System Filesystem), thereby correcting the task utilization and CPU utilization calculation, affecting frequency selection and task placement, and forming a feedback loop.

[0075] Further, adjusting the CPU utilization and the task utilization of the current application based on the clamping parameter includes:

[0076] According to the clamping parameters, the CPU utilization and the task utilization of the current application are adjusted through a resource limitation mechanism.

[0077] Specifically, the resource restriction mechanism includes at least one of a Uclamp mechanism and a SchedTune mechanism, both of which can be used as downstream of the frame rate monitoring service to clamp task utilization.

[0078] Uclamp (Utilization clamping) is a scheduler feature used to limit the CPU utilization of tasks in a multitasking system. Uclamp was first introduced in Linux kernel version 5.3, and support for control groups (Cgroups) was added in kernel version 5.4.

[0079] Uclamp allows the scheduler to understand the performance requirements and limits of tasks. Uclamp affects CPU frequency selection when using a speed governor like schedutil cpufreq (scheduling tool CPU frequency adjustment).

[0080] SchedTune (scheduling optimization) is a scheduler mechanism in the Linux kernel that adjusts scheduling behavior based on the needs and importance of tasks. It allows the system to dynamically allocate CPU resources based on the type and priority of tasks. SchedTune provides a configuration parameter called schedtune.boost. Whenever this parameter is adjusted, its value affects the priority of tasks in the system to obtain CPU time, and can change the weight of tasks.

[0081] The dynamic resource adjustment based on the adjusted CPU utilization and task utilization includes:

[0082] Based on the adjusted CPU utilization, the task scheduling component is used to schedule the current application tasks;

[0083] Based on the adjusted task utilization, the frequency adjustment component adjusts the CPU frequency.

[0084] Exemplarily, the task scheduling component may be a Scheduler, and the frequency adjustment component may be a Governor.

[0085] In one embodiment, the method further comprises:

[0086] Perform task scheduling for the current application based on at least one scheduling strategy among PELT, WALT, and EAS;

[0087] The CPU frequency is adjusted based on at least one frequency adjustment strategy in Schedutil and WALT_Governer.

[0088] Among them, PELT (Per-Entity Load Tracking) is used to track the load of tasks and help the scheduler understand the demand for system resources for each task in order to better schedule tasks; WALT (Window-Aware Latency Topology) helps the system better understand the performance of tasks when executed on different CPU cores by monitoring the running delay of tasks; EAS (Energy Aware Scheduling) adjusts the scheduling of tasks by considering energy efficiency factors in order to better balance performance and power consumption in multi-core systems.

[0089] Schedutil (scheduling tool) works with the scheduler to dynamically adjust the CPU frequency according to the system load to balance performance and power consumption; WALT_Governer (WALT scheduler) adjusts the CPU frequency by considering task execution delays.

[0090] Among them, task scheduling includes placing tasks for the current application, that is, selecting a suitable CPU core to execute the current task. Specifically, the scheduling strategy can be combined with the Linux native scheduling mechanism to perform task scheduling.

[0091] In one embodiment of the present application, obtaining the actual frame rate of the current application further includes:

[0092] Re-obtain the actual frame rate of the current application at a preset interval.

[0093] This application also provides an embodiment, please refer to the attached Figure 2 .

[0094] Figure 2 FIG. 1 is a detailed flow chart of a resource adjustment method according to an embodiment of the present application. Figure 2 As shown, it mainly includes the following steps S201-step S205.

[0095] The current application renders a frame and starts adjusting resources. Exemplarily, the current application may be a graphics application, a game, or a media application.

[0096] Step S201, obtaining the actual frame rate of the current application;

[0097] Step S202, determining whether the actual frame rate is less than a preset target frame rate; if not, returning to step S201; if so, continuing to step S203.

[0098] Step S203, obtaining a clamping parameter of the task utilization of the current application based on the actual frame rate, including a clamping upper limit parameter and a clamping lower limit parameter;

[0099] Step S204, adjusting the CPU utilization and the task utilization of the current application based on the clamping parameters;

[0100] Step S205: Dynamically adjust resources based on the adjusted CPU utilization and task utilization.

[0101] On the one hand, during each resource adjustment process, the dynamically changing CPU utilization and task utilization are required to meet the requirements of the above technical solution and balance performance and power consumption. On the other hand, the actual frame rate of the current application is retrieved at every preset interval, and resource adjustments are performed cyclically. Dynamic resource adjustments are performed based on the adjusted CPU utilization and task utilization to optimize the actual frame rate of the current application, forming a feedback loop.

[0102] Furthermore, for the optimized current application, the actual frame rate of the current application is re-acquired at every preset time interval, and the above steps S201 to S205 are repeated to perform dynamic resource adjustment.

[0103] Based on the above steps S11 to S13, the clamping parameters of the task utilization and the actual frame rate of the application form a feedback loop, and dynamic resource adjustment has great flexibility. The minimum performance point required by the display link can be dynamically increased to ensure that there is no frame loss and no power consumption loss, to ensure that the requirements of specific applications or scenarios are met and users have a smooth experience. The problem of difficulty in achieving a balance between performance and power consumption for tasks with high requirements for frame rate and response time is solved.

[0104] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.

[0105] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0106] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the resource adjustment method of the above method embodiment, and the program can be loaded and run by a processor to implement the above resource adjustment method.

[0107] For ease of explanation, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiments of the present application is a non-temporary computer-readable storage medium.

[0108] Another aspect of the present application also provides a smart device, see the attached Figure 3 , Figure 3 It is a main structural block diagram of an intelligent device used to execute the resource adjustment method of the present application.

[0109] like Figure 3 As shown, the smart device 300 may include at least one processor 301; and a memory 302 that is communicatively connected to the at least one processor 301; wherein the memory 302 stores a computer program 303, and when the computer program 303 is executed by the at least one processor 301, the method described in any of the above embodiments is implemented.

[0110] The smart device described in the present application may be a terminal device such as a smart phone, a wearable device, a tablet computer, a desktop computer, a laptop computer, a PDA, etc. Exemplarily, the memory 302 and the processor 301 are connected in communication via a bus.

[0111] In some embodiments of the present application, the smart device further includes at least one sensor for sensing information. The sensor is communicatively connected to any type of processor mentioned in the present application. Exemplarily, the sensor may be a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0112] Exemplarily, the processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0113] The memory 302 may be an internal storage unit of the smart device 300, for example, a hard disk or memory of the smart device 300; the memory 302 may also be an external storage device of the smart device 300, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the smart device 300. Further, the memory 302 may also include both an internal storage unit of the smart device 300 and an external storage device. The memory 302 is used to store the computer program 303 and other programs and data required by the smart device 300. The memory 302 may also be used to temporarily store data that has been output or is to be output.

[0114] In some possible implementations, the smart device 300 may include multiple processors 301 and memories 302. The computer program 303 for executing the resource adjustment method of the above method embodiment may be divided into multiple subprograms, each of which may be loaded and run by the processor 301 to execute different steps of the resource adjustment method of the above method embodiment. Specifically, each subprogram may be stored in different memories 302, and each processor 301 may be configured to execute programs in one or more memories 302 to jointly implement the resource adjustment method of the above method embodiment, that is, each processor 301 executes different steps of the resource adjustment method of the above method embodiment to jointly implement the resource adjustment method of the above method embodiment.

[0115] The above-mentioned multiple processors 301 may be processors deployed on the same device. For example, the above-mentioned smart device 300 may be a high-performance device composed of multiple processors 301, and the above-mentioned multiple processors 301 may be processors configured on the high-performance device. In addition, the above-mentioned multiple processors 301 may also be processors deployed on different devices. For example, the above-mentioned smart device may be a server cluster, and the above-mentioned multiple processors 301 may be processors on different servers in the server cluster.

[0116] The smart device 300 may be the above-mentioned terminal device and cloud server and other smart devices. The smart device 300 may include but is not limited to a processor 301 and a memory 302. Those skilled in the art will understand that Figure 3 It is only an example of the smart device 300 and does not constitute a limitation of the smart device 300. The smart device 300 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the smart device may also include input and output devices, network access devices, buses, etc.

[0117] The software system of the terminal device using the resource adjustment method can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the smart device.

[0118] Please refer to the attached Figure 4 , Figure 4 It is a software structure diagram of a smart device in one embodiment of the present application.

[0119] like Figure 4 As shown, in the embodiment of the present application, the Android system includes an application (APP) layer, a framework (Framework) layer, a native (Native) layer and a kernel (Kernel) layer from top to bottom.

[0120] The application layer may include a series of application packages. The application package may include system applications. Among them, system applications refer to applications that are set in the electronic device before leaving the factory. Exemplarily, system applications may include programs such as camera, gallery, calendar, map, music, short message and call. The application package may also include third-party applications, which refer to applications that users install after downloading the installation package from the application store (or application market).

[0121] The application layer in this embodiment includes: games, graphic applications, and multimedia applications.

[0122] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. The application framework layer may include a window manager, a content provider, a phone manager, a notification manager, a view system, a resource manager, a display decision module, and a camera decision module.

[0123] The framework layer in this embodiment can provide a frame rate monitoring service, which includes a frame acquisition module, a data processing module and a decision module.

[0124] The application layer and framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0125] The native layer includes native libraries used by the Android system, some of which are written in C / C++. These libraries provide some low-level system functions, such as graphics processing, audio processing, etc. They work with the Java virtual machine to provide low-level support for the Android system. The native library layer in Android also includes runtime libraries (Runtime Libraries), such as libbionic, which are used to provide support for standard C library functions.

[0126] The local layer SurfaceFlinger module described in this embodiment is used to obtain the frame rate of the current application.

[0127] The kernel layer is at the bottom of the Android system. The Android kernel is a variant of the Linux kernel and also belongs to the software layer. The kernel is responsible for managing hardware resources, handling interrupts, providing process scheduling, file system management and other core operating system functions.

[0128] In this embodiment, the kernel layer includes a resource limitation mechanism, specifically including at least one of the Uclamp mechanism and the SchedTune mechanism; the kernel layer also includes a task scheduling component, such as a Scheduler, which schedules tasks for the current application based on at least one scheduling strategy among PELT, WALT, and EAS; and a frequency adjustment component, such as a Governor, which adjusts the frequency of the CPU based on at least one frequency modulation strategy among Schedutil and WALT_Governer.

[0129] In this embodiment, the SurfaceFlinger module of the local layer obtains the frame rate information of the current application and passes it to the frame acquisition module; based on the preset target frame rate of the current application in the application layer, it is passed to the data processing module to obtain the actual frame rate and compare it with the preset target frame rate. After the decision module generates the clamping parameters of the task utilization, it is sent to the resource limitation mechanism, such as SchedTune and Uclamp, for task scheduling and frequency adjustment.

[0130] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in the embodiments of the present application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0132] In the embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the electronic device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0135] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0136] The relevant user personal information that may be involved in the various embodiments of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.

[0137] The user personal information processed by this application will vary depending on the specific product / service scenario, and shall be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information, driving information, vehicle information or other related information. This application will treat the user's personal information and its processing with a high degree of diligence.

[0138] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.

[0139] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings.

[0140] It is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific implementations. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.

Claims

1. A resource adjustment method, It is characterized in that include: Get the actual frame rate of the current application; In response to the actual frame rate being less than a preset target frame rate, obtaining a clamping parameter of the task utilization based on the actual frame rate; Dynamic resource adjustment is performed based on the clamping parameters.

2. The method according to claim 1, It is characterized in that The obtaining of the actual frame rate of the current application includes: Get the frame rate information of the current application in the preset time window; The frame rate information is filtered to obtain an actual frame rate of the current application.

3. The method according to claim 1, It is characterized in that The clamping parameter for obtaining the task utilization rate based on the actual frame rate includes: Acquire a clamping parameter of a task utilization rate corresponding to the current application based on the actual frame rate and a plurality of preset thresholds; The clamping parameters include a clamping upper limit parameter and a clamping lower limit parameter.

4. The method according to any one of claims 1 to 3, It is characterized in that The dynamically adjusting resources based on the clamping parameters includes: Adjusting CPU utilization and task utilization of the current application based on the clamping parameters; Dynamic resource adjustment is performed based on the adjusted CPU utilization and task utilization.

5. The method according to claim 4, It is characterized in that The adjusting the CPU utilization and the task utilization of the current application based on the clamping parameter includes: According to the clamping parameters, the CPU utilization and the task utilization of the current application are adjusted through a resource limitation mechanism.

6. The method according to claim 4, It is characterized in that The dynamic resource adjustment based on the adjusted CPU utilization and task utilization includes: Based on the adjusted CPU utilization, the task scheduling component is used to schedule the current application tasks; Based on the adjusted task utilization, the frequency adjustment component adjusts the CPU frequency.

7. The method according to claim 6, It is characterized in that The method further comprises: Perform task scheduling for the current application based on at least one scheduling strategy among PELT, WALT, and EAS; The CPU frequency is adjusted based on at least one frequency adjustment strategy in Schedutil and WALT_Governer.

8. The method according to claim 1, It is characterized in that The obtaining of the actual frame rate of the current application also includes: Re-obtain the actual frame rate of the current application at a preset interval.

9. A computer-readable storage medium having a plurality of program codes stored therein, It is characterized in that The program code is suitable for being loaded and run by a processor to execute the resource adjustment method according to any one of claims 1 to 8.

10. A smart device, It is characterized in that include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores a computer program, and when the computer program is executed by the at least one processor, the resource adjustment method according to any one of claims 1 to 8 is implemented.