A method, system, device, and medium for controlling real-time rendering performance.
By monitoring and adjusting the rendering performance of target applications in real time, the problem of inconsistent user experience on different devices is solved, and resource optimization and utilization on devices with different performance levels are achieved, ensuring a good user experience and device performance management.
Patent Information
- Application Number
- CN202411654359.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Existing technologies cannot effectively manage rendering performance, resulting in inconsistent user experiences on devices with different performance levels, and may lead to resource waste or excessive consumption.
By obtaining the processor utilization of the target application, calculating the running frame rate and generating the target frame rate, selecting frames to be rendered and performing frame dropping processing to reduce processor utilization, and using third-party dynamic libraries to intercept the rendering interface for real-time monitoring and adjustment.
To provide a good user experience on devices with different performance levels, while avoiding resource waste and overconsumption, and ensuring the rational use of device performance.
Smart Images

Figure CN119621306B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, system, device, and medium for controlling real-time rendering performance. Background Technology
[0002] Rendering performance is one of the key factors determining the overall performance of an application. For applications that require a lot of graphics processing, such as games, maps, VR, and videos, poor rendering efficiency will directly lead to a degraded user experience. To ensure a good user experience, applications need to maintain an appropriate frame rate. However, excessively high frame rates can lead to excessive consumption of device resources, especially on lower-performance devices, which may cause device overload and thus affect the smoothness and responsiveness of the app.
[0003] In existing technologies, some applications adjust their rendering strategies using pre-defined device performance tables. However, this method cannot be applied to devices whose performance tables are not compatible. Other applications use a single rendering setting, which may result in high-performance devices not fully utilizing their capabilities, while low-performance devices may experience stuttering due to excessive workload. Therefore, effectively managing rendering performance to ensure a good user experience across devices with varying performance levels, while avoiding resource waste or overconsumption, remains an area for improvement. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a method, system, device and medium for controlling the real-time rendering performance of applications, so as to solve the technical problems in the prior art that it is impossible to effectively manage the rendering performance of applications, and it is difficult to ensure a good user experience on devices with different performance levels, while avoiding resource waste or excessive consumption.
[0005] To achieve the above and other related objectives, the present invention provides a method for controlling the real-time rendering performance of applications, comprising:
[0006] Obtain the current processor utilization rate of the target application and determine whether the current processor utilization rate exceeds a preset utilization threshold;
[0007] When the processor utilization rate exceeds the utilization threshold, the running frame rate of the target application is calculated, and the current target frame rate is generated based on the processor utilization rate and the running frame rate.
[0008] Based on the current target frame rate, select multiple frames to be rendered within one rendering cycle of the target application and perform frame dropping processing to reduce the processor utilization of the target application.
[0009] The processor utilization rate of the target application is continuously monitored after frame dropping. When the processor utilization rate exceeds the utilization threshold after frame dropping, the next target frame rate is generated. Frame dropping is then performed on the target application based on the next target frame rate until the processor utilization rate drops below the utilization threshold.
[0010] In one embodiment of the present invention, the step of calculating the running frame rate of the target application includes:
[0011] Calculate the time difference based on the start and end times of the current rendering cycle;
[0012] Calculate the ratio of the number of renders to be rendered in the current rendering cycle to the time difference, and generate the running frame rate.
[0013] In one embodiment of the present invention, the initial time, the end time, and the rendering frame count are obtained according to the following steps:
[0014] Get the generation time of the current frame to be rendered, use it as the initial time of the rendering cycle, and set the rendering frame count to 1;
[0015] Continue generating frames to be rendered, and record and determine the generation time of each frame:
[0016] When the difference between the generation time and the initial time is less than the rendering cycle, the rendering frame count is incremented by 1, and the generation of frames to be rendered continues.
[0017] When the difference between the generation time and the initial time is greater than the rendering cycle, the generation time at this time is taken as the end time of the rendering cycle, and the rendering frame count is incremented by 1, thus ending the generation of the frames to be rendered in the current rendering cycle.
[0018] In one embodiment of the present invention, the target frame rate satisfies the following formula:
[0019]
[0020] The rendering coefficient represents the ratio of the processor utilization of the rendering thread of the target application to the overall processor utilization of the application.
[0021] In one embodiment of the present invention, the step of selecting multiple frames to be rendered within a rendering cycle of the target application based on the current target frame rate for frame dropping processing to reduce the processor utilization of the target application includes:
[0022] Based on the running frame rate and the corresponding target frame rate, calculate the frame dropping frequency of the target application in one rendering cycle;
[0023] Based on the frame dropping frequency and the running frame rate, select multiple frames to be rendered within a rendering cycle as frames to be discarded.
[0024] Before rendering each frame to be rendered, determine whether the current frame to be rendered is a frame to be discarded;
[0025] If the current frame to be rendered is a frame to be discarded, the target application's rendering interface will not be called, and the application will sleep for one frame.
[0026] If the current frame to be rendered is not a frame to be discarded, then the rendering interface of the target application is called to generate the corresponding image.
[0027] In one embodiment of the present invention, the frame dropping frequency is the difference between the running frame rate and the corresponding target frame rate.
[0028] In one embodiment of the present invention, the step of selecting a plurality of frames to be rendered within a rendering cycle as frames to be discarded based on the frame dropping frequency and the running frame rate includes:
[0029] Based on the frame dropping frequency and the running frame rate, multiple frame dropping location values are calculated and generated;
[0030] Calculate the corresponding difference between the current frame to be rendered and the multiple dropped frame position values. If there is a difference among the multiple differences that meets the preset range, set the current frame to be rendered as a frame to be discarded.
[0031] The present invention also provides a control system for applying real-time rendering performance, comprising:
[0032] The utilization rate determination module is used to obtain the current processor utilization rate of the target application and determine whether the current processor utilization rate exceeds a preset utilization threshold.
[0033] The target frame rate generation module is used to calculate the running frame rate of the target application when the processor utilization rate exceeds the utilization threshold, and generate the current target frame rate based on the processor utilization rate and the running frame rate.
[0034] The frame dropping processing module is used to select multiple frames to be rendered within a rendering cycle of the target application based on the current target frame rate and perform frame dropping processing to reduce the processor utilization of the target application.
[0035] The continuous monitoring module is used to continuously monitor the processor utilization rate of the target application after frame dropping processing, and when the processor utilization rate exceeds the utilization threshold after frame dropping processing, it generates the next target frame rate, performs frame dropping processing on the target application based on the next target frame rate, until the processor utilization rate drops below the utilization threshold.
[0036] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the application real-time rendering performance control method as described in any of the preceding claims.
[0037] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of controlling the real-time rendering performance of the application as described in any of the preceding claims.
[0038] As described above, the present invention provides a method, system, device, and medium for controlling real-time rendering performance, which has the following beneficial effects: the present invention can effectively manage rendering performance, ensure a good user experience on devices with different performance levels, and avoid resource waste or excessive consumption. Attached Figure Description
[0039] Figure 1 A flowchart illustrating a method for controlling real-time rendering performance according to an embodiment of the present invention;
[0040] Figure 2 The diagram shown is a structural block diagram of a control system for applying real-time rendering performance, provided in an embodiment of the present invention.
[0041] Figure 3 The diagram shown is a structural schematic of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0042] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0044] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0045] This invention provides a method, system, device, and medium for controlling real-time rendering performance, relating to the field of computer technology. By intercepting the application rendering interface through a third-party dynamic library, this invention can monitor and adjust the FPS of the App / Sdk without intruding on the original App / Sdk code, thereby controlling rendering performance and overall App performance. This invention can be used to effectively manage rendering performance, ensuring a good user experience on devices with varying performance levels while avoiding resource waste or excessive consumption. Detailed descriptions are provided below using specific embodiments.
[0046] Please see Figure 1 In one embodiment of the present invention, a method for controlling the real-time rendering performance of an application provided by the present invention may include the following steps:
[0047] Step S100: Obtain the current processor utilization rate of the target application and determine whether the current processor utilization rate exceeds the utilization threshold.
[0048] Step S200: When the processor utilization rate exceeds the utilization threshold, calculate the running frame rate of the target application, and generate the current target frame rate based on the processor utilization rate and the running frame rate.
[0049] Step S300, based on the current target frame rate, selects multiple frames to be rendered within a rendering cycle of the target application and performs frame dropping processing to reduce the processor utilization of the target application.
[0050] Step S400: Continuously monitor the processor utilization rate of the target application after frame dropping processing, and when the processor utilization rate after frame dropping processing exceeds the utilization threshold, generate the next target frame rate, and perform frame dropping processing on the target application based on the next target frame rate until the processor utilization rate drops below the utilization threshold.
[0051] In one embodiment of the present invention, when step S100 is executed, the current processor utilization rate of the target application is obtained, and it is determined whether the current processor utilization rate exceeds the utilization threshold. The present invention obtains the real-time processor utilization rate of the target application through a third-party dynamic library. Before executing this step, the third-party dynamic library needs to be injected into the runtime environment of the target application. That is, during the startup or operation of the target application, a third-party developed dynamic library (Dynamic Link Library, DLL) is loaded into the address space of the target application, so that the code in the third-party dynamic library can be executed in the context of the target application. The present invention ensures that the third-party dynamic library can be automatically loaded and run when the target application starts by setting the execution relationship of the executable file. This third-party dynamic library can be used to intercept the rendering interface of the target application and monitor the CPU utilization rate of the target application, thereby ensuring that the rendering behavior of the target application can be monitored and intervened in the future. In this embodiment, the target application can be various types of App (Application) or SDK (Software Development Kit).
[0052] In this embodiment, firstly, the rendering interface of the target application is intercepted through a third-party dynamic library and redirected to the proxy rendering interface of the third-party dynamic library. The third-party dynamic library uses a hook mechanism to intercept the rendering interface of the target application. Hooking technology is a technique that dynamically changes the behavior of a program during execution. Through hooking, the implementation of a function or API can be replaced before or after the program calls that function or API. The core of hooking technology is to insert custom code into the execution flow of the target program to achieve specific functions. The proxy rendering interface is a function implemented in the third-party dynamic library that can be used to replace the native rendering interface. The proxy rendering interface can perform multiple operations, such as collecting performance data, dynamically adjusting rendering parameters, performing frame dropping processing, and calling the native rendering interface. In this embodiment, the processor utilization rate of the target application can be monitored in the proxy rendering interface. The processor utilization rate can represent the proportion of time the processor is in the task execution state within a specific time period. Then, it is determined whether the real-time processor utilization rate of the target application exceeds a preset utilization threshold. If the processor utilization rate does not exceed the utilization threshold, it means that the current rendering load of the target application is within the device's capacity, and no rendering performance adjustment is required. If the processor utilization rate exceeds the utilization threshold, it indicates that the current rendering load is high, and the rendering frame rate needs to be adjusted to reduce the rendering load on the device.
[0053] In one embodiment of the present invention, when step S200 is executed, i.e., when the processor utilization rate exceeds the utilization threshold, the running frame rate of the target application is calculated, and the current target frame rate is generated based on the processor utilization rate and the running frame rate. Specifically, when the processor utilization rate exceeds the utilization threshold, it indicates that the current rendering load is high, and the number of rendering frames needs to be adjusted to reduce the rendering load of the device. The present invention can calculate the running frame rate of the target application through a third-party dynamic library, and generate the current target frame rate based on the processor utilization rate and the running frame rate. The running frame rate can characterize the number of times the target application calls the rendering interface per unit time.
[0054] In one embodiment of the present invention, calculating the running frame rate of the target application in the proxy rendering interface may include the following steps:
[0055] Step S210: Calculate the time difference based on the initial and end times of the current rendering cycle;
[0056] Step S220: Calculate the ratio of the number of rendering cycles to be rendered in the current rendering cycle to the time difference, and generate the running frame rate.
[0057] In one embodiment of the present invention, when steps S210 to S220 are executed, specifically, the number of running frames of the target application can be calculated based on the initial time, end time, and rendering frame count of the current rendering cycle. First, the difference between the end time and the initial time is calculated and recorded as the time difference. Then, the ratio of the rendering frame count to the time difference is calculated to generate the running frame rate. The number of running frames of the target application can satisfy the following formula:
[0058]
[0059] In this embodiment, the initial time, end time, and rendering frame count are obtained according to the following steps:
[0060] Step S201: Obtain the generation time of the current frame to be rendered as the initial time of the rendering cycle, and set the rendering frame count to 1;
[0061] Step S202: Continue generating frames to be rendered, and record and determine the generation time of the frames to be rendered.
[0062] Step S203: When the difference between the generation time and the initial time is less than the rendering cycle, the rendering frame count is incremented by 1, and the generation of frames to be rendered continues.
[0063] Step S204: When the difference between the generation time and the initial time is greater than the rendering cycle, the generation time at this time is taken as the end time of the rendering cycle, and the rendering frame count is incremented by 1. The generation of the frames to be rendered in the current rendering cycle ends.
[0064] In one embodiment of the present invention, when steps S201 to S205 are executed, specifically, after the third-party dynamic library detects the rendering interface call of the target application, it can intercept and call it to the proxy rendering interface. Then, the generation time of the current frame to be rendered is obtained as the initial time of the rendering cycle, and the rendering frame count is set to 1. The rendering frame count is used to count how many frames are generated in a rendering cycle. After the first frame, the generation of frames to be rendered continues, and the generation time of the frames to be rendered is recorded and determined. When the difference between the generation time and the initial time is less than the rendering cycle, the frame to be rendered count is increased by 1, and the generation of frames to be rendered continues; when the difference between the generation time and the initial time is greater than the rendering cycle, the current generation time is taken as the end time of the rendering cycle, and the frame to be rendered count is increased by 1, and the generation of frames to be rendered in the current rendering cycle ends.
[0065] In this embodiment, the difference between the end time and the initial time is first calculated and denoted as the time difference. Then, the ratio of the rendered frame count to the time difference is calculated to generate the running frame rate. The number of running frames for the target application can satisfy the following formula:
[0066]
[0067] In one embodiment of the present invention, when the processor utilization rate exceeds a threshold, rendering performance control is required. In this step, the target frame rate can be calculated based on a preset threshold for the target application, as well as the processor utilization rate and frame rate of the target application. The target frame rate can satisfy the following formula:
[0068]
[0069] The rendering coefficient represents the ratio of the processor utilization of the rendering thread to the overall processor utilization of the application. The processor utilization of the rendering thread refers to the proportion of processor resources used by the thread specifically responsible for rendering tasks in the application, while the overall processor utilization of the application refers to the proportion of processor resources used by the entire target application (including the rendering thread and other threads).
[0070] In one embodiment of the present invention, when step S300 is executed, that is, based on the current target frame rate, frame dropping processing is performed on the target application to reduce the processor utilization of the target application. Specifically, it may include the following steps:
[0071] Step S310: Calculate the frame drop frequency of the target application in one rendering cycle based on the running frame rate and the corresponding target frame rate;
[0072] Step S320: Based on the frame dropping frequency and the running frame rate, select multiple frames to be rendered within a rendering cycle as frames to be discarded;
[0073] Step S330: Before rendering each frame to be rendered, determine whether the current frame to be rendered is a frame to be discarded;
[0074] Step S340: If the current frame to be rendered is a frame to be discarded, then the rendering interface of the target application is not called, and the application sleeps for one frame.
[0075] Step S350: If the current frame to be rendered is not a frame to be discarded, then call the rendering interface of the target application to generate the corresponding image.
[0076] In one embodiment of the present invention, when step S310 is executed, the frame dropping frequency of the target application in one rendering cycle is calculated based on the running frame rate and the corresponding target frame rate. Specifically, when the processor utilization rate exceeds the utilization threshold, firstly, based on the current running frame rate of the target application and the target frame rate generated in step S200, the frame dropping frequency of the target application in one rendering cycle can be calculated. In this embodiment, the frame dropping frequency characterizes the number of times the target application performs frame dropping processing within one rendering cycle. The frame dropping frequency can satisfy the following formula:
[0077] Frame drop rate = running frame rate - target frame rate.
[0078] In one embodiment of the present invention, when step S320 is executed, that is, based on the frame dropping frequency and the running frame rate, multiple frames to be rendered within a rendering cycle are selected as frames to be discarded. Specifically, this may include the following steps:
[0079] Step S321: Calculate and generate multiple frame drop location values based on the frame drop frequency and the running frame rate;
[0080] Step S322: Calculate the corresponding difference between the current frame to be rendered and the multiple dropped frame position values, and when there is a difference among the multiple differences that satisfies the preset interval, set the current frame to be rendered as a frame to be discarded.
[0081] In one embodiment of the present invention, when steps S321 to S322 are executed, specifically, firstly, multiple frame dropping position values are calculated and generated based on the frame dropping frequency and the running frame rate. Then, the rendering frame count of the current frame to be rendered in the current rendering cycle is compared with the multiple frame dropping position values to determine whether the current frame needs to be dropped. In this embodiment, when the difference between the rendering frame count of the current frame to be rendered and the corresponding frame dropping position value is in (-1, 0], the current frame to be rendered is set as a frame to be dropped and frame dropping processing is required. The frame dropping position value can satisfy the following formula:
[0082]
[0083] Where n is the count of frames to be dropped, n = 1, 2, ..., m, and the value of m is equal to the frame dropping frequency. For example, if the running frame rate is 14 and the frame dropping frequency is 3, then frames 4, 9, and 14 need to be dropped.
[0084] In one embodiment of the present invention, when executing steps S330 to S350, specifically, before rendering each frame to be rendered, it is determined whether the current frame to be rendered is a frame to be discarded. If the current frame to be rendered is a frame to be discarded, frame dropping processing is required. The original rendering interface is called in the proxy rendering interface to skip the rendering opportunity of the current frame, and the rendering interface is made to sleep for one frame, thereby allowing other processes or applications to have the opportunity to obtain more processor resources. If the current frame to be rendered is not a frame to be discarded, frame dropping processing is not required, and the rendering interface of the target application is called according to the normal process to create the required display screen.
[0085] In one embodiment of the present invention, when step S400 is executed, the processor utilization rate of the target application after frame dropping is continuously monitored. If the processor utilization rate exceeds a threshold after frame dropping, a next target frame rate is generated. Frame dropping is then performed on the target application based on this next target frame rate until the processor utilization rate drops below the threshold. Specifically, the processor utilization rate of the target application after frame dropping is monitored to determine if it has dropped below the threshold. If the processor utilization rate of the target application is less than or equal to the threshold, rendering performance adjustment can be paused, while processor utilization monitoring continues. If the processor utilization rate of the target application after frame dropping is still higher than the threshold, further rendering performance adjustment is required. In this embodiment, steps S200 to S300 are executed cyclically until the processor utilization rate of the target application drops below the threshold.
[0086] Furthermore, a target frame rate can be generated by gradually reducing the running frame rate. For example, if the current running frame rate is 30 frames per second, the target frame rate can be generated by reducing the running frame rate by 5 frames each time, and then frame dropping is performed until the processor utilization rate of the target application is below the threshold.
[0087] Please see Figure 2 The present invention also provides a control system for real-time rendering performance, which corresponds one-to-one with the control methods in the above embodiments. This control system may include a occupancy rate determination module 101, a target frame rate production module 102, a frame drop processing module 103, and a continuous monitoring module 104. Detailed descriptions of each functional module are as follows:
[0088] The processor utilization rate determination module 101 can be used to obtain the current processor utilization rate of the target application and determine whether the current processor utilization rate exceeds the utilization threshold. Specifically, the utilization rate determination module 101 can first intercept the rendering interface of the target application through a third-party dynamic library and redirect it to the proxy rendering interface of the third-party dynamic library. Then, it determines whether the real-time processor utilization rate of the target application exceeds a preset utilization threshold. If the processor utilization rate does not exceed the utilization threshold, it indicates that the current rendering load of the target application is within the device's capacity, and no rendering performance adjustment is needed. If the processor utilization rate exceeds the utilization threshold, it indicates that the current rendering load is high, and the rendering frame rate needs to be adjusted to reduce the device's rendering load.
[0089] The target frame rate generation module 102 can be used to calculate the running frame rate of the target application when the processor utilization exceeds the utilization threshold, and generate the current target frame rate based on the processor utilization and the running frame rate. Further, the target frame rate generation module 102 can specifically be used to obtain the generation time of each frame in the current rendering cycle, record the generation time of the first frame in the current rendering cycle as the initial time, and set the rendering frame count to 1; when rendering each frame after the first frame, it determines whether the current rendering cycle has ended; if the current rendering cycle has not ended, it increments the rendering frame count by 1; if the current rendering cycle has ended, it records the generation time of the corresponding frame at the end of the current rendering cycle as the end time; and calculates the running frame rate of the target application based on the initial time, the end time, and the rendering frame count. When the processor utilization exceeds the utilization threshold, rendering performance control is required. In this step, the current target frame rate can be calculated and generated based on the target application's preset utilization threshold, as well as the target application's processor utilization and running frame rate. The target frame rate can satisfy the following formula:
[0090]
[0091] The rendering coefficient represents the ratio of the processor utilization of the rendering thread to the overall processor utilization of the application. The processor utilization of the rendering thread refers to the proportion of processor resources used by the thread specifically responsible for rendering tasks in the application, while the overall processor utilization of the application refers to the proportion of processor resources used by the entire target application (including the rendering thread and other threads).
[0092] The frame dropping processing module 103 can be used to select multiple frames to be rendered within a rendering cycle of the target application for frame dropping processing based on the current target frame rate, so as to reduce the processor utilization of the target application. Further, the frame dropping processing module 103 can specifically be used to calculate the frame dropping frequency of the target application within a rendering cycle based on the running frame rate and the corresponding target frame rate; select multiple frames to be rendered within a rendering cycle as frames to be dropped based on the frame dropping frequency and the running frame rate; before rendering each frame to be rendered, determine whether the current frame to be rendered is a frame to be dropped; if the current frame to be rendered is a frame to be dropped, then the rendering interface of the target application is not called, and the application sleeps for one frame; if the current frame to be rendered is not a frame to be dropped, then the rendering interface of the target application is called to generate the corresponding image.
[0093] The continuous monitoring module 104 can be used to continuously monitor the processor utilization of the target application after frame dropping processing. When the processor utilization exceeds a threshold after frame dropping processing, it generates the next target frame rate and performs frame dropping processing on the target application based on the next target frame rate until the processor utilization drops below the threshold. Specifically, the continuous monitoring module 104 can monitor the processor utilization of the target application after frame dropping processing and determine whether it has dropped below the threshold. If the processor utilization of the target application is less than or equal to the threshold, rendering performance adjustment can be paused, and processor utilization monitoring can continue. If the processor utilization of the target application after frame dropping processing is still higher than the threshold, further rendering performance adjustment is required until the processor utilization of the target application drops below the threshold.
[0094] Specific limitations regarding the control system for real-time rendering performance can be found in the limitations of the control method described above, and will not be repeated here. Each module in the aforementioned control system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independent of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the corresponding operations of each module.
[0095] Embodiments of the present invention also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the application real-time rendering performance control method provided in the above embodiments.
[0096] Please see Figure 3 The electronic device 2 may include a memory 22, a processor 23 and a bus, and may also include a computer program stored in the memory 22 and that can run on the processor 23, such as a control program that applies real-time rendering performance.
[0097] The memory 22 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 22 can be an internal storage unit of the electronic device 2, such as a portable hard drive. In other embodiments, the memory 22 can be an external storage device of the electronic device 2, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the electronic device 2. Furthermore, the memory 22 can include both internal and external storage units of the electronic device 2. The memory 22 can be used not only to store application software and various types of data installed on the electronic device 2, such as code controlling real-time rendering performance, but also to temporarily store data that has been output or will be output.
[0098] In some embodiments, processor 23 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. Processor 23 is the control unit of electronic device 2, connecting various components of the entire electronic device 2 via various interfaces and lines. It executes programs or modules stored in memory 22 (e.g., control programs for real-time rendering performance) and calls data stored in memory 22 to perform various functions and process data in electronic device 2.
[0099] Processor 23 executes the operating system of electronic device 2 and various installed applications. Processor 23 executes applications to implement the steps in the above-mentioned method for controlling the real-time rendering performance of applications.
[0100] For example, a computer program can be divided into one or more modules, one or more of which are stored in memory 22 and executed by processor 23 to complete this application. One or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in electronic device 2. For example, the computer program can be divided into a occupancy rate determination module 101, a target frame rate production module 102, a frame drop processing module 103, and a continuous monitoring module 104.
[0101] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium, which can be non-volatile or volatile. The software functional module stored in the storage medium includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute some functions of the application real-time rendering performance control method described in the various embodiments of this application.
[0102] In summary, the present invention discloses a method, system, device, and medium for controlling real-time rendering performance. By intercepting the application rendering interface through a third-party dynamic library, it can monitor and adjust the FPS of the App / Sdk without intruding on the original App / Sdk code, thereby controlling rendering performance and overall App performance. This invention can be used to effectively manage rendering performance, ensuring a good user experience on devices with varying performance levels while avoiding resource waste or excessive consumption. Therefore, this invention effectively overcomes the shortcomings of existing technologies and has high industrial applicability.
[0103] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for controlling the performance of real-time rendering applications, characterized in that, include: Obtain the current processor utilization rate of the target application and determine whether the current processor utilization rate exceeds a preset utilization threshold; When the processor utilization rate exceeds the utilization threshold, the running frame rate of the target application is calculated, and the current target frame rate is generated based on the processor utilization rate and the running frame rate. Based on the current target frame rate, select multiple frames to be rendered within one rendering cycle of the target application and perform frame dropping processing to reduce the processor utilization of the target application. The processor utilization rate of the target application is continuously monitored after frame dropping processing. When the processor utilization rate exceeds the utilization threshold after frame dropping processing, the next target frame rate is generated. Frame dropping processing is performed on the target application based on the next target frame rate until the processor utilization rate drops below the utilization threshold. The target frame rate satisfies the following formula: The rendering coefficient represents the ratio of the processor utilization of the rendering thread of the target application to the overall processor utilization of the application.
2. The method for controlling real-time rendering performance according to claim 1, characterized in that, The steps for calculating the target application's frame rate include: Calculate the time difference based on the start and end times of the current rendering cycle; Calculate the ratio of the number of renders to be rendered in the current rendering cycle to the time difference, and generate the running frame rate.
3. The method for controlling real-time rendering performance according to claim 2, characterized in that, The initial time, the end time, and the rendering frame count are obtained according to the following steps: Get the generation time of the current frame to be rendered, use it as the initial time of the rendering cycle, and set the rendering frame count to 1; Continue generating frames to be rendered, and record and determine the generation time of each frame: When the difference between the generation time and the initial time is less than the rendering cycle, the rendering frame count is incremented by 1, and the generation of frames to be rendered continues. When the difference between the generation time and the initial time is greater than the rendering cycle, the generation time at this time is taken as the end time of the rendering cycle, and the rendering frame count is incremented by 1, thus ending the generation of the frames to be rendered in the current rendering cycle.
4. The method for controlling real-time rendering performance according to claim 2, characterized in that, The step of selecting multiple frames to be rendered within a rendering cycle of the target application based on the current target frame rate for frame dropping processing to reduce the processor utilization of the target application includes: Based on the running frame rate and the corresponding target frame rate, calculate the frame dropping frequency of the target application in one rendering cycle; Based on the frame dropping frequency and the running frame rate, select multiple frames to be rendered within a rendering cycle as frames to be discarded. Before rendering each frame to be rendered, determine whether the current frame to be rendered is a frame to be discarded; If the current frame to be rendered is a frame to be discarded, the target application's rendering interface will not be called, and the application will sleep for one frame. If the current frame to be rendered is not a frame to be discarded, then the rendering interface of the target application is called to generate the corresponding image.
5. The method for controlling real-time rendering performance according to claim 4, characterized in that, The frame dropping frequency is the difference between the running frame rate and the corresponding target frame rate.
6. The method for controlling real-time rendering performance according to claim 4, characterized in that, The step of selecting multiple frames to be rendered within a rendering cycle as frames to be discarded based on the frame dropping frequency and the running frame rate includes: Based on the frame dropping frequency and the running frame rate, multiple frame dropping location values are calculated and generated; Calculate the corresponding differences between the current frame count and multiple dropped frame position values, and set the current frame to be rendered as a frame to be discarded when there is a difference that meets the preset range among the multiple differences.
7. A control system for applying real-time rendering performance, characterized in that, include: The utilization rate determination module is used to obtain the current processor utilization rate of the target application and determine whether the current processor utilization rate exceeds a preset utilization threshold. The target frame rate generation module is used to calculate the running frame rate of the target application when the processor utilization rate exceeds the utilization threshold, and generate the current target frame rate based on the processor utilization rate and the running frame rate. The frame dropping processing module is used to select multiple frames to be rendered within a rendering cycle of the target application based on the current target frame rate and perform frame dropping processing to reduce the processor utilization of the target application. The continuous monitoring module is used to continuously monitor the processor utilization rate of the target application after frame dropping processing, and when the processor utilization rate after frame dropping processing exceeds the utilization threshold, generate the next target frame rate, and perform frame dropping processing on the target application based on the next target frame rate until the processor utilization rate drops below the utilization threshold. The target frame rate satisfies the following formula: The rendering coefficient represents the ratio of the processor utilization of the rendering thread of the target application to the overall processor utilization of the application.
8. An electronic device, characterized in that: The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the method for controlling the real-time rendering performance of an application as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the application real-time rendering performance control method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for improving fluency of cloud game through dynamic frame limiting and medium
CN112370776A
Data processing method and device and storage medium
CN113347466A
Cloud application rendering video frame processing method and device
CN115278289A