Resource scheduling method and device, readable medium and computer product

By adjusting the GPU frequency based on the rendering and compositing time intervals, the problem of inaccurate GPU resource usage detection is solved, enabling more accurate resource scheduling, improving frame rate stability, and reducing power consumption.

CN121934993APending Publication Date: 2026-04-28ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZTE CORP
Filing Date
2024-10-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, inaccurate detection of GPU resource usage leads to untimely resource scheduling, resulting in resource waste and performance issues.

Method used

By obtaining the time when the rendered frame image is completed and the time when the frame image synthesis begins, the time interval is calculated, and the GPU frequency is adjusted according to a preset time threshold to accurately determine the GPU resource usage and achieve real-time scheduling.

Benefits of technology

It improves the real-time performance of GPU resource scheduling, avoids resource waste, enhances frame rate stability, reduces stuttering and frame drops, and lowers power consumption and heat generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121934993A_ABST
    Figure CN121934993A_ABST
Patent Text Reader

Abstract

The invention provides a resource scheduling method. The resource scheduling method comprises the steps of obtaining first time when rendering of a frame image is completed and second time when synthesis of the frame image is started; calculating a first time interval between the second time and the first time, and controlling the frequency of the GPU according to a comparison result between the first time interval and a first preset time threshold; according to the embodiment of the invention, the GPU resource use condition is judged through the time interval between the image rendering stage and the image synthesis stage, and the GPU frequency is correspondingly adjusted, so that the GPU processing capability is estimated more accurately; gPU resource monitoring is carried out on each frame of image, so that the GPU resource scheduling real-time performance can be enhanced, and the GPU resource waste is avoided. The invention further provides a resource scheduling device, a readable medium and a computer product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a resource scheduling method, apparatus, readable medium, and computer product. Background Technology

[0002] Image drawing, rendering, compositing, and display are essential processing steps for display screen devices. As hardware performance improves, so does image quality, requiring more hardware resources. Therefore, it is crucial to ensure performance while minimizing heat generation, so that performance is just right to meet user needs. The GPU (Graphics Processing Unit) is one of the hottest chips in terminal devices. Therefore, it is particularly important to rationally allocate GPU resources, ensuring the GPU runs at an appropriate frequency to meet user performance requirements while reducing power consumption.

[0003] In related technologies, inaccurate detection of GPU resource usage and untimely GPU resource scheduling lead to a waste of GPU resources. Summary of the Invention

[0004] This disclosure provides a resource scheduling method, apparatus, readable medium, and computer product.

[0005] In a first aspect, embodiments of this disclosure provide a resource scheduling method, including:

[0006] The first time when the rendered frame image is completed and the second time when the composite of the frame image begins;

[0007] Calculate the first time interval between the second time and the first time;

[0008] The frequency of the graphics processing unit (GPU) is controlled based on the comparison result between the first time interval and the first preset time threshold.

[0009] Secondly, embodiments of this disclosure also provide a resource scheduling apparatus, including a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the resource scheduling method described above.

[0010] Thirdly, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed, implements the resource scheduling method as described above.

[0011] Fourthly, this disclosure also provides a computer program product comprising a computer program that, when executed by a processor, implements the resource scheduling method as described above.

[0012] The resource scheduling method in this embodiment includes: acquiring a first time when the rendered frame image is completed and a second time when the composite frame image begins; calculating a first time interval between the second time and the first time; and controlling the frequency of the graphics processing unit (GPU) based on a comparison between the first time interval and a first preset time threshold. This embodiment uses the time interval between the image rendering stage and the image compositing stage to determine GPU resource usage and adjusts the GPU frequency accordingly, resulting in a more accurate estimation of GPU processing power. Monitoring GPU resources for each frame image enhances the real-time performance of GPU resource scheduling and avoids wasting GPU resources. Attached Figure Description

[0013] In the accompanying drawings of the embodiments disclosed herein:

[0014] Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of the present disclosure;

[0015] Figure 2 A schematic diagram of a software module provided in an embodiment of this disclosure;

[0016] Figure 3 A schematic diagram of the resource scheduling process provided in the embodiments of this disclosure. Figure 1 ;

[0017] Figure 4 A schematic diagram illustrating the resource scheduling principle provided in this embodiment of the disclosure;

