Game lag analysis method and device, electronic equipment and storage medium

Through the combination of frame interval interface and function grouping time-consuming instrumentation functions, the game frame time-consuming and lag factors are directly obtained, which solves the problem of low efficiency in game lag analysis in the existing technology, and realizes lightweight and efficient lag analysis.

CN120478982APending Publication Date: 2025-08-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410162760.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-05
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing game lag analysis method requires reconstruction of the test package, which is cumbersome to operate, affects the analysis efficiency and has large performance losses.

Method used

The time-consuming process of obtaining the current game frame and adjacent frames through the frame interval interface, combined with the time-consuming instrumentation function of function grouping, directly determine the lag factors, avoid the time-consuming process of obtaining game program functions in real time, and simplify the analysis process.

Benefits of technology

Realize lightweight data acquisition, improve the efficiency and accuracy of lag analysis, and reduce the impact on game performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120478982A_ABST
    Figure CN120478982A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a game lag analysis method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining the current frame time consumption of a target game program in a current game frame based on a frame interval interface; determining lag information of the current game frame based on the current frame time consumption and adjacent frame time consumption of an adjacent game frame before the current game frame; under the condition that the lagging information of the current game frame represents that the current game frame is lagged, obtaining function consumed time corresponding to at least one function group based on a consumed time instrumentation function corresponding to the at least one function group; and based on the function time consumption corresponding to the at least one function group, determining a lag factor corresponding to the current game frame. The game lag analysis efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a game lag analysis method, device, electronic device and storage medium. Background Art

[0002] In the prior art, when performing game stutter analysis, the game frame rate of the constructed game program package is generally collected. When it is determined that the game is stuttering based on the collected game frame rate, a test dedicated to game performance analysis is further constructed to perform subsequent game performance analysis. The Test package is constructed by adding a full set of performance tags on the basis of the Shipping package. Game stutter analysis can only be performed after the Test package is built. In addition, when collecting stutter data based on the Test package, its own performance tags are greatly lost. The existing game stutter analysis method requires the reconstruction of the test package, which is cumbersome to operate, thereby affecting the efficiency of game stutter analysis. Summary of the Invention

[0003] The technical problem to be solved by this application is to provide a game jam analysis method, device, electronic device and storage medium, which can improve the efficiency of game jam analysis.

[0004] In order to solve the above technical problems, on the one hand, the present application provides a game jam analysis method, including:

[0005] Get the current frame time of the target game program in the current game frame based on the frame interval interface;

[0006] Determining jamming information of the current game frame based on the current frame duration and adjacent frame durations of adjacent game frames before the current game frame;

[0007] When the jam information of the current game frame indicates that the current game frame has jammed, obtaining a function time corresponding to the at least one function group based on a time-consuming instrumented function corresponding to the at least one function group; the target game program includes a plurality of function groups and time-consuming instrumented functions corresponding to each of the plurality of function groups; each function group includes at least one game program function, and the plurality of function groups are determined based on a function category of each game program function in the target game program;

[0008] Based on the function time corresponding to the at least one function group, a jamming factor corresponding to the current game frame is determined.

[0009] On the other hand, the present application provides a game jam analysis device, comprising:

[0010] The current frame time acquisition module is used to obtain the current frame time of the target game program in the current game frame based on the frame interval interface;

[0011] a jam information determination module, configured to determine jam information of the current game frame based on the current frame duration and the adjacent frame durations of adjacent game frames preceding the current game frame;

[0012] A function time-consuming acquisition module is configured to, when the jam information of the current game frame indicates that the current game frame has jammed, acquire the function time corresponding to at least one function group based on the time-consuming instrumented function corresponding to at least one function group; the target game program includes a plurality of function groups and time-consuming instrumented functions corresponding to each of the plurality of function groups; each function group includes at least one game program function, and the plurality of function groups are determined based on the function category of each game program function in the target game program;

[0013] A jam factor determination module is used to determine a jam factor corresponding to the current game frame based on the function time corresponding to the at least one function group.

[0014] On the other hand, the present application provides a device comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game lag analysis method as described above.

[0015] On the other hand, the present application provides a computer storage medium, which stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded by a processor and executed by the game lag analysis method as described above.

[0016] The implementation of the embodiments of the present application has the following beneficial effects:

[0017] In this application, the current frame time of the target game program in the current game frame can be directly obtained through the frame interval interface, without having to determine the current frame time by obtaining the running time of the game program function corresponding to the current game frame in real time, thereby avoiding the impact of conventional time statistics such as the running time of the game program function corresponding to the current game frame in real time on the game performance, and realizing lightweight data collection; and directly obtaining the current frame time through the frame interval interface can improve the efficiency of obtaining the current frame time. In addition, in this application, when it is determined that the current game frame is stuck, the function time corresponding to the corresponding function group is obtained based on the time-consuming plug-in function corresponding to the function group, thereby realizing function time statistics based on the function group dimension, improving the accuracy of determining the stuck factor; and function time statistics are performed when the game is stuck, and function time statistics are not performed when the game is not stuck, avoiding the impact of conventional time statistics on game performance. Furthermore, in this application, there is no need to perform game performance analysis by reconstructing the Test package, thereby simplifying the game stuck analysis process and improving the efficiency of game stuck analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0019] Figure 1 This is a schematic diagram of the implementation environment provided by the embodiment of the present application;

