Resource performance adjustment method and device, terminal and storage medium
By installing the resource performance adjustment strategy engine in the HAL layer of the Android terminal, the resource scheduling of different applications and unified scheduling of multiple types of resources is solved, and the problem of inflexible resource scheduling in the existing technology is significantly improved.
Patent Information
- Application Number
- CN202411335237.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-14
AI Technical Summary
The existing technology cannot formulate different resource scheduling strategies for different applications, and only supports scheduling of a single type of resource, resulting in less significant improvement in performance of Android devices.
By installing the resource performance adjustment strategy engine at the HAL layer of the terminal, unified scheduling of various types of resources, including the regulation of CPU, DDR, GPU and memory file system resources, the resource performance adjustment strategy engine is used to interact with the Framework layer and the Kernel layer, and formulate Resource adjustment strategies for target applications.
It realizes the formulation of resource scheduling strategies for different applications and unified scheduling of multiple types of resources, and the scheduling method is more flexible and significantly improves terminal performance.
Smart Images

Figure CN119311385A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of terminal technology, and in particular to a resource performance adjustment method, device, terminal and storage medium. Background Art
[0002] Running applications (such as APP) smoothly and stably on Android devices requires timely scheduling of hardware, processes and other resources on the device. For example, CPU scheduling generally needs to consider the performance requirements of the currently launched APP, and consider appropriately reducing CPU power consumption to extend device battery life while ensuring that users have a smooth operating experience. This requires reasonable dynamic scheduling of CPU resources.
[0003] In related technologies, Android frequency modulation technology is usually used to increase the frequency of application startup, process startup, basic control sliding, etc. for a fixed time. However, in this way, it is impossible to identify different applications, nor to formulate different scheduling strategies for the resources required by different types of applications. In addition, it only supports scheduling of a single type of resources such as CPU, and cannot uniformly schedule multiple types of resources on the device. Therefore, the resource scheduling method is not flexible enough, resulting in the inability to significantly improve the performance of Android devices. Summary of the invention
[0004] The purpose of the present invention is to provide a resource performance adjustment method, device, terminal and storage medium, which are used to formulate different resource performance adjustment strategies for different applications, and realize unified scheduling of various types of resources on Android devices, and the scheduling method is more flexible, thereby achieving an overall improvement in terminal performance.
[0005] Based on the above purpose, in a first aspect, the present application provides a resource performance adjustment method, which is applied to a terminal, wherein a resource performance adjustment policy engine is installed in the HAL layer of the terminal, and the resource performance adjustment policy engine is used to indicate multiple resource performance adjustment policies, and the resource performance adjustment policy engine interacts with the Framework layer and the Kernel layer of the terminal for data respectively, and each resource performance adjustment policy is bound to an application in the APP layer of the terminal, and the method includes:
[0006] In response to a start request initiated to a target application, determining a target resource performance adjustment policy bound to the target application from the resource performance adjustment policy engine;
[0007] At least one target resource in the Kernel layer is processed according to the target resource performance adjustment strategy.
[0008] In some embodiments, the resource performance adjustment policy engine has a native interface, and the resource performance adjustment policy engine performs data interaction with the Framework layer of the terminal by calling the native interface.
[0009] In some embodiments, the Framework layer includes a boostframework service, an activity manager service, and a window manager service, which are used to monitor the running status of each application.
[0010] In some embodiments, the target resources include any one or a combination of the following categories: CPU resources, DDR resources, GPU resources, and memory file system resources.
[0011] In some embodiments, the resource performance adjustment policy engine includes a feedback module and multiple scheduling modules, wherein the feedback module is used to interact with the Framework layer for data exchange; each scheduling module is used to adjust a control parameter of a target resource in the Kernel layer, and the control parameter is used to indicate a processing method for the target resource.
[0012] In some embodiments, the scheduling module includes any one or a combination of the following:
[0013] CPUset scheduling module, used to adjust the control parameters corresponding to the CPUset grouping;
[0014] Devfre scheduling module, used to adjust the control parameters corresponding to the CPU scheduler;
[0015] Thermal scheduling module, used to adjust the control parameters corresponding to the Thermal temperature control limit frequency;
[0016] FS scheduling module, used to adjust the control parameters corresponding to the memory file system;
[0017] The DDR scheduling module is used to adjust the control parameters corresponding to the DDR.
[0018] In some embodiments, the HAL layer includes a perflock interface, and the resource performance adjustment policy engine processes at least one target resource in the Kernel layer by calling the perflock interface.
[0019] In a second aspect, the present application provides a resource performance adjustment device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is called by the processor, the processor executes any method described in the first aspect.
[0020] In a third aspect, the present application provides a terminal, comprising: a resource performance adjustment device as described in the second aspect.
[0021] In a fourth aspect, the present application provides a storage medium storing a computer program, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect.
[0022] Compared with the prior art, the present invention has the following advantages:
[0023] The present application provides a resource performance adjustment method, device, terminal and storage medium. By formulating different resource performance adjustment policies on a resource performance adjustment policy engine, it is possible to distinguish resource scheduling of different applications, and the resource performance adjustment policy engine can process at least one target resource in the Kernel layer, thereby realizing unified scheduling of multiple types of resources, and the scheduling method is more flexible, thereby achieving an overall improvement in terminal performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings are included to provide a further understanding of the present application. They are included and constitute a part of the present application. The accompanying drawings illustrate embodiments of the present application and together with the present specification serve to explain the principles of the present application. In the accompanying drawings:
[0025] Figure 1 is a schematic diagram of a system architecture of a terminal provided in an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of the internal framework of a resource performance adjustment strategy engine provided in an embodiment of the present application;
[0027] Figure 3 is a flow chart of a resource performance method provided by an embodiment of the present application;
[0028] Figure 4 It is a schematic diagram of a resource performance adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0030] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0031] In addition, it should be noted that the use of words such as "first" and "second" to define components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above words have no special meaning and cannot be understood as limiting the scope of protection of this application. In addition, although the terms used in this application are selected from well-known and commonly used terms, some terms mentioned in the specification of this application may be selected by the applicant at his or her discretion, and their detailed meanings are explained in the relevant parts of the description of this article. In addition, it is required to understand this application not only by the actual terms used, but also by the meaning implied by each term.
[0032] In the embodiment of the present application, "terminal" may refer to a device using the Android system architecture.
[0033] The technical terms involved in this application are explained as follows:
[0034] APP layer (also known as Applications layer): refers to the "application layer" in the Android system architecture;
[0035] Framework layer: refers to the "middle layer" in the Android system architecture;
[0036] HAL layer: refers to the "hardware abstraction layer" in the Android system architecture;
[0037] Kernel layer: refers to the "kernel layer" in the Android system architecture.
[0038] Specifically, Figure 1 As shown, in some embodiments, the system architecture of the terminal is divided into four layers, namely, APP layer, Framework layer, HAL layer and Kernel layer from top to bottom.
[0039] In some embodiments, the APP layer runs at least one application, such as Figure 1 As shown, these applications can be applications, application plug-ins, SDKs (software development kits) and the like that come with the Android system architecture; they can also be applications developed by third-party developers. In specific implementation, the applications in the APP layer are not limited to the above examples.
[0040] In some embodiments, an application is composed of one or more processes that cooperate with each other, wherein a process is a basic unit for resource allocation in a terminal.
[0041] In some embodiments, the Framework layer provides an application programming interface (API) and a programming framework for applications. The Framework layer includes some predefined functions, which is equivalent to a processing center. The Framework layer enables applications in the application layer to perform actions. Through the API interface, applications can access resources in the Android system architecture and obtain services in the Android system architecture during execution. Figure 1 As shown, the Framework layer may include boostframework service, activity manager service (AMS in English) and window manager service (WMS in English) for monitoring the running status of each application.
[0042] Specifically, the boostframework service is mainly responsible for providing applications with performance-enhancing capabilities. For example, when an application is started, the boostframework service is used to improve the application startup performance by identifying the scenario. AMS is mainly responsible for managing and tracking the active tasks and life cycles of all applications. When an application is opened, AMS starts the process of the application and allocates processor resources and memory to the application. When the application is no longer in the foreground or background, or when the system memory is insufficient, AMS terminates or kills the process of the application. WMS is mainly responsible for managing window views on Android devices and controlling the application interface and correct display and input. WMS is responsible for managing the position, size, and layout of application windows, taking care of multitasking and switching between applications, thereby ensuring a stable, smooth, and consistent user interface.
[0043] In some embodiments, the HAL layer abstracts the hardware of the terminal, hides the hardware interface details of a specific platform, and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The HAL layer makes it easier for the operating system to be compatible with a variety of different hardware devices, as long as the manufacturer provides an interface implementation that complies with the HAL specification. For example, Figure 1As shown, the HAL layer has a perflock interface for performance optimization in the Android system architecture. The perflock interface can, for example, intelligently adjust the CPU frequency to optimize the performance and power consumption of the device. In addition, a resource performance enhancement policy engine (abbreviated as HyperEngine in English) is installed in the HAL layer. The resource performance adjustment policy engine is used to indicate multiple resource performance adjustment policies. The resource performance adjustment policy engine interacts with the Framework layer and the Kernel layer for data respectively, and each resource performance adjustment policy is bound to an application in the APP layer, which is equivalent to providing HIDL (Hardware Abstraction Layer Interface Definition Language) services.
[0044] In some embodiments, the resource performance adjustment policy engine may provide a native interface, and the boost framework service may call the native interface to implement the scheduling of related resources.
[0045] In some embodiments, the Kernel layer shields the differences between multiple kernels and provides basic kernel capabilities to the upper HAL layer, including but not limited to process / thread management, memory management, file system, network management, and peripheral management. Therefore, various types of resources in the terminal can be called. For example, Figure 1 As shown, the various types of resources may be CPUfreq (CPU frequency converter), CPUidle (CPU sleeper), schedule (scheduler), or GPU (graphics processor), Memory (storage), FS (file system), DDR (memory). In specific implementation, the resources in the Kernel layer are not limited to the above examples.
[0046] Figure 2 It is a schematic diagram of the internal framework of a resource performance adjustment policy engine provided in an embodiment of the present application. The resource performance adjustment policy engine may include a feedback module (English abbreviation: HyperEngineCallback) and multiple scheduling modules. The feedback module is mainly responsible for data interaction with the Framework layer. The scheduling modules can be responsible for the scheduling of different types of resources respectively. For example, resources can be CPU resources, DDR resources, GPU resources, and memory file system resources. The scheduling modules corresponding to these resources can be registered separately in the resource performance adjustment policy engine. Each scheduling module is used to adjust the control parameters of a target resource in the Kernel layer, where the control parameters are used to indicate the processing method of a target resource. Such as Figure 2As shown, the optional scheduling modules include: CPUset scheduling module (English abbreviation: CPUsetPolicyModule), Devfre scheduling module (English abbreviation: DevfrePolicyModule), Thermal scheduling module (English abbreviation: ThermalPolicyModule), FS scheduling module (English abbreviation: FSPolicyModule), DDR scheduling module (English abbreviation: DDRPolicyModule). The CPUset scheduling module is used to adjust the control parameters corresponding to the CPUset grouping; the Devfre scheduling module is used to adjust the control parameters corresponding to the CPU scheduler; the Thermal scheduling module is used to adjust the control parameters corresponding to the Thermal temperature control limit frequency; the FS scheduling module is used to adjust the control parameters corresponding to the memory file system; the DDR scheduling module is used to adjust the control parameters corresponding to the DDR.
[0047] Taking the Thermal scheduling module as an example, the Thermal scheduling module can be used to adjust the control parameters related to the Thermal temperature control limit frequency. For example, the control parameters can be configured as follows: when the CPU temperature exceeds 60°, the CPU maximum frequency is reduced by one level, otherwise the CPU maximum frequency is restored.
[0048] In some embodiments, each scheduling module may also use an intermediate service to call a corresponding type of resource. Figure 2 As shown, the CPUset scheduling module, Devfre scheduling module, FS scheduling module, and DDR scheduling module can interact with Mpctl_client and Mpctl_server. Mpctl_client and Mpctl_server are typical cs architecture services that interact with CPU settings. The Thermal scheduling module can interact with thermal_engine and thermal_core, which are responsible for monitoring and managing the temperature of the system, so that the maximum capabilities of the hardware and different dynamic software parameter configurations can be timely utilized when the application is started, thereby achieving an overall improvement in terminal performance.
[0049] Figure 3 This is a flow chart of a resource performance adjustment method provided by this application. Figure 3 ,This method can be applied to terminals, such as Figure 1 The terminal shown in FIG. 1 includes:
[0050] S301 : In response to a start request initiated to a target application, determine a target resource performance adjustment policy bound to the target application from a resource performance adjustment policy engine.
[0051] S302: Process at least one target resource in the Kernel layer according to the target resource performance adjustment strategy.
[0052] In some embodiments, the resource performance adjustment policy engine has a native interface, and the resource performance adjustment policy engine performs data interaction with the Framework layer of the terminal by calling the native interface.
[0053] In some embodiments, the Framework layer includes a boostframework service, an activity manager service, and a window manager service, which are used to monitor the running status of each application.
[0054] In some embodiments, the target resources include any one or a combination of the following categories: CPU resources, DDR resources, GPU resources, and memory file system resources.
[0055] In some embodiments, the resource performance adjustment policy engine includes a feedback module and multiple scheduling modules, wherein the feedback module is used to interact with the Framework layer for data; each scheduling module is used to adjust the control parameters of a target resource in the Kernel layer, and the control parameters are used to indicate how to process a target resource.
[0056] In some embodiments, the scheduling module includes any one or combination of the following:
[0057] CPUset scheduling module, used to adjust the control parameters corresponding to the CPUset grouping;
[0058] Devfre scheduling module, used to adjust the control parameters corresponding to the CPU scheduler;
[0059] Thermal scheduling module, used to adjust the control parameters corresponding to the Thermal temperature control limit frequency;
[0060] FS scheduling module, used to adjust the control parameters corresponding to the memory file system;
[0061] The DDR scheduling module is used to adjust the control parameters corresponding to the DDR.
[0062] In some embodiments, the HAL layer includes a perflock interface, and the resource performance adjustment policy engine processes at least one target resource in the Kernel layer by calling the perflock interface.
[0063] Figure 4The resource performance adjustment device includes a memory 401 and a processor 402. The memory 401 stores a computer program, which, when called by the processor 402, causes the processor 402 to execute any method of the first aspect.
[0064] It should be understood that the processor mentioned in the embodiments of the present application may be a CPU, or other general-purpose processors, DSPs, ASICs, FPGAs 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 be any conventional processor, etc.
[0065] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory, dynamic random access memory, synchronous dynamic random access memory, double data rate synchronous dynamic random access memory, enhanced synchronous dynamic random access memory, synchronously connected dynamic random access memory, and direct memory bus random access memory.
[0066] The present application also provides a terminal, which should include: Figure 4 The resource performance adjustment device shown.
[0067] The present application also provides a storage medium storing a computer program, which, when executed on a computer, enables the computer to execute the steps of any of the methods mentioned above.
[0068] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.
[0069] The basic concepts have been described above. Obviously, for those skilled in the art, the above invention disclosure is only used as an example and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and amendments to the present application. Such modifications, improvements and amendments are suggested in the present application, so such modifications, improvements and amendments still belong to the spirit and scope of the exemplary embodiments of the present application.
[0070] At the same time, the present application uses specific words to describe the embodiments of the present application. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present application can be appropriately combined.
[0071] Some aspects of the present application may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. In addition, various aspects of the present application may be expressed as computer products located in one or more computer-readable media, which include computer-readable program codes. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes ...), optical disks (e.g., compact disks CDs, digital versatile disks DVDs ...), smart cards, and flash memory devices (e.g., cards, sticks, key drives ...).
[0072] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.
[0073] Similarly, it should be noted that in order to simplify the description of the disclosure of this application and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this application, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the object of this application are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0074] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of the present application are approximate values, in specific embodiments, the setting of such numerical values is as accurate as possible within the feasible range.
[0075] Although the present application has been described with reference to the current specific embodiments, ordinary technicians in this technical field should recognize that the above embodiments are only used to illustrate the present application, and various equivalent changes or substitutions may be made without departing from the spirit of the present application. Therefore, as long as the changes and modifications to the above embodiments are within the essential spirit of the present application, they will fall within the scope of the claims of the present application.
Claims
1. A resource performance adjustment method, characterized in that: Applied to a terminal, the HAL layer of the terminal is installed with a resource performance adjustment policy engine, the resource performance adjustment policy engine is used to indicate multiple resource performance adjustment policies, the resource performance adjustment policy engine interacts with the Framework layer and the Kernel layer of the terminal for data respectively, each resource performance adjustment policy is bound to an application in the APP layer of the terminal, and the method includes: In response to a start request initiated to a target application, determining a target resource performance adjustment policy bound to the target application from the resource performance adjustment policy engine; At least one target resource in the Kernel layer is processed according to the target resource performance adjustment strategy.
2. The method according to claim 1, characterized in that The resource performance adjustment policy engine has a native interface, and the resource performance adjustment policy engine performs data interaction with the Framework layer of the terminal by calling the native interface.
3. The method according to claim 1, characterized in that The Framework layer includes boostframework service, activity manager service and window manager service, which are used to monitor the running status of each application.
4. The method according to claim 1, characterized in that The target resources include any one or a combination of the following categories: CPU resources, DDR resources, GPU resources, and memory file system resources.
5. The method according to claim 4, characterized in that The resource performance adjustment strategy engine includes a feedback module and multiple scheduling modules, wherein the feedback module is used to interact with the Framework layer for data; each scheduling module is used to adjust the control parameters of a target resource in the Kernel layer, and the control parameters are used to indicate the processing method of the target resource.
6. The method according to claim 5, characterized in that The scheduling module includes any one or a combination of the following: CPUset scheduling module, used to adjust the control parameters corresponding to the CPUset grouping; Devfre scheduling module, used to adjust the control parameters corresponding to the CPU scheduler; Thermal scheduling module, used to adjust the control parameters corresponding to the Thermal temperature control limit frequency; FS scheduling module, used to adjust the control parameters corresponding to the memory file system; The DDR scheduling module is used to adjust the control parameters corresponding to the DDR.
7. The method according to claim 1, characterized in that The HAL layer includes a perflock interface, and the resource performance adjustment policy engine processes at least one target resource in the Kernel layer by calling the perflock interface.
8. A resource performance adjustment device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is called by the processor, the processor executes the method according to any one of claims 1 to 7.
9. A terminal, characterized in that: include: The resource performance adjustment device as described in claim 8.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program runs on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.