Graphics card frame detection method, electronic device and computer storage medium
By acquiring the first and second rendering data of the rendering task, the completion time of the current frame is predicted, solving the problem of not being able to detect frame drops in existing technologies, achieving accurate detection of frame drops, and avoiding waste of resources and time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN RENDERBUS TECH
- Filing Date
- 2023-03-06
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies cannot effectively detect frame drops in rendering tasks, resulting in a waste of machine resources and user time.
By acquiring the first and second rendering data from the rendering task, the completion time of the current frame is predicted, and the actual rendering time is compared with the predicted time. If the actual rendering time is longer than the predicted time, then a frame freeze is determined.
Accurately detect whether there are frame drops in the rendering task, avoid the rendering task being in a state of lag, and save machine resources and user time.
Smart Images

Figure CN116166466B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of film and television rendering technology, specifically to a rendering card frame detection method, electronic device, and computer storage medium. Background Technology
[0002] With the development of cloud computing technology, more and more rendering tasks are being processed through cloud rendering platforms. Users can upload the rendering scene files they need to render through the cloud rendering platform, which then generates rendering tasks, provides rendering services to users, and finally outputs the rendered result files to them.
[0003] Each rendering task consists of multiple frames to be rendered. During the rendering process, the cloud rendering platform schedules specific rendering servers to render those frames. Sometimes, due to insufficient machine memory, high CPU usage, or rendering software errors causing frame freezes, a particular frame may become stuck and unable to complete. This prevents the rendering of these frames from producing the correct result. If frame freezes are not detected in time, the rendering task will remain stalled, wasting machine resources and user time. Currently, there is no effective method for detecting frame freezes; therefore, a frame freeze detection method is urgently needed to promptly identify and address them, avoiding wasted machine resources and user time. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a rendering frame skipping detection method, electronic device and computer storage medium to overcome the current problem that it is impossible to accurately detect whether there are frame skips in rendering tasks, which leads to serious waste of machine resources and user time due to frame skips.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, embodiments of this application provide a rendering card frame detection method, including:
[0007] Obtain first rendering data and second rendering data from the rendering task. The first rendering data is the rendering data of the completed frames in the rendering task, and the second rendering data is the rendering data of the current frame in the rendering task.
[0008] Based on the first rendering data and the second rendering data, the completion time of the current frame is predicted;
[0009] If the actual rendering time of the current frame is longer than the completion time of the current frame, then the rendering task is determined to have a frame freeze.
[0010] Furthermore, the first rendering data includes: the completion time of the completed frame and rendering hardware information; the second rendering data includes: the rendering hardware information of the current frame;
[0011] The step of predicting the completion time of the current frame based on the first rendering data and the second rendering data includes:
[0012] Based on the completion time of the completed frame and the rendering hardware information, the prediction coefficients are calculated and determined;
[0013] Based on the prediction coefficients and the rendering hardware information of the current frame, the completion time of the current frame is calculated.
[0014] Furthermore, the number of completed frames is multiple; the rendering hardware information of the completed frames includes: the charging performance coefficient and hardware performance value of the rendering device corresponding to the completed frame, wherein the rendering device corresponding to the completed frame is the rendering device used to complete the rendering job of the completed frame;
[0015] The calculation and determination of prediction coefficients based on the completion duration of the completed frames and rendering hardware information includes:
[0016] The product of the rendering device's cost performance coefficient and the rendering device's performance value corresponding to a completed frame is used as the first calculation factor for that completed frame.
[0017] The quotient of the completion duration of the completed frame and the first calculation factor of the completed frame is used as the second calculation factor of the completed frame;
[0018] The average of the second calculated factors of all the completed frames is used as the prediction coefficient.
[0019] Further, the step of calculating the completion duration of the current frame based on the prediction coefficients and the rendering hardware information of the current frame includes:
[0020] Calculate the first calculation factor of the current frame, which is the product of the cost performance coefficient of the rendering device used to render the current frame and the hardware performance value;
[0021] The product of the first calculation factor of the current frame and the prediction coefficient is taken as the completion duration of the current frame.
[0022] Furthermore, before obtaining the first and second rendering data from the rendering task, the process also includes:
[0023] Multiple sets of operating parameters of the device used for the rendering task are acquired at a preset frequency. One set of operating parameters includes CPU utilization and memory usage.
[0024] If multiple sets of the above-mentioned operating parameters are the same, it is determined that the rendering task is experiencing lag.
[0025] If multiple sets of the aforementioned operating parameters are different, then the first and second rendering data in the rendering task will be acquired.
[0026] Furthermore, before obtaining the first and second rendering data from the rendering task, the process also includes:
[0027] Get the memory usage of the device used to perform this rendering task;
[0028] If the memory usage rate is greater than or equal to the first preset threshold, it is determined that the rendering task is experiencing lag.
[0029] If the memory usage rate is less than the first preset threshold, then the first rendering data and the second rendering data in the rendering task will be acquired.
[0030] Furthermore, before obtaining the first and second rendering data from the rendering task, the process also includes:
[0031] Get the rendering time of all frames in this rendering task;
[0032] If any of the rendering durations exceeds the second preset threshold, then the first and second rendering data in the rendering task will be acquired.
[0033] Furthermore, the completed frames include a preset number of completed frames adjacent to the current frame.
[0034] Secondly, embodiments of this application provide an electronic device, including a memory and a calculator, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the rendering card frame detection method described above at a preset frequency.
[0035] Thirdly, embodiments of this application provide a computer storage medium on which a computer program is stored. When the computer program is run by a processor, it causes the processor to execute the rendering card frame detection method as described above.
[0036] The technical solution provided by this invention has at least the following beneficial effects:
[0037] This application provides a rendering frame-stuttering detection method, electronic device, and computer storage medium. The method includes: firstly, acquiring first rendering data and second rendering data from a rendering task, wherein the first rendering data is the rendering data of completed frames in the rendering task, and the second rendering data is the rendering data of the current frame in the rendering task; then, based on the first rendering data and the second rendering data, predicting the completion time of the current frame; if the actual rendering time of the current frame is longer than the completion time of the current frame, then determining that the rendering task has a frame-stuttering issue. Thus, by pre-setting the completion time of the currently rendering frame and comparing it with the actual rendering time of the current frame, when the actual rendering time is longer than the predicted completion time, the current frame is determined to be a frame-stuttering issue, accurately detecting whether a frame-stuttering issue exists in the rendering task, allowing relevant personnel to calmly end the rendering task, restart or cancel the task, avoiding the task being stuck in a frame-stuttering state, wasting machine resources and user time. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a flowchart illustrating a rendering card frame detection method according to an embodiment of the present invention;
[0040] Figure 2 A flowchart illustrating a rendering card frame detection method according to another embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram of a module of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0043] In the process of film and animation rendering or cloud rendering, rendering resources generally include scene resource files uploaded by users that need to be read before rendering, and result files obtained after rendering and output to users.
[0044] Rendering platforms, such as cloud rendering platforms, generate a task for each rendering submission from a user, each task having a unique ID. After creating a rendering task, the cloud platform allocates computing resources (rendering resources) to render the frames within the task. Normally, each frame is rendered correctly, and the cloud platform outputs a rendering result file. However, under abnormal conditions, such as insufficient machine memory, high CPU usage, or other reasons during frame rendering, some frames may fail to render correctly, or the frame rendering time may be abnormally long (even if some frames have already been rendered). This results in frame freezing, preventing the rendering task from completing. If not detected promptly, the machine will continue running, causing users to wait indefinitely, wasting both machine resources and user time. Therefore, timely detection of frame freezing is crucial to avoiding wasted machine resources and user time during rendering.
[0045] Based on this, embodiments of the present invention provide a rendering card frame detection method, an electronic device, and a computer storage medium.
[0046] Method Implementation Examples:
[0047] Figure 1 This is a flowchart illustrating a rendering card frame detection method according to an embodiment of the present invention. (See attached diagram.) Figure 1 This embodiment may include the following steps:
[0048] Step S101: Obtain the first and second rendering data from the rendering task.
[0049] The first rendering data is the rendering data of the frames that have been completed in the rendering task, and the second rendering data is the rendering data of the current frame in the rendering task.
[0050] Specifically, the first rendering data refers to the data of the frames that have already been rendered in the rendering task, which may include the completion time of the completed frame and rendering hardware information. It should be noted that rendering hardware generally includes the computing resources of the cloud platform, such as the number of computers that completed the frame, the specific number of CPUs or cores used, and the number of GPUs or cores.
[0051] Step S102: Based on the first rendering data and the second rendering data, predict the completion time of the current frame.
[0052] Specifically, based on the computing resources used and the completion time of the frames rendered in the same rendering task, the relationship between computing resources and completion time can be obtained, that is, how many computing resources a frame uses and what the corresponding completion time might be.
[0053] Step S103: Based on the completion time of the current frame and the actual rendering time of the current frame, determine whether there is frame freezing in the rendering task.
[0054] Specifically, based on the relationship between the computational resources used to render a frame and the completion time of rendering that frame, as well as the computational resources of the currently being rendered frame (i.e., the current frame) obtained in real time, the completion time of the current frame can be predicted. Meanwhile, the time the current frame is in the rendering process can be directly obtained from the platform. This rendering time is then compared with the predicted completion time of the current frame; if the comparison is greater, a frame freeze is confirmed.
[0055] In some embodiments, due to error considerations, the judgment criteria can be made more lenient to ensure a more reliable result regarding whether a frame is stuck. For example, a frame is marked as stuck only if the actual rendering time of the current frame exceeds a preset range or a preset coefficient multiple of the current frame's completion time. If the actual rendering time of the current frame exceeds 50% of the predicted completion time of the current frame, then the frame (i.e., the current frame) is marked as stuck.
[0056] The rendering frame-stuck detection method provided in this application first acquires first rendering data and second rendering data from the rendering task. The first rendering data represents the rendering data of completed frames in the rendering task, and the second rendering data represents the rendering data of the current frame in the rendering task. Then, based on the first and second rendering data, the completion time of the current frame is predicted. If the actual rendering time of the current frame is longer than the completion time of the current frame, it is determined that the rendering task is experiencing frame-stuck conditions. Thus, by pre-setting the completion time of the currently rendering frame and comparing it with the actual rendering time of the current frame, when the actual rendering time is longer than the predicted completion time, the current frame is determined to be a frame-stuck frame. This accurately detects whether a frame-stuck situation exists in the rendering task, allowing relevant personnel to easily end the rendering task, restart or cancel it, avoiding the task from being stuck in a frame-stuck state and wasting machine resources and user time.
[0057] In some embodiments, a prediction coefficient can be calculated using the completion durations of multiple sets of completed frames and the computing resources used for rendering. This coefficient reflects the relationship between completion duration and computing resources. After determining the prediction coefficient using the completion durations and computing resources of multiple sets of completed frames, the predicted completion duration of the current frame, i.e., the current frame completion duration, is calculated based on this prediction coefficient and the computing resources of the current frame. This method is simple, effective, and greatly improves prediction efficiency.
[0058] In some embodiments, computing resources can be determined by rendering hardware information, such as the number of CPU cores or GPU cores used for rendering. By using the number of cores and the computing performance of a single CPU and GPU, the above-mentioned corresponding calculations can be performed, resulting in more accurate predictions.
[0059] In other embodiments, a billing performance coefficient of the machine hardware can be introduced during the calculation process for billing calculation. This coefficient is a coefficient based on the performance of the machine hardware, and the better the machine hardware performance, the higher the coefficient.
[0060] For example, in a complete implementation process, based on the completion time y1 of completed frame y1, the number of CPU or GPU cores A1 used to complete frame y1, and the charging performance coefficient B1 of the machine used to complete frame y1; the completion time y2 of completed frame y2, the number of CPU or GPU cores A2 used to complete frame y2, and the charging performance coefficient B2 of the machine used to complete frame y2; and the completion time yn of completed frame yn, the number of CPU or GPU cores An used to complete frame yn, and the charging performance coefficient Bn of the machine used to complete frame yn, the calculation process or formula for the prediction coefficient k can be as follows:
[0061] k=(y1 / (A1*B1)+y2 / (A2*B2)+...+yn / (An*Bn)) / n;
[0062] Here, A1*B1 is the first calculation factor of frame y1, and y1 / (A1*B1) is the second calculation factor of frame y1.
[0063] After calculating the prediction coefficients, based on the CPU or GPU core A for the current frame and the charging performance coefficient B for the machine used to complete the current frame, the formula for calculating the completion time of the current frame can be as follows:
[0064] Y = A * B * k; where A * B is the first calculation factor of the current frame.
[0065] For example: Suppose the current task is CPU rendering (GPU rendering is similar), the performance factor B is 1 for all, the machine has 64 CPU cores, only frame number 6 is still being rendered, and the other frames have been rendered. Frame number 6, which is currently being rendered, is identified as the current frame. The completion times of the frames already completed in this rendering task are obtained. For example, the completion times of the 5 frames before frame 6 are 1000s, 1010s, 1020s, 1005s, and 1002s respectively; the completion times of the 5 frames after the current frame are 1050s, 1050s, 1020s, 1030s, and 1040s respectively.
[0066] At this point, the calculation process of the prediction coefficient k is as follows: k = ((1000 / 64*1) + (1010 / 64*1) + (1020 / 64*1) + (1005 / 64*1) + (1002 / 64*1) + (1050 / 64*1) + (1050 / 64*1) + (1020 / 64*1) + (1030 / 64*1) + (1040 / 64*1)) / 10;
[0067] The predicted coefficient k = 15.9796875 was obtained.
[0068] Therefore, the prediction time for the current frame, i.e., frame 6, is Y = 64 * 1 * k = 1022.7 s.
[0069] It should be noted that in some embodiments of this application, the selection of completed frames can also be done in other ways, such as the 10 frames before the current frame or the 10 frames after the current frame. However, in practical applications, because the frame number intervals are too large (such as the first and last frames), the completion time difference is large. Using the 5 completed frames before and after the current frame for prediction results in a smaller error. Therefore, selecting the 5 completed frames before and after the current rendering frame to predict the completion time yields a more accurate prediction result.
[0070] Based on this, in some other embodiments of this application, before obtaining the first and second rendering data in the rendering task, multiple sets of operating parameters of the device used to perform the rendering task can be obtained at a preset frequency. Among them, one set of operating parameters includes CPU utilization and memory usage value, which are used to roughly determine in advance whether there may be frame drops.
[0071] Specifically, if multiple sets of operating parameters are the same, it is determined that the rendering task is experiencing lag. In this case, the lag is directly determined and the state is recorded without further obtaining the first and second rendering data and performing the predictions in the above process based on this data, thereby saving computing resources. If multiple sets of operating parameters are different, that is, it is impossible to determine whether there is lag based on the operating parameters, then the first and second rendering data in the rendering task are obtained, and the above calculations and judgments are performed to further determine whether there is lag, i.e., prediction calculation or prediction judgment.
[0072] For example, the CPU usage of the CG software (rendering software) in the current rendering frame is detected, and the used memory is checked to see if it remains unchanged after three iterations (i.e., taking three sets of running parameters as an example). If so, a frame is directly marked as stuck, and the frame-stuck judgment ends. Otherwise, a precise judgment based on the first and second rendering data is performed to determine whether a frame is stuck. This has been described in detail in the above embodiments and will not be repeated here. This value can be obtained by downstream programs and reported to the platform service.
[0073] In other embodiments of this application, before obtaining the first and second rendering data in the rendering task for prediction and judgment, the method may further include obtaining the memory usage rate of the device used to perform the rendering task; if the memory usage rate is greater than or equal to a first preset threshold, it is determined that the rendering task is experiencing stuttering, and the cause of the stuttering is marked, i.e., memory abnormality causes stuttering; if the memory usage rate is less than the first preset threshold, the method begins to obtain the first and second rendering data in the rendering task, and then performs subsequent prediction calculations, thereby saving computing resources in the scenario.
[0074] Specifically, the device first sets a preset threshold, such as 99.8%. Then, it checks the frames being rendered through a preset platform to obtain the memory usage of the machine containing the corresponding frame (current frame). Based on the real-time memory usage and the value of 99.8%, it directly determines whether the current frame is stuck. If it exceeds 99.8%, the frame is directly determined to be stuck, and the cause of the stuck frame is memory abnormality. If it does not exceed 99.8%, the judgment can be made based on the first and second rendering data as described in the above embodiment. In this way, when memory causes a stuck frame, prediction and judgment can be omitted, saving computing resources in this scenario.
[0075] In other embodiments of this application, before obtaining the first and second rendering data in the rendering task for prediction and judgment, the method may further include obtaining the rendering duration of all frames in the rendering task, determining whether there is frame freezing based on the rendering duration of each frame, and marking the cause of frame freezing when it is determined that there is frame freezing.
[0076] Specifically, if all rendering times are less than the second preset threshold, such as 900 seconds, it is preliminarily determined that there is no stuttering in the rendering task. At this time, it is not necessary to obtain the first and second rendering data or to make predictions. If there is a rendering time greater than or equal to the second preset threshold, it is preliminarily determined that there is frame stuttering. Then, the first and second rendering data in the rendering task are obtained, and further predictions are made based on the first and second rendering data to determine whether there is indeed frame stuttering.
[0077] It should be noted that in actual rendering, if a frame freeze occurs, the rendering time is usually quite long. Based on rendering experience, a frame with a rendering time exceeding 900 seconds is likely to be a frame freeze. Then, the frame (the frame whose rendering process exceeds 900 seconds) can be obtained as the second rendering data, and the data of the pre-set number of completed frames before and after the frame can be used as the first rendering data. Then, based on the scheme in the above embodiment, prediction calculations are performed to determine whether the frame is a frame freeze.
[0078] Understandably, for frames exceeding 900 seconds, if they are already completed, it can be directly determined that the frame is not a frame freeze, and no further prediction calculations are needed; however, for frames exceeding 900 seconds and still in the rendering state, the aforementioned prediction calculations are required to determine whether they are frame freezes.
[0079] Furthermore, since the first rendering data in this application can be the data of a preset number of frames immediately before and after the current frame, such as five frames before and after, before performing the prediction calculation, it can be determined whether there are any frames that have been rendered successfully within the five frames before and after the current rendering frame, based on the frame number arrangement. If there are, it means that the frame can normally be rendered successfully, but the frame is still being rendered, indicating a high probability of frame freezing, and subsequent prediction calculations can be performed; if not, the judgment can be terminated, and the judgment can be restarted after a preset time.
[0080] Furthermore, when initially determining that frame drops might occur (i.e., situations other than those confirmed by the above criteria), it can also determine whether the total number of frames completed in the current task is greater than a third preset value, such as 15, and whether the percentage of completed frames ((completed frames / total task frames) * 100%) is greater than a fourth preset value, such as 60%. If so, the system proceeds to obtain the first and second rendering data for prediction; otherwise, no further prediction is made. This ensures that a sufficient number of completed frames are available for subsequent prediction, guaranteeing the accuracy of the prediction.
[0081] The following section provides a detailed description of the rendering card frame detection method provided in this application, using a complete implementation process. Figure 2 This is a flowchart illustrating a rendering card frame detection method provided in another embodiment of this application, as shown below. Figure 2 As shown, it may include:
[0082] First, the CPU usage of the CG software (the rendering software) in the current rendering frame is checked, along with whether the memory usage has remained unchanged after three iterations. If so, the frame is marked as stuck; otherwise, the next step is executed. This value is obtained by the downstream program and reported to the platform service.
[0083] Next, the platform checks the frames being rendered and obtains the memory usage of the machine hosting the corresponding frame. If this value is greater than 99.8%, the frame is marked as a stuck frame due to a memory error. Otherwise, proceed to the next step.
[0084] Then, filter out frames that take longer than 900 seconds from all the frames being rendered. Based on rendering experience, frame drops usually indicate a longer rendering time. If this does not occur, end the process.
[0085] Then, after sorting by frame number, check if there are any frames that have been rendered successfully within the five frames before and after the current frame. If so, it means that this frame should be rendered successfully under normal circumstances, but since it is still being rendered, there is a high probability of frame freezing, and proceed to the next step. If not, end the process.
[0086] Next, determine if the current task's completed frame count is greater than 15 and if the completion frame rate ((completed frames / total task frames) * 100%) is greater than 60%. If yes, proceed to the next step. If no, end the process.
[0087] Next, select the five completed frames before and after the current rendering frame to predict the completion time. Because the frame number intervals are too large (such as the first and last frames), the completion time difference is large, and using the five completed frames before and after the current rendering frame to make the prediction error is smaller.
[0088] Finally, based on the prediction time, if the current rendering time exceeds the prediction time by more than 50%, the frame is marked as a stuck frame. Otherwise, the judgment ends.
[0089] Furthermore, the above process can be performed within a specified time, such as 15 minutes, by setting a timer. The platform timer scans the tasks being rendered on the platform every 15 minutes to achieve real-time frame detection.
[0090] Furthermore, this detection method can simultaneously detect multiple rendering tasks or multiple frames in the same rendering task, based on computing resources. This application can accurately detect whether a rendering frame is a stuck frame, and the detected stuck frames can be displayed centrally, allowing operators (relevant personnel) to promptly identify them and locate the corresponding machine for appropriate processing, thus significantly improving the client's rendering efficiency.
[0091] The rendering frame skipping detection method provided in this application first uses hardware operation information to preliminarily determine whether frame skipping exists. When the hardware information determines whether frame skipping exists or not, a detection result is obtained. However, when the hardware operation information cannot accurately determine whether frame skipping exists, calculations are performed based on first and second rendering data to predict the current frame completion time. This prediction is then compared with the actual rendering time to determine whether frame skipping exists. In this way, frame skipping can be accurately detected in various scenarios, allowing for timely warnings when frame skipping occurs, enabling relevant personnel to handle the situation and preventing the rendering task from remaining in the rendering process indefinitely, wasting machine resources and user time.
[0092] Electronic device example:
[0093] Based on a general inventive concept, one embodiment of the present invention also provides an electronic device, including a memory 32 and a calculator 31, and a computer program stored on the memory 32 and executable on a processor 31. When the computer program is executed by the processor 31, it implements the rendering card frame detection method mentioned in the above method embodiment.
[0094] In some embodiments, the above functions can be achieved by using a timer, etc., to scan the tasks being rendered on the platform every 15 minutes to achieve real-time detection.
[0095] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0096] Examples of computer storage media:
[0097] Based on the same inventive concept, embodiments of this application also provide a computer storage medium on which a computer program is stored. When the computer program is run by a processor, it causes the processor to execute the rendering card frame detection method mentioned in the above method embodiments.
[0098] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0099] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.
[0100] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0101] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0102] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0103] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0104] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0105] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0106] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for detecting rendering frame rates, characterized in that, include: Obtain first rendering data and second rendering data from the rendering task. The first rendering data is the rendering data of the completed frames in the rendering task, and the second rendering data is the rendering data of the current frame in the rendering task. Based on the first rendering data and the second rendering data, the completion time of the current frame is predicted; If the actual rendering time of the current frame is longer than the completion time of the current frame, then it is determined that the rendering task has a frame freeze. The first rendering data includes: the completion time of the completed frame and the rendering hardware information; the second rendering data includes: the rendering hardware information of the current frame; The step of predicting the completion time of the current frame based on the first rendering data and the second rendering data includes: Based on the completion time of the completed frame and the rendering hardware information, the prediction coefficients are calculated and determined; Based on the prediction coefficients and the rendering hardware information of the current frame, the completion time of the current frame is calculated. The number of completed frames is multiple; the rendering hardware information of the completed frames includes: the performance coefficient and hardware performance value of the rendering device corresponding to the completed frame, and the rendering device corresponding to the completed frame is the rendering device used to complete the rendering operation of the completed frame. The calculation and determination of prediction coefficients based on the completion duration of the completed frames and rendering hardware information includes: The product of the rendering device's cost performance coefficient and the rendering device's performance value corresponding to a completed frame is used as the first calculation factor for that completed frame. The quotient of the completion duration of the completed frame and the first calculation factor of the completed frame is used as the second calculation factor of the completed frame; The average of the second calculated factors of all the completed frames is used as the prediction coefficient; The calculation of the current frame completion time based on the prediction coefficients and the rendering hardware information of the current frame includes: Calculate the first calculation factor of the current frame, which is the product of the cost performance coefficient of the rendering device used to render the current frame and the hardware performance value; The product of the first calculation factor of the current frame and the prediction coefficient is taken as the completion duration of the current frame; The billing performance coefficient is determined based on the machine hardware performance, and the better the machine hardware performance, the higher the billing performance coefficient.
2. The rendering frame detection method according to claim 1, characterized in that, Before obtaining the first and second rendering data from the rendering task, the process also includes: Multiple sets of operating parameters of the device used for the rendering task are acquired at a preset frequency. One set of operating parameters includes CPU utilization and memory usage. If multiple sets of the above-mentioned operating parameters are the same, it is determined that the rendering task is experiencing lag. If multiple sets of the aforementioned operating parameters are different, then the first and second rendering data in the rendering task will be acquired.
3. The rendering frame detection method according to claim 1, characterized in that, Before obtaining the first and second rendering data from the rendering task, the process also includes: Get the memory usage of the device used to perform this rendering task; If the memory usage rate is greater than or equal to the first preset threshold, it is determined that the rendering task is experiencing lag. If the memory usage rate is less than the first preset threshold, then the first rendering data and the second rendering data in the rendering task will be acquired.
4. The rendering frame detection method according to claim 1, characterized in that, Before obtaining the first and second rendering data from the rendering task, the process also includes: Get the rendering time of all frames in this rendering task; If any of the rendering durations exceeds the second preset threshold, then the first and second rendering data in the rendering task will be acquired.
5. The rendering frame detection method according to claim 1, characterized in that, The completed frames include a preset number of completed frames adjacent to the current frame.
6. An electronic device, characterized in that, It includes a memory and a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the rendering card frame detection method as described in any one of claims 1 to 5 at a preset frequency.
7. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when run by a processor, causes the processor to execute the rendering card frame detection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method, apparatus and device for monitoring display fluency of animation
CN107193515A
Jamming prediction method and device, terminal equipment and computer readable storage medium
CN114741192A