[0020] Figure 2 This is a flow chart of a game jam analysis method provided by an embodiment of the present application;

[0021] Figure 3 This is a flow chart of a method for determining jamming factors based on function time consumption provided by an embodiment of the present application;

[0022] Figure 4 This is a flow chart of a method for determining a jamming factor based on drawing records provided in an embodiment of the present application;

[0023] Figure 5 This is a flow chart of a method for determining jamming factors based on drawing code analysis provided in an embodiment of the present application;

[0024] Figure 6 This is a flow chart of a method for determining a jamming factor based on a semi-transparent drawing operation provided by an embodiment of the present application;

[0025] Figure 7This is a flow chart of a method for determining jamming information provided by an embodiment of the present application;

[0026] Figure 8 This is a schematic diagram of a game jam analysis device provided in an embodiment of the present application;

[0027] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0028] Figure 10 This is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. It is clear that the embodiments described are only some of the embodiments of this application, and not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0031] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0032] First, the following explanations are given for the relevant terms involved in the embodiments of this specification:

[0033] FPS: Frames Per Second, is a definition in the field of imaging, which refers to the number of frames transmitted per second. Generally speaking, it refers to the number of frames of animation or video.

[0034] CPU: It is the CPU usage occupied by the running program, which indicates the status of the running program on the machine at a certain point in time.

[0035] Rendering refers to the process of converting a model into an image using software. It's used to describe the effects used in video editing software and the final video output. Rendering applications include computer and video games, special effects for film, and visual design. Each application requires a comprehensive consideration of characteristics and techniques.

[0036] RenderDoc: A free, standalone, open-source graphics debugger that can be used to perform single-frame captures of applications such as Unreal Engine 4 (UE4). The capture is loaded into RenderDoc, which allows for comprehensive inspection of the GPU using events, APIs, and more.

[0037] Mesh: refers to the mesh of the model. The main attributes of Mesh include vertex coordinates, normals, texture coordinates, triangle drawing sequence and other useful attributes and functions.

[0038] Draw Call (DC): This is when the CPU calls a graphics programming interface, such as DirectX or OpenGL, to instruct the GPU to render. For example, the DrawIndexedPrimitive command in DirectX and the glDrawElement command in OpenGL.

[0039] See also Figure 1 , which shows a schematic diagram of the implementation environment provided by an embodiment of the present application, the implementation environment may include: at least one game terminal 110 and a data analysis terminal 120, and the game terminal 110 and the data analysis terminal 120 can communicate data through the network.

[0040] In one example, a target game program may be running on the game terminal 110, and the current frame time of the current game frame and the adjacent frame time of the adjacent game frame before the current game frame may be obtained based on the frame interval interface, and the current frame time and the adjacent frame time of the adjacent game frame may be sent to the data analysis terminal 120; the data analysis terminal 120 determines the stuttering information of the current game frame based on the current frame time and the adjacent frame time, and when the stuttering information of the current game frame indicates that the current game frame is stuttering, the data analysis terminal 120 performs time statistics and other operations on the current game frame to determine the stuttering factor corresponding to the current game frame.

[0041] In another example, a target game program may be running on the game terminal 110, and the current frame time of the current game frame and the adjacent frame time of the adjacent game frame before the current game frame may be obtained based on the frame interval interface; the jamming information of the current game frame is determined based on the current frame time and the adjacent frame time, and when the jamming information of the current game frame indicates that the current game frame is jammed, the time statistics and other operations are performed on the current game frame to determine the jamming factor corresponding to the current game frame.

[0042] The game terminal 110 can communicate with the data analysis terminal 120 based on a browser / server (B / S) or client / server (C / S) model. The game terminal 110 may include a physical device such as a smartphone, tablet computer, laptop computer, digital assistant, smart wearable device, or vehicle-mounted terminal, and may also include software running on the physical device, such as an application. The operating system running on the game terminal 110 in the embodiments of the present application may include, but is not limited to, Android, iOS, Linux, Windows, etc.

[0043] The data analysis terminal 120 can establish a communication connection with the game terminal 110 via wired or wireless communication. The data analysis terminal 120 can include an independently running server, a distributed server, or a server cluster composed of multiple servers, wherein the server can be a cloud server.

[0044] In order to solve the problem of low efficiency of game jam analysis in the prior art, the embodiment of the present application provides a game jam analysis method, the execution subject of the method can be the above-mentioned game terminal or the above-mentioned data analysis terminal; please refer to Figure 2 , the method may include:

[0045] S210. Obtain the current frame time of the target game program in the current game frame based on the frame interval interface.

[0046] The frame interval interface in this embodiment may refer to an interface for obtaining the time interval between two adjacent game frames, specifically Delta Seconds, and then the time interval between the obtained current game frame and the adjacent previous game frame may be determined as the current frame timing of the current game frame; the time interval between two adjacent game frames may be a game performance parameter collected in real time based on the changes in the game frame screen during the operation of the target game program, without the need for collection through other auxiliary tools; compared with the method of determining the current frame timing by performing time statistics on each game frame, the method for determining the current frame timing in this embodiment is more lightweight and has less impact on the game operation performance.

[0047] S220. Determine the jamming information of the current game frame based on the current frame duration and the adjacent frame durations of adjacent game frames before the current game frame.

