Control method, system and equipment for real-time rendering performance of application and medium
By monitoring the processor occupancy rate and generating the target frame rate for frame drop processing, the problem of poor rendering performance management in the prior art is solved, and good user experience and resource optimization on different performance devices are achieved.
Patent Information
- Application Number
- CN202411654359.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The prior art is difficult to effectively manage rendering performance, which makes it difficult to provide a good user experience on devices of various performance levels, and at the same time there are problems of waste or over-consumption of resources.
By obtaining the processor occupancy rate of the target application, calculating the running frame rate and generating the target frame rate, selecting the frame to be rendered based on the target frame rate for frame drop processing, reducing the processor occupancy rate until the preset threshold is reached.
Effectively manage rendering performance to ensure a good user experience on different performance devices while avoiding wasted or over-consuming resources.
Smart Images

Figure CN119621306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a control method, system, device and medium for applying real-time rendering performance. Background Art
[0002] Rendering performance is one of the key factors that determine the overall performance of an application. For applications that require a lot of graphics processing, such as games, maps, VR, and videos, low rendering efficiency will directly lead to a decline in user experience. In order to ensure a good user experience, the application needs to maintain a suitable frame rate. However, too high a frame rate will cause excessive consumption of device performance, especially on devices with lower performance, which may cause device overload and affect the fluency and response speed of the App.
[0003] In the prior art, some applications adjust rendering strategies through a pre-set device performance comparison table. This method cannot be applied to devices that are not adapted to the device performance comparison table. Other applications adopt a single rendering setting, which may cause high-performance devices to fail to fully utilize their capabilities, while low-performance devices may experience problems such as freezing due to excessive burden. Therefore, there is room for improvement in how to effectively manage rendering performance to ensure a good user experience on devices of different performance levels while avoiding waste or excessive consumption of resources. Summary of the invention
[0004] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a method, system, device and medium for controlling the real-time rendering performance of an application, so as to solve the technical problems in the prior art that the application rendering performance cannot be effectively managed, it is difficult to ensure a good user experience on devices with various performance levels, and at the same time avoid waste or excessive consumption of resources.
[0005] To achieve the above objectives and other related objectives, the present invention provides a control method for applying real-time rendering performance, comprising:
[0006] Obtaining the current processor occupancy rate of the target application, and determining whether the current processor occupancy rate exceeds a preset occupancy threshold;
[0007] When the processor occupancy rate exceeds the occupancy threshold, calculating the running frame rate of the target application, and generating a current target frame rate based on the processor occupancy rate and the running frame rate;
[0008] Based on the current target frame rate, multiple frames to be rendered within a rendering cycle of the target application are selected for frame drop processing to reduce the processor occupancy of the target application;
[0009] The processor occupancy rate of the target application after the frame loss processing is continuously monitored, and when the processor occupancy rate after the frame loss processing exceeds the occupancy threshold, a next target frame rate is generated, and frame loss processing is performed on the target application based on the next target frame rate until the processor occupancy rate drops below the occupancy 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 time and end time of the current rendering cycle;
[0012] The ratio of the pending rendering count of the current rendering cycle to the time difference is calculated to generate a 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 as the initial time of the rendering cycle, and set the rendering frame count to 1;
[0015] Continue to generate frames to be rendered, record and determine the generation time of the frames to be rendered:
[0016] When the difference between the generation time and the initial time is less than the rendering cycle, the rendering frame count is increased by 1, and the frame to be rendered continues to be generated;
[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 used as the end time of the rendering cycle, and the rendering frame count is increased by 1, and the generation of the to-be-rendered frame of the current rendering cycle is completed.
[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 occupancy of the rendering thread of the target application to the processor occupancy of the entire application.
[0021] In one embodiment of the present invention, the step of selecting a plurality of frames to be rendered within a rendering cycle of the target application for frame drop processing based on the current target frame rate to reduce the processor occupancy of the target application includes:
[0022] Calculate the frame loss frequency of the target application in a rendering cycle according to the running frame rate and the corresponding target frame rate;
[0023] According to the frame loss frequency and the running frame rate, selecting a plurality of 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 rendering interface of the target application is not called and the system sleeps for one frame.
[0026] If the current frame to be rendered is not a frame to be discarded, the rendering interface of the target application is called to generate a corresponding picture.
[0027] In one embodiment of the present invention, the frame drop 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 according to the frame loss frequency and the running frame rate includes:
[0029] Calculate and generate a plurality of frame loss position values according to the frame loss frequency and the running frame rate;
[0030] The corresponding differences between the rendering frame count of the current frame to be rendered and the multiple frame drop position values are calculated, and when a difference that satisfies a preset interval exists among the multiple differences, the current frame to be rendered is set as a frame to be dropped.
[0031] The present invention also provides a control system for applying real-time rendering performance, comprising:
[0032] An occupancy rate determination module is used to obtain the current processor occupancy rate of the target application and determine whether the current processor occupancy rate exceeds a preset occupancy threshold;
[0033] A target frame rate generation module, configured to calculate the running frame rate of the target application when the processor occupancy rate exceeds the occupancy threshold, and generate a current target frame rate based on the processor occupancy rate and the running frame rate;
[0034] A frame loss processing module, configured to select a plurality of frames to be rendered within a rendering cycle of a target application for frame loss processing based on the current target frame rate, so as to reduce the processor occupancy rate of the target application;
[0035] The continuous monitoring module is used to continuously monitor the processor occupancy of the target application after the frame loss processing, and when the processor occupancy after the frame loss processing exceeds the occupancy threshold, generate a next target frame rate, and perform frame loss processing on the target application based on the next target frame rate until the processor occupancy drops below the occupancy threshold.
[0036] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of the control method for real-time rendering performance of an application as described in any one of the above items are implemented.
[0037] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of controlling the real-time rendering performance of the application as described in any of the above items are implemented.
[0038] As described above, the control method, system, device and medium of the real-time rendering performance of the application of the present invention have the following beneficial effects: the present invention can effectively manage the rendering performance, ensure that a good user experience can be provided on devices with various performance levels, and avoid waste or excessive consumption of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flowchart of a method for controlling real-time rendering performance of an application provided by an embodiment of the present invention;
[0040] Figure 2 Shown is a structural block diagram of a control system for applying real-time rendering performance provided by an embodiment of the present invention;
[0041] Figure 3 Shown is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0044] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0045] The present invention provides a control method, system, device and medium for real-time rendering performance of an application, and relates to the field of computer technology. The present invention intercepts the application rendering interface through a third-party dynamic library, and can complete the monitoring and adjustment of the FPS of the App / Sdk without invading the original App / Sdk code, so as to achieve the purpose of controlling the rendering performance and the overall performance of the App. The present invention can be used to effectively manage the rendering performance, ensure that a good user experience can be provided on devices with various performance levels, and avoid waste or excessive consumption of resources. The following is a detailed description through specific embodiments.
[0046] See also Figure 1 In one embodiment of the present invention, a method for controlling application real-time rendering performance provided by the present invention may include the following steps:
[0047] Step S100, obtaining the current processor occupancy rate of the target application, and determining whether the current processor occupancy rate exceeds an occupancy threshold;
[0048] Step S200: When the processor occupancy rate exceeds the occupancy threshold, the running frame rate of the target application is calculated, and a current target frame rate is generated based on the processor occupancy rate and the running frame rate;
[0049] Step S300 selects a plurality of frames to be rendered within a rendering cycle of the target application for frame drop processing based on the current target frame rate, so as to reduce the processor occupancy rate of the target application;
[0050] Step S400, continuously monitor the processor occupancy of the target application after the frame loss processing, and when the processor occupancy after the frame loss processing exceeds the occupancy threshold, generate the next target frame rate, and perform frame loss processing on the target application based on the next target frame rate until the processor occupancy drops below the occupancy threshold.
[0051] In one embodiment of the present invention, when step S100 is executed, the current processor occupancy of the target application is obtained, and it is determined whether the current processor occupancy exceeds the occupancy threshold. The present invention obtains the real-time processor occupancy of the target application through a third-party dynamic library. Before executing this step, a third-party dynamic library needs to be injected into the operating environment of the target application, that is, during the startup or operation of the target application, a dynamic library (Dynamic Link Library, DLL) developed by a third party 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 is started by setting the operating relationship of the executable file. The third-party dynamic library can be used to intercept the rendering interface of the target application and monitor the CPU occupancy of the target application, so as to ensure that the rendering behavior of the target application is subsequently monitored and intervened. In this embodiment, the target application can be various types of App (Application, application) or SDK (Software Development Kit, software development kit).
[0052] In this embodiment, first, the rendering interface of the target application is intercepted by a third-party dynamic library, and redirected to the proxy rendering interface of the third-party dynamic library. The third-party dynamic library uses the Hook mechanism to intercept the rendering interface of the target application. Hook technology is a technology that dynamically changes the behavior of a program during program execution. Through Hook, the implementation of a function or API can be replaced before and after the program calls a function or API. The core of Hook technology is to insert custom code into the execution process of the target program to achieve specific functions. The proxy rendering interface is a function implemented in a third-party dynamic library and 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 loss processing, and calling the native rendering interface. In this embodiment, in the proxy rendering interface, the processor occupancy of the target application can be monitored. The processor occupancy rate can represent the proportion of time that the processor is in the task execution state within a specific time. Then, it is determined whether the real-time processor occupancy rate of the target application exceeds the preset occupancy threshold. If the processor occupancy rate does not exceed the occupancy threshold, it means that the current rendering load of the target application is within the tolerance range of the device, and there is no need to adjust the rendering performance. If the processor usage exceeds the usage threshold, it means that the current rendering load is high and the rendering frame rate needs to be adjusted to reduce the rendering load of the device.
[0053] In one embodiment of the present invention, when step S200 is executed, that is, when the processor occupancy rate exceeds the occupancy threshold, the running frame rate of the target application is calculated, and based on the processor occupancy rate and the running frame rate, the current target frame rate is generated. Specifically, when the processor occupancy rate exceeds the occupancy threshold, it means 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 occupancy rate and the running frame rate. The running frame rate can represent 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, calculating the time difference according to the initial time and the end time of the current rendering cycle;
[0056] Step S220: Calculate the ratio of the pending rendering count of the current rendering cycle to the time difference to generate a running frame rate.
[0057] In one embodiment of the present invention, when executing steps S210 to S220, 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, which is 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, the end time and the rendering frame count are obtained according to the following steps:
[0060] Step S201, obtaining the generation time of the current frame to be rendered as the initial time of the rendering cycle, and setting the rendering frame count to 1;
[0061] Step S202: Continue to generate 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 increased by 1, and the frames to be rendered continue to be generated;
[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 used as the end time of the rendering cycle, and the rendering frame count is increased by 1, and the generation of the to-be-rendered frame of the current rendering cycle is completed.
[0064] In one embodiment of the present invention, when executing steps S201 to S205, specifically, after monitoring the rendering interface call of the target application, the third-party dynamic library can intercept it and call it into 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 rendered and generated in a rendering cycle. After the first frame, continue to generate frames to be rendered, and record and determine the generation time of the frames to be rendered. When the difference between the generation time and the initial time is less than the rendering cycle, the frame count to be rendered 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 generation time at this time is used as the end time of the rendering cycle, and the frame count to be rendered 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 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 running frame number of the target application can satisfy the following formula:
[0066]
[0067] In one embodiment of the present invention, when the processor occupancy exceeds the occupancy threshold, it is necessary to control the rendering performance. In this step, the current corresponding target frame rate can be calculated based on the occupancy threshold preset by the target application, as well as the processor occupancy and running 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 occupancy of the rendering thread of the target application to the processor occupancy of the entire application. The processor occupancy of the rendering thread refers to the proportion of processor resources occupied by the thread specifically responsible for rendering tasks in the application, and the processor occupancy of the entire application refers to the proportion of processor resources occupied by the entire target application (including the rendering thread and other threads).
[0070] In one embodiment of the present invention, when executing step S300, frame drop processing is performed on the target application based on the current target frame rate to reduce the processor occupancy rate of the target application. Specifically, the following steps may be included:
[0071] Step S310, calculating the frame loss frequency of the target application in a rendering cycle according to the running frame rate and the corresponding target frame rate;
[0072] Step S320: selecting one of a plurality of frames to be rendered within a rendering cycle as frames to be discarded according to the frame loss frequency and the running frame rate;
[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, the rendering interface of the target application is not called, and the system sleeps for one frame.
[0075] Step S350: If the current frame to be rendered is not a frame to be discarded, the rendering interface of the target application is called to generate a corresponding picture.
[0076] In one embodiment of the present invention, when executing step S310, the frame loss 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 occupancy exceeds the occupancy threshold, first, based on the current running frame rate of the target application and the target frame rate generated in step S200, the frame loss frequency of the target application in one rendering cycle can be calculated. In this embodiment, the frame loss frequency represents the number of times the target application performs frame loss processing in one rendering cycle. The frame loss frequency can satisfy the following formula:
[0077] Frame drop frequency = running frame rate - target frame rate.
[0078] In one embodiment of the present invention, when executing step S320, that is, according to the frame loss frequency and the running frame rate, a plurality of frames to be rendered within a rendering cycle are selected as frames to be discarded. Specifically, the following steps may be included:
[0079] Step S321, calculating and generating a plurality of frame loss position values according to the frame loss frequency and the running frame rate;
[0080] Step S322: Calculate the corresponding differences between the rendered frame count of the current frame to be rendered and the multiple frame drop position values, and when a difference that satisfies a preset interval exists among the multiple differences, set the current frame to be rendered as a frame to be dropped.
[0081] In one embodiment of the present invention, when executing step S321 to step S322, specifically, first, according to the frame loss frequency and the running frame rate, a plurality of frame loss position values are calculated and generated. Then, the rendering frame count of the current frame to be rendered in the current rendering cycle is compared with the plurality of frame loss position values to determine whether the current frame needs to be dropped. In this embodiment, when the corresponding difference between the rendering frame count of the current frame to be rendered and the frame loss position value is (-1,0], the current frame to be rendered is set as a frame to be dropped, and frame loss processing is required. The frame loss position value can satisfy the following formula:
[0082]
[0083] Where n is the count of frames to be discarded, n=1, 2, ..., m, and the value of m is equal to the frame drop frequency. For example, if the running frame rate is 14 and the frame drop frequency is 3, the 4th, 9th and 14th frames need to be discarded.
[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 discarding processing is required, and the original rendering interface is called in the middle of the proxy rendering interface to skip the rendering opportunity of the current frame, and the rendering interface is put to sleep for one frame, so that other processes or applications have the opportunity to obtain more processor resources. If the current frame to be rendered is not a frame to be discarded, frame discarding 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 occupancy rate of the target application after the frame loss processing is continuously monitored, and when the processor occupancy rate after the frame loss processing exceeds the occupancy threshold, the next target frame rate is generated, and the target application is subjected to frame loss processing based on the next target frame rate until the processor occupancy rate drops below the occupancy threshold. Specifically, the processor occupancy rate of the target application after the frame loss processing is monitored to determine whether it drops below the occupancy threshold. If the processor occupancy rate of the target application is less than or equal to the occupancy threshold, the regulation of the rendering performance can be suspended and the monitoring of the processor occupancy rate is maintained. If the processor occupancy rate of the target application after the frame loss processing is still higher than the occupancy threshold, the rendering performance needs to be further regulated. In this embodiment, steps S200 to S300 are executed in a loop until the processor occupancy rate of the target application drops below the occupancy threshold.
[0086] Furthermore, the target frame rate can be generated by reducing the running frame rate in steps. For example, if the current running frame rate is 30 frames, the target frame rate for this regulation can be generated by reducing the running frame rate by 5 frames each time, and then frame dropping processing is performed until the processor occupancy rate of the target application falls below the occupancy threshold.
[0087] See also Figure 2 The present invention also provides a control system for applying real-time rendering performance, which corresponds to the control method in the above embodiment. The control system may include an occupancy rate determination module 101, a target frame rate generation module 102, a frame loss processing module 103, and a continuous monitoring module 104. Each functional module is described in detail as follows:
[0088] The occupancy determination module 101 can be used to obtain the current processor occupancy of the target application and determine whether the current processor occupancy exceeds the occupancy threshold. Furthermore, the occupancy determination module 101 can be specifically used to 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, determine whether the real-time processor occupancy of the target application exceeds the preset occupancy threshold. If the processor occupancy does not exceed the occupancy threshold, it means that the current rendering load of the target application is within the tolerance range of the device, and there is no need to adjust the rendering performance. If the processor occupancy exceeds the occupancy threshold, it means 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.
[0089] The target frame rate generation module 102 can be used to calculate the running frame rate of the target application when the processor occupancy rate exceeds the occupancy threshold, and generate the current target frame rate based on the processor occupancy rate and the running frame rate. Further, the target frame rate generation module 102 can be specifically used to obtain the generation time of each frame in the current rendering cycle, and 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 and generating each frame after the first frame, determine whether the current rendering cycle has ended; if the current rendering cycle has not ended, increase the rendering frame count by 1; if the current rendering cycle has ended, record the generation time of the corresponding frame at the end of the current rendering cycle as the end time; calculate the running frame rate of the target application based on the initial time, end time and rendering frame count. When the processor occupancy rate exceeds the occupancy threshold, it is necessary to control the rendering performance. In this step, the current corresponding target frame rate can be calculated and generated based on the preset occupancy threshold of the target application, as well as the processor occupancy rate and running frame rate of the target application. The target frame rate can satisfy the following formula:
[0090]
[0091] The rendering coefficient represents the ratio of the processor occupancy of the rendering thread of the target application to the processor occupancy of the entire application. The processor occupancy of the rendering thread refers to the proportion of processor resources occupied by the thread specifically responsible for rendering tasks in the application, and the processor occupancy of the entire application refers to the proportion of processor resources occupied by the entire target application (including the rendering thread and other threads).
[0092] The frame loss processing module 103 can be used to select multiple frames to be rendered within a rendering cycle of the target application for frame loss processing based on the current target frame rate, so as to reduce the processor occupancy rate of the target application. Further, the frame loss processing module 103 can be specifically used to calculate the frame loss frequency of the target application in a rendering cycle according to the running frame rate and the corresponding target frame rate; select multiple frames to be rendered within a rendering cycle as frames to be discarded according to the frame loss frequency and the running frame rate; before rendering and generating 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, do not call the rendering interface of the target application, and sleep for one frame; if the current frame to be rendered is not a frame to be discarded, call the rendering interface of the target application to generate the corresponding picture.
[0093] The continuous monitoring module 104 can be used to continuously monitor the processor occupancy of the target application after the frame loss processing, and when the processor occupancy after the frame loss processing exceeds the occupancy threshold, generate the next target frame rate, and perform frame loss processing on the target application based on the next target frame rate until the processor occupancy drops below the occupancy threshold. Further, the continuous monitoring module 104 can be specifically used to monitor the processor occupancy of the target application after the frame loss processing to determine whether it drops below the occupancy threshold. If the processor occupancy of the target application is less than or equal to the occupancy threshold, the regulation of the rendering performance can be suspended and the monitoring of the processor occupancy can be maintained. If the processor occupancy of the target application after the frame loss processing is still higher than the occupancy threshold, the rendering performance needs to be further regulated until the processor occupancy of the target application drops below the occupancy threshold.
[0094] For the specific definition of the control system that applies real-time rendering performance, please refer to the definition of the control method above, which will not be repeated here. Each module in the above control system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0095] An embodiment of the present invention also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the control method of the real-time rendering performance of the application provided in the above-mentioned embodiments.
[0096] See also 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 executable on the processor 23, such as a control program for applying real-time rendering performance.
[0097] Among them, the memory 22 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 22 can be an internal storage unit of the electronic device 2, such as a mobile hard disk of the electronic device 2. In other embodiments, the memory 22 can also be an external storage device of the electronic device 2, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 2. Further, the memory 22 can also include both an internal storage unit of the electronic device 2 and an external storage device. The memory 22 can not only be used to store application software and various types of data installed in the electronic device 2, such as code for controlling the real-time rendering performance of the application, but can also be used to temporarily store data that has been output or is to be output.
[0098] In some embodiments, the processor 23 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 23 is the control core (Control Unit) of the electronic device 2, and uses various interfaces and lines to connect various components of the entire electronic device 2, and executes or executes programs or modules stored in the memory 22 (such as control programs for real-time rendering performance, etc.), and calls data stored in the memory 22 to execute various functions of the electronic device 2 and process data.
[0099] The processor 23 executes the operating system and various installed applications of the electronic device 2. The processor 23 executes the application to implement the steps in the control method of the above-mentioned application real-time rendering performance.
[0100] Exemplarily, the computer program may be divided into one or more modules, one or more modules are stored in the memory 22, and executed by the processor 23 to complete the present application. One or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 2. For example, the computer program may be divided into an occupancy determination module 101, a target frame rate generation module 102, a frame loss processing module 103, and a continuous monitoring module 104.
[0101] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the control method of the real-time rendering performance of the application described in each embodiment of the present application.
[0102] In summary, the present invention discloses a control method, system, device and medium for real-time rendering performance of an application. By intercepting the application rendering interface through a third-party dynamic library, the FPS of the App / Sdk can be monitored and adjusted without invading the original App / Sdk code, so as to achieve the purpose of controlling the rendering performance and the overall performance of the App. The present invention can be used to effectively manage rendering performance, ensure a good user experience on devices with different performance levels, and avoid waste or excessive consumption of resources. Therefore, the present invention effectively overcomes the various shortcomings of the prior art and has a high industrial utilization value.
[0103] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may 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 a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A control method for applying real-time rendering performance, characterized in that: include: Obtaining the current processor occupancy rate of the target application, and determining whether the current processor occupancy rate exceeds a preset occupancy threshold; When the processor occupancy rate exceeds the occupancy threshold, calculating the running frame rate of the target application, and generating a current target frame rate based on the processor occupancy rate and the running frame rate; Based on the current target frame rate, multiple frames to be rendered within a rendering cycle of the target application are selected for frame drop processing to reduce the processor occupancy of the target application; The processor occupancy rate of the target application after the frame loss processing is continuously monitored, and when the processor occupancy rate after the frame loss processing exceeds the occupancy threshold, a next target frame rate is generated, and frame loss processing is performed on the target application based on the next target frame rate until the processor occupancy rate drops below the occupancy threshold.
2. The method for controlling the real-time rendering performance of an application according to claim 1, characterized in that: The step of calculating the running frame rate of the target application includes: Calculate the time difference based on the start time and end time of the current rendering cycle; The ratio of the pending rendering count of the current rendering cycle to the time difference is calculated to generate a running frame rate.
3. The method for controlling the real-time rendering performance of an application according to claim 1, 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 as the initial time of the rendering cycle, and set the rendering frame count to 1; Continue to generate frames to be rendered, record and determine the generation time of the frames to be rendered: When the difference between the generation time and the initial time is less than the rendering cycle, the rendering frame count is increased by 1, and the frame to be rendered continues to be generated; When the difference between the generation time and the initial time is greater than the rendering cycle, the generation time at this time is used as the end time of the rendering cycle, and the rendering frame count is increased by 1, and the generation of the to-be-rendered frame of the current rendering cycle is completed.
4. The method for controlling the real-time rendering performance of an application according to claim 1, characterized in that: The target frame rate satisfies the following formula: The rendering coefficient represents the ratio of the processor occupancy of the rendering thread of the target application to the processor occupancy of the entire application.
5. The method for controlling application real-time rendering performance according to claim 2, characterized in that: The step of selecting a plurality of frames to be rendered within a rendering cycle of the target application for frame drop processing based on the current target frame rate to reduce the processor occupancy of the target application includes: Calculate the frame loss frequency of the target application in a rendering cycle according to the running frame rate and the corresponding target frame rate; According to the frame loss frequency and the running frame rate, selecting a plurality of 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 rendering interface of the target application is not called and the system sleeps for one frame. If the current frame to be rendered is not a frame to be discarded, the rendering interface of the target application is called to generate a corresponding picture.
6. The method for controlling the real-time rendering performance of an application according to claim 5, characterized in that: The frame loss frequency is the difference between the running frame rate and the corresponding target frame rate.
7. The method for controlling application real-time rendering performance according to claim 5, characterized in that: The step of selecting a plurality of frames to be rendered within a rendering cycle as frames to be discarded according to the frame loss frequency and the running frame rate comprises: Calculate and generate a plurality of frame loss position values according to the frame loss frequency and the running frame rate; The corresponding differences between the rendering frame count of the current frame to be rendered and the multiple frame drop position values are calculated, and when a difference that satisfies a preset interval exists among the multiple differences, the current frame to be rendered is set as a frame to be dropped.
8. A control system using real-time rendering performance, characterized in that: include: An occupancy rate determination module is used to obtain the current processor occupancy rate of the target application and determine whether the current processor occupancy rate exceeds a preset occupancy threshold; A target frame rate generation module, configured to calculate the running frame rate of the target application when the processor occupancy rate exceeds the occupancy threshold, and generate a current target frame rate based on the processor occupancy rate and the running frame rate; A frame loss processing module, configured to select a plurality of frames to be rendered within a rendering cycle of a target application for frame loss processing based on the current target frame rate, so as to reduce the processor occupancy rate of the target application; The continuous monitoring module is used to continuously monitor the processor occupancy of the target application after the frame loss processing, and when the processor occupancy after the frame loss processing exceeds the occupancy threshold, generate a next target frame rate, and perform frame loss processing on the target application based on the next target frame rate until the processor occupancy drops below the occupancy threshold.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the control method for real-time rendering performance of an application as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the control method for real-time rendering performance of an application as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Page fluency detection method and device
CN110764986A
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
Method and device for adjusting frequency, electronic equipment and readable storage medium
CN114911336A
Cloud application rendering video frame processing method and device
CN115278289A