Data processing method, device and equipment, readable storage medium and program product
By injecting data into the game process to obtain indicator files and creating shared storage space to obtain game performance data, the problems of low data efficiency and inaccuracy in the prior art are solved, and efficient and accurate performance analysis is achieved.
Patent Information
- Application Number
- CN202311139949.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art has low data efficiency and is not very accurate when acquiring game performance data, resulting in low performance analysis efficiency.
By injecting data into the game process to obtain indication files, create state shared storage space and performance shared storage space, thereby obtaining game performance data.
Improve data acquisition efficiency, enhance the accuracy of performance data, and thus improve the efficiency of performance analysis.
Smart Images

Figure CN119565165A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, a data processing apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Electronic games are games that are played on electronic devices (such as personal computers) for educational or entertainment purposes. With the rapid development of computer technology, the content of electronic games is becoming increasingly rich and the types of games are becoming increasingly diverse. In some cases, in order to ensure the quality of the game, it is usually necessary to perform performance analysis on the game based on the game performance data.
[0003] At present, the method for performance analysis of games mainly involves obtaining game performance data of the game and obtaining performance analysis results of the game based on the game performance data. However, the data efficiency of the existing game performance data acquisition method is low, and the acquired game performance data is not very accurate, resulting in low efficiency of game performance analysis. Therefore, how to efficiently and accurately obtain game performance data of the game is a problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, apparatus, device, readable storage medium and program product, which can use a data acquisition indication file to accurately obtain game performance data of a game, which is beneficial to improving data acquisition efficiency and further beneficial to improving performance analysis efficiency.
[0005] On the one hand, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Running a game process of the game, and injecting the data acquisition instruction file into the game process;
[0007] Creating a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data;
[0008] If the status indication information indicates obtaining game performance data, obtaining first game performance data of the game from the game process according to the data obtaining indication file, the first game performance data including one or more of the number of game rendering instructions, the number of game graphics elements, the computing resource occupancy rate and the storage space occupancy rate;
[0009] The first game performance data is stored in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
[0010] On the one hand, an embodiment of the present application provides a data processing device, the device comprising:
[0011] An injection unit, used for running a game process of the game and injecting a data acquisition instruction file into the game process;
[0012] a creating unit, configured to create a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to acquire game performance data, and the performance shared storage space is used to store game performance data;
[0013] an acquisition unit, configured to acquire first game performance data of the game from the game process according to the data acquisition instruction file if the status indication information indicates to acquire game performance data, wherein the first game performance data includes one or more of the number of game rendering instructions, the number of game primitives, the occupancy rate of computing resources, and the occupancy rate of storage space;
[0014] The acquisition unit is further used to store the first game performance data in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
[0015] On the one hand, an embodiment of the present application provides a computer device, comprising: a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected, wherein the memory stores an executable program code, and the processor is used to call the executable program code to implement the data processing method provided in the embodiment of the present application.
[0016] Accordingly, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer implements the data processing method provided by the embodiment of the present application.
[0017] Accordingly, an embodiment of the present application further provides a computer program product, the computer program product comprising a computer program or computer instructions, the computer program or computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device implements the data processing method provided in the embodiment of the present application.
[0018] In the present application, the game process of the game is run, and the data acquisition instruction file is injected into the game process; the state shared storage space and the performance shared storage space are created by the game process according to the data acquisition instruction file; if the state indication information indicates to obtain the game performance data, the first game performance data of the game is obtained from the game process according to the data acquisition instruction file; the first game performance data is stored in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space, and analyzes and processes the first game performance data. Through the data processing method provided by the embodiment of the present application, the game performance data of the game can be accurately obtained by using the data acquisition instruction file, which effectively improves the efficiency of obtaining performance data, and thus improves the accuracy of the game performance analysis results determined according to the game performance data; the shared storage space created according to the data acquisition instruction file can be accessed by the game process and the processing process, so that the processing process can accurately and efficiently obtain the game performance data of the game through the shared storage space without writing relevant codes in the game, which effectively improves the efficiency of data processing; the data acquisition instruction file is universal, and the same data acquisition instruction file can be used to obtain game performance data of multiple different games, which is conducive to reducing the workload of obtaining game performance data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 is a schematic diagram of a system architecture of a data processing system provided in an embodiment of the present application;
[0021] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0022] Figure 3 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0023] Figure 4 A method for determining an offset address of a function provided by an embodiment of the present application is shown;
[0024] Figure 5 A method for determining a data acquisition function provided in an embodiment of the present application is shown;
[0025] Figure 6 is a schematic diagram of game performance data provided by an embodiment of the present application;
[0026] Figure 7 It is a schematic diagram of a method for determining computing power performance indication data provided by an embodiment of the present application;
[0027] Figure 8 is a structural block diagram of a data processing device provided in an embodiment of the present application;
[0028] Fig. 9 It is a structural block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] It should be noted that the descriptions of "first", "second", etc. involved in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0031] First, several terms involved in the embodiments of the present application are explained:
[0032] Unreal Engine: Unreal Engine, or UE for short, is a complete game development platform for game consoles and personal computers, providing game developers with a large number of core technologies, data generation tools, and basic support required for game development. Many video games are developed based on the Unreal Engine.
[0033] D3D12: Direct3D12 is a performance-optimized version of Direct3D. Direct3D (D3D for short) is a set of low-level graphics application programming interfaces (APIs). With the help of this API, hardware acceleration can be used to draw three-dimensional scenes in games. Direct3D can realize the interaction between applications and low-level devices.
[0034] Rendering instruction: Drawcall is an instruction sent by the central processing unit (CPU) to the graphics processing unit (GPU). This command points to a list of primitives that need to be rendered. When a Drawcall is given, the GPU will calculate based on the rendering state (such as materials, textures, shaders, etc.) and all input vertex data, and finally output the pixels displayed on the screen. The number of rendering instructions is one of the indicators to measure game performance.
[0035] Primitives: Primitives are basic shapes or elements in computer graphics that can be used to build complex graphics models and scenes. Common primitives include points, line segments, triangles, etc. The number of primitives depends on the required level of detail and scene complexity. The number of game primitives is one of the indicators to measure game performance.
[0036] In order to ensure the quality of the game, it is usually necessary to perform performance analysis on the game. The existing game performance analysis method mainly obtains the performance data of the game and performs game performance analysis based on the game performance data. However, the data acquisition efficiency of the existing game performance data acquisition method is low, and the acquired game performance data is not very accurate. This will result in a low accuracy rate of the game performance analysis result determined based on the game performance data.
[0037] Based on this, the embodiment of the present application provides a data processing method, which can run the game process of the game, inject the data acquisition instruction file into the game process; create a state shared storage space and a performance shared storage space according to the data acquisition instruction file through the game process; if the state indication information indicates to obtain the game performance data, the first game performance data of the game is obtained from the game process according to the data acquisition instruction file; the first game performance data is stored in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space, and analyzes and processes the first game performance data. Through the data processing method provided by the embodiment of the present application, the game performance data of the game can be accurately obtained by using the data acquisition instruction file, which effectively improves the efficiency of obtaining performance data and also improves the accuracy of the game performance analysis results determined according to the game performance data; at the same time, because the data acquisition instruction file is universal, the same data acquisition instruction file can be used to obtain game performance data of multiple different games, which is conducive to reducing the workload of obtaining game performance data and also improves the processing efficiency of performance data.
[0038] The data processing method provided in the embodiment of the present application can also be applied to the field of cloud computing. Cloud computing is a computing mode that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices. The data processing method provided in the embodiment of the present application can be implemented using cloud computing devices. The terminal device can send a game performance data acquisition request to the cloud computing device. After receiving the game performance data acquisition request, the cloud computing device executes the data processing method provided in the embodiment of the present application, and stores the game performance data of the game in the performance shared storage space. The acquisition process in the cloud computing device can obtain the game performance data through the performance shared storage space and send the game performance data to the terminal device. The method provided in the embodiment of the present application can use the data acquisition instruction file to accurately obtain the game performance data of the game, which is conducive to improving the efficiency of data acquisition, and then to improving the efficiency of performance analysis.
[0039] The architecture of the data processing system provided in the embodiments of the present application will be introduced below in conjunction with the accompanying drawings.
[0040] See also Figure 1 , which is a schematic diagram of the system architecture of a data processing system provided in an embodiment of the present application, the data processing system includes a terminal device 101, a server 102 and a database 103, the server 102 may include a processing module 1021 and a game module 1022, and the server 102 may interact with the terminal device 101 and the database 103 for data. Among them:
[0041] The terminal device 101 can be a handheld device with communication function (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC), a vehicle terminal, an intelligent voice interaction device, a wearable device or other intelligent device, but is not limited thereto.
[0042] The server 102 includes a processing module 1021 and a game module 1022. The processing module 1021 can be used to run a processing process, and the game module 1022 can be used to run a game process. Both the processing module 1021 and the game module 1022 can access a shared storage space. The server 102 can receive a request from the terminal device 101, and can also store data in the database 103. The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0043] Database 103 is used to store relevant data sent by server 102. Database 103 can be a database located in server 102, that is, it can be a database built into or carried by the server; it can also be an external database connected to server 102, such as a cloud database (i.e., a database deployed in the cloud), which can be specifically based on any deployment of private cloud, public cloud, hybrid cloud, edge cloud, etc., so that the cloud database focuses on different functions. For example: For a database deployed in a private cloud, the basic cloud hardware is the user's personal equipment, and it focuses more on serving a small number of users, while a database deployed in a public cloud is deployed based on a cloud platform provided by a third party, which allows the data stored in the database to realize data sharing, and any user's data can be stored in the database, and any user can also use the data in the database.
[0044] The following will explain in detail Figure 1 The working principle of the data processing system shown:
[0045] The terminal device 101 sends a request for obtaining game performance data to the server 102. After receiving the request for obtaining game performance data, the server 102 can use the game module 1022 to run the game process of the game and use the processing module 1021 to run the processing process. The server 102 calls the processing process to inject the data acquisition instruction file into the game process; the server 102 creates a shared storage space according to the data acquisition instruction file through the game process, and the shared storage space includes a state shared storage space and a performance shared storage space, the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data; the processing process can modify the state indication information in the state shared storage space; if the state indication information indicates to obtain game performance data, the server 102 obtains the first game performance data of the game from the game process according to the data acquisition instruction file, and the first game performance data includes one or more of the number of game rendering instructions, the number of game graphics, the computing resource occupancy rate and the storage space occupancy rate; the first game performance data is stored in the performance shared storage space; the server 102 calls the processing process to obtain the first game performance data from the performance shared storage space, analyzes and processes the first game performance data, and obtains the game performance analysis result. The server 102 can send the first game performance data to the terminal device 101, and store the game performance analysis result in the database 103. Through the data processing method provided in the embodiment of the present application, the game performance data of the game can be accurately obtained by using the data acquisition instruction file, which is beneficial to improving the data acquisition efficiency and further beneficial to improving the performance analysis efficiency.
[0046] It is to be understood that the schematic diagram of the data processing system described in the embodiment of the present application is to more clearly illustrate the data processing method of the embodiment of the present application, and does not constitute a limitation on the data processing method provided in the embodiment of the present application. For example, the data processing method provided in the embodiment of the present application can be executed by the server 102, and can also be executed by other devices different from the server 102 and capable of communicating with the terminal device 101 and the database 103. It is known to those skilled in the art that Figure 1 The number of terminal devices 101, servers 102, and databases 103 is merely illustrative. Any number of devices may be configured according to business implementation requirements. Moreover, with the evolution of system architecture and the emergence of new business scenarios, the data processing method provided in the embodiment of the present application is also applicable to similar technical problems.
[0047] See also Figure 2 , Figure 2A flow chart of a data processing method provided in an embodiment of the present application. The data processing method can be implemented by the above-mentioned server 102, or by other devices. The flow of the data processing method provided in an embodiment of the present application includes but is not limited to:
[0048] S201, running a game process of a game, and injecting a data acquisition instruction file into the game process.
[0049] In the embodiment of the present application, the game may be an electronic game developed based on Direct3D, the electronic game may be a personal computer game (PC GAME), and the game engine of the electronic game may be Unreal Engine (UE), Unity engine, etc. The game process is relatively independent of the external process (e.g., processing process, display process, etc.), and the method of directly modifying the relevant code of the game to obtain the game performance data is inefficient. Therefore, the method provided in the embodiment of the present application may be used to obtain the game performance data: the server runs the game process of the game, and injects the data acquisition instruction file into the game process. The data acquisition instruction file is used to obtain the game performance data from the running game process.
[0050] It should be noted that the data acquisition instruction file is determined based on the common data of games developed based on Direct3D. Therefore, the data acquisition instruction file can be used to obtain the performance data of all games developed based on Direct3D, and has good universality. The version of Direct3D in the game can be the above-mentioned D3D12 version, or it can be other versions. At the same time, since the data acquisition instruction file is determined based on the underlying code associated with the game, the game performance data can be fully obtained according to the data acquisition instruction file. Compared with the method of modifying the game-related code to obtain game performance data, the method provided in the embodiment of the present application can effectively reduce the resources consumed in obtaining game performance data and effectively improve the efficiency of data acquisition.
[0051] S202. Create a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data.
[0052] In an embodiment of the present application, the server can create a state shared storage space and a performance shared storage space according to the injected data acquisition instruction file through the game process, wherein the state shared storage space is used to store state indication information, and the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data. The state shared storage space and the performance shared storage space can be accessed by the game process, and can also be accessed by other processes running in the server. In the present application, after the game performance analysis is completed, the injected data acquisition instruction file can be deleted, so as to obtain the game performance data without modifying or adding game-related codes, thereby ensuring low coupling and high cohesion of game-related codes. The method provided in the embodiment of the present application creates a shared storage space that can be accessed by the game process and the processing process, so that the processing process can accurately obtain the game performance data of the game.
[0053] S203. If the status indication information indicates obtaining game performance data, first game performance data of the game is obtained from the game process according to the data acquisition indication file, and the first game performance data includes one or more of the number of game rendering instructions, the number of game primitives, computing resource occupancy rate and storage space occupancy rate.
[0054] In the embodiment of the present application, the processing process is a process different from the game process running in the server. Both the processing process and the game process can access the state shared storage space and modify the state indication information. After the state shared storage space is created, the state indication information is in the initial state, and the state indication information is not to obtain game performance data; the processing process can modify the state indication information to obtain game performance data. The game process can obtain the state indication information in the state shared storage space. If the state indication information obtained by the game process indicates to obtain game performance data, the server can obtain the first game performance data of the game from the game process according to the data acquisition instruction file. The first game performance data may include one or more of the number of game rendering instructions, the number of game primitives, the computing resource occupancy rate and the storage space occupancy rate. The number of game rendering instructions refers to the number of rendering instructions (Drawcall) in the game process. Drawcall is an instruction sent by the CPU to the GPU. The CPU stores the Drawcall instruction in the command buffer, and the GPU reads the Drawcall instruction from the command buffer and executes it. The more the number of Drawcall, the more times the CPU stores, which leads to the CPU spending a lot of time submitting, which is easy to cause CPU overload. Therefore, the number of game rendering instructions can be used to measure the performance of the game. The number of game primitives refers to the number of primitives that need to be rendered in the game process. Primitives are used to build graphic models and scenes in the game, so the number of game primitives can reflect the picture quality of the game to a certain extent and can be used to measure the performance of the game. The computing resource occupancy rate may include the CPU occupancy rate and GPU occupancy rate of the game process. Too high computing resource occupancy rate may cause hardware failure and may also cause errors in the operation of the game process, so the computing resource occupancy rate can be used to measure the performance of the game. The storage space occupancy rate refers to the occupancy rate of the game process on the server's memory. Too high storage space occupancy rate may also cause errors in the operation of the game process, so the storage space occupancy rate can be used to measure the performance of the game. The method provided in the embodiment of the present application can completely obtain game performance data from the game process, ensuring the accuracy and completeness of the game performance data.
[0055] It should be noted that the first game performance data may include not only one or more of the number of game rendering instructions, the number of game primitives, the computing resource occupancy rate, and the storage space occupancy rate, but may also include other game performance data. The data contained in the first game performance data may be adaptively adjusted according to different games. For example: For a game developed based on Direct3D, there will also be parameters such as game frames in the game process. The game frame number refers to the number of frames transmitted per second (Frames Per Second, FPS), that is, the number of frames transmitted per second of the game; then the first game performance data may include one or more of the number of game rendering instructions, the number of game primitives, the computing resource occupancy rate, the storage space occupancy rate, and the game frame number.
[0056] S204: Store the first game performance data in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
[0057] In the embodiment of the present application, after obtaining the first game performance data of the game from the game process, the server can call the game process to store the first game performance data in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data. The method provided in the embodiment of the present application can store the obtained game performance data in the shared storage space for storage, so that the processing process can obtain the game performance data and perform performance analysis, which effectively improves the efficiency and accuracy of the game performance analysis.
[0058] Based on the above embodiments, the beneficial effects of the present application are: the method provided in the embodiments of the present application can utilize the data acquisition indication file to obtain the game performance data of the game and perform performance analysis, thereby effectively improving the data processing efficiency of the game performance data; the data acquisition indication file is determined based on the common underlying code associated with the game, therefore, the game performance data can be comprehensively and accurately obtained using the data acquisition indication file, and the data acquisition indication file has good universality and can be applied to multiple different games; the shared storage space created in the present application realizes indirect interaction between the game process and the processing process, and can efficiently obtain game performance data while ensuring the independence of the game process.
[0059] See also Figure 3 , Figure 3 A flow chart of another data processing method provided in an embodiment of the present application. The data processing method can be implemented by the above-mentioned server 102, or by other devices. The flow of the data processing method provided in an embodiment of the present application includes but is not limited to:
[0060] S301, running a processing process and a game process of the game, and injecting a data acquisition instruction file into the game process.
[0061] In an embodiment of the present application, the server runs a processing process and a game process of the game, and the processing process is an external process different from the game process. The processing process can receive external information (for example, the quality of user input) and display relevant information on a display (for example, displaying the acquired game performance data). The game can be an electronic game developed based on Direct3D, and the electronic game can be a computer game, etc. The data acquisition instruction file can be determined based on the common data of the game developed based on Direct3D. The same data acquisition instruction file can be used to obtain performance data of multiple different games.
[0062] In one embodiment, the implementation method of injecting the data acquisition instruction file into the game process can be: obtaining the process identification information of the game process; calling the processing process to load the data acquisition instruction file into the game process according to the process identification information. In the embodiment of the present application, the process identification information of the game process can be a process identification number (Process Identity document, PID), which is a value used by the kernel of the operating system to uniquely identify the process. After obtaining the process identification information of the game process, the game process can be scheduled and controlled. Calling the processing process to load the data acquisition instruction file into the game process according to the identification information can be loading the data acquisition instruction file into the process space corresponding to the game process. The process space of the process is actually a data structure. The process space can protect the physical memory and the relevant data in the process, ensuring that each process is independent of each other. Loading the file into the process space of the process can enable the process to execute the relevant content in the file. Loading the data acquisition instruction file into the game process can enable the game process to execute the relevant content in the data acquisition instruction file, thereby accurately obtaining the game performance data of the game.
[0063] S302. Create a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data.
[0064] In the embodiment of the present application, after the data acquisition instruction file is injected into the game process, the game process will execute the relevant content in the data acquisition instruction file. The state shared storage space and the performance shared storage space are created by the game process according to the data acquisition instruction file, wherein the state shared storage space is used to store the state indication information, and the state indication information is used to indicate whether to obtain the game performance data, and the performance shared storage space is used to store the game performance data. The state shared storage space and the performance shared storage space can be accessed by the game process, and can also be accessed by other processes (such as processing processes) running in the server. In the present application, after the game performance analysis is completed, the injected data acquisition instruction file can be deleted, so as to achieve the acquisition of game performance data without modifying or adding game related codes, and ensure the low coupling and high cohesion of game related codes. The method provided in the embodiment of the present application creates a shared storage space that can be accessed by the game process and the processing process, so that the processing process can accurately obtain the game performance data of the game.
[0065] S303. If the status indication information indicates obtaining game performance data, then the first game performance data of the game is obtained from the game process according to the data acquisition indication file, and the first game performance data includes one or more of the number of game rendering instructions, the number of game graphics elements, the computing resource occupancy rate and the storage space occupancy rate.
[0066] In the embodiment of the present application, the processing process can access the state shared storage space and modify the state indication information. The game process can detect the state indication information in the state shared storage space. If the state indication information indicates obtaining the game performance data, the first game performance data of the game is obtained from the game process according to the data acquisition indication file. The first game performance data may include one or more of the number of game rendering instructions, the number of game primitives, the computing resource occupancy rate and the storage space occupancy rate. The number of game rendering instructions refers to the number of rendering instructions (Drawcall) in the game process. Drawcall is an instruction sent by the CPU to the GPU. The CPU stores the Drawcall instruction in the command buffer, and the GPU reads the Drawcall instruction from the command buffer and executes it. The more the number of Drawcall, the more times the CPU stores it, which in turn causes the CPU to spend a lot of time submitting, which easily causes the CPU to overload. Therefore, the number of game rendering instructions can be used to measure the performance of the game. The number of game primitives refers to the number of primitives that need to be rendered in the game process. Primitives are used to build graphic models and scenes in the game, so the number of game primitives can reflect the picture quality of the game to a certain extent and can be used to measure the performance of the game. The computing resource occupancy rate may include the CPU occupancy rate and GPU occupancy rate of the game process. A high computing resource occupancy rate may cause hardware failure or errors in the running of the game process, so the computing resource occupancy rate can be used to measure the performance of the game. The storage space occupancy rate refers to the memory occupancy rate of the server by the game process. A high storage space occupancy rate may also cause errors in the running of the game process, so the storage space occupancy rate can be used to measure the performance of the game.
[0067] In one embodiment, after the processing process injects the data acquisition indication file into the game process, it is possible to: call the processing process to perform detection processing on the shared storage space to obtain the storage space detection result; if the storage space detection result indicates that the state shared storage space and the performance shared storage space are created, the state indication information is modified to obtain the game performance data, and the processing process is called to store the modified state indication information in the state shared storage space. After the processing process injects the data acquisition indication file into the game process, it is possible to perform detection processing on the shared storage space in the server to obtain the storage space detection result. If the storage space detection result indicates that the state shared storage space and the performance shared storage space are created, the state indication information can be modified to obtain the game performance data, and the processing process is called to store the modified state indication information in the state shared storage space. The processing process can receive external instructions and can modify the status indication information according to actual conditions. For example, if the external instruction indicates that the game performance data needs to be obtained, the processing process modifies the status indication information to obtain the game performance data after receiving the external instruction, and stores it in the state shared storage space, thereby obtaining the game performance data of the game; after a period of time, the external instruction indicates that the game performance data does not need to be obtained, and the processing process modifies the status indication information to not obtain the game performance data after receiving the external instruction, and stores it in the state shared storage space, thereby stopping obtaining the game performance data of the game. The method provided in the embodiment of the present application can effectively realize the acquisition of game performance data, improve the efficiency of data acquisition, and ensure the independence of the game process.
[0068] In one embodiment, the data acquisition instruction file may be a dynamic link library file, which may include a data acquisition function and acquisition frequency data. The implementation method of acquiring the first game performance data of the game from the game process according to the data acquisition instruction file may be: calling the data acquisition function to acquire the first game performance data of the game from the game process according to the acquisition frequency data, and the data acquisition function is determined according to the game file of the game. The data acquisition instruction file may be a dynamic link library file, and the dynamic link library (DLL) file is a non-executable binary program file, which includes codes and other resources necessary for allowing processes to share and perform special tasks. The data acquisition instruction file in the embodiment of the present application may be a dynamic link library file, which contains codes and other resources necessary for running the game process and processing the process to share and perform the game performance data acquisition task. The dynamic link library file may include a data acquisition function and acquisition frequency data, the data acquisition function is used to acquire the game performance data in the game process, and the acquisition frequency data is used to indicate the frequency of collecting the game performance data. The dynamic link library file may include multiple data acquisition functions, each of which is used to acquire different categories of game performance data. The data acquisition function can be determined based on the underlying code of the game, and the acquisition frequency data can be modified according to actual application requirements. For example, the acquisition frequency data can be 1 second, that is, the game performance data is collected every second, and the collected game performance data is stored in the performance shared storage space.
[0069] In one embodiment, the data acquisition instruction file is a dynamic link library file, which includes a data acquisition function and acquisition frequency data. The method of determining the data acquisition function can be: acquiring a game file associated with the game, analyzing and processing the game file to obtain a game performance function associated with the game performance data; rewriting the game performance function to obtain the data acquisition function. In order to ensure the universality of the dynamic link library file, the data acquisition function in the dynamic link library file can be determined according to the common underlying code associated with the game (the game is developed based on Direct3D), so that the dynamic link library file can be used to obtain game performance data of different games (the game is developed based on Direct3D). The game file associated with the game is acquired, and the game file can be a file or code associated with Direct3D game performance data. The game file can be acquired from the source code of Direct3D, from the game engine source code associated with Direct3D, or from other files associated with Direct3D. The game file is analyzed and processed to obtain a game performance function associated with the game performance data; the game performance function is rewritten to obtain the data acquisition function. Since the Unreal Engine contains D3D-related calling codes, and the Unreal Engine code is open source, the game files (that is, functions related to Direct3D game performance data) can be obtained from the Unreal Engine source code, so that the game performance functions can be subsequently separated from them and the data acquisition functions can be determined. After determining the game files, the game files can be analyzed and processed. Assuming that it is determined that there are functions related to rendering instructions (Drawcall) in the class named ID3D12GraphicsCommandList, an instance of the ID3D12GraphicsCommandList class can be generated so that the game performance functions can be rewritten later. After generating an instance of the ID3D12GraphicsCommandList class, the offset address of the relevant function in the ID3D12GraphicsCommandList class can be determined according to the compilation process. See Figure 4 , which shows a method for determining the offset address of a function provided in an embodiment of the present application. Figure 4In the , the first line is "ID3D12GraphicsCommandList::$vftable@:", indicating that the following is the virtual function table of the ID3D12GraphicsCommandList class; the second line is "|&ID3D12GraphicsCommandList_meta", indicating the beginning of the virtual function table of the ID3D12GraphicsCommandList class; the third line is "12|&ID3D12GraphicsCommandList::DrawInstanced", indicating that the name of the ID3D12GraphicsCommandList class is "Draw Instanced" function has an offset address of 12, which is used to obtain the number of rendering instructions in the game process; the fourth line is "13|&ID3D12GraphicsCommandList::DrawIndexedInstanced", which means that the offset address of the function named "DrawIndexedInstanced" in the ID3D12GraphicsCommandList class is 13, which is used to obtain the number of game primitives in the game process; the fifth line is "20|&ID3D12GraphicsCommandList::IASetPrimitiveTopology", which means that ID3D12GraphicsCo The offset address of the function named "IASetPrimitiveTopology" in the mmandList class is 20, which is used to set the type of topological structure of the game primitives in the game process; the sixth line is "59|&ID3D12GraphicsCommandList::ExecuteIndirect", which means that the offset address of the function named "ExecuteIndirect" in the ID3D12GraphicsCommandList class is 59, which is used to obtain the number of rendering instructions in the game process. Before executing the rendering instruction (Drawcall), the game process usually sets the topological type of the game primitives through the IASetPrimitiveTopology function, and the game process will save the topological type of the game primitives set at this time until the next rendering instruction (Drawcall) is executed. The game process sets the topological type of the game primitives through the IASetPrimitiveTopology function, so the topological type of the game image that was most recently configured by the IASetPrimitiveTopology function can be obtained.After determining the offset address of the game performance function, the address of the virtual function table of the ID3D12GraphicsCommandList class can be obtained. The implementation code of this step can be "Dx12_pCommandListVTable = (DWORD_PTR*)g_pd3dCommandList;" where Dx12_pCommandListVTable is the object that receives the virtual function table, g_pd3dCommandList is an instance of the ID3D12GraphicsCommandList class, and "DWORD_PTR*" means getting the address. The overall effect of the above code is: store the address corresponding to the g_pd3dCommandList instance into Dx12_pCommandListVTable, that is, Dx12_pCommandListVTa ble contains the virtual function table of the ID3D12GraphicsCommandList class. After determining the virtual function table, you can do something like. Figure 4 The game performance function shown (i.e. Figure 4 The DrawInstanced function, DrawIndexedInstanced function, IASetPrimitiveTopology function, and ExecuteIndirect function in the dynamic link library file are rewritten to obtain the data acquisition function. After the dynamic link library file is injected into the game process, the data acquisition function in the dynamic link library file can obtain game performance data. Figure 5 , which shows a method for determining a data acquisition function provided in an embodiment of the present application. Figure 5 In the above Figure 4 For example, the DrawInstanced function in Figure 4 It can be seen that the offset address of the DrawInstanced function is 12, so the position of the DrawInstanced function in the virtual function table of the ID3D12GraphicsCommandList class is the 12th, so you can execute the following Figure 5The first line of code (i.e. "FuncPtr_D3D12_DrawInstanced D3D12_pDrawInstanced = (FuncPtr_D3D12_DrawInstanced) Dx12_pCommandListVTable
[12] ;") gives the 12th position in the virtual function table to the object D3D12_pDrawInstanced (the class of the object is FuncPtr_D3D12_DrawInstanced), which is equivalent to replacing the original DrawInstanced function with the D3D12_pDrawInstanced function. The second line is "void__stdcall New_D3D12_DrawInstanced(...)", which means generating the data acquisition function New_D3D12_DrawInstanced, which can be used to obtain the number of rendering instructions in the game process. Lines 3 to 7 are the function contents of the New_D3D12_DrawInstanced function, where the 4th line is "gi_Dx_ptr->drawcalls+=1; / / Drawcall calculation", which indicates that a Drawcall calculation is performed. Each time a Drawcall instruction is executed by the game process, the drawcalls parameter is increased by 1 on the original basis; the 5th line is "gi_Dx_ptr=>primitives+=InstanceCount*ComputeDX12Info(D3D12PrimitivesTopology...); / / Primitive calculation", which indicates that the number of current game primitives is calculated. D3D12PrimitivesTopology is the type of game primitives, which can be calculated according to the above Figure 4 The IASetPrimitiveTopology function in the function is determined; the sixth line is "D3D12_pDrawInstanced(...);", which means calling Figure 5 The D3D12_pDrawInstanced function rewritten in line 1 performs Drawcall instruction-related processing. The method provided in the embodiment of the present application can extract functions related to game performance data from the game file and rewrite these functions, so as to accurately and comprehensively obtain game performance data, which is conducive to obtaining accurate game performance analysis results.
[0071] In one embodiment, the method of stripping and determining the data acquisition function from the game file and using the data acquisition function to acquire the game performance data may be a HOOK technology, which refers to the use of technical means to dynamically attach additional code to the current process while the process is running, thereby achieving the purpose of replacing the existing processing logic or inserting additional functions. Through the method provided in the embodiment of the present application, the functions associated with the game performance data can be fully acquired and the data acquisition function can be determined, so that the game performance data can be acquired comprehensively and accurately, which effectively improves the efficiency of acquiring the game performance data and is also conducive to improving the accuracy of the game performance analysis.
[0072] S304: Store the first game performance data into the performance shared storage space through the game process.
[0073] In the embodiment of the present application, the first game performance data is stored in the performance shared storage space through the game process, so that the processing process can obtain the first game performance data from the performance shared storage space and perform performance analysis based on the first game performance data. The method provided in the embodiment of the present application uses the performance shared storage space to achieve indirect interaction between the game process and the processing process, ensures the independence of the game process and the processing process, and achieves efficient acquisition of game performance data of the game.
[0074] S305: Obtain the first game performance data from the performance shared storage space through the processing process, and analyze and process the first game performance data.
[0075] In the embodiment of the present application, the first game performance data is obtained from the performance shared storage space by processing the process. After the first game performance data is obtained, the first game performance data can be displayed. Figure 6 , which is a schematic diagram of game performance data provided in an embodiment of the present application. Figure 6 In the figure, the upper part is the game interface, and the figure also shows the game performance data obtained by the processing process and the game performance data in the game process after using the method provided in the embodiment of the present application. Figure 6In the figure, the game performance data obtained by the processing process is as follows: "Time" indicates the time for obtaining the game performance data, which is "154"; "FPS" indicates the number of frames per second transmitted by the current game, which is "81"; "Drawcalls" indicates the number of rendering instructions of the current game, which is "986.0"; "Primitives" indicates the number of primitives of the current game, which is "14507530"; "CPU" indicates the proportion of CPU occupied by the current game, which is "8.7%"; "GPU" indicates the proportion of GPU occupied by the current game, which is "100.0%"; "Mem" indicates the size of the memory space occupied by the current game, which is "5912.33M". The game performance data during the game process is as follows: "Frame" indicates the rate at which the game displays images per unit time, which is "12.20ms"; "GPUspeed" indicates the current GPU processing rate, which is "12.40ms"; "Drawcalls" indicates the number of rendering instructions for the current game, which is "987"; "Primitives" indicates the number of primitives in the current game, which is "14451.2K". Figure 6 It can be seen that the difference between the number of game rendering instructions in the game performance data obtained by the processing process (Drawcalls is 986) and the actual number of game rendering instructions in the game process (Drawcalls is 987) is small (the error rate is about 0.1%); the difference between the number of game primitives in the game performance data obtained by the processing process (Primitives is 14507530) and the actual number of game primitives in the game process (Primitives is 14451.2K, about 14451200) is small (the error rate is about 0.4%). Figure 6 It can be seen that the game performance data obtained by the method provided in the embodiment of the present application is very close to the actual game performance data of the game process. The method provided in the embodiment of the present application can accurately obtain game performance data, which is conducive to game performance analysis based on accurate game performance data.
[0076] It should be noted that Figure 6 Some performance parameters in the game performance data in the game process (for example, "Frame" and "GPU speed" performance parameters) do not appear in the game performance data obtained by the processing process because the types of game performance data required for different game performance analyses may be different. According to different actual application requirements, the data acquisition instruction file can be adaptively modified to obtain the above game performance data. The method provided in the embodiment of the present application is also applicable to other types of game performance data in the game.
[0077] In one embodiment, the implementation method of analyzing and processing the first game performance data can be: calling a processing process to obtain the first game performance data from the performance shared storage space according to the acquisition frequency data; obtaining the second game performance data of the game, and the data acquisition time of the second game performance data is earlier than the data acquisition time of the first game performance data; performing data analysis according to the first game performance data and the second game performance data to obtain the game performance analysis result of the game. Since the data acquisition function in the dynamic link library file obtains the first game performance data according to the acquisition frequency data, and the game process also stores the first game performance data in the performance shared storage space according to the data acquisition frequency, in order to avoid data overwriting, it is necessary to call the processing process to obtain the first game performance data from the performance shared storage space according to the acquisition frequency data. For example: if the acquisition frequency data is 1 second, the data acquisition function obtains the first game performance data from the game process every second, and the game process stores the obtained first game performance data in the performance shared storage space, and the processing process can be called to obtain the first game performance data from the performance shared storage space every second. One or more second game performance data of the game can be obtained, and the data acquisition time of the second game performance data is earlier than the data acquisition time of the first game performance data, that is, the second game performance data is the historical game performance data of the game. Data analysis is performed based on the first game performance data and the second game performance data to obtain a game performance analysis result of the game. The method provided in the embodiment of the present application can effectively determine the performance analysis result of the game based on the current game performance data obtained and the previously obtained game performance data, which is conducive to further optimizing the relevant functions of the game based on the game performance analysis result.
[0078] In one embodiment, the first game performance data includes the number of game rendering instructions and the number of game primitives, and the second game performance data includes the number of game rendering instructions and the number of game primitives. Then, data analysis is performed based on the first game performance data and the second game performance data to obtain the game performance analysis result of the game. The implementation method may be as follows: calculating the change rate of the number of game rendering instructions of the first game performance data and the number of game rendering instructions of the second game performance data according to the data acquisition time to obtain the game rendering instruction change rate of the game; calculating the change rate of the number of game primitives of the first game performance data and the number of game primitives of the second game performance data according to the data acquisition time to obtain the change rate of the number of game primitives of the game; and determining the game performance analysis result of the game based on the game rendering instruction change rate and the change rate of the number of game primitives. In the embodiment of the present application, the second game performance data may be one or more, and multiple second game performance data are used as an example for explanation: according to the data acquisition time, the number of game rendering instructions of the first game performance data and the number of game rendering instructions of the multiple second game performance data are calculated (the change rate calculation may be a curve fitting process), and the game rendering instruction change rate of the game is obtained. The game rendering instruction change rate can reflect the change of the number of rendering instructions of the game over a period of time. If the game rendering instruction change rate indicates that the number of rendering instructions of the game has been maintained at a high state, it may cause CPU overload. According to the data acquisition time, the number of game primitives of the first game performance data and the number of game primitives of the multiple second game performance data are calculated (the change rate calculation may be a curve fitting process), and the game primitive number change rate of the game is obtained. The game primitive number change rate can reflect the change of the number of primitives in the game screen of the game over a period of time. If the game primitive number change rate indicates that the number of primitives in the game screen of the game has been maintained at a high state, it means that the picture quality of the game is good during this period, and the picture performance of the game is good. The weighted summation process can be performed according to the game rendering instruction change rate and the game primitive number change rate to determine the game performance analysis result of the game. When the first game performance data includes one or more of the number of game rendering instructions, the number of game graphics elements, the computing resource occupancy rate and the storage space occupancy rate, the method for determining the game performance analysis result of the game based on the first game performance data is similar to the above embodiment.
[0079] See also Figure 7 , which shows a schematic diagram of a method for obtaining game performance data provided in an embodiment of the present application. Figure 7The processing process 701 and the game process 702 are included in the processing process 701. The processing process 701 includes an injection module 7011, a data acquisition module 7012 and a data display module 7013. The game process includes a performance data acquisition module 7021, a state shared storage space 7022, a performance shared storage space 7023 and a state detection module 7024. The server runs the processing process 701 and the game process 702 of the game. The injection module 7011 in the processing process 701 injects a data acquisition instruction file into the game process 702. The game process 702 creates a performance data acquisition module 7021, a state shared storage space 7022, a performance shared storage space 7023 and a state detection module 7024 according to the data acquisition instruction file. After the processing process 701 detects that the state shared storage space and the performance shared storage space are created, the data acquisition module 7012 modifies the state indication information in the state shared storage space to obtain game performance data. The state detection module 7024 reads the state indication information in the state shared storage space 7022. If the state indication information is to obtain game performance data, the game performance data of the game process 702 can be periodically obtained, and the game performance data can be stored in the performance shared storage space. The data acquisition module 7012 of the processing process 701 obtains the game performance data from the performance shared storage space, and sends the game performance data to the data display module 7013, and the data display module 7013 displays the obtained game performance data. Through the method provided in the embodiment of the present application, the game performance data of the game can be quickly and accurately obtained, which effectively improves the efficiency of data processing and ensures the accuracy of game performance analysis.
[0080] Based on the above embodiments, the beneficial effects of the present application are: the data processing method provided in the embodiments of the present application can utilize the data acquisition indication file to obtain the game performance data of the game and perform performance analysis, thereby effectively improving the data processing efficiency of the game performance data; the data acquisition indication file is determined based on the common underlying code of the game, therefore, the game performance data can be comprehensively obtained using the data acquisition indication file, and the data acquisition indication file has good universality and can be applied to multiple different games; when the data acquisition indication file is a dynamic link library file, the data acquisition function is stripped from the game file associated with the game, does not involve the source code of the game itself, and can accurately and comprehensively obtain various types of performance data of the game, which is conducive to accurate analysis of the game performance; the shared storage space created in the present application realizes indirect interaction between the game process and the processing process, and can periodically and continuously obtain game performance data while ensuring the independence of the game process, so that accurate and reliable game performance analysis results can be determined based on the game performance data over a period of time.
[0081] See also Figure 8 , Figure 8This is a structural block diagram of a data processing device provided in an embodiment of the present application. The device includes:
[0082] An injection unit 801 is used to run a game process of a game and inject a data acquisition instruction file into the game process;
[0083] A creating unit 802, configured to create a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to acquire game performance data, and the performance shared storage space is used to store game performance data;
[0084] An acquiring unit 803 is configured to acquire first game performance data of the game from the game process according to the data acquisition instruction file if the status indication information indicates to acquire game performance data, wherein the first game performance data includes one or more of the number of game rendering instructions, the number of game primitives, the occupancy rate of computing resources, and the occupancy rate of storage space;
[0085] The acquisition unit 803 is further used to store the first game performance data in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
[0086] In one embodiment, the data acquisition indication file is a dynamic link library file, and the dynamic link library file includes a data acquisition function and acquisition frequency data. When the acquisition unit 803 acquires the first game performance data of the game from the game process according to the data acquisition indication file, it is specifically used to: call the data acquisition function to acquire the first game performance data of the game from the game process according to the acquisition frequency data, and the data acquisition function is determined according to the game file of the game.
[0087] In one embodiment, the acquisition unit 803 is further used to: acquire game files associated with the game, analyze and process the game files to obtain a game performance function associated with game performance data; and rewrite the game performance function to obtain the data acquisition function.
[0088] In one embodiment, the acquisition unit 803 is also used to: call the processing process to acquire the first game performance data from the performance shared storage space according to the acquisition frequency data; acquire the second game performance data of the game, the data acquisition time of the second game performance data being earlier than the data acquisition time of the first game performance data; perform data analysis based on the first game performance data and the second game performance data to obtain a game performance analysis result of the game.
[0089] In one embodiment, the first game performance data includes the number of game rendering instructions and the number of game primitives, and the second game performance data includes the number of game rendering instructions and the number of game primitives; when the acquisition unit 803 performs data analysis based on the first game performance data and the second game performance data to obtain the game performance analysis result of the game, it is specifically used to: calculate the change rate of the number of game rendering instructions of the first game performance data and the number of game rendering instructions of the second game performance data according to the data acquisition time to obtain the game rendering instruction change rate of the game; calculate the change rate of the number of game primitives of the first game performance data and the number of game primitives of the second game performance data according to the data acquisition time to obtain the change rate of the number of game primitives of the game; determine the game performance analysis result of the game according to the game rendering instruction change rate and the change rate of the number of game primitives.
[0090] In one embodiment, when the injection unit 801 injects the data acquisition instruction file into the game process, it is specifically used to: obtain the process identification information of the game process; call the processing process to load the data acquisition instruction file into the game process according to the process identification information.
[0091] In one embodiment, the acquisition unit 803 is also used to: call the processing process to perform detection processing on the shared storage space to obtain a storage space detection result; if the storage space detection result indicates that the state shared storage space and the performance shared storage space are created, then the state indication information is modified to obtain game performance data, and the processing process is called to store the modified state indication information in the state shared storage space.
[0092] It can be understood that the functions of each functional unit of the data processing device of the embodiment of the present application can be specifically implemented according to the data processing method in the above method embodiment, and its specific implementation process can refer to the relevant description in the above data processing method embodiment, which will not be repeated here.
[0093] Based on the above embodiments, the beneficial effects of the present application are: the data processing method provided in the embodiments of the present application can utilize the data acquisition indication file to obtain the game performance data of the game and perform performance analysis, thereby effectively improving the data processing efficiency of the game performance data; the data acquisition indication file is determined based on the common underlying code of the game, therefore, the game performance data can be comprehensively obtained using the data acquisition indication file, and the data acquisition indication file has good universality and can be applied to multiple different games; when the data acquisition indication file is a dynamic link library file, the data acquisition function is stripped from the game file associated with the game, does not involve the source code of the game itself, and can accurately and comprehensively obtain various types of performance data of the game, which is conducive to accurate analysis of the game performance; the shared storage space created in the present application realizes indirect interaction between the game process and the processing process, and can periodically and continuously obtain game performance data while ensuring the independence of the game process, so that accurate and reliable game performance analysis results can be determined based on the game performance data over a period of time.
[0094] See also Fig. 9 , Fig. 9 A block diagram of a computer device provided in an embodiment of the present application. The computer device described in the embodiment of the present application includes: a processor 901, a communication interface 902, and a memory 903. The processor 901, the communication interface 902, and the memory 903 may be connected via a bus or other means, and the embodiment of the present application takes the connection via a bus as an example.
[0095] Among them, the processor 901 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which can parse various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to parse the power on and off instructions sent by the user to the computer device, and control the computer device to perform power on and off operations; for another example, the CPU can transmit various interactive data between the internal structures of the computer device, and so on. The communication interface 902 can optionally include a standard wired interface, a wireless interface (such as Wi-Fi, a mobile communication interface, etc.), which is controlled by the processor 901 to send and receive data. The memory 903 (Memory) is a memory device in the computer device, which is used to store programs and data. It can be understood that the memory 903 here can include both the built-in memory of the computer device and the extended memory supported by the computer device. The memory 903 provides a storage space, which stores the operating system of the computer device, which may include but is not limited to: Android system, iOS system, Windows Phone system, etc., and this application does not limit this.
[0096] In the embodiment of the present application, the processor 901 performs the following operations by running the executable program code in the memory 903:
[0097] Running a game process of the game, and injecting the data acquisition instruction file into the game process;
[0098] Creating a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data;
[0099] If the status indication information indicates obtaining game performance data, obtaining first game performance data of the game from the game process according to the data obtaining indication file, the first game performance data including one or more of the number of game rendering instructions, the number of game graphics elements, the computing resource occupancy rate and the storage space occupancy rate;
[0100] The first game performance data is stored in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
[0101] In one embodiment, the data acquisition indication file is a dynamic link library file, and the dynamic link library file includes a data acquisition function and acquisition frequency data. When the processor 901 acquires the first game performance data of the game from the game process according to the data acquisition indication file, it is specifically used to: call the data acquisition function to acquire the first game performance data of the game from the game process according to the acquisition frequency data, and the data acquisition function is determined according to the game file of the game.
[0102] In one embodiment, the processor 901 is further used to: obtain a game file associated with the game, analyze and process the game file to obtain a game performance function associated with game performance data; and rewrite the game performance function to obtain the data acquisition function.
[0103] In one embodiment, the processor 901 is further used to: call the processing process to obtain the first game performance data from the performance shared storage space according to the acquisition frequency data; obtain second game performance data of the game, the data acquisition time of the second game performance data is earlier than the data acquisition time of the first game performance data; perform data analysis based on the first game performance data and the second game performance data to obtain a game performance analysis result of the game.
[0104] In one embodiment, the first game performance data includes the number of game rendering instructions and the number of game primitives, and the second game performance data includes the number of game rendering instructions and the number of game primitives; when the processor 901 performs data analysis based on the first game performance data and the second game performance data to obtain the game performance analysis result of the game, it is specifically used to: calculate the change rate of the number of game rendering instructions of the first game performance data and the number of game rendering instructions of the second game performance data according to the data acquisition time to obtain the game rendering instruction change rate of the game; calculate the change rate of the number of game primitives of the first game performance data and the number of game primitives of the second game performance data according to the data acquisition time to obtain the change rate of the number of game primitives of the game; determine the game performance analysis result of the game according to the game rendering instruction change rate and the change rate of the number of game primitives.
[0105] In one embodiment, when the processor 901 injects the data acquisition instruction file into the game process, it is specifically used to: obtain the process identification information of the game process; call the processing process to load the data acquisition instruction file into the game process according to the process identification information.
[0106] In one embodiment, the processor 901 is also used to: call the processing process to perform detection processing on the shared storage space to obtain a storage space detection result; if the storage space detection result indicates that the status shared storage space and the performance shared storage space are created, then modify the status indication information to obtain game performance data, and call the processing process to store the modified status indication information in the status shared storage space.
[0107] In a specific implementation, the processor 901, communication interface 902 and memory 903 described in the embodiment of the present application can execute the implementation of the server described in a data processing method provided in an embodiment of the present application, and can also execute the implementation described in a data processing device provided in an embodiment of the present application, which will not be repeated here.
[0108] Based on the above embodiments, the beneficial effects of the present application are: the data processing method provided in the embodiments of the present application can utilize the data acquisition indication file to obtain the game performance data of the game and perform performance analysis, thereby effectively improving the data processing efficiency of the game performance data; the data acquisition indication file is determined based on the common underlying code of the game, therefore, the game performance data can be comprehensively obtained using the data acquisition indication file, and the data acquisition indication file has good universality and can be applied to multiple different games; when the data acquisition indication file is a dynamic link library file, the data acquisition function is stripped from the game file associated with the game, does not involve the source code of the game itself, and can accurately and comprehensively obtain various types of performance data of the game, which is conducive to accurate analysis of the game performance; the shared storage space created in the present application realizes indirect interaction between the game process and the processing process, and can periodically and continuously obtain game performance data while ensuring the independence of the game process, so that accurate and reliable game performance analysis results can be determined based on the game performance data over a period of time.
[0109] The present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is run on a computer, the computer executes the data processing method described in the present application. The specific implementation method can be referred to the above description, and will not be repeated here.
[0110] The embodiment of the present application also provides a computer program product, which includes a computer program or a computer instruction, and the computer program or the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer program or the computer instruction from the computer-readable storage medium, and the processor executes the computer program or the computer instruction, so that the computer device performs the data processing method as described in the embodiment of the present application. The specific implementation method can be referred to the above description, which will not be repeated here.
[0111] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0112] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0113] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Running a game process of the game, and injecting the data acquisition instruction file into the game process; Creating a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to obtain game performance data, and the performance shared storage space is used to store game performance data; If the status indication information indicates obtaining game performance data, obtaining first game performance data of the game from the game process according to the data obtaining indication file, the first game performance data including one or more of the number of game rendering instructions, the number of game graphics elements, the computing resource occupancy rate and the storage space occupancy rate; The first game performance data is stored in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
2. The method according to claim 1, characterized in that The data acquisition instruction file is a dynamic link library file, and the dynamic link library file includes a data acquisition function and acquisition frequency data. The first game performance data of the game is acquired from the game process according to the data acquisition instruction file, including: The data acquisition function is called to acquire first game performance data of the game from the game process according to the acquisition frequency data, and the data acquisition function is determined according to the game file of the game.
3. The method according to claim 2, characterized in that The method further comprises: Acquire a game file associated with the game, analyze and process the game file, and obtain a game performance function associated with the game performance data; The game performance function is rewritten to obtain the data acquisition function.
4. The method according to claim 2, characterized in that: The method further comprises: Calling the processing process to obtain the first game performance data from the performance shared storage space according to the acquisition frequency data; Acquire second game performance data of the game, where data acquisition time of the second game performance data is earlier than data acquisition time of the first game performance data; Data analysis is performed based on the first game performance data and the second game performance data to obtain a game performance analysis result of the game.
5. The method according to claim 4, characterized in that The first game performance data includes the number of game rendering instructions and the number of game primitives, and the second game performance data includes the number of game rendering instructions and the number of game primitives; The performing data analysis according to the first game performance data and the second game performance data to obtain a game performance analysis result of the game includes: Calculate the change rate of the number of game rendering instructions of the first game performance data and the number of game rendering instructions of the second game performance data according to the data acquisition time to obtain the game rendering instruction change rate of the game; Calculating the change rate of the number of game graphics elements of the first game performance data and the number of game graphics elements of the second game performance data according to the data acquisition time to obtain the change rate of the number of game graphics elements of the game; The game performance analysis result of the game is determined according to the change rate of the game rendering instructions and the change rate of the number of game primitives.
6. The method according to any one of claims 1 to 5, characterized in that: The step of injecting the data acquisition instruction file into the game process includes: Obtaining process identification information of the game process; The processing process is called to load the data acquisition instruction file into the game process according to the process identification information.
7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Calling the processing process to perform detection processing on the shared storage space to obtain a storage space detection result; If the storage space detection result indicates that the state shared storage space and the performance shared storage space are created, the state indication information is modified to obtain game performance data, and the processing process is called to store the modified state indication information in the state shared storage space.
8. A data processing device, characterized in that: The device comprises: An injection unit, used for running a game process of the game and injecting a data acquisition instruction file into the game process; a creating unit, configured to create a state shared storage space and a performance shared storage space according to the data acquisition indication file through the game process, wherein the state shared storage space is used to store state indication information, the state indication information is used to indicate whether to acquire game performance data, and the performance shared storage space is used to store game performance data; an acquisition unit, configured to acquire first game performance data of the game from the game process according to the data acquisition instruction file if the status indication information indicates to acquire game performance data, wherein the first game performance data includes one or more of the number of game rendering instructions, the number of game primitives, the occupancy rate of computing resources, and the occupancy rate of storage space; The acquisition unit is further used to store the first game performance data in the performance shared storage space, so that the processing process obtains the first game performance data from the performance shared storage space and analyzes and processes the first game performance data.
9. A computer device, characterized in that: include: A processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected, wherein the memory stores an executable program code, and the processor is used to call the executable program code to implement the data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer, enable the computer to implement the data processing method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises a computer program or a computer instruction, and when the computer program or the computer instruction is executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.