[0048] In this embodiment, since the jamming judgment of the current game frame needs to rely on the adjacent time consumption of the adjacent game frames before the current game frame, and there are no adjacent game frames before the starting game frame; thus, jamming analysis may not be performed on a preset number of starting game frames of the target game program; for example, jamming analysis may not be performed on the three game frames starting from the target game program, or jamming analysis may not be performed on the two game frames starting from the target game program.

[0049] For non-starting game frames, the jamming information of the current game frame can be determined based on the adjacent time consumption of the adjacent game frame before the current game frame; when the number of adjacent game frames is one, the adjacent time consumption of the adjacent game frame can be the frame time consumption of the adjacent game frame; when the number of adjacent game frames is multiple, the adjacent time consumption of the adjacent game frame can include the frame time consumption corresponding to each of the multiple adjacent game frames.

[0050] Based on a joint analysis of the current frame duration and the adjacent durations of adjacent game frames, the stuttering information of the current game frame can be determined; the stuttering information of the current game frame can indicate whether there is no stuttering in the current game frame or whether there is stuttering in the current game frame.

[0051] S230. When the jam information of the current game frame indicates that the current game frame has jammed, the function time corresponding to the at least one function group is obtained based on the time-consuming instrumented function corresponding to the at least one function group; the target game program includes multiple function groups and time-consuming instrumented functions corresponding to the multiple function groups; each function group includes at least one game program function, and the multiple function groups are determined based on the function category of each game program function in the target game program.

[0052] First, the multiple game program functions included in the target game program can be classified to obtain function groups corresponding to multiple function categories. Specifically, each function category can correspond to a function group. In this embodiment, the function category division can be based on different benchmarks; when the program function is classified based on the target of the program, function categories such as system-level programs and object-level programs can be obtained. In this embodiment, the system-level program includes STATGROUP_GPU, STATGROUP_Net, etc., and the object-level program includes STATGROUP_Object, STATGROUP_ObjectVerbose, etc.; when the program function is classified based on the program function, function categories such as physical program, logic program, and rendering program can be obtained.

[0053] Each function group may include at least one game program function, and each game program function may include at least one time-consuming instrumentation function. The location and number of time-consuming instrumentation functions may be determined based on the code information of the game program function. For example, a time-consuming instrumentation function may be inserted after every preset number of lines of code, or at specific code statements. The specific code statements may include loop statements such as for statements. When a game program function includes multiple time-consuming instrumentation functions, the multiple time-consuming instrumentation functions may be nested or in a parallel relationship.

[0054] Specifically, after determining the function category of the game program function, you can first declare the function time-consuming category of each category; make a specific stub function declaration for the function of this category; insert the stub function at the specific function location; then perform statistical control of each category; and finally derive the time consumption of the stuck function.

[0055] 1. The time-consuming categories of TestGroup are defined as follows:

[0056] DECLARE_STATS_GROUP(TEXT("TestGroupDesc"), STATGROUP_TestGroup,

[0057] STATCAT_Advanced); / / Define a group named TestGroup

[0058] 2. The time-consuming instrumentation function is declared as:

[0059] DECLARE_CYCLE_STAT(TEXT("Test1"), STAT_Test1, STATGROUP_TestGroup);

[0060] / / Define the embedding type and static embedding variable of Test1 and put them in the TestGroup group

[0061] DECLARE_CYCLE_STAT(TEXT("Test2"), STAT_Test2, STATGROUP_TestGroup);

[0062] / / Define the embedding type and static embedding variable of Test2 and put them in the TestGroup group

[0063]

[0064] According to the above time-consuming instrumentation function declaration, we define time-consuming instrumentation functions Test1, Test2, etc. under the TestGroup group.

[0065] 3. Take six time-consuming instrumented functions as an example. In the StatTest function, Test1, Test2, Test3, Test4, Test5, and Test6 are instrumented at various locations. The specific call relationship is Test1->Test2->Test3->Test4->Test5->Test6. The specific call time statistics are as follows:

[0066] Test1 559.568ms

[0067] Test2 557.414ms

[0068] Test3 541.354ms

[0069] Test4 532.492ms

[0070] Test5 532.460ms

[0071] Test1 took 559.568ms, including Test5 which took 532.460ms.

[0072] S240. Determine a lag factor corresponding to the current game frame based on the function duration corresponding to the at least one function group.

[0073] The function time corresponding to at least one function group includes the function time corresponding to each game program function in the corresponding function group. Therefore, by analyzing the function time corresponding to each game program function, the game program function that takes longer time can be determined, and then the lag factor of the current game frame can be determined.

[0074] In this application, the current frame time of the target game program in the current game frame can be directly obtained through the frame interval interface, without having to determine the current frame time by obtaining the running time of the game program function corresponding to the current game frame in real time, thereby avoiding the impact of conventional time statistics such as the running time of the game program function corresponding to the current game frame in real time on the game performance, and realizing lightweight data collection; and directly obtaining the current frame time through the frame interval interface can improve the efficiency of obtaining the current frame time. In addition, in this application, when it is determined that the current game frame is stuck, the function time corresponding to the corresponding function group is obtained based on the time-consuming plug-in function corresponding to the function group, thereby realizing function time statistics based on the function group dimension, improving the accuracy of determining the stuck factor; and function time statistics are performed when the game is stuck, and function time statistics are not performed when the game is not stuck, avoiding the impact of conventional time statistics on game performance. Furthermore, in this application, there is no need to perform game performance analysis by reconstructing the Test package, thereby simplifying the game stuck analysis process and improving the efficiency of game stuck analysis.