[0018] Figure 5 A schematic diagram of the resource scheduling process provided in the embodiments of this disclosure. Figure 2 ;

[0019] Figure 6 This is a schematic diagram of the module composition of the resource scheduling device provided in the embodiments of this disclosure. Detailed Implementation

[0020] To enable those skilled in the art to better understand the technical solutions of this disclosure, the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.

[0021] The present disclosure will be described more fully below with reference to the accompanying drawings; however, the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as limited to the embodiments set forth below. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will enable those skilled in the art to fully understand the scope of the disclosure.

[0022] The accompanying drawings of the embodiments of this disclosure are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the detailed embodiments to explain this disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the description of the detailed embodiments with reference to the accompanying drawings.

[0023] This disclosure may be described with reference to plan and / or cross-sectional views using the ideal schematic diagrams of this disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances.

[0024] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.

[0025] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. The term "and / or" as used in this disclosure includes any and all combinations of one or more of the associated enumerated entries. The singular forms "a" and "the" as used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. The terms "comprising," "made of," etc., as used in this disclosure specify the presence of the stated feature, integral, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof.

[0026] Unless otherwise specified, all terms used in this disclosure (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined in this disclosure.

[0027] This disclosure is not limited to the embodiments shown in the accompanying drawings, but includes modifications to the configuration based on the manufacturing process. Therefore, the areas illustrated in the drawings are schematic, and the shapes of the areas shown illustrate specific shapes of areas of an element, but are not intended to be limiting.

[0028] Frame dropping and stuttering are common performance issues in terminal devices. Currently, mainstream chips generally have high power consumption, making it crucial to improve frame rate stability while reducing power consumption. Frame dropping and stuttering are typically related to CPU (Central Processing Unit) and / or GPU resource scheduling. CPU resource scheduling and GPU resource scheduling are implemented separately, and the two chips play different roles in image compositing and display. GPU resource scheduling algorithms are generally provided by the chip manufacturer, and many are closed-source. Therefore, accurately determining GPU resource usage—that is, whether GPU resources are sufficient / GPU processing power—is extremely important.

[0029] One approach to detecting GPU resource usage involves monitoring the GPU load. If the load exceeds a threshold, the GPU frequency is increased; if the load is below the threshold, the GPU frequency is decreased. However, GPU load is not directly correlated with frame rate, and it cannot accurately reflect frame drops. Therefore, this approach is inaccurate in detecting GPU resource usage.

[0030] One approach to detecting GPU resource usage in related technologies is to compare the single-frame GPU compositing time with the frame rate duration to determine if GPU resources are sufficient. However, GPU code is generally closed, making it difficult for third parties to obtain the single-frame GPU compositing time, and it requires statistical analysis of the frame rate of multiple frames to determine GPU resource usage, which can lead to untimely GPU resource scheduling. Furthermore, simply using GPU compositing time as a sole indicator of GPU resource usage is unreasonable. If CPU resources are insufficient, generating new frames will be slow, potentially delaying the generation of new frames for an extended period before the next frame is generated. Since GPU image rendering completes according to the target frame rate duration, this also results in wasted GPU resources.

[0031] To address the aforementioned problems, this disclosure provides a resource scheduling method, which is applied to a resource scheduling device, wherein the resource scheduling device may be a CPU. Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of the present disclosure, such as... Figure 1 As shown, the system to which the resource scheduling method belongs includes: CPU, GPU, ROM (Read Only Memory), RAM (Random Access Memory), image synthesis device, and display device.

[0032] The image compositing device can be a Hardware Composer (HWC). An HWC uses a Surface Filter to combine all visible layers on the interface into a single layer. An HWC can abstract overlays and 2D bitblock transporters to assist the GPU in performing certain tasks. It's worth noting that if the system lacks an HWC, a GPU can be used instead. The CPU executes all instructions. A GPU is a hardware device specifically designed to process graphics and image data, including a set of dedicated execution units such as stream processors, texture units, and rasterization units. RAM stores currently used data and is typically divided into two types: Static Random-Access Memory (SRAM) and Dynamic Random-Access Memory (DRAM). ROM stores fixed, unchangeable data and is typically used to store boot programs, operating systems, and firmware. Display devices are hardware devices used to display images and text output by computers or other electronic devices, typically including monitors, projectors, and touchscreens. These components are connected together via buses (such as PCI Express and SATA) so they can communicate and exchange data. For example, when the CPU needs to access data in RAM, it sends a request through the memory bus, and then the RAM passes the data back to the CPU. Similarly, when the GPU needs to access data in ROM, it also sends a request through the memory bus, and then the ROM passes the data back to the GPU. Display devices typically connect to the CPU using the MIPI (Mobile Industry Processor Interface) bus, and the synthesized data is generally sent as image data to the display device for display to the user via MIPI.

[0033] Figure 2 A schematic diagram of the software modules provided in the embodiments of this disclosure, in conjunction with Figure 1 and Figure 2As shown, the software modules involved in this disclosure include: a signal generation module, an image drawing module, an image rendering module, an image compositing module, and an image display module. The signal generation module generates Vsync (Vertical Synchronization) signals. Vsync signals are used to implement a synchronization mechanism between the display device and the computer system, ensuring that screen updates are synchronized with the vertical scan lines, thereby reducing screen flicker and improving display performance. Android devices typically have two VSync signals: VSync-app and VSync-sf. The signal generation module can be deployed in the display device. The generated VSync signals are first synchronized to the VSync model, and then split into two, resulting in the VSync-app and VSync-sf signals. The VSync-app signal controls the rhythm of the application's UI (user interface) rendering and the rhythm of handling swipe events. For game applications, the UI rendering rhythm is determined by the application itself, but swipe events still rely on the VSync-app signal cycle for processing; the VSync-sf signal controls the rhythm of the HWC compositing layers. The image drawing module is generally deployed on the CPU, and its main function is to generate image frame data. The image rendering module is typically deployed on the GPU, performing image rasterization and other processing. The image compositing module is used to overlay multiple image layers together to create the final visual effect; it is generally implemented by the GPU or a dedicated hardware chip. The image display module is used to display the final image to the user.

[0034] After the image rendering module generates a frame image, the image rendering module renders the frame image. After processing, the image compositing module composites the image, and finally, the composited image is displayed by the image display module. Typically, three buffers are set up to avoid display stuttering caused by waiting for frame image data. If the GPU processing time is long, it will inevitably affect the transmission of subsequent frame image data, causing delays in image compositing and resulting in dropped frames. If the buffer is unavailable after the image rendering module generates a new frame image, the rendering of the next frame image is also delayed, causing further frame drops. For general applications, images are drawn according to the VSync-app signal cycle. The GPU's rendering processing is completed before image compositing begins to ensure no frame drops. For game programs, image rendering generally does not depend on the VSync-app signal; the game program controls the image rendering rhythm itself. Therefore, if the interval between the GPU's image rendering processing and the start of the VSync-sf signal (used to control image compositing) is very small, even if the GPU frequency is increased to its maximum, it cannot guarantee timely completion of rendering processing. Furthermore, it will increase GPU power consumption. Therefore, it is sufficient to ensure that the GPU's image rendering processing is completed before the image rendering module next uses the buffer.

[0035] Figure 3A schematic diagram of the resource scheduling process provided in the embodiments of this disclosure. Figure 1 ,like Figure 3 As shown, the method is applied to a resource scheduling device, which may be a CPU, and the method includes the following steps:

[0036] Step S11: Obtain the first time when the rendered frame image is completed and the second time when the composite frame image is started.

[0037] After the system powers on, each hardware module initializes, and then the system software starts, with the foreground application beginning to draw frame images. In this step, for each frame image, the CPU obtains the first time t1 when the rendering of that frame image is completed, and the second time t2 when the compositing of that frame image begins. The first time t1 is the time when the GPU completes the rendering process, and the second time t2 is the time when the HWC begins the image compositing process. Therefore, the second time t2 is after the first time t1.

[0038] Step S12: Calculate the first time interval between the second time and the first time.

[0039] Since t2 > t1, the first time interval Δt1 = t2 - t1. In this step, the CPU calculates Δt1.

[0040] Step S13: Control the frequency of the GPU based on the comparison result of the first time interval and the first preset time threshold.

[0041] In this embodiment, the first preset time threshold can be one or more. If there are multiple first preset time thresholds, then in this step, the first time interval Δt1 is compared with a threshold range formed by the multiple first preset time thresholds. The comparison result between the first time interval Δt1 and the first preset time threshold reflects the current GPU resource usage, such as insufficient GPU resources, excessive GPU resources leading to resource waste, or reasonable GPU resource usage. Therefore, in this step, the CPU can adjust the GPU frequency based on the comparison result between the first time interval Δt1 and the first preset time threshold to control the duration and speed of image rendering by the GPU, thereby achieving GPU resource scheduling.

[0042] The resource scheduling method in this embodiment includes: acquiring a first time when the rendered frame image is completed and a second time when the composite frame image begins; calculating a first time interval between the second time and the first time; and controlling the frequency of the graphics processing unit (GPU) based on a comparison between the first time interval and a first preset time threshold. This embodiment uses the time interval between the image rendering stage and the image compositing stage to determine GPU resource usage and adjusts the GPU frequency accordingly, resulting in a more accurate estimation of GPU processing power. Monitoring GPU resources for each frame image enhances the real-time performance of GPU resource scheduling and avoids wasting GPU resources.

[0043] Figure 4 This is a schematic diagram of the resource scheduling principle provided in the embodiments of this disclosure, which is described below in conjunction with... Figure 4 The inventive principles of the embodiments of this disclosure will be explained. For example... Figure 4 As shown, the image processing and display process is as follows: The numbers in the diagram represent the frame image sequence number. Frame images are passed step-by-step in the order of image rendering module (CPU) → image rendering module (GPU) → image compositing module (HWC) → image display module (display device). Each of the image rendering / image compositing module, image compositing module, and image display module occupies a buffer to store frame image data. The image rendering module in the CPU generates the frame image and hands it over to the image rendering module in the GPU for rendering. The rendered frame image is then given to the image compositing module, which composites all layers and finally hands it over to the image display module for display. Generally, the image rendering, image compositing, and image display modules all rely on the VSync signal cycle for operation. However, some applications, such as Unity engine games, can draw images according to their own cycle instead of the VSync signal cycle, but subsequent image compositing and display still rely on the VSync signal for synchronization. The GPU's image rendering time depends on the GPU frequency. The higher the GPU frequency, the faster the image rendering process and the shorter the rendering time; the lower the GPU frequency, the slower the image rendering process and the longer the rendering time.

[0044] If the GPU frequency is too high, the rendering time of the current frame is very short. The GPU finishes rendering the image, but the drawing of the next frame and the compositing of the current frame have not yet begun. Therefore, the extra time, i.e., the first time interval Δt1, can be reduced by lowering the GPU frequency, thus increasing the GPU rendering time and ensuring that it starts earlier than the drawing of the next frame and the compositing of the current frame. This prevents frame drops. Correspondingly, lowering the GPU frequency also brings the benefits of reduced power consumption and heat generation. Taking frame image 2 as an example, the GPU completes the rendering of frame image 2 in the first time interval t1, but the CPU has not yet started drawing frame image 3, and HWC has not yet started compositing frame image 2. There is a first time interval Δt1, which wastes GPU resources. By lowering the GPU frequency, the GPU's image rendering time can be increased, thereby reducing the first time interval Δt1.

[0045] If the GPU frequency is too low, image rendering takes too long. When HWC needs to synthesize the current frame image, the GPU has not yet finished rendering the previous frame image. This causes the current VSync signal cycle to be unable to synthesize the current frame image, resulting in the data on the display not being refreshed and causing frame drops. In this case, the GPU frequency can be increased to make GPU rendering processing faster and the rendering time shorter. Taking frame image 3 as an example, the GPU takes a long time to render frame image 3, exceeding the frame length. That is, the moment frame image 3 is rendered, it falls into the next VSync signal cycle. Therefore, HWC cannot synthesize the image in the next VSync signal cycle (i.e., the VSync signal cycle for drawing frame image 4), causing frame drops. By increasing the GPU frequency, the GPU's image rendering time can be reduced, and frame drops can be avoided accordingly.

[0046] In some embodiments, the first preset time threshold includes a first threshold T1. Controlling the GPU frequency based on the comparison between the first time interval and the first preset time threshold (i.e., step S13) includes the following steps: increasing the GPU frequency when the first time interval is less than or equal to the first threshold. That is, if Δt1 ≤ T1, it indicates that the GPU has a small time margin for rendering images, and therefore, GPU resources are considered insufficient, requiring an appropriate increase in GPU frequency.

[0047] In some embodiments, the first preset time threshold includes a second threshold T2. Controlling the GPU frequency based on the comparison between the first time interval and the first preset time threshold (i.e., step S13) includes the following steps: reducing the GPU frequency when the first time interval is greater than or equal to the second threshold. That is, if Δt1 ≥ T2, it indicates a large time margin for GPU rendering, and therefore GPU resources are considered excessive, requiring appropriate frequency reduction.

[0048] In some embodiments, the first preset time threshold includes a first threshold T1 and a second threshold T2, and the first threshold is less than the second threshold. The step of controlling the GPU frequency based on the comparison result of the first time interval and the first preset time threshold (i.e., step S13) includes the following steps: If the first time interval is greater than or equal to the first threshold and less than or equal to the second threshold, maintain the GPU frequency. That is, if T1 ≤ Δt1 ≤ T2, it is considered that GPU resources are just sufficient, and the current GPU frequency is maintained.

[0049] In some embodiments, the first threshold T1 and the second threshold T2 are determined based on the frame rate of the frame image, which refers to the frame rate of the application to which the frame image belongs. For example, assuming a game has a frame rate of 60 frames per second, then T1 can be set to 5% of the frame length, i.e., 1000 / 60*80% = 0.83ms, and T2 can be set to 10% of the frame length, i.e., 1000 / 60*10% = 0.17ms.

[0050] In some embodiments, the second time t2 is the time when the image synthesis device retrieves the frame image from the cache, such as... Figure 4 As shown, taking the current frame image as frame image 2 as an example, the second time t2 is the time when HWC retrieves frame image 2 from the buffer after the Vsync signal arrives.

[0051] In some embodiments, the second time t2 is the time when the next frame of the frame image begins to be drawn. For example... Figure 4 As shown, taking frame image 2 as an example, the second time t2 is the time when the CPU starts drawing frame image 3. It should be noted that in Figure 4 In the process, the time when the CPU starts drawing frame image 3 is the same as the time when the HWC retrieves frame image 2 from the cache, both being the start time of the current Vsync signal cycle. However, for applications that do not rely on the Vsync signal for image drawing, the time when the CPU starts drawing frame image 3 may be different from the start time of the current Vsync signal cycle.

[0052] In some embodiments, such as Figure 5 As shown, the resource scheduling method may further include the following steps:

[0053] Step S21: When the GPU starts rendering the frame image, a preset timer is started; wherein the timing duration of the preset timer is less than the frame length of the frame image.

[0054] Step S22: If the GPU fails to render the frame image within the timed period, increase the GPU frequency.

[0055] Typically, the time when HWC starts compositing images coincides with the arrival time of the Vsync signal. If, according to the application's frame rate, HWC starts compositing images before the GPU has finished rendering, it indicates a severe shortage of GPU resources. To avoid this, at least one timer can be started when the GPU begins rendering images, with its duration set to be less than the application's frame length. Specifically, the timer duration is calculated by multiplying the frame length by a percentage, leaving some margin for GPU image rendering. If the timer expires before the GPU has finished rendering the image, and it's not yet time to start compositing that frame, the GPU frequency can be increased by several points. For example, if the game's frame rate is 60 frames per second, the timer duration can be set to 80% of the frame length, i.e., 1000 / 60*80% = 13.33ms. If the GPU has been rendering for 13.33ms without completing the image rendering, the GPU frequency needs to be increased immediately.

[0056] During GPU image rendering, the CPU uses timers to monitor GPU resource usage. If it detects potential GPU resource shortages, it can proactively increase the GPU frequency, thus speeding up image rendering and preventing issues such as insufficient GPU resources. Figure 4 The frame image shown in Figure 3 has a long rendering time, resulting in frame dropping.

[0057] It's important to note that the GPU frequency is maintained if it completes rendering the frame within the specified time interval. In other words, if the GPU completes image rendering within the time interval, it indicates sufficient GPU resources. This can be further analyzed using the first time interval Δt1 to determine if GPU resources are excessive, thus deciding whether to appropriately reduce the GPU frequency. Therefore, by monitoring the GPU's image rendering completion status within each frame and the time interval between image rendering and image compositing operations, potential frame drops can be detected and addressed promptly. This allows for real-time control of the GPU frequency within a reasonable range, improving frame rate stability, reducing stuttering and frame drops, and lowering power consumption and heat generation.

[0058] In some embodiments, there are at least two preset timers, each with a different duration. Setting multiple timers allows for successive increases in GPU clock speed, improving frame rate stability.

[0059] Accordingly, if the GPU fails to render the frame image within the specified time interval, increasing the GPU frequency can include: sequentially determining whether the GPU has completed rendering the frame image within the specified time interval of each preset timer; and increasing the GPU frequency if the frame image rendering is not completed within each specified time interval. For example, two timers are set for the GPU: Timer 1 has a time interval of 50% of the frame length, and Timer 2 has a time interval of 80% of the frame length. If the GPU has not completed image rendering when Timer 1's time interval expires, the CPU controls the GPU to increase its frequency once. If the GPU still has not completed rendering when Timer 2's time interval expires, the CPU controls the GPU to increase its frequency again.

[0060] GPU image rendering can only proceed after the CPU has obtained the frame image. The two processes of CPU image drawing and GPU image rendering are generally completed within one frame length. Therefore, the first time t1 after the GPU finishes rendering the frame image will be affected by the time it takes for the CPU to draw that frame image.

[0061] To balance CPU and GPU capabilities and avoid wasting GPU resources, in some embodiments, after controlling the GPU frequency based on the comparison result of a first time interval and a first preset time threshold (i.e., step S13), and / or, if the GPU fails to complete rendering of the frame image within the time interval, after increasing the GPU frequency (i.e., step S22), the resource scheduling method may further include the following steps:

[0062] Step S31: Obtain the third time of the previous frame image after the frame image has been drawn and the fourth time of the start of drawing the frame image.

[0063] Step S32: Calculate the second time interval between the fourth time and the third time.

[0064] Step S32: Control the CPU frequency based on the comparison result of the second time interval and the second preset time threshold.

[0065] like Figure 4 As shown, taking frame images 1 and 2 as examples, the CPU obtains the third time t3 when frame image 1 is completed and the fourth time t4 when frame image 2 is started to be drawn, and calculates the second time interval Δt2, Δt2 = t4 - t3; based on the comparison result of the second time interval Δt2 and the second preset time threshold, the CPU frequency is increased, decreased or maintained.

[0066] The first preset time threshold may include a third threshold T3. If the second time interval Δt2 is less than or equal to the third threshold T3, the CPU frequency is increased. In other words, if Δt2≤T3, it means that the time margin for CPU to draw the image is small, and the CPU resources are considered insufficient, so the CPU frequency needs to be increased appropriately.

[0067] The second preset time threshold may include a fourth threshold T4. If the second time interval Δt2 is greater than or equal to the fourth threshold T4, the CPU frequency is reduced. In other words, if Δt2 ≥ T4, it means that the CPU has a large time margin for rendering images, and the CPU resources are considered to be excessive, so the GPU frequency needs to be appropriately reduced.

[0068] The first preset time threshold may include a third threshold T3 and a fourth threshold T4, where the third threshold T3 is less than the fourth threshold T4. If the second time interval Δt2 is greater than or equal to the third threshold T3 and less than or equal to the fourth threshold T4, the CPU frequency is maintained. In other words, if T3 ≤ Δt2 ≤ T4, it is considered that CPU resources are just sufficient, and the current CPU frequency continues to be maintained.

[0069] By monitoring the time interval between two adjacent frames drawn by the CPU, the GPU resource usage can be accurately determined, and the CPU frequency can be adjusted accordingly.

[0070] This disclosed embodiment can be applied to scenarios such as mobile phone system scrolling and gaming, improving frame rate stability, reducing stuttering and frame drops, and lowering power consumption and heat generation. It is also applicable to other devices with displays. Using the solution disclosed in this embodiment can resolve stuttering and frame drops caused by GPU performance issues, improve frame rate stability, and ensure sufficient GPU performance for gaming, while also reducing power consumption and heat generation.

[0071] Related technologies generally compare the single-frame GPU compositing time with the frame rate duration, adjusting the GPU frequency through frame rate ranges, or adjusting the GPU frequency based on the difference between the actual frame rate and the target frame rate. GPU frequency control is not precise enough; for cases with long single-frame compositing times, the issue isn't resolved until the compositing is complete, which can cause stuttering. This disclosure combines the logical relationship between the image rendering stage and the image compositing stage, and monitors GPU resource usage during image rendering. This allows for timely detection and intervention before stuttering or frame drops occur, leading to more accurate GPU capability estimation, improved frame rate stability, and reduced power consumption and heat generation. When CPU processing is slow, GPU resources can be appropriately reduced, as long as timely GPU processing is maintained. Based on the principles of image compositing and display, this disclosure provides a simple and effective solution to accurately determine whether GPU resources are sufficient, resolving stuttering and frame drops while reducing GPU power consumption.

[0072] This disclosure also provides a resource scheduling device, such as... Figure 6 As shown, it includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the resource scheduling methods of the present disclosure embodiments.

[0073] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to the data bus (Bus).

[0074] This disclosure also provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed, implements the resource scheduling method as described above.

[0075] This disclosure also provides a computer program product, which includes a computer program that, when executed by a processor, implements the resource scheduling method as described above.

[0076] Those skilled in the art will understand that all or some of the steps, systems, and devices disclosed above, as functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0077] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components working together.

