Performance parameter acquisition method and device, computer equipment and storage medium
By obtaining the rendering operation information of the application rendering screen, reconstructing the screen information, and generating performance parameters, the problem of poor applicability of performance analysis in the existing technology is solved, and efficient and dependency-free performance analysis is achieved.
Patent Information
- Application Number
- CN202510417178.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, the performance analysis method of application needs to be carried out in a specific environment, resulting in poor applicability and inability to perform effective performance analysis in any application or screen.
By obtaining the rendering operation information of the application rendering any frame of the screen, reconstructing the screen information, generating performance parameters, independent of the development framework and operation environment, avoiding modifying the application code or building a specific test environment, and realizing performance analysis.
It realizes efficient performance analysis without affecting the operation of the application, saves analysis time and code modification costs, and expands the scope of application.
Smart Images

Figure CN120353674A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technologies, and in particular, to a method and apparatus for obtaining performance parameters, a computer device, and a storage medium. Background Art
[0002] With the development of computer technologies, applications are becoming increasingly rich and diverse. For example, the applications include game applications, shopping applications, multimedia applications, etc. During the operation of an application, the application will render a picture for the user to view. Generally, in order to optimize the application, it is necessary to analyze the resource utilization situation when the application renders each picture. However, the current performance analysis method for pictures can only be implemented in a specific environment, resulting in poor applicability. Summary of the Invention
[0003] The embodiments of the present application provide a method and apparatus for obtaining performance parameters, a computer device, and a storage medium, which can improve applicability. The technical solutions are as follows:
[0004] On the one hand, a method for obtaining performance parameters is provided. The method includes:
[0005] Obtaining n rendering operation information of any frame of a picture in an application, where the n rendering operation information is obtained during the process of the application rendering the picture, the rendering operation information indicates the display positions of at least one display element in the picture, and n is an integer greater than 1;
[0006] Rendering the picture based on each rendering operation information to obtain picture information corresponding to each rendering operation information, where the picture information indicates the pixel values assigned to each pixel point in the picture based on the rendering operation information;
[0007] Generating performance parameters corresponding to the picture based on the picture information corresponding to the n rendering operation information, where the performance parameters indicate the resource utilization situation during the process of the application rendering the picture.
[0008] In a possible implementation manner, the fusing the picture information corresponding to the n rendering operation information to obtain fused picture information includes:
[0009] Fusing the pixel values of the same pixel point in the picture information corresponding to the n rendering operation information to obtain the fused picture information.
[0010] On the other hand, a device for obtaining performance parameters is provided. The device includes:
[0011] An acquisition module, configured to acquire n rendering operation information of any frame of a picture in an application, where the n rendering operation information is obtained during the process of the application rendering the picture, the rendering operation information indicates the display positions of at least one display element in the picture, and n is an integer greater than 1;
[0012] A rendering module, configured to render the picture based on each rendering operation information to obtain picture information corresponding to each rendering operation information, where the picture information indicates the pixel values assigned to each pixel point in the picture based on the rendering operation information;
[0013] A generation module, configured to generate performance parameters corresponding to the picture based on the picture information corresponding to the n rendering operation information, where the performance parameters indicate the resource utilization situation during the process of the application rendering the picture.
[0014] In a possible implementation manner, the rendering operation information includes first vertex information, and the first vertex information indicates the vertex positions of the display element; the rendering module is configured to render the picture based on the first vertex information in each rendering operation information to obtain picture information corresponding to each rendering operation information.
[0015] In another possible implementation manner, the first vertex information includes the vertex coordinates of the display element; the rendering module is configured to perform coordinate system conversion on the vertex coordinates in the first vertex information to obtain second vertex information, where the second vertex information indicates the vertex coordinates of the display element in the screen coordinate system; based on the second vertex information, first pixel points are determined from the pixel points included in the picture, and the first pixel points are the pixel points occupied by the display element in the picture; the first pixel points in the picture are rendered to obtain picture information corresponding to the rendering operation information.
[0016] In another possible implementation manner, the rendering module is configured to render the pixel value of the first pixel point in the picture as a first pixel value and render the pixel value of a second pixel point in the picture as a second pixel value to obtain picture information corresponding to the rendering operation information, where the second pixel point is a pixel point other than the first pixel point in the picture.
[0017] In another possible implementation manner, the rendering module is configured to render the picture based on the first pixel value, the second pixel value, and the rendering operation information, so as to obtain picture information corresponding to the rendering operation information. The picture information indicates that the pixel value of the first pixel point in the picture is the first pixel value and the pixel value of the second pixel point is the second pixel value. The first pixel point is the pixel point occupied by the display element in the picture, and the second pixel point is the pixel point in the picture other than the first pixel point.
[0018] In another possible implementation manner, the performance parameter includes indication information, and the indication information indicates invalid rendering operation information among the n rendering operation information; the generating module is configured to determine the invalid rendering operation information from the n rendering operation information based on the picture information corresponding to the n rendering operation information; and generate the indication information based on the invalid rendering operation information.
[0019] In another possible implementation manner, the picture information indicates that the pixel value of the first pixel point in the picture is the first pixel value and the pixel value of the second pixel point is the second pixel value. The first pixel point is the pixel point occupied by the display element in the picture, and the second pixel point is the pixel point in the picture other than the first pixel point; the generating module is configured to, when the pixel points indicated by any picture information are all the second pixel value, determine the rendering operation information corresponding to the picture information as the invalid rendering operation information.
[0020] In another possible implementation manner, the performance parameter includes a rendering frequency graph, and the rendering frequency graph indicates the rendering frequency of each pixel point during the process of the application rendering the picture; the generating module is configured to fuse the picture information corresponding to the n rendering operation information to obtain fused picture information; and render the fused picture information to obtain the rendering frequency image.
[0021] In another possible implementation manner, the generating module is configured to fuse the pixel values of the same pixel point in the picture information corresponding to the n rendering operation information to obtain the fused picture information.
[0022] In another possible implementation manner, the performance parameter indicates the rendering precision corresponding to the n rendering operation information; the generating module is configured to determine the number of pixel points occupied by the display element in the picture in the picture information based on the pixel values of each pixel point in the picture information corresponding to the rendering operation information; determine the number of vertices of the display element in the picture information based on the rendering operation information corresponding to the picture information; and determine the ratio of the number of vertices to the number of pixel points as the rendering precision corresponding to the rendering operation information.
[0023] In another possible implementation manner, the obtaining module is configured to obtain the data used by the application when rendering the picture during the process of the application rendering the picture; and parse the obtained data to obtain the n rendering operation information.
[0024] In another possible implementation manner, the apparatus further includes:
[0025] A establishing module, configured to establish a binding relationship with the application by operating an obtaining tool;
[0026] The obtaining module is configured to, when the operating obtaining tool has a binding relationship with the application, obtain the data used by the application when rendering the picture during the process of the application rendering the picture through the operating obtaining tool.
[0027] On the other hand, a computer device is provided, the computer device includes a processor and a memory, and at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the performance parameter obtaining method as described in the above aspect.
[0028] On the other hand, a computer-readable storage medium is provided, and at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the operations performed by the performance parameter obtaining method as described in the above aspect.
[0029] In still another aspect, a computer program product is provided, including a computer program, and the computer program, when executed by a processor, implements the operations performed by the performance parameter obtaining method as described in the above aspect.
[0030] In the solution provided by the embodiments of the present application, when the rendering operation information used for rendering any frame of the application is obtained, the method of reconstructing the screen is adopted to reconstruct the screen information corresponding to each rendering operation information. Then, the resource utilization situation during the application rendering process is determined by using the screen information corresponding to each rendering operation information, and the performance parameters corresponding to the screen are obtained. This method of obtaining performance parameters is completely independent of the development framework and operating environment of the application, and there is no need to modify the application code or rely on a specific performance testing environment. It realizes a performance analysis mechanism that does not affect the operation of the application. Only by obtaining the rendering operation information corresponding to the screen can the performance analysis of the screen be realized, saving the time required for running the application or creating its operating environment during performance analysis, and also saving the time required for modifying the application code or building a specific performance testing environment. It improves the performance analysis efficiency and also reduces the technical threshold of performance analysis. It can be applied to any application or any screen, expanding the applicable range of the performance parameter acquisition method, that is, improving the applicability of the performance parameter acquisition method. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0032] Figure 1 is a block diagram of the structure of a computer system provided by the embodiments of the present application;
[0033] Figure 2 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application;
[0034] Figure 3 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application;
[0035] Figure 4 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application;
[0036] Figure 5 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application;
[0037] Figure 6 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application;
[0038] Figure 7 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application;
[0039] Figure 8It is a flowchart of an image for obtaining rendering frequency provided by an embodiment of the present application;
[0040] Figure 9 It is a schematic diagram of a flame graph provided by an embodiment of the present application;
[0041] Figure 10 It is a schematic structural diagram of a performance parameter acquisition device provided by an embodiment of the present application;
[0042] Figure 11 It is a schematic structural diagram of a performance parameter acquisition device provided by an embodiment of the present application;
[0043] Figure 12 It is a schematic structural diagram of a terminal provided by an embodiment of the present application;
[0044] Figure 13 It is a schematic structural diagram of a server provided by an embodiment of the present application. Detailed implementation manners
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0046] The terms "first", "second", etc. used in the present application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the present application, the first pixel point may be referred to as the second pixel point, and similarly, the second pixel point may be referred to as the first pixel point.
[0047] The terms "at least one", "multiple", "each", "any one" used in the present application, at least one includes one, two, or more than two, multiple includes two or more than two, and each refers to each of the corresponding multiple, and any one refers to any one of the multiple. For example, multiple pixel points include 3 pixel points, and each refers to each of these 3 pixel points, and any one refers to any one of these 3 pixel points, which can be the first pixel point, or the second pixel point, or the third pixel point.
[0048] It should be noted that the collection and processing of relevant data (such as including rendering operation information, screen information, performance parameters, etc.) in the present application should strictly comply with the requirements of relevant national laws and regulations during actual application, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behaviors within the scope authorized by laws and regulations and the personal information subject.
[0049] The performance parameter acquisition method provided by the embodiments of this application is executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster composed of multiple physical servers. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc., but is not limited thereto.
[0050] Figure 1 is a structural block diagram of a computer system provided by the embodiments of this application. Refer to Figure 1 As shown in the figure, the computer system includes a terminal 101 and a server 102.
[0051] The terminal 101 is used to obtain n rendering operation information of any frame of the application and send the n rendering operation information to the server 102. The server 102 is used to receive the n rendering operation information sent by the terminal 101, generate the performance parameters corresponding to the frame according to the solution provided by the embodiments of this application, and send the performance parameters to the terminal 101 so that the terminal 101 receives and displays the performance parameters.
[0052] In some embodiments, the terminal 101 installs and runs an application 111 provided by the server 102. Optionally, the application 111 is any type of application. For example, the application 111 is a performance analysis application. The terminal 101 is a terminal used by a user. The user uses the terminal 101 to log in to the application 111 based on an object. The terminal 101 is used to obtain n rendering operation information of any frame of the application through the application 111 and send the n rendering operation information to the server 102; receive the performance parameters returned by the server 102 through the application 111 and display the performance parameters.
[0053] The terminal 101 is connected to the server 102 through a wireless network or a wired network. The server 102 is used to provide background services for the application 111. Exemplarily, the server 102 includes a processor and a memory. The memory further includes a receiving module and a sending module. The receiving module is used to receive requests sent by the terminal 101, such as performance analysis requests, etc.; the processor is used to respond to the received requests; the sending module is used to send responses to the terminal 101, such as sending performance parameters to the terminal 101. Optionally, the server 102 undertakes the main computing work, and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work.
[0054] Those skilled in the art can know that the number of the above terminals can be more or less. For example, there can be only one of the above terminals, or there can be dozens or hundreds of the above terminals, or even more. The embodiments of this application do not limit the number and device type of the terminals.
[0055] Figure 2 It is a flowchart of a method for obtaining performance parameters provided by an embodiment of the present application. Taking the case where this method is executed by a computer device as an example, as Figure 2 shown, this method includes:
[0056] 201. The computer device obtains n rendering operation information of any frame of the application. The n rendering operation information is obtained during the process of the application rendering the screen. The rendering operation information indicates the display positions of at least one display element in the screen, and n is an integer greater than 1.
[0057] In the embodiment of the present application, for any device, during the process of the application rendering any frame of the screen, the device will render the screen based on multiple rendering operation information. Each rendering operation information is the information used by a rendering operation. Different rendering operation information is used to render different display elements in the screen, that is, the device respectively executes corresponding rendering operations based on multiple rendering operation information to render the screen. By obtaining the n rendering operation information used when the application renders any frame of the screen, it is possible to reconstruct the screen based on the n rendering operation information subsequently, so as to determine the resource utilization situation when the application renders the screen during the process of reconstructing the screen.
[0058] Among them, the application is an application of any type. For example, the application is a game application, an instant messaging application, a shopping application, etc. The screen is any screen included in the application. For example, the screen is the main interface screen of the application, or the screen is any frame of the screen used to display a virtual scene in a game application. The rendering operation is used to render at least one element included in the screen during the process of rendering the screen. For example, the rendering operation is Draw Call (drawing call). The rendering operation information refers to the information used to execute the rendering operation, and the rendering operation information indicates the rendering target of the rendering operation. The rendering operation information can be information of any type. For example, the rendering operation information is represented in the form of text, or in the form of other files. The display element refers to an element that can be displayed when the application displays the screen. For example, taking the application as a game application as an example, the display element is a virtual object, a virtual object, a virtual special effect in the virtual scene; or, taking the application as an instant messaging application as an example, the display element is a button, an input box, etc. in a certain interface of the application.
[0059] In the embodiments of the present application, considering that there are many display elements in any screen, based on the multiple display elements in the screen, n rendering operations are divided. Different rendering operations are used to render different display elements in the screen, so that each rendering operation can render at least one display element in the screen. In this way, different display elements in the screen can be rendered separately, and then the screen can be rendered. In this way, based on the n rendering operation information, the process of the application rendering this screen can be reconstructed, and then the resource utilization situation in the process of the application rendering this screen can be determined.
[0060] 202. The computer device renders the screen based on each rendering operation information, and obtains the screen information corresponding to each rendering operation information. The screen information indicates the pixel values assigned to each pixel point in the screen based on the rendering operation information.
[0061] In the embodiments of the present application, since each rendering operation information indicates the display positions of at least one display element in the screen, each rendering operation information is used to render the indicated display element. Therefore, for any one of the n rendering operation information, based on this rendering operation information, the entire screen can be rendered to render the display element indicated by this rendering operation information. In this way, the pixel value of each pixel point in the screen can be determined, so that the pixel values of each pixel point in the screen can reflect the display element indicated by the rendering operation information. In the above manner, the screen information corresponding to each rendering operation information can be obtained.
[0062] Among them, the screen information can be represented in any form. For example, the screen information is represented in the form of a matrix. The pixel points indicated by the screen information are the same as the pixel points in the screen. For example, the screen includes (p + 1) * (q + 1) pixel points, where p + 1 is used to represent the number of pixel points in the length of the screen, and q + 1 is used to represent the number of pixel points in the width of the screen; then the screen information corresponding to any one rendering operation information indicates the pixel values of (p + 1) * (q + 1) pixel points, and this screen information is represented by a matrix of (p + 1) * (q + 1), and each element in the matrix is the pixel value of each pixel point in the screen.
[0063] 203. The computer device generates the performance parameters corresponding to the screen based on the screen information corresponding to the n rendering operation information. The performance parameters indicate the resource utilization situation in the process of the application rendering the screen.
[0064] In the embodiments of the present application, the screen information corresponding to each rendering operation information can reflect the situation of the application rendering the screen. Then, based on the screen information corresponding to the n rendering operation information, the resource utilization situation in the process of the application rendering the screen can be determined, and the performance parameters corresponding to the screen can be obtained.
[0065] Among them, the performance parameter can be represented in any form. For example, the performance parameter is represented in the form of an image, or in the form of an identifier, and the identifier is any character, which is used to indicate the serial number of the rendering operation information among the n rendering operation information.
[0066] In the solution provided by the embodiments of the present application, when the rendering operation information used for rendering any frame of the application is obtained, the method of reconstructing the screen is adopted to reconstruct the screen information corresponding to each rendering operation information. Then, the resource utilization situation during the application rendering process is determined by using the screen information corresponding to each rendering operation information, and the performance parameter corresponding to the screen is obtained. This method of obtaining the performance parameter is completely independent of the application development framework and the running environment, and there is no need to modify the application code or rely on a specific performance test environment. It realizes a performance analysis mechanism that does not affect the application operation. Only by obtaining the rendering operation information corresponding to the screen can the performance analysis of the screen be realized, which saves the time required for running the application or creating its running environment during performance analysis, and can also save the time required for modifying the application code or setting up a specific performance test environment, improves the performance analysis efficiency, and reduces the technical threshold of performance analysis. It can be applied to any application or any screen, expands the applicable range of the performance parameter acquisition method, that is, improves the applicability of the performance parameter acquisition method.
[0067] In Figure 2 Based on the shown embodiment, in the embodiments of the present application, the data obtained during the application rendering process is parsed to obtain the rendering operation information, and then the rendering is performed based on the vertex information in the rendering operation information. The specific process is described in detail in the following embodiments.
[0068] Figure 3 It is a flowchart of a performance parameter acquisition method provided by the embodiments of the present application. Taking the execution of this method by a computer device as an example, as Figure 3 shown, this method includes:
[0069] 301. During the process of a computer device rendering any frame of an application, obtain the data used by the application for rendering this frame.
[0070] In the embodiments of the present application, when an application renders any frame of the screen, data related to the screen will be used, such as data used to represent the content included in the screen. Then, the rendering operation can be performed on the data related to the screen to render the screen. Therefore, the data used for rendering this frame can be obtained from the process of the application rendering this frame, so that the process of rendering this frame can be reconstructed based on the obtained data in the future.
[0071] Among them, the obtained data includes the rendering operation information when the application renders any frame of the screen, and may also include other data used by the application when rendering the screen, such as the data used to represent the content included in the screen. The obtained data can be represented in any form. For example, the obtained data is represented in the form of a file.
[0072] In a possible implementation manner, the process of obtaining the data used when the application renders any frame of the screen includes: establishing a binding relationship with the application through an operation acquisition tool; in the case where the operation acquisition tool and the application have a binding relationship, through the operation acquisition tool, during the process of the application rendering the screen, obtain the data used when the application renders the screen.
[0073] In the embodiments of the present application, the operation acquisition tool is used to obtain the data used during the process of any application rendering any screen. By operating the acquisition tool, a binding relationship is established with any application, so as to be able to perform data acquisition on the rendering process of the application with the binding relationship, in order to obtain the data used when the application with the binding relationship renders any frame of the screen. In this way, data acquisition can be performed on any screen of any application, ensuring the convenience of data acquisition, and this data acquisition method can be applied to any application, improving the applicability of the data acquisition method.
[0074] Among them, the operation acquisition tool is used for the data used during the process of any application rendering any screen. The operation acquisition tool can be any tool. For example, the operation acquisition tool is an open-source graphics debugging tool, and the graphics debugging tool can capture and save frames during the process of rendering the screen of any application to obtain the data used when rendering any frame of the screen. The binding relationship refers to the relationship in which the operation acquisition tool can perform data acquisition on the application, and can also reflect that the authorized operation acquisition function performs data acquisition on the screen rendering process of the application.
[0075] Optionally, the process of establishing the binding relationship includes: starting the application through the operation acquisition tool, and during the process of starting the application, through the operation acquisition tool, it is possible to obtain the data used when the application renders any frame of the screen, and obtain the data used by the application to render the screen.
[0076] In the embodiments of the present application, the operation acquisition tool can perform rendering data acquisition on the application started by itself. After starting the application through the operation acquisition tool, it is equivalent to establishing a binding relationship between the operation acquisition tool and the application.
[0077] For example, when the terminal is running the operation acquisition tool, it displays the interface of the operation acquisition tool. The user triggers the application startup option in this interface through the terminal, and the terminal displays at least one startable application identifier. The user clicks on any application identifier through the terminal, and the terminal starts the clicked application identifier through the operation acquisition tool. After that, the terminal can run the application corresponding to the application identifier, and then can render the picture of the application during the process of running the application, and can obtain the data used by the application to render this picture through the operation acquisition tool.
[0078] Optionally, the process of establishing the binding relationship includes: when at least one application has been started, select any process from the started application processes through the operation acquisition tool, and establish a binding relationship with the application corresponding to the selected process.
[0079] In the embodiments of the present application, when an application has been started, through the operation acquisition tool, it can be bound to the process of any application, which is equivalent to establishing a binding relationship between the operation acquisition tool and the application corresponding to the process.
[0080] For example, when the terminal is running the operation acquisition tool, it displays the interface of the operation acquisition tool. The user triggers the selection option in this interface through the terminal, and the terminal displays at least one process of the started application. The user clicks on any process through the terminal, and the terminal establishes a binding relationship between the application corresponding to the clicked process and the operation acquisition tool through the operation acquisition tool. After that, the terminal can render the picture of the application during the process of running the application corresponding to the clicked process, and can obtain the data used by the application to render this picture through the operation acquisition tool.
[0081] For example, during the process of the terminal running an application, in response to a display instruction for any picture of the application, the central processing unit of the terminal will obtain the rendering data of this picture, generate at least one rendering operation information based on the rendering data, and send the generated rendering operation information to the graphics processing unit; the graphics processing unit of the terminal performs corresponding rendering operations based on the rendering operation information to render this picture. Therefore, through the operation acquisition tool, when the terminal renders this picture through the application, the rendering operation information used for rendering this picture can be obtained.
[0082] 302. The computer device parses the obtained data to obtain n rendering operation information of this picture. The n rendering operation information is obtained during the process of the application rendering the picture. The rendering operation information indicates the display positions of at least one display element in the picture, and n is an integer greater than 1.
[0083] In the embodiment of the present application, since data related to the screen is used when the application renders any frame of the screen, therefore, during the process of the application rendering the screen, the data used for rendering the screen is obtained, and then the obtained data is parsed to obtain n rendering operation information of the screen, so that the process of rendering the screen can be reconstructed based on the rendering operation information subsequently. This ensures the convenience and accuracy of the obtained rendering operation information, and further ensures the accuracy of obtaining performance parameters subsequently.
[0084] In a possible implementation manner, the data obtained in the above step 301 is stored in the form of a file, and by parsing the file, n rendering operation information of the screen can be obtained.
[0085] For example, by operating the acquisition tool, during the process of the application rendering any frame of the screen, the data used by the application for rendering the screen is obtained to obtain a file containing the data. Then, the file is parsed to obtain n rendering operation information of the screen.
[0086] It should be noted that the embodiment of the present application takes the example of first obtaining the data used for rendering the screen and then parsing it to obtain the rendering operation information. In another embodiment, it is not necessary to execute the above steps 301-302, but other methods are adopted to obtain n rendering operation information of any frame of the screen in the application.
[0087] 303. The computer device renders the screen based on the first vertex information in each rendering operation information to obtain the screen information corresponding to each rendering operation information. The screen information indicates the pixel values assigned to each pixel point in the screen based on the rendering operation information.
[0088] In the embodiment of the present application, the rendering operation information includes first vertex information, and the first vertex information indicates the vertex position of the display element. For any rendering operation information, based on the first vertex information in the rendering operation information, the screen can be rendered according to the position of the display element indicated by the first vertex information in the screen, so as to assign pixel values to each pixel point, and then obtain the screen information corresponding to the rendering operation information. The first vertex information in different rendering operation information indicates different display elements, and the screen information corresponding to each rendering operation information can be obtained in the above manner.
[0089] In the embodiment of the present application, the first vertex information in the rendering operation information can accurately reflect the position of the display element in the screen. Therefore, based on the first vertex information in the rendering operation information, the screen is rendered so that pixel values can be assigned to each pixel point in the screen according to the position of the display element in the screen, so that the obtained screen information can accurately describe the rendering situation corresponding to the rendering operation information, and further ensure the accuracy of the screen information.
[0090] In the embodiment of the present application, the first vertex information refers to the vertex information of the basic graphics that make up the display element indicated by the rendering operation information. Any display element may be composed of at least one basic graphic. For example, the basic graphic is a triangle or a quadrilateral, etc. For example, taking the application as a game application, the display element is a virtual object in the virtual scene, and the virtual object is a three-dimensional model composed of a Mesh (mesh). Then, the basic image that makes up the virtual object is a triangle or a quadrilateral in the Mesh.
[0091] In a possible implementation manner, the first vertex information includes the vertex coordinates of the display element; step 303 includes: performing coordinate system conversion on the vertex coordinates in the first vertex information to obtain second vertex information, where the second vertex information indicates the vertex coordinates of the display element in the screen coordinate system; based on the second vertex information, determining a first pixel point from the pixel points included in the picture, where the first pixel point is the pixel point occupied by the display element in the picture; rendering the first pixel point in the picture to obtain the picture information corresponding to the rendering operation information.
[0092] In the embodiment of the present application, the vertex coordinates in the first vertex information are coordinate information in the local space (i.e., the model space), that is, the vertex coordinates are coordinates with the model center as the origin, and the model center is set during modeling. During the rendering process, by mapping the vertex coordinates in the first vertex information to the screen coordinate system, the position of the display element described by the first vertex information in the picture can be accurately reflected, that is, the pixel points occupied by the described display element in the picture are determined. Furthermore, the pixel points occupied by the first display element in the picture can be rendered to obtain the picture information corresponding to the rendering operation information. This precise positioning avoids unnecessary processing of irrelevant pixel points, enables the rendering operation to focus on the areas that really need to be rendered, reduces rendering errors, improves the accuracy of rendering, and further ensures the accuracy of the picture information.
[0093] In the embodiment of the present application, only the first pixel point in the picture is rendered, and for the pixel points in the picture other than the first pixel point, they may not be rendered. In this way, the obtained picture information can accurately describe the pixel value of the first pixel point, and the pixel values of the pixel points in the picture other than the first pixel point are 0 or empty.
[0094] In the embodiment of the present application, since the vertex coordinates in the second vertex information are coordinates in the screen coordinate system and the positions of each pixel point in the picture in the screen coordinate system have been determined, based on the second vertex information, the positions of each vertex can be determined from the screen coordinate system, and then each vertex is combined into a display element to determine the position of the display element in the screen coordinate system. Furthermore, the pixel points covered by the display element in the screen coordinate system can be determined, that is, the first pixel point.
[0095] Optionally, the process of rendering the first pixel point includes: rendering the pixel value of the first pixel point in the picture as a first pixel value, and rendering the pixel value of the second pixel point in the picture as a second pixel value, to obtain the picture information corresponding to the rendering operation information, where the second pixel point is a pixel point in the picture other than the first pixel point.
[0096] In the embodiment of the present application, during the process of rendering the first pixel point, by rendering the pixel value of the first pixel point as a first pixel value and rendering the pixel value of the second pixel point as a second pixel value, the picture information can accurately distinguish the pixel points occupied by the display element from the unoccupied pixel points, so as to ensure the accuracy of the picture information and ensure the accuracy of the subsequent obtained performance parameters.
[0097] Wherein, the first pixel value and the second pixel value are different pixel values. For example, the first pixel value is (1, 0, 0), where 1 represents red, the first 0 represents green, and the second 0 represents blue, then the first pixel value represents red; the second pixel value is (0, 0, 0), the first 0 represents red, the second 0 represents green, and the third 0 represents blue, then the second pixel value represents colorless.
[0098] Optionally, if the vertex coordinates in the first vertex information are coordinate information in the local space (i.e., the model space), then the process of performing coordinate system conversion on the vertex coordinates in the first vertex information includes: converting the vertex coordinates in the first vertex information to the world space to obtain the third vertex information, where the third vertex information indicates the vertex coordinates of the display element in the world space; converting the vertex coordinates in the third vertex information to the clip space to obtain the fourth vertex information, where the fourth vertex information indicates the vertex coordinates of the display element in the clip space; in the clip space, screening the vertex coordinates indicated by the fourth vertex information based on the view frustum (6 clip planes), and mapping the vertex coordinates located within the view frustum to the screen coordinate system to obtain the second vertex information.
[0099] In the embodiment of the present application, first, the vertex coordinates in the first vertex information need to be converted to the world space to obtain the world vertex coordinates corresponding to the display element, and then the world vertex coordinates are further converted to the clip space. This process involves matrix multiplication. By multiplying the model matrix, view matrix, and projection matrix, the position of the vertex is finally mapped to the clip space. For example, in a three-dimensional game scene, the vertex coordinates of each virtual object need to be converted to the unified world space, and then converted to the clip space through the perspective and projection method of the camera. After that, the vertex coordinates in the clip space are clipped based on the view frustum, and only the vertex coordinates within the view frustum can be mapped to the screen coordinate system.
[0100] Among them, the viewing frustum is defined by six planes, which delimit the visible area in the clip space. The vertex coordinates located within the viewing frustum can be mapped to the screen coordinate system and displayed on the screen. These six planes are respectively: (1) Near clip plane: The plane closest to the virtual camera. Objects closer to the virtual camera than this plane will be clipped; (2) Far clip plane: The plane farthest from the virtual camera. Objects farther from the virtual camera than this plane will be clipped; (3) Left clip plane: Defines the left boundary of the viewing frustum; (4) Right clip plane: Defines the right boundary of the viewing frustum; (5) Top clip plane: Defines the upper boundary of the viewing frustum; (6) Bottom clip plane: Defines the lower boundary of the viewing frustum. In the clip space, vertex coordinates need to satisfy -w ≤ (x, y, z) ≤ w to be considered within the viewing frustum, that is, x, y, and z are all within the range of [-w, w], and thus the vertex coordinates within the viewing frustum can be determined. Among them, (x, y, z, w) are the homogeneous coordinates of the vertex, and w is the homogeneous coordinate.
[0101] Among them, the local space is also called the local coordinate space, which is the distribution space of virtual objects based on the local coordinate system. World space: A region larger than the local space. For example, the local space can correspond to a smaller area that can cover a certain virtual object in the game, while the world space can correspond to the area of a map in the game that includes multiple virtual objects. The clip space is the coordinate system used after the vertex shader performs a projection transformation on the vertices. The projection transformation converts the vertices from the world space or view space to the clip space through a projection matrix. Screen space: The space corresponding to the display screen.
[0102] It should be noted that the embodiments of this application are described by taking the example of rendering the picture using the first vertex information. In another embodiment, it is not necessary to perform the above step 303. Instead, other methods are adopted to render the picture based on each rendering operation information to obtain the picture information corresponding to each rendering operation information.
[0103] 304. The computer device generates performance parameters corresponding to the picture based on the picture information corresponding to n rendering operation information, and the performance parameters indicate the resource utilization situation during the application's rendering of the picture.
[0104] It should be noted that this step 304 is the same as the above step 203 and will not be elaborated here.
[0105] In the solution provided by the embodiments of the present application, when the rendering operation information used for rendering any frame of the application is obtained, the method of reconstructing the screen is adopted to reconstruct the screen information corresponding to each rendering operation information. Then, the resource utilization situation during the application's screen rendering process is determined by using the screen information corresponding to each rendering operation information, and the performance parameters corresponding to the screen are obtained. This method of obtaining performance parameters is completely independent of the application's development framework and operating environment, and there is no need to modify the application code or rely on a specific performance testing environment. It realizes a performance analysis mechanism that does not affect the application's operation. Only by obtaining the rendering operation information corresponding to the screen can the performance analysis of the screen be realized, saving the time required to run the application or create its operating environment during performance analysis, and also saving the time required to modify the application code or build a specific performance testing environment. It improves the performance analysis efficiency and reduces the technical threshold of performance analysis. It can be applied to any application or any screen, expanding the applicable range of the performance parameter acquisition method, that is, improving the applicability of the performance parameter acquisition method.
[0106] It should be noted that in the above Figure 3 shown embodiment, the same computer device first obtains the rendering operation information according to the above steps 301-302, and then obtains the performance parameters of the screen based on the rendering operation information. In another embodiment, the process of obtaining the rendering operation information and the process of obtaining the performance parameters are executed by different devices. For example, the first device executes the above steps 301-302, and then sends the obtained n rendering operation information to the second device, so that the second device executes the above steps 303-304; or, the first device executes the above step 301, and then sends the obtained data to the second device, so that the second device executes the above steps 302-304. In the embodiments of the present application, the application is installed in the first device, and the application may not be installed in the second device. After the second device obtains the n rendering operation information of any frame of the application in the above manner, it can be independent of the application itself and only use the n rendering operation information to obtain the performance parameters of the screen, without relying on the application's operating environment or specific tools, realizing a solution for offline obtaining the performance parameters of the screen.
[0107] Based on the above Figure 2 shown embodiment, in the embodiments of the present application, the performance parameters include a rendering frequency image, and the specific process is detailed in the following embodiments.
[0108] Figure 4 is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application. Taking the example that the method is executed by a computer device, as Figure 4 shown, the method includes:
[0109] 401. The computer device obtains n rendering operation information of any frame of the application. The n rendering operation information is obtained during the process of the application rendering the screen. The rendering operation information indicates the display positions of at least one display element in the screen, and n is an integer greater than 1.
[0110] It should be noted that this step 401 is the same as the above steps 301-302 and will not be elaborated here.
[0111] 402. The computer device renders the screen based on each rendering operation information to obtain the screen information corresponding to each rendering operation information. The screen information indicates the pixel values assigned to each pixel point in the screen based on the rendering operation information.
[0112] It should be noted that this step 402 is the same as the above step 202 or 403 and will not be elaborated here.
[0113] 403. The computer device fuses the screen information corresponding to the n rendering operation information to obtain the fused screen information.
[0114] In the embodiment of the present application, since the screen information corresponding to each rendering operation information can only describe the screen obtained based on this rendering operation information, and the n rendering operation information is the rendering operation information during the process of the application rendering the screen, then the screen information corresponding to the n rendering operation information is fused so that the fused screen information can represent the screen rendered by the application. Furthermore, the fused screen information is rendered into a rendering frequency image, and by converting the discrete rendering operation information into a rendering frequency distribution diagram, the rendering frequency image can accurately reflect the rendering situation of each pixel point in the screen during the process of the application rendering the screen, ensuring the accuracy of the rendering frequency image and facilitating the user to view the performance parameters of the screen to know the resource utilization situation during the rendering of the lake surface, thereby improving the user experience.
[0115] Among them, the fused screen information can be represented in any form. For example, the fused screen information is represented in the form of a matrix. The pixel points indicated by the fused screen information are the same as the pixel points in the screen. For example, the screen includes (p + 1) * (q + 1) pixel points, where p + 1 is used to represent the number of pixel points in the length of the screen, and q + 1 is used to represent the number of pixel points in the width of the screen; then the fused screen information indicates the pixel values of (p + 1) * (q + 1) pixel points, and the fused screen information is represented by a matrix of (p + 1) * (q + 1), and each element in the matrix is the pixel value of each pixel point in the screen.
[0116] In a possible implementation manner, this step 403 includes: fusing the pixel values of the same pixel point in the screen information corresponding to the n rendering operation information to obtain the fused screen information
[0117] In an embodiment of the present application, for the screen information corresponding to n rendering operation information, that is, n screen information, each screen information can indicate the pixel values of each pixel in the screen. Then, the pixel values of the same pixel in the n screen information are fused to obtain the pixel value of the pixel in the fused screen information. In the above manner, the pixel value of each pixel in the fused screen information can be obtained, which can ensure the accuracy of pixel fusion and the accuracy of the fused screen information.
[0118] For example, the screen includes (p + 1) * (q + 1) pixels, and the screen information A corresponding to any rendering operation information i is expressed as where a 00 is used to represent the pixel value of the pixel at the 0th row and 0th column, and a mn is used to represent the pixel value of the pixel at the pth row and qth column. Then the fused screen information is expressed as A = A1 + A2 + … + A n .
[0119] 404. The computer device renders the fused screen information to obtain a rendering frequency image.
[0120] In an embodiment of the present application, the rendering frequency map indicates the rendering frequency of each pixel during the process of the application rendering the screen. By rendering the fused screen information, so as to render the screen information into an image to obtain a rendering frequency image, enabling the rendering frequency image to accurately reflect the rendering frequency of each pixel.
[0121] For example, for each screen information, this screen information indicates that the pixel value of the first pixel is the first pixel value, and this screen information indicates that the pixel value of the second pixel is the second pixel value; the first pixel value is (1, 0, 0), 1 represents red, the first 0 represents green, and the second 0 represents blue, then the first pixel value is represented as red; the second pixel value is (0, 0, 0), the first 0 represents red, the second 0 represents green, and the third 0 represents blue, then the second pixel value is represented as colorless. That is, the first pixel in the screen information is red, while the second pixel in the screen information is colorless. Then, the red depth of each pixel in the rendering frequency image can reflect the rendering frequency of the pixel; the deeper the red of any pixel, the higher the rendering frequency of the pixel; the lighter the red of any pixel, the lower the rendering frequency of the pixel.
[0122] In a possible implementation manner, the fused screen information is represented in the form of a matrix, and the matrix includes the pixel values after fusion of each pixel in the screen. Then, step 404 includes: performing normalization processing on the pixel values of each pixel in the fused screen information, and rendering the normalized fused screen information to obtain a rendering frequency image.
[0123] In the embodiments of the present application, by normalizing the pixel values of each pixel point in the fused screen information and then rendering it into a rendering frequency image, in this way, for any two pixel points with too small a difference in rendering frequency, the rendering frequency image can accurately reflect the difference in rendering frequency between these two pixel points, ensuring the display effect of the rendering frequency image.
[0124] Optionally, the process of normalizing the pixel values of pixel points in the fused screen information includes: determining the maximum value from the fused screen information and performing normalization processing on the pixel values of each pixel point in the fused screen information according to the following relationship:
[0125] a′ xy =int(255*a xy / Max)
[0126] where a xy is used to represent the pixel value of the pixel point at the x-th row and y-th column in the fused screen information, Max is used to represent the maximum value, int(·) is used to represent the rounding function, and a′ xy is used to represent the pixel value of the pixel point at the x-th row and y-th column in the fused screen information after normalization.
[0127] For example, when obtaining the screen information corresponding to each rendering operation information as described above, the pixel value of the pixel point occupied by the display element is rendered as (1, 0, 0), that is, red; the pixel value of the pixel point not occupied by the display element is rendered as (0, 0, 0), that is, colorless. Taking the maximum value in the fused screen information as 8 as an example, if the pixel value of any pixel point in the fused screen information is (8, 0, 0), then the pixel value of this pixel point after normalization is (255, 0, 0), that is, the pixel value of the pixel point in the fused screen information that is not (0, 0, 0) after normalization still represents red, but the depth of red is different.
[0128] In the embodiments of the present application, according to the above relationship, the pixel values of each pixel point can be mapped to between [0, 255], which can widen the difference in rendering frequency. Even if the difference in rendering frequency between any two pixel points is small, it can also be reflected in the rendering frequency image.
[0129] It should be noted that the embodiments of the present application are described by taking the performance parameter including the rendering frequency image as an example. In another embodiment, it is not necessary to perform the above steps 403 - 404, but other methods are adopted to generate the performance parameter corresponding to the screen based on the screen information corresponding to n rendering operation information, and the performance parameter indicates the resource utilization situation during the application's rendering of the screen.
[0130] In the solution provided by the embodiments of the present application, when the rendering operation information used for rendering any frame of the application is obtained, the method of reconstructing the picture is adopted to reconstruct the picture information corresponding to each rendering operation information. Then, the resource utilization situation during the application rendering process is determined by using the picture information corresponding to each rendering operation information, and the performance parameters corresponding to the picture are obtained. This way of obtaining performance parameters is completely independent of the application development framework and operating environment, and there is no need to modify the application code or rely on a specific performance test environment, realizing a performance analysis mechanism that does not affect the operation of the application. Only by obtaining the rendering operation information corresponding to the picture can the performance analysis of the picture be realized, saving the time required to run the application or create its operating environment during performance analysis, and also saving the time required to modify the application code or build a specific performance test environment, improving the performance analysis efficiency, and reducing the technical threshold of performance analysis. It can be applied to any application or any picture, expanding the applicable range of the performance parameter acquisition method, that is, improving the applicability of the performance parameter acquisition method.
[0131] Based on the above Figure 2 In the embodiments of the present application, on the basis of the shown embodiments, the first pixel value and the second pixel value are used to render the picture information, and the invalid rendering operation information is used as the performance parameter for description. The specific process is shown in the following embodiments.
[0132] Figure 5 FIG. is a flowchart of a method for obtaining performance parameters provided by the embodiments of the present application. Taking the execution of this method by a computer device as an example, as Figure 5 shown, the method includes:
[0133] 501. The computer device obtains n rendering operation information of any frame of the application. The n rendering operation information is obtained during the process of the application rendering the picture. The rendering operation information indicates the display position of at least one display element in the picture, and n is an integer greater than 1.
[0134] It should be noted that this step 501 is the same as the above steps 301-302 and will not be elaborated here.
[0135] 502. The computer device renders the picture based on the first pixel value, the second pixel value, and the rendering operation information, and obtains the picture information corresponding to the rendering operation information. The picture information indicates that the pixel value of the first pixel point in the picture is the first pixel value and the pixel value of the second pixel point is the second pixel value. The first pixel point is the pixel point occupied by the display element in the picture, and the second pixel point is the pixel point in the picture other than the first pixel point.
[0136] In the embodiment of the present application, since the rendering operation information can indicate the display positions of at least one display element in the picture, based on the rendering operation information, it is possible to determine the pixels occupied by the display element indicated by the rendering operation information from the pixels included in the picture. Furthermore, the pixel values of the pixels of the display element are rendered as the first pixel value, and the pixel values of the remaining pixels are rendered as the second pixel value, so as to ensure that the picture information can accurately distinguish the pixels occupied by the display element from the unoccupied pixels, that is, the picture information can accurately reflect the specific situation of the rendering operation, ensuring the accuracy of the picture information.
[0137] It should be noted that step 502 is the same as step 303 above, and will not be elaborated here.
[0138] It should be noted that the embodiment of the present application takes rendering the picture based on the first pixel value, the second pixel value and the rendering operation information as an example for illustration. In another embodiment, it is not necessary to execute the above step 502, but other methods are adopted to render the picture based on each rendering operation information to obtain the picture information corresponding to each rendering operation information, and the picture information indicates the pixel values assigned to each pixel in the picture based on the rendering operation information.
[0139] 503. The computer device determines invalid rendering operation information from the n rendering operation information based on the picture information corresponding to the n rendering operation information.
[0140] In the embodiment of the present application, each piece of picture information can reflect the situation of executing the corresponding rendering operation during the process of rendering the picture. Then, based on the n pieces of picture information, it is possible to determine the execution situation of the rendering operations corresponding to each piece of picture information, and further determine which rendering operation information is invalid, that is, determine the invalid rendering operation information, so as to generate an indication information indicating the invalid rendering operation information, so that the indication information can indicate the invalid rendering operations executed during the process of rendering the picture, reflecting the situation of wasted resource occupation by the invalid rendering operations, and further ensuring the accuracy of the performance parameters, and also providing a basis for subsequent optimization of the application, thereby ensuring the performance of the application optimization.
[0141] Among them, the invalid rendering operation information refers to that the rendering operation information does not render any display elements during the process of applying the picture, that is, it makes no contribution to the finally rendered picture. The rendering operation corresponding to the invalid operation information is also equivalent to an invalid rendering operation. In the embodiment of the present application, if there is too much invalid rendering operation information among the n rendering operation information when the application renders any picture, the bandwidth will be reduced.
[0142] In a possible implementation, step 503 includes: when all pixel points indicated by any piece of picture information are the second pixel value, determining the rendering operation information corresponding to the picture information as invalid rendering operation information.
[0143] In the embodiments of the present application, when rendering a picture based on each piece of rendering operation information, the pixel values of the pixel points occupied by the display element are rendered as the first pixel value, and the pixel values of the remaining pixel points are rendered as the second pixel value. In this way, if all pixel points indicated by the picture information are the second pixel value, it means that the rendering operation information corresponding to the picture information fails to render the display element in the picture. That is, the rendering operation information corresponding to the picture information makes no contribution to the finally rendered picture, thus ensuring the accuracy of the determined invalid rendering operation information.
[0144] For example, if the second pixel value is (0, 0, 0), where the first 0 represents red, the second 0 represents green, and the third 0 represents blue, then the second pixel value represents colorless. If the picture information corresponding to any rendering operation information is colorless, then the rendering operation corresponding to the rendering operation information is an invalid rendering operation and makes no contribution to the finally rendered picture.
[0145] 504. The computer device generates indication information based on the invalid rendering operation information, and the indication information indicates the invalid rendering operation information among the n pieces of rendering operation information.
[0146] In the embodiments of the present application, the performance parameter of the picture includes indication information. After determining the invalid operation information from the n pieces of rendering operation information, indication information is generated based on the invalid operation information, so that the indication information can reflect the invalid rendering operations in the process of the application rendering the picture.
[0147] In a possible implementation, the indication information includes the operation identifier of the invalid rendering operation information.
[0148] Among them, the operation identifier can be represented in any form. For example, the operation identifier can be represented by any character. For example, there is an execution order among the n pieces of rendering operation information, and this order can reflect the order of executing each rendering operation in the process of the application rendering the picture. The operation identifier indicates the serial number of the invalid rendering operation information among the n pieces of rendering operation information, and this serial number can reflect the operation order of the invalid rendering operation information among the n pieces of rendering operation information.
[0149] It should be noted that the embodiments of the present application are described by taking the performance parameter including indication information as an example. In another embodiment, steps 503 - 504 do not need to be executed, but other methods are adopted to generate the performance parameter corresponding to the picture based on the picture information corresponding to the n pieces of rendering operation information, and the performance parameter indicates the resource utilization situation in the process of the application rendering the picture.
[0150] In the solution provided by the embodiment of the present application, when the rendering operation information used for rendering any frame of the application is obtained, the method of reconstructing the screen is adopted to reconstruct the screen information corresponding to each rendering operation information. Then, the resource utilization situation during the application's rendering process is determined by using the screen information corresponding to each rendering operation information, and the performance parameters corresponding to the screen are obtained. This method of obtaining performance parameters is completely independent of the application's development framework and operating environment, and there is no need to modify the application code or rely on a specific performance test environment. It realizes a performance analysis mechanism that does not affect the application's operation. Only by obtaining the rendering operation information corresponding to the screen can the performance analysis of the screen be realized, saving the time required to run the application or create its operating environment during performance analysis, and also saving the time required to modify the application code or build a specific performance test environment. It improves the performance analysis efficiency and reduces the technical threshold of performance analysis. It can be applied to any application or any screen, expanding the applicable range of the performance parameter acquisition method, that is, improving the applicability of the performance parameter acquisition method.
[0151] Based on the above Figure 2 On the basis of the embodiment shown, the embodiment of the present application takes the rendering accuracy as an example for the performance parameters of the screen, and the specific process is shown in the following embodiments.
[0152] Figure 6 It is a flowchart of a method for obtaining performance parameters provided by the embodiment of the present application. Taking the example that this method is executed by a computer device, as Figure 6 shown, this method includes:
[0153] 601. The computer device obtains n rendering operation information of any frame of the application. The n rendering operation information is obtained during the process of the application rendering the screen. The rendering operation information indicates the display position of at least one display element in the screen, and n is an integer greater than 1.
[0154] It should be noted that this step 601 is the same as the above steps 301-302, and will not be elaborated here.
[0155] 602. The computer device renders the screen based on each rendering operation information to obtain the screen information corresponding to each rendering operation information. The screen information indicates the pixel values assigned to each pixel point in the screen based on the rendering operation information.
[0156] It should be noted that this step 402 is the same as the above steps 202 or 403, and will not be elaborated here.
[0157] 603. The computer device determines the number of pixel points occupied by the display element in the screen information based on the pixel values of each pixel point in the screen information corresponding to the rendering operation information.
[0158] In an embodiment of the present application, if the pixel values of the pixel points occupied by the display element in the screen information are different from those of the unoccupied pixel points, then based on the pixel values of each pixel point in the screen information, the number of pixel points occupied by the display element in the screen can be determined. The number of pixel points occupied by the display element in the screen corresponding to any screen information can reflect the contribution of the rendering operation corresponding to the rendering operation information to the screen.
[0159] Wherein, the display element is the display element indicated by the rendering operation information.
[0160] In a possible implementation manner, the screen information indicates that the pixel value of the first pixel point in the screen is the first pixel value and the pixel value of the second pixel point is the second pixel value. The first pixel point is the pixel point occupied by the display element in the screen, and the second pixel point is the pixel point other than the first pixel point in the screen. Then step 603 includes: determining the number of pixel points with the first pixel value in the screen information as the number of pixel points occupied by the display element in the screen.
[0161] In an embodiment of the present application, the first pixel point is the pixel point occupied by the display element in the screen, so the number of the first pixel points is the number of pixel points occupied by the display element in the screen.
[0162] Optionally, both the first pixel value and the second pixel value are represented in the form of RGB (Red, Green, Blue). Any one color value in the first pixel value is 1 and the other color values are 0, and the values of red, green, and blue in the second pixel value are all 0. Then the process of determining the number of pixel points includes: determining the sum of the pixel values of each pixel point in the screen information as the number of pixel points occupied by the display element in the screen.
[0163] For example, the first pixel value is (1, 0, 0), where 1 represents red, the first 0 represents green, and the second 0 represents blue, so the first pixel value represents red; the second pixel value is (0, 0, 0), where the first 0 represents red, the second 0 represents green, and the third 0 represents blue, so the second pixel value represents colorless; taking the number of the first pixel points in the screen information as 10 as an example, then the sum of the pixel values of each pixel point in the screen information is determined to be (10, 0, 0), and the number of pixel points occupied by the display element in the screen in the screen information is 10.
[0164] 604. The computer device determines the number of vertices of the display element in the screen information based on the rendering operation information corresponding to the screen information.
[0165] In an embodiment of the present application, the rendering operation information indicates the vertex positions of the display element, so based on the first vertex information, the number of vertices of the display element in the screen information can be determined.
[0166] For example, if the rendering operation information includes the respective vertex coordinates of the display element, then the number of vertex coordinates in the rendering operation information is the number of vertices of the display element.
[0167] 605. The computer device determines the ratio of the number of vertices to the number of pixel points as the rendering precision corresponding to the rendering operation information.
[0168] In the embodiment of the present application, the number of vertices can reflect the number of display elements indicated by the rendering operation information. The number of pixel points is the number of pixel points rendered when rendering the display element. Then, the ratio of the number of vertices to the number of pixel points can reflect the rendering precision of the display element.
[0169] In the embodiment of the present application, for any rendering operation information, the number of vertices corresponding to the rendering operation information can reflect the geometric complexity of the display element corresponding to the rendering operation information, and the number of pixel points occupied by the display element in the picture can reflect the contribution of the rendering operation information on the screen. Therefore, based on the number of vertices and the number of pixel points, the rendering precision corresponding to the rendering operation information is determined. Through the normalization analysis of geometric complexity and screen contribution, the refined evaluation of graphic rendering resources is realized, so that the rendering precision can accurately reflect the rendering situation corresponding to the rendering operation information, ensuring the accuracy of the rendering precision. And based on the rendering precision, it is more convenient to optimize the application subsequently, ensuring the optimization effect of the application subsequently.
[0170] In a possible implementation manner, the rendering operation information includes first vertex information. The first vertex information refers to the vertex information of the basic graphics that make up the display element indicated by the rendering operation information. Then, the number of vertices can reflect the number of basic graphics rendered by the rendering operation information, and the number of pixel points can reflect the number of pixel points occupied by the basic image rendered by the rendering operation information. Then, the ratio of the number of vertices to the number of pixel points can reflect the rendering precision of these basic graphics.
[0171] For example, taking the application as a game application, the display element is a virtual object in the virtual scene. The virtual object is a three-dimensional model composed of a Mesh (mesh). Then, the basic graphics that make up the virtual object are triangles or quadrilaterals in the Mesh. Then, the rendering precision obtained according to the above steps 603-605 can reflect the rendering precision of the virtual object.
[0172] In a possible implementation manner, both the first pixel value and the second pixel value are represented in the form of RGB (red, green, blue). Any value of one color in the first pixel value is 1 and the values of the other colors are 0. The values of red, green, and blue in the second pixel value are all 0. Then, the rendering precision corresponding to the rendering operation information satisfies the following relationship:
[0173] r = V / S
[0174] S = Σa ij
[0175] Wherein, r is used to represent the rendering precision corresponding to any rendering operation information, V is used to represent the number of vertices corresponding to the rendering operation, S is used to represent the number of pixel points corresponding to the rendering operation, i is used to represent the row number of the pixel points included in the picture, j is used to represent the column number among the pixel points included in the picture, and a ij is used to represent the pixel value of the pixel point at the i-th row and j-th column in the picture information corresponding to the rendering operation information.
[0176] It should be noted that the embodiments of the present application are only described by taking obtaining the rendering precision corresponding to any rendering operation information as an example. For each rendering operation information in the n rendering operations, according to the above steps 603-605, the rendering precision corresponding to each rendering operation information can be obtained, and the performance parameter indicates the rendering precision corresponding to the n rendering operation information.
[0177] In a possible implementation manner, precision indication information can also be generated based on the rendering precision corresponding to each rendering operation information. That is, the process of generating precision indication information includes: generating precision indication information based on the rendering operation information with a rendering precision higher than the threshold, and the precision indication information indicates the rendering operation information with a rendering precision higher than the threshold among the n rendering operation information.
[0178] Wherein, the threshold is an arbitrary value.
[0179] In the embodiments of the present application, the performance parameter of the picture includes precision indication information. After determining the rendering precision corresponding to each rendering operation information, precision indication information is generated based on the rendering operation information with a rendering precision higher than the threshold, so that the precision indication information can reflect the rendering operations with too high rendering precision during the process of the application rendering the picture.
[0180] In a possible implementation manner, the precision indication information includes the operation identifier of the rendering operation information with a rendering precision higher than the threshold.
[0181] Wherein, the operation identifier can be represented in any form. For example, the operation identifier can be represented by any character. For example, there is an execution order among the n rendering operation information, and this order can reflect the order of executing each rendering operation during the process of the application rendering the picture. The operation identifier indicates the serial number of the rendering operation information with a rendering precision higher than the threshold among the n rendering operation information, and this serial number can reflect the operation order of the rendering operation information with a rendering precision higher than the threshold among the n rendering operation information.
[0182] It should be noted that, in the embodiments of the present application, the case where the performance parameter indicates the rendering accuracy corresponding to n rendering operation information is taken as an example for illustration. In another embodiment, the above steps 603-605 do not need to be executed, but other methods are adopted to generate the performance parameter corresponding to the picture based on the picture information corresponding to the n rendering operation information, and the performance parameter indicates the resource utilization situation during the application rendering of the picture.
[0183] In the solution provided by the embodiments of the present application, when the rendering operation information used when the application renders any frame of the picture is obtained, the method of picture reconstruction is adopted to reconstruct the picture information corresponding to each rendering operation information, and then the resource utilization situation during the application rendering of the picture is determined by using the picture information corresponding to each rendering operation information, and the performance parameter corresponding to the picture is obtained. This method of obtaining the performance parameter is completely independent of the development framework and operating environment of the application, and there is no need to modify the application code or rely on a specific performance test environment, realizing a performance analysis mechanism that does not affect the operation of the application. Only by obtaining the rendering operation information corresponding to the picture can the performance analysis of the picture be realized, saving the time required to run the application or create its operating environment during performance analysis, and also being able to save the time required to modify the application code or build a specific performance test environment, improving the performance analysis efficiency, reducing the technical threshold of performance analysis, being applicable to any application or any picture, expanding the applicable range of the performance parameter acquisition method, that is, improving the applicability of the performance parameter acquisition method.
[0184] Based on the above Figures 2 to 6 On the basis of the embodiments shown, the embodiments of the present application also provide a flowchart of a method for obtaining a performance parameter. Taking the rendering operation as a draw call and the rendering operation information including vertex information as an example, as Figure 7 shown, the method includes:
[0185] 701. Obtain the frame capture file when any application renders any picture through an operation acquisition tool.
[0186] 702. Parse the frame capture file to obtain the vertex information corresponding to each draw call when rendering the picture.
[0187] In the embodiments of the present application, the vertex information corresponding to the draw call is equivalent to the rendering operation information.
[0188] 703. Initialize the vertex shader and the pixel shader, and draw the pixel points drawn by each draw call through the vertex shader and the pixel shader respectively to obtain a two-dimensional array corresponding to each draw call.
[0189] In the embodiments of the present application, through the vertex shader, the vertex coordinates in the vertex information corresponding to the draw call are converted to the world space, and then the vertex coordinates in the world space are converted to the clip space; then, after the clipping stage and the rasterization stage, the pixel points drawn by each draw call on the screen are obtained; through the pixel shader, the pixel points drawn by each draw call are respectively drawn to obtain a two-dimensional array corresponding to each draw call.
[0190] In the embodiments of the present application, the Open Graphics Library is an application for rendering graphics. Through the vertex shader (Vertex Shader) and the pixel shader (Pixel Shader) in the Open Graphics Library, the drawing of each draw call can be realized. During the initialization process of the vertex shader and the pixel shader, the VAO (Vertex Array Object), VBO (Vertex Buffer Object), and IBO (Index Buffer Object) can be set. The VAO is used to store the configuration information of vertex attributes (such as vertex coordinates), the VBO is used to store attributes such as vertex coordinates, normals, colors, and texture coordinates, and the IBO is a GPU buffer object for storing vertex indices, which is used to specify the drawing order of vertices (such as the vertex indices of a triangle). Moreover, the Open Graphics Library will cache the two-dimensional arrays corresponding to each draw call.
[0191] For example, after initializing the vertex shader and the pixel shader, the setting information of the vertex shader is "declaring the language version of the shading programming language used; specifying the storage location from which the vertex shader reads data, and the input variable of the vertex shader is a color value of three-dimensional vector type; defining the main function of the vertex shader: converting the input three-dimensional vertex coordinates into four-dimensional homogeneous coordinates (x, y, z, w), and the homogeneous coordinate w is 1.0". The setting information of the pixel shader is "declaring that the GLSL language version used is 3.3; defining the output variable as a color value of three-dimensional vector type, such as red, green, and blue; defining the main function of the pixel shader: setting the pixel point to red".
[0192] It should be noted that in the embodiments of the present application, the drawing of each draw call is realized by using the vertex shader and the pixel shader in the Open Graphics Library. In another embodiment, the drawing of each draw call can also be realized based on other open interfaces. For example, it can be realized based on the Graphics API.
[0193] In the embodiment of the present application, in the clipping stage: in the clipping space, based on the view frustum, the vertex information of each draw call in the clipping space is filtered, and the vertex coordinates located within the view frustum are mapped to the screen coordinate system. In the rasterization stage: based on the vertex coordinates of each draw call in the screen coordinate system, the pixel points drawn by each draw call in the picture are determined. The two-dimensional array corresponding to the draw call is equivalent to the picture information corresponding to the draw call.
[0194] 704. Use the array reading interface to read the two-dimensional arrays obtained by each draw call, and superimpose the two-dimensional arrays of multiple draw calls.
[0195] Among them, the array reading interface is an interface of any type. For example, the array reading interface is a graphics library pixel reading interface, which is an interface for the Open Graphics Library to read pixel data from the frame buffer (such as the color buffer).
[0196] 705. After normalizing the superimposed data.
[0197] 706. Render the normalized data into an image to obtain a rendering frequency image.
[0198] In the embodiment of the present application, the process of obtaining the image of the rendering frequency is as Figure 8 shown. Image 801 is the picture information drawn by each draw call respectively. The display elements drawn by 3 draw calls are a circle, a triangle and a rectangle respectively, and the colors in the circle, triangle and rectangle are red. And image 802 is the obtained rendering frequency map, that is, the circle, triangle and rectangle are displayed in the same picture. Among them, compared with the red color in other non-overlapping areas, the red color in the overlapping area of the circle and rectangle and the red color in the overlapping area of the triangle and rectangle are darker.
[0199] For example, the rendering frequency image can be represented in the form of an Over Draw (overdrawing) flame graph, as Figure 9 shown. The red value of each pixel point in the flame graph represents the rendering frequency of each pixel point, and the triangle or quadrilateral in the flame graph is the basic graph drawn by any draw call. There are multiple basic graphs shown in the flame graph, such as a circle, a triangle and a rectangle. The areas other than the basic images are white, the areas occupied by the circle, triangle and rectangle are red, and the red color in the overlapping areas is darker. The red color of each pixel point in the flame graph can reflect the rendering frequency of the pixel point. The OverDraw flame graph can reflect the number of times each pixel point is drawn within the same frame of the picture. Excessive Over Draw will lead to performance degradation, a longer time to render a frame of the picture, and cause the user to experience lag.
[0200] The embodiment of the present application provides a solution for generating an Over Draw flame graph based on the draw replay technology: obtaining a frame capture file by using an operation acquisition tool, parsing relevant rendering data based on the frame capture file, re-drawing the rendering by using relevant interfaces of the Open Graphics Library, and then obtaining key rendering parameters such as the Over Draw flame graph of the rendered frame image through an algorithm, which increases the means for analyzing rendering performance. In this way, through the operation acquisition tool, any application can be frame-captured, and the rendering operation information of any frame of any application can be obtained. After that, according to the solution provided by the embodiment of the present application, the performance parameters of the frame can be obtained, which is independent of the engine or GPU technology used by the application, can be generated independently from the game engine or hardware tools, is applicable to any application, has no compatibility problems, can greatly improve the efficiency of business rendering performance analysis through automation and other means, and has a wider applicability. Moreover, in addition to obtaining the Over Draw flame graph of each frame, it is also possible to obtain rendering performance analysis such as invalid drawing or rendering accuracy when rendering the frame.
[0201] Based on the solution provided by the embodiment of the present application, it is possible to perform performance analysis on any application, or, during the process of developing an application, analyze the application to analyze the rendering performance parameters of each frame of the application, so as to provide a basis for subsequent optimization of the application, so that the application can be optimized according to the situation of the rendering performance parameters. For example, the rendering performance parameters indicate invalid draw calls or draw calls with too high rendering accuracy, so as to delete the invalid draw calls and reduce the rendering accuracy of the draw calls with too high rendering accuracy.
[0202] Figure 10 It is a schematic structural diagram of a performance parameter acquisition device provided by the embodiment of the present application, as Figure 10 shown, the device includes:
[0203] An acquisition module 1001, configured to acquire n rendering operation information of any frame of an application, where the n rendering operation information is obtained during the process of the application rendering the frame, and the rendering operation information indicates the display positions of at least one display element in the frame, and n is an integer greater than 1;
[0204] A rendering module 1002, configured to render the frame based on each rendering operation information to obtain the frame information corresponding to each rendering operation information, where the frame information indicates the pixel values assigned to each pixel point in the frame based on the rendering operation information;
[0205] A generation module 1003, configured to generate the performance parameters corresponding to the frame based on the frame information corresponding to the n rendering operation information, where the performance parameters indicate the resource utilization situation during the process of the application rendering the frame.
[0206] In a possible implementation, the rendering operation information includes first vertex information, and the first vertex information indicates the vertex positions of the display elements; the rendering module 1002 is configured to render the screen based on the first vertex information in each rendering operation information to obtain the screen information corresponding to each rendering operation information.
[0207] In another possible implementation, the first vertex information includes the vertex coordinates of the display elements; the rendering module 1002 is configured to perform coordinate system conversion on the vertex coordinates in the first vertex information to obtain second vertex information, and the second vertex information indicates the vertex coordinates of the display elements in the screen coordinate system; based on the second vertex information, a first pixel point is determined from the pixel points included in the screen, and the first pixel point is the pixel point occupied by the display element in the screen; the first pixel point in the screen is rendered to obtain the screen information corresponding to the rendering operation information.
[0208] In another possible implementation, the rendering module 1002 is configured to render the pixel value of the first pixel point in the screen as a first pixel value, and render the pixel value of the second pixel point in the screen as a second pixel value to obtain the screen information corresponding to the rendering operation information, where the second pixel point is the pixel point other than the first pixel point in the screen.
[0209] In another possible implementation, the rendering module 1002 is configured to render the screen based on the first pixel value, the second pixel value, and the rendering operation information to obtain the screen information corresponding to the rendering operation information, and the screen information indicates that the pixel value of the first pixel point in the screen is the first pixel value and the pixel value of the second pixel point is the second pixel value, where the first pixel point is the pixel point occupied by the display element in the screen, and the second pixel point is the pixel point other than the first pixel point in the screen.
[0210] In another possible implementation, the performance parameter includes indication information, and the indication information indicates the invalid rendering operation information among n pieces of rendering operation information; the generation module 1003 is configured to determine the invalid rendering operation information from the n pieces of rendering operation information based on the screen information corresponding to the n pieces of rendering operation information; and generate indication information based on the invalid rendering operation information.
[0211] In another possible implementation, the screen information indicates that the pixel value of the first pixel point in the screen is the first pixel value and the pixel value of the second pixel point is the second pixel value, where the first pixel point is the pixel point occupied by the display element in the screen, and the second pixel point is the pixel point other than the first pixel point in the screen; the generation module 1003 is configured to, when all the pixel points indicated by any piece of screen information are the second pixel value, determine the rendering operation information corresponding to the screen information as the invalid rendering operation information.
[0212] In another possible implementation, the performance parameter includes a rendering frequency map, which indicates the rendering frequency of each pixel point during the process of the application rendering the picture; a generating module 1003, configured to fuse the picture information corresponding to n rendering operation messages to obtain fused picture information; and render the fused picture information to obtain a rendering frequency image.
[0213] In another possible implementation, the generating module 1003 is configured to fuse the pixel values of the same pixel point in the picture information corresponding to n rendering operation messages to obtain fused picture information.
[0214] In another possible implementation, the performance parameter indicates the rendering precision corresponding to n rendering operation messages; the generating module 1003 is configured to determine the number of pixel points occupied by the display elements in the picture based on the pixel values of each pixel point in the picture information corresponding to the rendering operation messages; determine the number of vertices of the display elements in the picture based on the rendering operation messages corresponding to the picture information; and determine the ratio of the number of vertices to the number of pixel points as the rendering precision corresponding to the rendering operation messages.
[0215] In another possible implementation, the obtaining module 1001 is configured to obtain the data used when the application renders the picture during the process of the application rendering the picture; and parse the obtained data to obtain n rendering operation messages.
[0216] In another possible implementation, as Figure 11 shown, the apparatus further includes:
[0217] A establishing module 1004, configured to establish a binding relationship with the application by operating an obtaining tool;
[0218] The obtaining module 1001 is configured to, when the operating obtaining tool has a binding relationship with the application, obtain the data used when the application renders the picture during the process of the application rendering the picture by operating the obtaining tool.
[0219] It should be noted that: for the performance parameter obtaining apparatus provided in the above embodiments, only the above division of each functional module is used for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the performance parameter obtaining apparatus provided in the above embodiments and the embodiments of the performance parameter obtaining method belong to the same concept, and the specific implementation process is detailed in the method embodiments and will not be repeated here.
[0220] An embodiment of the present application also provides a computer device, which includes a processor and a memory. At least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the performance parameter acquisition method in the above embodiment.
[0221] Optionally, the computer device is provided as a terminal. Figure 12 The structural block diagram of a terminal 1200 provided by an exemplary embodiment of the present application is shown. The terminal 1200 includes: a processor 1201 and a memory 1202.
[0222] The processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0223] The memory 1202 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1202 may further include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one computer program, and the at least one computer program is used to be executed by the processor 1201 to implement the performance parameter acquisition method provided by the method embodiment of the present application.
[0224] In some embodiments, the terminal 1200 may further optionally include: a peripheral device interface 1203 and at least one peripheral device. The processor 1201, the memory 1202, and the peripheral device interface 1203 may be connected by a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 1203 through a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, an audio circuit 1207, and a power supply 1208.
[0225] The peripheral device interface 1203 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202, and the peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1201, the memory 1202, and the peripheral device interface 1203 can be implemented on a separate chip or circuit board, and this embodiment does not limit this.
[0226] The radio frequency circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1204 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1204 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1204 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on. The radio frequency circuit 1204 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, each generation of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1204 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.
[0227] The display screen 1205 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1205 is a touch display screen, the display screen 1205 also has the ability to collect touch signals on or above the surface of the display screen 1205. The touch signals can be input as control signals to the processor 1201 for processing. At this time, the display screen 1205 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1205, which is provided on the front panel of the terminal 1200; in other embodiments, there may be at least two display screens 1205, which are respectively provided on different surfaces of the terminal 1200 or are in a folding design; in other embodiments, the display screen 1205 may be a flexible display screen, which is provided on a curved surface or a folding surface of the terminal 1200. Even further, the display screen 1205 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 1205 can be prepared using materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0228] The camera module 1206 is used to collect images or videos. Optionally, the camera module 1206 includes a front camera and a rear camera. The front camera is provided on the front panel of the terminal, and the rear camera is provided on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the function of background blurring by fusing the main camera and the depth-of-field camera, the function of panoramic shooting by fusing the main camera and the wide-angle camera, and the VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera module 1206 may further include a flash. The flash can be a single-color-temperature flash or a two-color-temperature flash. A two-color-temperature flash refers to the combination of a warm-light flash and a cold-light flash, which can be used for light compensation under different color temperatures.
[0229] The audio circuit 1207 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to achieve voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1200. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 1207 may further include a headphone jack.
[0230] The power supply 1208 is used to supply power to each component in the terminal 1200. The power supply 1208 may be alternating current, direct current, a disposable battery or a rechargeable battery. When the power supply 1208 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charging technology.
[0231] Those skilled in the art can understand that Figure 12 the structure shown in does not constitute a limitation on the terminal 1200, and may include more or fewer components than shown in the figure, or combine some components, or adopt a different component layout.
[0232] Optionally, the computer device is provided as a server. Figure 13 is a schematic structural diagram of a server provided by an embodiment of the present application. The server 1300 may vary greatly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1301 and one or more memories 1302. Among them, at least one computer program is stored in the memory 1302, and the at least one computer program is loaded and executed by the processor 1301 to implement the methods provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard and an input / output interface for input / output. The server may further include other components for implementing the functions of the device, which will not be elaborated here.
[0233] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the performance parameter acquisition method in the above embodiment.
[0234] The embodiment of the present application further provides a computer program product, including a computer program, and the operations performed by the performance parameter acquisition method in the above embodiment are realized when the computer program is executed by a processor.
[0235] Those of ordinary skill in the art can understand that all or part of the steps in the above embodiment can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disk, or the like.
[0236] The above are only optional embodiments of the embodiments of the present application, and are not intended to limit the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the embodiments of the present application shall be included in the protection scope of the present application.
Claims
1. A method for obtaining performance parameters, characterized in that, The method includes: Obtaining n rendering operation information of any frame of a picture in an application, where the n rendering operation information is obtained during the process of the application rendering the picture, and the rendering operation information indicates the display positions of at least one display element in the picture, and n is an integer greater than 1; Rendering the picture based on each rendering operation information to obtain picture information corresponding to each rendering operation information, where the picture information indicates the pixel values assigned to each pixel point in the picture based on the rendering operation information; Generating performance parameters corresponding to the picture based on the picture information corresponding to the n rendering operation information, where the performance parameters indicate the resource utilization situation during the process of the application rendering the picture.
2. The method according to claim 1, characterized in that, The rendering operation information includes first vertex information, and the first vertex information indicates the vertex positions of the display element; The rendering the picture based on each rendering operation information to obtain picture information corresponding to each rendering operation information includes: Rendering the picture based on the first vertex information in each rendering operation information to obtain picture information corresponding to each rendering operation information.
3. The method according to claim 2, characterized in that The first vertex information includes the vertex coordinates of the display element; the rendering the picture based on the first vertex information in each rendering operation information to obtain picture information corresponding to each rendering operation information includes: Performing coordinate system conversion on the vertex coordinates in the first vertex information to obtain second vertex information, where the second vertex information indicates the vertex coordinates of the display element in the screen coordinate system; Based on the second vertex information, determining first pixel points from the pixel points included in the picture, where the first pixel points are the pixel points occupied by the display element in the picture; Rendering the first pixel points in the picture to obtain picture information corresponding to the rendering operation information.
4. The method according to claim 3, wherein The rendering the first pixel points in the picture to obtain picture information corresponding to the rendering operation information includes: Rendering the pixel value of the first pixel points in the picture as a first pixel value and rendering the pixel value of second pixel points in the picture as a second pixel value to obtain picture information corresponding to the rendering operation information, where the second pixel points are the pixel points in the picture other than the first pixel points.
5. The method according to claim 1, characterized in that The rendering the picture based on each rendering operation information to obtain picture information corresponding to each rendering operation information includes: Rendering the picture based on the first pixel value, the second pixel value and the rendering operation information to obtain picture information corresponding to the rendering operation information, where the picture information indicates that the pixel value of the first pixel points in the picture is the first pixel value and the pixel value of the second pixel points is the second pixel value, the first pixel points are the pixel points occupied by the display element in the picture, and the second pixel points are the pixel points in the picture other than the first pixel points.
6. The method according to claim 1, characterized in that, The performance parameters include indication information, and the indication information indicates invalid rendering operation information among the n rendering operation information; Generating the performance parameter corresponding to the picture based on the picture information corresponding to the n rendering operation information includes: Based on the picture information corresponding to the n rendering operation information, determining the invalid rendering operation information from the n rendering operation information; Generating the indication information based on the invalid rendering operation information.
7. The method according to claim 6, wherein The picture information indicates that the pixel value of the first pixel point in the picture is the first pixel value and the pixel value of the second pixel point is the second pixel value. The first pixel point is the pixel point occupied by the display element in the picture, and the second pixel point is the pixel point other than the first pixel point in the picture; determining the invalid rendering operation information from the n rendering operation information based on the picture information corresponding to the n rendering operation information includes: When all pixel points indicated by any picture information are the second pixel value, determining the rendering operation information corresponding to the picture information as the invalid rendering operation information.
8. The method according to claim 1, characterized in that, The performance parameter includes a rendering frequency map, and the rendering frequency map indicates the rendering frequency of each pixel point during the process of the application rendering the picture; Generating the performance parameter corresponding to the picture based on the picture information corresponding to the n rendering operation information includes: Fusing the picture information corresponding to the n rendering operation information to obtain fused picture information; Rendering the fused picture information to obtain the rendering frequency image.
9. The method according to claim 1, characterized in that The performance parameter indicates the rendering accuracy corresponding to the n rendering operation information; Generating the performance parameter corresponding to the picture based on the picture information corresponding to the n rendering operation information includes: Based on the pixel values of each pixel point in the picture information corresponding to the rendering operation information, determining the number of pixel points occupied by the display element in the picture information; Based on the rendering operation information corresponding to the picture information, determining the number of vertices of the display element in the picture information; Determining the ratio of the number of vertices to the number of pixel points as the rendering accuracy corresponding to the rendering operation information.
10. The method according to claim 1, characterized in that Obtaining the n rendering operation information of any frame of picture in the application includes: During the process of the application rendering the picture, obtaining the data used by the application when rendering the picture; Parsing the obtained data to obtain the n rendering operation information.
11. The method according to claim 10, wherein Before obtaining the data used by the application when rendering the picture during the process of the application rendering the picture, the method further includes: Establishing a binding relationship with the application through an operation acquisition tool; Obtaining the data used by the application when rendering the picture during the process of the application rendering the picture includes: When the operation acquisition tool and the application have a binding relationship, obtaining the data used by the application when rendering the picture during the process of the application rendering the picture through the operation acquisition tool.
12. A performance parameter acquisition device, characterized in that, The device includes: An acquisition module, configured to acquire n rendering operation information of any frame of a picture in an application, where the n rendering operation information is obtained during the process of the application rendering the picture, and the rendering operation information indicates the display positions of at least one display element in the picture, and n is an integer greater than 1; A rendering module, configured to render the picture based on each rendering operation information to obtain picture information corresponding to each rendering operation information, where the picture information indicates the pixel values assigned to each pixel point in the picture based on the rendering operation information; A generation module, configured to generate performance parameters corresponding to the picture based on the picture information corresponding to the n rendering operation information, where the performance parameters indicate the resource utilization situation during the process of the application rendering the picture.
13. A computer device, characterized in that, The computer device includes a processor and a memory, and at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the performance parameter acquisition method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the operations performed by the performance parameter acquisition method according to any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the operations performed by the performance parameter acquisition method according to any one of claims 1 to 11.