[0075] In this embodiment, the function time corresponding to the at least one function group includes the function time corresponding to each game program function in the at least one function group; accordingly, please refer to Figure 3 , which shows a method for determining a jam factor based on function time consumption, which may include:

[0076] S310. Receive a stuck function export instruction; the stuck function export instruction includes a function time consumption condition, a function root node condition, and a function call depth condition.

[0077] The function time consumption condition can be specifically that the function time consumption is greater than the preset time consumption; the function root node condition can be specifically a specified root node function. For example, if the function body of function a includes function b, function c..., then the corresponding function a is the function root node of function b, function c...; the function call depth condition can be the statistical maximum function call depth value.

[0078] In an example, the instruction for exporting the stuck function can be stat dumpframe-ms=.001-root=initviews-depth=10, where -ms=.001 means that the printing function takes more than 0.001ms, -root=initviews means that statistics are performed on the root node named initviews, and -depth=10 means that the maximum function call depth is 10.

[0079] S320. Determine a target lag function from each game program function of the at least one function group; the function time of the target lag function meets the function time condition, the root node of the target lag function meets the function root node condition, and the call depth of the target lag function meets the function call depth condition.

[0080] According to the function time consumption condition, function root node condition and function call depth condition included in the above-mentioned jam function export instruction, the target jam function that meets the function time consumption condition, function root node condition and function call depth condition is determined.

[0081] S330. Determine the jam factor based on the target jam function.

[0082] By exporting the jam function instruction, we can determine the target jam function that meets the function time conditions, function root node conditions, and function call depth conditions. We can then know that the target jam function may be one of the jam factors that causes the current game frame to jam.

[0083] In this embodiment, by generating corresponding lag function export instructions based on function time consumption conditions, function root node conditions and function call depth conditions, and exporting target lag functions from each game function based on the lag function export instructions, the target lag function is quickly exported without the need for other auxiliary screening work, thereby improving the export efficiency of the target lag function and further improving the efficiency of determining the lag factors.

[0084] In this embodiment, when the jam information of the current game frame indicates that the current game frame has jammed, obtaining the function time consumption corresponding to the at least one function group based on the time-consuming instrumented function corresponding to the at least one function group includes:

[0085] In a case where the jam information of the current game frame indicates that jamming occurs in the current game frame, in response to the function grouping specifying instruction, determining at least one function group corresponding to the function grouping specifying instruction;

[0086] The function time consumption corresponding to the at least one function group is obtained based on the time-consuming instrumented function corresponding to the at least one function group.

[0087] If the current game frame is experiencing lag, you can flexibly select the function groups for which function timing statistics should be collected. Some of the multiple function groups may not cause the current game frame to lag, so function timing statistics are not required for these function groups. However, function timing statistics should be collected for function groups that may cause lag. Alternatively, the user can determine at least one function group for which function timing statistics should be collected based on historical analysis results.

[0088] Specifically, in this embodiment, the statistics of all function category items can be enabled through the instruction stat group all; if extremely lightweight function category statistical control is required, the statistics of all items can be turned off through the instruction stat group none, and then statistics can be performed on a single function category, such as stat group enable ShadowRendering to enable statistics for the ShadowRendering function category.

[0089] By specifying the function groups that need to be counted for function time consumption, and obtaining the corresponding function time consumption based on the time-consuming stub functions corresponding to the specified function groups, flexible acquisition of function time consumption can be achieved; and by specifying function groups, function groups that will not cause the current game frame to be stuck can be filtered out, which can reduce the number of game program functions that need to obtain function time consumption, reduce the system's data processing volume, and improve the efficiency of obtaining function time consumption.

[0090] Furthermore, the current game frame is obtained through drawing, so the drawing process of the current game frame can be analyzed; for details, please refer to Figure 4 , which shows a method for determining a jamming factor based on a drawing record, which may include:

[0091] S410. When the jamming information of the current game frame indicates that the current game frame has jammed, obtain a current drawing list corresponding to the current game frame; the current drawing list includes multiple drawing records in drawing the current game frame.

[0092] In this embodiment, detailed information about the DC drawing the current game frame can be obtained, that is, the current drawing list corresponding to the current game frame can be obtained. Each drawing operation response will generate a drawing record. Each drawing record includes the current drawing material name, instance number, Mesh face number, VertexShaderID (VSID), PixelsShaderID (PSID), TextureID, texture name, format, size, and texture thumbnail information; as shown in Table 1:

[0093] Table 1

[0094]

[0095]

[0096] In the above table, each row can be regarded as a drawing record. The drawing records in Table 1 are all drawing records for the same type of Mesh (Baltic_Grass01).

[0097] S420. Determine at least one group of drawing records to be merged from the multiple drawing records; each group of drawing records to be merged includes multiple drawing records, and each group of drawing records to be merged corresponds to the same mesh drawing object.