[0078] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technique for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only optical disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cartridges, magnetic tapes, disk storage or other magnetic storage; and any other media that can be used to store desired information and can be accessed by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0079] This disclosure has disclosed exemplary embodiments, and although specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.

Claims

1. A resource scheduling method, comprising: The first time when the rendered frame image is completed and the second time when the composite of the frame image begins; Calculate the first time interval between the second time and the first time; The frequency of the graphics processing unit (GPU) is controlled based on the comparison result between the first time interval and the first preset time threshold.

2. The method according to claim 1, wherein, The first preset time threshold includes a first threshold, and the step of controlling the frequency of the graphics processing unit (GPU) based on the comparison result of the first time interval and the first preset time threshold includes: If the first time interval is less than or equal to the first threshold, the frequency of the GPU is increased.

3. The method according to claim 1, wherein, The first preset time threshold includes a second threshold, and the step of controlling the frequency of the graphics processing unit (GPU) based on the comparison result of the first time interval and the first preset time threshold includes: If the first time interval is greater than or equal to the second threshold, the frequency of the GPU is reduced.

4. The method according to claim 1, wherein, The first preset time threshold includes a first threshold and a second threshold, wherein the first threshold is less than the second threshold, and controlling the frequency of the graphics processing unit (GPU) based on the comparison result of the first time interval and the first preset time threshold includes: The frequency of the GPU is maintained if the first time interval is greater than or equal to the first threshold and less than or equal to the second threshold.

5. The method according to claim 4, wherein, The first threshold and the second threshold are determined based on the frame rate of the frame image.

6. The method according to claim 1, wherein, The second time is the time when the image synthesis device retrieves the frame image from the cache, or the second time is the time when the next frame image of the frame image begins to be drawn.

7. The method according to any one of claims 1-6, wherein, Also includes: When the GPU starts rendering the frame image, a preset timer is started; wherein the duration of the preset timer is less than the frame length of the frame image; If the GPU fails to render the frame image within the specified time interval, the GPU frequency is increased.

8. The method according to claim 7, wherein, There are at least two preset timers, and the timing duration of each preset timer is different.

9. The method according to claim 7, wherein, After controlling the frequency of the graphics processing unit (GPU) based on the comparison result of the first time interval and the first preset time threshold, and / or, after increasing the frequency of the GPU if the GPU fails to complete rendering of the frame image within the time interval, the method further includes: Obtain the third time of the previous frame image after the frame image has been drawn and the fourth time of the start of drawing the frame image; Calculate the second time interval between the fourth time and the third time; The frequency of the central processing unit (CPU) is controlled based on the comparison result of the second time interval and the second preset time threshold.

10. A resource scheduling apparatus, comprising a memory and a processor; the memory storing a computer program executable by the processor, wherein the computer program, when executed by the processor, implements the resource scheduling method according to any one of claims 1-9.

11. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed, it implements the resource scheduling method as described in any one of claims 1-9.

12. A computer program product comprising a computer program that, when executed by a processor, implements the resource scheduling method according to any one of claims 1-9.