[0098] In this embodiment, the same mesh drawing object can refer to the same mesh and the same material. For example, in Table 1, the drawing records with EventIDs 1498, 1512, and 1526 all have a Mesh Name of Baltic_Grass01 and a Material Name of Master_Grass_Billboard. These records are considered to correspond to the same mesh drawing object, and the drawing records with EventIDs 1498, 1512, and 1526 form a group of drawing records to be merged. Similarly, in Table 1, the drawing records with EventIDs 7 and 2085 all have a Mesh Name of Baltic_Grass01 and a Material Name of Master_Grass_EarlyZ. These records are considered to correspond to the same mesh drawing object, and the drawing records with EventIDs 7 and 2085 form a group of drawing records to be merged.

[0099] S430. Determine the jamming factor based on the function duration corresponding to the at least one function group and the at least one group of drawing records to be merged.

[0100] For drawing operations corresponding to the same mesh drawing objects, batch processing is generally required. If batch processing is not performed, it may lead to more drawing operations, which in turn leads to longer drawing time and occupies more system resources. By analyzing the drawing records corresponding to the current game frame, the drawing records to be merged are determined. Therefore, these drawing operations that should be batched but are not actually batched during operation may be the factors affecting the current game frame lag. By analyzing the drawing records, it is possible to find factors that may affect the lag from the drawing dimension, thereby improving the accuracy and efficiency of the analysis of the current game frame drawing operations, and thus improving the accuracy and efficiency of determining the lag factors.

[0101] Furthermore, the drawing operation for the current game frame can be implemented based on the corresponding drawing code; accordingly, please refer to Figure 5 , which shows a method for determining a jam factor based on drawing code analysis, which may include:

[0102] S510. When the jamming information of the current game frame indicates that the current game frame has jammed, obtain a current frame drawing code corresponding to the current game frame.

[0103] The shader code used in the current game frame drawing process can be obtained through the previous DC analysis.

[0104] S520. Parse the current frame drawing code to obtain vertex processing code and shader processing code.

[0105] By parsing the Shader code, you can get the vertex processing code VS and the shader processing code FS.

[0106] S530. Perform static simulation analysis on the vertex processing code and the shader processing code to obtain the running time corresponding to the vertex processing code and the running time corresponding to the shader processing code.

[0107] Using the Mali Offline Compiler tool, you can specify the model platform for compilation, such as specifying compilation for the Mali T860 chip, and then obtain the Arithmetic (arithmetic operation instruction time), Load / Store (read and store instruction time), and Texture (sampling map time) of VS and FS respectively through static simulation analysis. Based on the Arithmetic (arithmetic operation instruction time), Load / Store (read and store instruction time), and Texture (sampling map time) corresponding to VS, the running time corresponding to the vertex processing code can be determined. Based on the Arithmetic (arithmetic operation instruction time), Load / Store (read and store instruction time), and Texture (sampling map time) corresponding to FS, the running time corresponding to the shader processing code can be determined.

[0108] S540. Determine the jamming factor based on the function time corresponding to the at least one function group, the running time corresponding to the vertex processing code, and the running time corresponding to the shader processing code.

[0109] The running time corresponding to the vertex processing code and the running time corresponding to the shader processing code in the drawing code have a certain impact on the running of the current game frame. In this embodiment, the corresponding vertex processing code and shader processing code can be obtained by obtaining the drawing code and parsing the drawing code. The running time corresponding to the vertex processing code and the running time corresponding to the shader processing code are further obtained by static simulation analysis, which improves the convenience and efficiency of the running time corresponding to the vertex processing code and the running time corresponding to the shader processing code. The stuttering factor is determined based on the running time corresponding to the vertex processing code and the running time corresponding to the shader processing code, which can improve the efficiency of determining the stuttering factor.

[0110] If there is semi-transparent drawing in the current game frame, there may be an overdraw problem. Overdraw means that in each rendering cycle, each pixel on the screen is ideally rendered only once, but due to the overlap of UI elements, the pixel will be rendered multiple times. Each rendering from the CPU stage to the GPU stage consumes a lot of resources. If this situation is serious, it will cause lag. Figure 6 , which shows a method for determining a jamming factor based on a semi-transparent drawing operation, which may include:

[0111] S610. When the jam information of the current game frame indicates that the current game frame has jammed, obtain a semi-transparent drawing operation corresponding to the current game frame.

[0112] The semi-transparent drawing operation in this embodiment may be a drawing operation when drawing a semi-transparent image portion, and each drawing operation may perform color drawing on one or more pixels; the semi-transparent drawing operation corresponding to the current game frame may refer to a drawing operation performed when drawing the semi-transparent image portion in the current game frame.

[0113] S620. Perform color replacement on the pixel points corresponding to the semi-transparent drawing operation based on the target color. When the color replacement is completed, count the number of color replacements corresponding to each pixel point; the pixel point is a pixel point in the current game frame.

[0114] The target color can be any color, such as red, yellow, or blue. Each pixel required for a semi-transparent drawing operation is painted to the target color. Once the color replacement is complete, the number of color replacements for each pixel is counted. Each pixel here refers to the pixel associated with the semi-transparent drawing operation. For any given pixel, multiple different semi-transparent drawing operations may have performed the same drawing operation on that pixel, resulting in the pixel being drawn multiple times.

[0115] After determining the number of color replacements corresponding to each pixel, we can determine the proportion of OverDraw as 1 layer, 2 layers, 3 layers, 4 layers, 5 layers..., the average number of OverDraw layers, and the maximum number of OverDraw layers; the number of times a pixel is subjected to semi-transparent drawing operations (corresponding to the number of color replacements) is the number of drawing layers for the pixel.

[0116] S630. Determine the jamming factor based on the function time corresponding to the at least one function group and the number of color replacements corresponding to each pixel point.

[0117] The problem of overdrawing consumes a large amount of system resources, which may affect the drawing process of the current game frame. Therefore, it is necessary to perform overdrawing analysis on the drawing process of the current game frame to determine the overdrawing problem in the current game frame. In this embodiment, the color of each pixel involved in the semi-transparent drawing operation is replaced by color replacement, and the number of color replacements for each pixel is counted to determine the number of drawing layers corresponding to each pixel, thereby improving the convenience of determining the number of semi-transparent drawing layers, and correspondingly improving the efficiency of determining the stuttering factor; based on the pixels drawn as the target color, the image area where the semi-transparent drawing is mainly concentrated can be determined, providing a basis for subsequent semi-transparent drawing optimization. The semi-transparent drawing optimization can specifically include reducing the number of drawing layers for the same pixel, deleting semi-transparent drawing operations corresponding to unimportant image parts, etc.

[0118] In this embodiment, adjacent frames include multiple historical game frames that are adjacent to and continuous with the current game frame; Figure 7 , which shows a method for determining jam information, which may include:

[0119] S710. Obtain the frame durations corresponding to the multiple historical game frames based on the frame interval interface.

[0120] The frame interval interface in this embodiment may refer to an interface for obtaining the time interval between two adjacent game frames, specifically Delta Seconds, and then the time interval between the obtained current game frame and the adjacent previous game frame may be determined as the current frame time of the current game frame; the time interval between two adjacent game frames may be a game performance parameter collected in real time based on changes in the game frame screen during the running of the target game program, without the need for collection through other auxiliary tools.

[0121] If the current game frame is the Nth frame and the number of historical game frames is n, the multiple historical game frames may include the N-1th frame, the N-2th frame...the Nnth frame.

[0122] The frame times corresponding to n historical game frames are Last1FrameTime, Last2FrameTime, ... LastnFrameTime.

[0123] S720: Determine an average frame duration based on the frame durations corresponding to the multiple historical game frames.

[0124] Average frame time AvgLastnFrameTime

[0125] =(Last1FrameTime+Last2FrameTime+...LastnFrameTime) / n.

[0126] S730. Determine the jamming information of the current game frame based on the comparison result of the current frame duration, the average frame duration and the jamming threshold duration.

[0127] In this embodiment, the stuttering threshold duration may include a mild stuttering threshold duration and a severe stuttering threshold duration. The mild stuttering threshold duration, FrameTimeThreshold, may be 1000 / 24*x ms, and the severe stuttering threshold duration, FrameTimeThreshold2, may be 1000 / 24*y ms, where x is less than y. The values of x and y may be set based on the specific application scenario. The current frame duration may be recorded as FrameTime. If the current frame duration, FrameTime, satisfies (FrameTime > AvgLastnFrameTime * 2) && (FrameTime > FrameTimeThreashold), the current game frame is determined to be slightly stuttered. If the current frame duration, FrameTime, satisfies (FrameTime > AvgLastnFrameTime * 2) && (FrameTime > FrameTimeThreashold2), the current game frame is determined to be severely stuttered. The stuttering information in this embodiment may include whether the current game frame is stuttering or not. If the current game frame is stuttering, it may further be determined whether it is slightly stuttering or severely stuttering.

[0128] In this embodiment, the frame duration of multiple adjacent game frames before the current game frame and the stuttering threshold duration are compared to determine the stuttering information of the current game frame; the average frame duration of multiple historical game frames can represent the average level of frame duration, avoiding the problem of incorrect judgment caused by stuttering judgment based solely on the current frame duration; further combined with the stuttering threshold duration in each application scenario, the stuttering information determination method can be applied to each application scenario, thereby improving the scenario applicability of the stuttering information determination method and the accuracy of the stuttering information determination.

[0129] It should be noted that the above methods in this embodiment can be combined based on actual application scenarios and have corresponding beneficial effects, which will not be described in detail here.

[0130] The game lag analysis method in this embodiment collects performance data in the most lightweight way possible, avoiding the impact of conventional time-consuming statistics on game performance. It only performs full CPU and GPU analysis when lags occur, greatly improving the effectiveness and accuracy of performance analysis data and significantly shortening the overall lag optimization time.

[0131] See also Figure 8 This embodiment also provides a game jam analysis device, including:

[0132] The current frame time acquisition module 810 is used to acquire the current frame time of the target game program in the current game frame based on the frame interval interface;

[0133] A jam information determination module 820 is configured to determine jam information of the current game frame based on the current frame duration and the adjacent frame durations of adjacent game frames before the current game frame;

[0134] A function time-consuming acquisition module 830 is configured to acquire the function time corresponding to at least one function group based on a time-consuming instrumented function corresponding to at least one function group, when the jam information of the current game frame indicates that the current game frame has jammed; the target game program includes multiple function groups and time-consuming instrumented functions corresponding to each of the multiple function groups; each function group includes at least one game program function, and the multiple function groups are determined based on the function categories of the game program functions in the target game program;

[0135] The jam factor determination module 840 is used to determine the jam factor corresponding to the current game frame based on the function time corresponding to the at least one function group.

[0136] Furthermore, the function time consumption corresponding to the at least one function group includes the function time consumption corresponding to each game program function in the at least one function group;

[0137] The jam factor determination module 840 includes:

[0138] An export instruction receiving module is used to receive a stuck function export instruction; the stuck function export instruction includes a function time consumption condition, a function root node condition, and a function call depth condition;

[0139] a target lag function determination module, configured to determine a target lag function from each game program function of the at least one function group; the function time of the target lag function satisfies the function time condition, the root node of the target lag function satisfies the function root node condition, and the call depth of the target lag function satisfies the function call depth condition;

[0140] A first determination module is used to determine the jamming factor based on the target jamming function.

[0141] Furthermore, the function time-consuming acquisition module 830 includes:

[0142] a function grouping determination module configured to, in response to a function grouping designation instruction, determine at least one function group corresponding to the function grouping designation instruction when the jamming information of the current game frame indicates that jamming has occurred in the current game frame;

[0143] The group time-consuming acquisition module is used to acquire the function time-consuming corresponding to the at least one function group based on the time-consuming instrumented function corresponding to the at least one function group.

[0144] Furthermore, the device further comprises:

[0145] a current drawing list acquisition module, configured to acquire a current drawing list corresponding to the current game frame when the jamming information of the current game frame indicates that the current game frame has jammed; the current drawing list includes a plurality of drawing records for drawing the current game frame;

[0146] a merged drawing record determining module, configured to determine at least one group of drawing records to be merged from the plurality of drawing records; each group of drawing records to be merged includes a plurality of drawing records, and each group of drawing records to be merged corresponds to the same mesh drawing object;

[0147] The jam factor determination module 840 includes:

[0148] The second determining module is configured to determine the jamming factor based on the function time consumption corresponding to the at least one function group and the at least one group of drawing records to be merged.

[0149] Furthermore, the device further comprises:

[0150] a drawing code acquisition module, configured to acquire a current frame drawing code corresponding to the current game frame when the jam information of the current game frame indicates that the current game frame has jammed;

[0151] A code parsing module, configured to parse the current frame drawing code to obtain vertex processing code and shader processing code;

[0152] A static simulation module, configured to perform static simulation analysis on the vertex processing code and the shader processing code to obtain the running time corresponding to the vertex processing code and the running time corresponding to the shader processing code;

[0153] The jam factor determination module 840 includes:

[0154] The third determination module is used to determine the jamming factor based on the function time corresponding to the at least one function group, the running time corresponding to the vertex processing code, and the running time corresponding to the shader processing code.

[0155] Furthermore, the device further comprises:

[0156] A drawing operation acquisition module, configured to acquire a semi-transparent drawing operation corresponding to the current game frame when the jam information of the current game frame indicates that the current game frame has jammed;

[0157] a replacement count statistics module, configured to perform color replacement on the pixel points corresponding to the semi-transparent drawing operation based on the target color, and count the number of color replacements corresponding to each pixel point when the color replacement is completed; the pixel points are the pixel points in the current game frame;

[0158] The jam factor determination module 840 includes:

[0159] The fourth determination module is used to determine the jamming factor based on the function time corresponding to the at least one function group and the number of color replacements corresponding to each pixel point.

[0160] Furthermore, the adjacent frames include a plurality of historical game frames that are adjacent to and continuous with the current game frame;

[0161] The jam information determination module 820 includes:

[0162] A historical frame duration acquisition module, configured to acquire the frame durations corresponding to the plurality of historical game frames based on the frame interval interface;

[0163] An average frame time determination module, configured to determine an average frame time based on the frame times corresponding to the plurality of historical game frames;

[0164] The region determination module is used to determine the jamming information of the current game frame based on the comparison result of the current frame duration, the average frame duration and the jamming threshold duration.

[0165] The apparatus provided in the above embodiments can execute the method provided in any embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution of the method. For technical details not fully described in the above embodiments, please refer to the method provided in any embodiment of the present application.

[0166] This embodiment further provides a computer-readable storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or at least one program is loaded by a processor and executed by any of the above methods of this embodiment.

[0167] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the above methods.

[0168] Figure 9This is a block diagram of an electronic device for game jam analysis according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 9 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a game jam analysis method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse.

[0169] Figure 10 This is a block diagram of an electronic device for game jam analysis according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Figure 10 As shown. The electronic device includes a processor, a memory, and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a game jam analysis method is implemented.

[0170] Those skilled in the art will understand that Figure 9 and Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0171] This specification provides method operation steps as described in the embodiments or flowcharts, but more or fewer operation steps may be included based on routine or non-creative work. The steps and order listed in the embodiments are only one way of executing the order of many steps and do not represent the only execution order. When an actual system or interrupt product is executed, it can be executed sequentially or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment).

[0172] The structure shown in this embodiment is only a partial structure related to the scheme of the present application, and does not constitute a limitation on the device to which the scheme of the present application is applied. The specific device may include more or fewer components than shown, or combine certain components, or have different arrangements of components. It should be understood that the methods, devices, etc. disclosed in this embodiment can be implemented in other ways. For example, the device embodiment described above is only schematic. For example, the division of the modules is only a division of logical functions. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or unit modules.

[0173] Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this application. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.

[0174] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0175] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for analyzing game jamming, characterized in that: include: Get the current frame time of the target game program in the current game frame based on the frame interval interface; Determining jamming information of the current game frame based on the current frame duration and adjacent frame durations of adjacent game frames before the current game frame; When the jam information of the current game frame indicates that the current game frame has jammed, obtaining a function time corresponding to the at least one function group based on a time-consuming instrumented function corresponding to the at least one function group; the target game program includes a plurality of function groups and time-consuming instrumented functions corresponding to each of the plurality of function groups; each function group includes at least one game program function, and the plurality of function groups are determined based on a function category of each game program function in the target game program; Based on the function time corresponding to the at least one function group, a jamming factor corresponding to the current game frame is determined.

2. The method according to claim 1, characterized in that The function time consumption corresponding to the at least one function group includes the function time consumption corresponding to each game program function in the at least one function group; Determining the jam factor corresponding to the current game frame based on the function time consumption corresponding to the at least one function group includes: Receive a jam function export instruction; the jam function export instruction includes a function time consumption condition, a function root node condition, and a function call depth condition; Determining a target lag function from each game program function of the at least one function group; the function time of the target lag function meets the function time condition, the root node of the target lag function meets the function root node condition, and the call depth of the target lag function meets the function call depth condition; The jam factor is determined based on the target jam function.

3. The method according to claim 1 or 2, characterized in that When the jam information of the current game frame indicates that jam occurs in the current game frame, obtaining the function time consumption corresponding to the at least one function group based on the time-consuming instrumented function corresponding to the at least one function group includes: In a case where the jam information of the current game frame indicates that jamming occurs in the current game frame, in response to the function grouping specifying instruction, determining at least one function group corresponding to the function grouping specifying instruction; The function time consumption corresponding to the at least one function group is obtained based on the time-consuming instrumented function corresponding to the at least one function group.

4. The method according to claim 1, wherein The method further comprises: When the jamming information of the current game frame indicates that the current game frame has jammed, obtaining a current drawing list corresponding to the current game frame; the current drawing list includes a plurality of drawing records for drawing the current game frame; determining at least one group of drawing records to be merged from the plurality of drawing records; each group of drawing records to be merged includes a plurality of drawing records, and each group of drawing records to be merged corresponds to the same mesh drawing object; The determining, based on the function duration corresponding to the at least one function group, a jamming factor corresponding to the current game frame includes: The jamming factor is determined based on the function time consumption corresponding to the at least one function group and the at least one group of drawing records to be merged.

5. The method according to claim 1 or 4, characterized in that The method further comprises: When the jam information of the current game frame indicates that the current game frame is jammed, obtaining a current frame drawing code corresponding to the current game frame; Parsing the current frame drawing code to obtain vertex processing code and shader processing code; Performing static simulation analysis on the vertex processing code and the shader processing code to obtain the running time corresponding to the vertex processing code and the running time corresponding to the shader processing code; The determining, based on the function duration corresponding to the at least one function group, a jamming factor corresponding to the current game frame includes: The jamming factor is determined based on the function time corresponding to the at least one function group, the running time corresponding to the vertex processing code, and the running time corresponding to the shader processing code.

6. The method according to claim 1, characterized in that The method further comprises: When the jam information of the current game frame indicates that the current game frame is jammed, obtaining a semi-transparent drawing operation corresponding to the current game frame; Performing color replacement on the pixel points corresponding to the semi-transparent drawing operation based on the target color, and counting the number of color replacements corresponding to each pixel point when the color replacement is completed; the pixel point is a pixel point in the current game frame; The determining, based on the function duration corresponding to the at least one function group, a jamming factor corresponding to the current game frame includes: The jamming factor is determined based on the function time corresponding to the at least one function group and the number of color replacements corresponding to each pixel point.

7. The method according to claim 1, characterized in that The adjacent frames include a plurality of historical game frames that are adjacent to and continuous with the current game frame; The determining of the jamming information of the current game frame based on the current frame duration of the current game frame and the adjacent frame durations of adjacent game frames before the current game frame includes: Obtaining the frame durations corresponding to the plurality of historical game frames based on the frame interval interface; Determine an average frame duration based on the frame durations respectively corresponding to the plurality of historical game frames; Based on the comparison result of the current frame duration, the average frame duration and the stuttering threshold duration, the stuttering information of the current game frame is determined.

8. A game jam analysis device, characterized in that: include: The current frame time acquisition module is used to obtain the current frame time of the target game program in the current game frame based on the frame interval interface; a jam information determination module, configured to determine jam information of the current game frame based on the current frame duration and the adjacent frame durations of adjacent game frames preceding the current game frame; A function time-consuming acquisition module is configured to, when the jam information of the current game frame indicates that the current game frame has jammed, acquire the function time corresponding to at least one function group based on the time-consuming instrumented function corresponding to at least one function group; the target game program includes a plurality of function groups and time-consuming instrumented functions corresponding to each of the plurality of function groups; each function group includes at least one game program function, and the plurality of function groups are determined based on the function category of each game program function in the target game program; A jam factor determination module is used to determine a jam factor corresponding to the current game frame based on the function time corresponding to the at least one function group.

9. An electronic device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game lag analysis method as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to perform the game jam analysis method according to any one of claims 1 to 7.