CN112023402B - Game data processing method, device, equipment and medium - Google Patents

Game data processing method, device, equipment and medium Download PDF

Info

Publication number
CN112023402B
CN112023402B CN202010910388.4A CN202010910388A CN112023402B CN 112023402 B CN112023402 B CN 112023402B CN 202010910388 A CN202010910388 A CN 202010910388A CN 112023402 B CN112023402 B CN 112023402B
Authority
CN
China
Prior art keywords
interface
game
calling
information
rendered
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010910388.4A
Other languages
Chinese (zh)
Other versions
CN112023402A (en
Inventor
王炳堪
谭文
杨榕
施帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010910388.4A priority Critical patent/CN112023402B/en
Publication of CN112023402A publication Critical patent/CN112023402A/en
Application granted granted Critical
Publication of CN112023402B publication Critical patent/CN112023402B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/75Enforcing rules, e.g. detecting foul play or generating lists of cheating players
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/71Game security or game management aspects using secure communication between game devices and game servers, e.g. by encrypting game data or authenticating players
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/30Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device
    • A63F2300/308Details of the user interface
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/609Methods for processing data by generating or executing the game program for unlocking hidden game elements, e.g. features, items, levels

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a game data processing method, a device, equipment and a medium, the method relates to rendering processing of game data such as a cloud game, a hand game, an end game, a page game and the like, and the method comprises the following steps: acquiring interface calling information and game data to be rendered for a rendering function interface in a first process, and transmitting the interface calling information and the game data to be rendered between the first process and a second process; the first process is a process which runs in the black box and is used for executing game logic, and the second process is a process which runs outside the black box and is used for executing rendering logic; and when the second process acquires the interface calling information and the game data to be rendered, calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display. By adopting the embodiment of the application, the safety of the game can be improved.

Description

Game data processing method, device, equipment and medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a medium for processing game data.
Background
The rapid development of internet technology enriches people's entertainment lives, and various online games emerge, increasing the frequency with which users use online games. During the running process of the online game, a drawing programming interface can be called, relevant data (such as virtual character position information in the game scene) in the game scene is rendered, a virtual character picture in the online game is drawn, and the game scene containing the virtual character picture is displayed in a client of the online game.
In the prior art, both the game logic and the rendering logic of the online game are completed in the game process, that is, the game logic can be executed in the game process corresponding to the online game, and when a drawing programming interface call is generated in the game process, the drawing programming interface can be directly called in the game process to render the game picture. Because the virtual character coordinate information and the drawing programming interface calling information in the online game are both in the same process (namely game process) space, the virtual character coordinate information is easy to leak and is further used by plug-ins, and the game safety is too low.
Disclosure of Invention
The embodiment of the application provides a game data processing method, a game data processing device, equipment and a medium, and the security of a game can be improved.
An embodiment of the present application provides a game data processing method, including:
acquiring interface calling information and game data to be rendered for a rendering function interface in a first process, and transmitting the interface calling information and the game data to be rendered between the first process and a second process; the first process is a process which runs in the black box and is used for executing game logic, and the second process is a process which runs outside the black box and is used for executing rendering logic;
and when the second process acquires the interface calling information and the game data to be rendered, calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display.
The above obtaining interface call information and game data to be rendered for a rendering function interface in a first process, and transmitting the interface call information and the game data to be rendered between the first process and a second process includes:
when a call instruction aiming at a rendering function interface in a first process is detected, interface call information and game data to be rendered, which correspond to the call instruction, are obtained from the first process through an agent dynamic link library;
transmitting the interface calling information and the game data to be rendered to a shared memory space through an agent dynamic link library;
if the second process monitors the interface calling information and the game data to be rendered in the shared memory space, the interface calling information and the game data to be rendered are obtained from the shared memory space through the second process; the first process and the second process both have the right to access the shared memory space.
The shared memory space comprises a ring queue;
transmitting the interface calling information and the game data to be rendered to a shared memory space through an agent dynamic link library, comprising:
acquiring an interface identifier corresponding to a rendering function interface through a proxy dynamic link library, packaging interface calling information and the interface identifier into a calling data packet, and acquiring interface category information corresponding to the rendering function interface;
and if the interface type information is the asynchronous calling interface type, storing the calling data packet and the game data to be rendered into an empty slot in the annular queue through the proxy dynamic link library.
Wherein, the method also comprises:
if the interface type information is the sequential calling interface type, monitoring the processing state of the historical calling data packet contained in the annular queue through the proxy dynamic link library;
and when the processing state of the historical calling data packet is a processed state, storing the calling data packet and the game data to be rendered into an empty slot in the annular queue through the proxy dynamic link library.
Wherein the history calling data packet comprises a calling data packet aiAnd call packet ai+1Call packet aiStore to ring queue earlier than call packet ai+1Storing time to a ring queue, i being a positive integer less than the number of call packets;
the method further comprises the following steps:
obtaining calling data packet a from ring queue by second processiWill call packet aiIn the form of a treatmentThe state is determined to be a processed state;
when calling data packet aiWhen the processing state of the call packet a is a processed state, the call packet a is acquired from the ring queue by the second processi+1Will call packet ai+1The processing state of (1) is determined as a processed state;
when calling data packet aiAnd call packet ai+1When the processing states of the history calling data packet are the processed states, the processing state of the history calling data packet is determined to be the processed state.
The asynchronous calling interface type comprises a setting interface type;
if the interface type information is asynchronous calling interface type, storing the calling data packet and the game data to be rendered to an empty slot in the annular queue through the proxy dynamic link library, and the method comprises the following steps:
if the interface type information is the set interface type, transmitting interface calling information in the first process to a state machine through a dynamic link library, and storing a calling data packet and game data to be rendered to an empty slot in an annular queue through a proxy dynamic link library;
determining an interface name and a setting state corresponding to the rendering function interface according to the interface calling information, and storing the interface name and the setting state as key value pair information in a state machine; the key-value pair information is used to instruct the first process to obtain the setting state from the state machine.
Wherein, the method also comprises:
if the rendering function interface belongs to the sequential calling interface category, packaging a calling result corresponding to the game interface into a result data packet in a second process, and transmitting the result data packet to the shared memory space;
and if the first process monitors the result data packet in the shared memory space, acquiring the result data packet from the shared memory space through the first process, analyzing the result data packet to obtain a calling result, and continuously executing subsequent game logic according to the calling result in the first process.
The method includes the steps of acquiring an interface identifier corresponding to a rendering function interface through a proxy dynamic link library, packaging interface calling information and the interface identifier into a calling data packet, and acquiring interface category information corresponding to the rendering function interface, including:
acquiring an interface calling information table through a proxy dynamic link library;
traversing in an interface calling information table according to the interface calling information, and acquiring interface identification and interface category information which have a mapping relation with the interface calling information from the interface calling information table;
and encapsulating the interface calling information and the interface identification into a calling data packet.
Wherein, the method also comprises:
acquiring an agent dynamic link library associated with a first process, loading the agent dynamic link library in the first process, and replacing an original dynamic link library corresponding to the first process with the agent dynamic link library; and the proxy dynamic link library is used for transmitting the interface calling information and the game data to be rendered in the first process to the shared memory space.
Acquiring interface calling information and game data to be rendered from a shared memory space through a second process; the method comprises the following steps:
acquiring a calling data packet and game data to be rendered from a shared memory space through a second process;
analyzing the calling data packet to obtain interface calling information and an interface identifier;
calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display, wherein the game interface comprises:
in the second process, calling a rendering function interface in the proxy dynamic link library according to the interface calling information and the interface identifier;
rendering the game data to be rendered according to the rendering function interface, generating a game interface corresponding to the game data to be rendered, and displaying the game interface in game application.
An embodiment of the present application provides a game data processing apparatus, including:
the transmission module is used for acquiring interface calling information aiming at a rendering function interface in a first process and game data to be rendered, and transmitting the interface calling information and the game data to be rendered between the first process and a second process; the first process is a process which runs in the black box and is used for executing game logic, and the second process is a process which runs outside the black box and is used for executing rendering logic;
and the rendering module is used for calling a rendering function interface according to the interface calling information in the second process when the second process acquires the interface calling information and the game data to be rendered, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for displaying.
Wherein, the transmission module includes:
the system comprises a calling interception unit, a proxy dynamic link library and a rendering unit, wherein the calling interception unit is used for acquiring interface calling information and game data to be rendered, which correspond to a calling instruction, from a first process through the proxy dynamic link library when the calling instruction aiming at a rendering function interface in the first process is detected;
the calling transmission unit is used for transmitting the interface calling information and the game data to be rendered to the shared memory space through the proxy dynamic link library;
the calling and obtaining unit is used for obtaining the interface calling information and the game data to be rendered from the shared memory space through the second process if the second process monitors the interface calling information and the game data to be rendered in the shared memory space; the first process and the second process both have the right to access the shared memory space.
The shared memory space comprises a ring queue;
the calling transmission unit comprises:
the calling information packaging subunit is used for acquiring an interface identifier corresponding to the rendering function interface through the proxy dynamic link library, packaging the interface calling information and the interface identifier into a calling data packet, and acquiring interface category information corresponding to the rendering function interface;
and the data storage subunit is used for storing the calling data packet and the game data to be rendered into the empty slot in the annular queue through the proxy dynamic link library if the interface type information is the asynchronous calling interface type.
Wherein, the device still includes:
the monitoring module is used for monitoring the processing state of the historical calling data packet contained in the annular queue through the proxy dynamic link library if the interface type information is the sequential calling interface type;
and the storage module is used for storing the calling data packet and the game data to be rendered to an empty slot in the annular queue through the proxy dynamic link library when the processing state of the historical calling data packet is the processed state.
Wherein the history calling data packet comprises a calling data packet aiAnd call packet ai+1Call packet aiStore to ring queue earlier than call packet ai+1Storing time to a ring queue, i being a positive integer less than the number of call packets;
the device also includes:
a processing state determining module for obtaining the calling data packet a from the ring queue through the second processiWill call packet aiThe processing state of (1) is determined as a processed state;
the processing state module is also used for calling the data packet aiWhen the processing state of the call packet a is a processed state, the call packet a is acquired from the ring queue by the second processi+1Will call packet ai+1The processing state of (1) is determined as a processed state;
the processing state determining module is also used for calling the data packet aiAnd call packet ai+1When the processing states of the history calling data packet are the processed states, the processing state of the history calling data packet is determined to be the processed state.
The asynchronous calling interface type comprises a setting interface type;
the data storage subunit includes:
the state machine transmission subunit is used for transmitting the interface calling information in the first process to the state machine through the dynamic link library and storing the calling data packet and the game data to be rendered into an empty slot in the annular queue through the proxy dynamic link library if the interface type information is the set interface type;
the state machine storage subunit is used for determining an interface name and a setting state corresponding to the rendering function interface according to the interface calling information, and storing the interface name and the setting state as key value pair information in the state machine; the key-value pair information is used to instruct the first process to obtain the setting state from the state machine.
Wherein, the device still includes:
the result packaging module is used for packaging a calling result corresponding to the game interface into a result data packet in a second process and transmitting the result data packet to the shared memory space if the rendering function interface belongs to the sequential calling interface category;
and the result acquisition module is used for acquiring the result data packet from the shared memory space through the first process if the first process monitors the result data packet in the shared memory space, analyzing the result data packet to obtain a calling result, and continuously executing subsequent game logic according to the calling result in the first process.
Wherein, the calling information packaging subunit comprises:
the information table acquisition subunit is used for acquiring an interface calling information table through the proxy dynamic link library;
the traversal subunit is used for traversing in the interface calling information table according to the interface calling information, and acquiring the interface identifier and the interface category information which have a mapping relation with the interface calling information from the interface calling information table;
and the packaging subunit is used for packaging the interface calling information and the interface identifier into a calling data packet.
Wherein, the device still includes:
the replacing module is used for acquiring an agent dynamic link library associated with the first process, loading the agent dynamic link library in the first process and replacing an original dynamic link library corresponding to the first process with the agent dynamic link library; and the proxy dynamic link library is used for transmitting the interface calling information and the game data to be rendered in the first process to the shared memory space.
Wherein, the call acquisition unit includes:
the data acquisition subunit is used for acquiring the calling data packet and the game data to be rendered from the shared memory space through a second process;
the analysis subunit is used for analyzing the calling data packet to obtain interface calling information and an interface identifier;
the rendering module includes:
the interface calling unit is used for calling a rendering function interface in the proxy dynamic link library according to the interface calling information and the interface identifier in the second process;
and the display unit is used for rendering the game data to be rendered according to the rendering function interface, generating a game interface corresponding to the game data to be rendered, and displaying the game interface in game application.
An aspect of the embodiments of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of the method in the aspect of the embodiments of the present application.
An aspect of the embodiments of the present application provides a computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions that, when executed by a processor, perform the steps of the method as in an aspect of the embodiments of the present application.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the method provided in the various alternatives of the above aspect.
The method and the device for processing the game data can transmit interface calling information and the game data to be rendered between a first process and a second process by acquiring the interface calling information and the game data to be rendered for a rendering function interface in the first process, wherein the first process is a process which runs in a black box and is used for executing game logic, and the second process is a process which runs outside the black box and is used for executing the rendering logic; when the second process obtains the interface calling information and the game data to be rendered, the rendering function interface can be called according to the interface calling information, the rendering function interface is adopted to render the game data to be rendered, and the game interface used for being displayed on the game display page is generated. Therefore, the game is separated into two processes, and the first process is packaged in the black box to run, so that the information such as the coordinates of virtual characters in the game, the process memory and the like can be effectively hidden, the difficulty of plug-in development of the game is increased, and the safety of the game is enhanced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a block diagram of a game processing system according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a game data processing scenario provided in an embodiment of the present application;
FIG. 3 is a flow chart of a game data processing method according to an embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating a game data processing method according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a game rendering provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a game rendering provided by an embodiment of the present application;
FIG. 7 is a flow chart illustrating a method for processing game data according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a game processing flow provided by an embodiment of the present application;
FIG. 9 is a schematic diagram of a game rendering provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of communication between a first process and a second process provided by an embodiment of the present application;
FIG. 11 is a schematic structural diagram of a game data processing device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Embodiments of the present application relate to cloud technology (cloud technology), cloud computing (cloud computing), and cloud gaming (cloud gaming). The cloud technology is a hosting technology for unifying series resources such as hardware, software, network and the like in a wide area network or a local area network to realize data calculation, storage, processing and sharing. The cloud technology is a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied based on a cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing is a computing model that distributes computing tasks over a resource pool of large numbers of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The game data processing scheme provided by the application relates to data processing in a game scene, and for a game with a large task scene (such as a large task requiring participation of tens of thousands of player virtual characters in the game scene), computing equipment can be acquired from the cloud computing resource pool to perform operation and rendering on game data generated in the game, for example, a process for executing game logic can acquire the computing equipment from the cloud computing resource pool, and perform action on the player virtual characters in the large task, The information such as the position is calculated, the process of executing the rendering logic can acquire the computing equipment from the cloud computing pool to perform picture rendering processing on the large task, the data operation pressure of the game background can be reduced, the picture rendering capability in the game is enhanced, and the smoothness of the game can be further enhanced.
Cloud games, which may also be referred to as game on demand (game), are an online game technology based on cloud computing technology. Cloud game technology enables light-end devices (thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not executed in a player game terminal but is executed in a cloud server, a game process and a rendering process can be executed in the cloud server, the game process can be executed in a black box formed by the cloud server and used for executing game logic, and the rendering process can be executed outside the black box (for example, another cloud server) and used for executing the rendering logic; the game process and the rendering process can be operated in different cloud servers, or can be operated in two containers of the same cloud server, so that memory isolation between the game process and the rendering process is achieved, the cloud server operating the rendering process renders a game scene into a video and audio stream, and the video and audio stream is transmitted to the game terminal of the player through a network. The player game terminal does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring player input instructions and sending the instructions to the cloud server. When a player tries to play a cloud game, the essence is to operate on streaming (audio streaming and video streaming) data of a game screen.
The embodiment of the application also relates to the following concepts:
direct 3D: direct3D (3D drawing Programming Interface) is a submodule in Direct x, Direct3D can be used to provide a graphics Interface, Direct x is a series of Application Programming Interfaces (APIs) developed specifically for multimedia and games, and APIs may refer to some predefined functions or to an agreement for linking different components of a software system. The purpose of an API is to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access the native code or understand the details of the internal workings; direct3D may include one or more APIs. In the present application, the APIs in Direct3D are all described as rendering function interfaces.
Virtual machine: a virtual machine may refer to an emulator of a computer system, which may simulate, through software, a complete computer system having complete hardware system functionality, operating in a completely isolated environment, and may provide the functionality of a physical computer.
Externally hanging: the plug-in refers to a cheating program which is manufactured by changing part of programs of software aiming at one or more online games by utilizing a computer technology. After the game player uses the plug-in program, the balance of the game is greatly influenced.
Dynamic link library: dynamic Link Library (DLL) generally cannot be executed directly, nor does it receive messages. A dynamically linked library may be a stand-alone file containing many functions that can be called by applications and other DLLs to perform some specific task, and a dynamically linked library is only started when another module calls the functions it contains.
Referring to fig. 1, fig. 1 is a schematic diagram of a game processing system according to an embodiment of the present disclosure. As shown in fig. 1, the game processing system may include a terminal device 10a and a server 10b, and the number of the terminal devices and the servers included in the game processing system may be one or more, and the number of the terminal devices and the servers is not limited in this application. The terminal device 10a may refer to a device used by a game player, and the game player may refer to a user who is experiencing a game. The terminal device 10a may include: the game system comprises an intelligent terminal with a game data rendering function, such as a smart phone, a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device (such as a smart watch and a smart bracelet), and a smart television. The server 10b may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like. The terminal device 10a and the server 10b may be directly or indirectly connected in communication, and the present application does not specifically limit the connection manner between the terminal device 10a and the server 10 b.
In the game processing system shown in fig. 1, the terminal device 10a may acquire various page presentation data related to a game, render the page presentation data to generate a page corresponding to the game (for example, a game start page, a game setting page, a game end page, and the like), and present the page to a game player in a terminal screen. In addition, the terminal device 10a may respond to various operations (e.g., function setting operations, virtual character confrontation operations, etc.) of the game player with respect to the above-described page, and transmit these operations to the server 10 b. The server 10b performs game logic according to various operations of the game player by interacting with the terminal device, and provides the terminal device 10a with corresponding game data to be rendered and interface calling information, so that the terminal device 10a can call a corresponding rendering function interface according to the interface calling information to perform rendering processing on the game data to be rendered, and generate a game interface for displaying to the game player. The rendering function interface may refer to an application program interface for performing 3D drawing, and the interface call information may refer to parameters required when the rendering function interface is called.
Referring to fig. 2, fig. 2 is a schematic view of a game data processing scenario provided in an embodiment of the present application. As shown in fig. 2, the terminal device 20a is a device used by a game player, the terminal device 20a may be a terminal device in the game processing system in the embodiment corresponding to fig. 1, a process 20c may be run in the terminal device 20a, and the process 20c may be configured to execute rendering logic in the game, that is, rendering may be performed on game data in the game in the process 20c, and generate a game interface for presentation to the game player.
When a game player performs a start operation on a game a in the terminal device 20a, the terminal device 20a may acquire login page data (such as an icon of the game a, an account input control, a password input control, a login control, and the like) of the game a, render the login page data in a process 20c of the terminal device 20a, generate a login page 20b, and present the login page 20b for the game player in the terminal device 20 a. The game player may perform a trigger operation on the account input control to input account information (for example, the account is 123xx567) in an input box corresponding to the account input control, perform a trigger operation on the password input control to input password information in an input box corresponding to the password input control. When the user performs a triggering operation (e.g., clicking, etc.) on the login control in the login page 20b, the process 20c in the terminal device 20a may obtain login operation data of the game player, where the login operation data may include information such as the above account number and password, and write the login operation data into the shared memory 20d, that is, store the login operation data in the shared memory space 20 d. The shared memory space 20d may be represented as a memory area, and may be accessed by two or more processes at the same time, for example, both the process 20c and the process 20f shown in fig. 1 may access the shared memory space 20d, and the shared memory space 20d may be a cloud storage space corresponding to the game a, or a physical memory space, and the like, which is not specifically limited in this application. It is understood that, when the game player starts the game a, the terminal device 20a may also automatically acquire an account number (e.g., an instant messaging application account number) of the game player in the remaining associated applications as a login account number of the game a, or acquire information such as the login account number and a password according to historical login information of the game player, and write login operation data into the shared memory control 20d through the process 20c without manually inputting information such as the login account number and the password by the game player.
When the process 20f monitors that the login operation data is added to the shared memory space 20d, the login operation data may be obtained from the shared memory space 20d, and corresponding game logic is executed according to the login operation data, for example, whether an account and a password input by a game player are correct is checked, whether the account of the game player has a game experience right (for example, whether the account of the game player is sealed is checked), and the like, and when the process 20f determines that the login operation data satisfies a login condition (for example, the account and the password of the game player are both correct, and the account has the game experience right), a login success prompt message may be returned to the terminal device 20 a. It should be noted that the process 20f may run in the virtual machine 20e, the process 20f may be configured to execute game logic, at this time, the virtual machine 20e may be regarded as a black box, the process 20e and the process 20c may jointly implement the game a, and the process 20e and the process 20c may communicate with each other through the shared memory control 20 d. The black box in the present application may refer to a system or a device that only knows an input/output relationship and does not know an internal structure, and for a process running in the black box, a corresponding result may be output after data is input, as for a process that is unclear as to a specific processing procedure of the data, information leakage in the data processing procedure may be prevented.
When the process 20f executes the game logic according to the login operation data and obtains a login result corresponding to the login operation data as a login success, the process 20f may generate a rendering function interface call according to the login success result, and if necessary, call the rendering function interface 1 to render the login success result, so as to update and switch the login page 20 b. In the process 20f, the call information of the rendering function interface 1 and the successful login result may be written into the shared memory control 20d, and the shared memory space 20d at this time may include the call information of the rendering function interface 1 and the successful login result. Optionally, after the process 20f acquires the login operation data in the shared memory space 20d, the login operation data may be deleted from the shared memory space 20d, or the login operation data may be temporarily retained in the shared memory space 20d, but the login operation data is switched from an unprocessed state to a processed state, and the data that has been processed in the shared memory space 20d may be cleaned at intervals.
When the process 20c monitors that new data is added to the shared memory space 20d, the calling information and the successful login result of the rendering function interface 1 may be acquired from the shared memory space 20d, the rendering function interface 1 may be called in the process 20c according to the acquired calling information, the successful login result is rendered according to the rendering function interface, a game start page 20g is generated, and the game start page 20g is displayed in the terminal device 20a, where the game start page 20g may include a name, an icon, a game start function control, prompt information of successful login, and the like of the game a. In other words, when executing the game logic, the process 20e may generate a rendering function interface call, and further may store the call information corresponding to the rendering function interface call and the game data to be rendered (for example, the login success result) in the shared memory space 20d, the process 20c may obtain the call parameter information and the game data to be rendered from the shared memory space 20d, call the corresponding rendering function interface according to the call parameter information, and perform rendering processing on the game data to be rendered to generate a game interface, which may be displayed in the terminal device 20a, so that the game logic and the rendering logic may be separated, and the operation of the game logic is in a black box of the virtual machine 20e, so that the coordinate information of the virtual character in the game, the process memory information, and the like may be effectively hidden, and the coordinate information of the virtual character is prevented from being used by external hanging, thereby improving the security of the game.
Referring to fig. 3, fig. 3 is a schematic flow chart of a game data processing method according to an embodiment of the present application. It is understood that the game data processing method may be performed by a computer device, which may be a server, or a terminal device, or a system of a server and a terminal device, and may include a first process for executing game logic and a second process for executing rendering logic. As shown in fig. 3, the game data processing method may include the steps of:
step S101, acquiring interface calling information and game data to be rendered for a rendering function interface in a first process, and transmitting the interface calling information and the game data to be rendered between the first process and a second process; the first process refers to a process running in the black box for executing game logic, and the second process refers to a process running outside the black box for executing rendering logic.
Specifically, in this embodiment of the present application, a first process (such as the process 20f in the embodiment corresponding to fig. 2, which may also be referred to as a game process) refers to a process running in a black box for executing game logic, a second process (such as the process 20c in the embodiment corresponding to fig. 2, which may also be referred to as a rendering process) refers to a process running outside the black box for executing rendering logic, the first process may generate a Direct3D call (which may also be referred to as a D3D call), and the Direct3D generated by the first process may be transmitted to the second process, and the rendering function interface in the Direct3D is called in the second process to perform rendering processing on game data to be rendered in a game; the first process may be run in a black box (e.g., a virtual machine, or a server), and the second process may be run in a physical machine of a user (e.g., the terminal device 20a in the embodiment corresponding to fig. 2, i.e., a device used by a game player), that is, the second process is run outside the black box, so that an effect that a game running in the black box performs a picture display outside the black box can be achieved, and not only can security of the game be ensured, but also a use effect of the game player is not affected.
Before performing step S101, the computer device may obtain a proxy dynamic link library associated with the first process, load the proxy dynamic link library in the first process, and replace an original dynamic link library corresponding to the first process with the proxy dynamic link library. In order to transfer the Direct3D call between the first process and the second process, the computer device needs to replace the original dynamically linked library in the game with a new dynamically linked library, referred to as a proxy dynamically linked library. The game developer can use the module definition (& def) file to create an agent dynamic link library (for example, the agent dynamic link library can be represented as agent d3d9.dll), after the agent dynamic link library is created, the computer device can enable a first process to load the agent dynamic link library, an original dynamic link library in the game (for example, the original agent link library can be represented as d3d9.dll) can be replaced by the agent dynamic link library, and after the agent dynamic link library is loaded by the first process, all Direct3D calls generated in the first process can be transmitted to a second process to be called and rendered. The agent dynamic link library and the agent dynamic link library can contain the same rendering function interface, namely, for the calling of the rendering function interface contained in Direct3D, both can be realized, and only the original dynamic link library can complete the calling process of the rendering function interface only in the process of generating the Direct3D call, namely when the Direct3D call is generated in the first process, the corresponding rendering function interface can be directly called in the first process to perform image rendering; and the proxy dynamically linked library may monitor and intercept Direct3D calls generated in the first process and transmit Direct3D calls to the second process. The normal operation of the first process and the second process can be ensured by the proxy dynamic link library.
The loading mode of the proxy dynamic link library may include an implicit link mode and a display loading mode. The implicit link mode is that when a game is started, an agent dynamic link library is loaded into a memory and mapped to an address space of a calling process, and the agent dynamic link library is directly called when the calling process is needed; the display loading mode means that the proxy dynamic link library is loaded into the memory only when the proxy dynamic link library needs to be called.
It is understood that, when the game is started, the computer device may first perform initialization processing on the running environment of the game, and prepare a shared memory space for the first process and the second process, where the shared memory space may allow the first process and the second process to access; meanwhile, the state machine of the first process may be initialized, and the state machine may be understood as an information backup area (also referred to as a local cache) of the first process.
During the process of executing the game logic by the first process, the first process may generate a call for a certain rendering function interface in Direct3D based on the game progress and the operation of the game player in the game presentation page, at this time, the computer device may obtain interface call information for the rendering function interface in the first process and the game data to be rendered through the proxy dynamic link library, and the interface calling information is stored in the shared memory space, the second process can monitor the data stored in the shared memory space in real time, when the interface calling information and the game data to be rendered are added to the shared memory space, the second process can sense, the interface calling information and the game data to be rendered can be obtained from the shared memory space, and the game data to be rendered can be data generated in a game and used for rendering game pictures. For example, when the shoulder of the virtual character a in the game is shot, the corresponding rendering function interface needs to be invoked to render the game picture hit by the virtual character a (for example, a picture of gun bleeding during the shoulder rendering of the virtual character a), and at this time, the game data such as the coordinate information of the virtual character a in the game needs to be acquired to draw the game picture of gun bleeding in the virtual character a.
And S102, when the second process acquires the interface calling information and the game data to be rendered, calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display.
Specifically, when the second process obtains the interface calling information and the game data to be rendered from the shared memory space, the corresponding rendering function interface can be called from the proxy link library according to the interface calling information in the second process, the game data model to be rendered is rendered according to the rendering function interface, a game interface is generated, and the game interface is displayed in a game application (or a game client). It should be noted that the game interface generated in the embodiment of the present application may be a complete page displayed in the game application (for example, a game start page displayed when the game application is started, a setting page displayed in the game application, or a large task scene displayed in the game application, etc.), or may be a certain game interface element of the game application (for example, a virtual character that is flashed in the game process, or a wound after the virtual character is hit, etc.). When the game data to be rendered acquired by the second process is all display content data corresponding to the game page, the second process performs rendering processing on the game data to be rendered by calling a rendering function interface, so that a complete game page can be generated, and the generated game page is displayed in game application; when the game data to be rendered acquired by the second process is the local display content data of the game page, the second process performs rendering processing on the game data to be rendered by calling the rendering function interface, so that a game interface element can be generated, and the game interface element is displayed in the current page displayed by the game application.
Optionally, after the second process obtains the interface calling information, it may be determined whether a calling result corresponding to the interface calling information needs to be returned to the first process; when the interface calling information indicates that the second process needs to return the calling result to the first process, after the calling of the rendering function interface is completed in the second process according to the interface calling information, the calling result corresponding to the rendering function interface can be transmitted to the first process through the shared memory space; when the interface calling information indicates that the second process does not need to return the calling result to the first process, the subsequent rendering logic can be continuously executed after the calling of the rendering function interface is completed in the second process according to the interface calling information, and the calling result does not need to be stored in the shared memory space.
Optionally, during the process of playing the game, the game player may view the game interface displayed in the game application, the user may also trigger a function control in the game display page (for example, trigger a shooting function in the game, an automatic following function, and the like), and then the second process may generate a corresponding operation instruction according to the trigger operation of the user for the function control, and the second process may transmit the operation instruction to the first process through the memory shared space, and at this time, the first process may obtain the operation instruction from the shared memory space, execute the game logic according to the operation instruction, and may continue to generate Direct3D call, and further repeat the call flow of the rendering function interface.
The game referred to in the present application may be a hand game, an end game, a page game, a cloud game, or the like, and the type of the game is not limited in the present application.
In the embodiment of the application, the game can be separated into the game logic and the rendering logic, the game logic and the rendering logic are respectively executed in two different processes, and the game logic can be executed in the black box, so that the virtual character information and the process memory information in the game can be effectively hidden, the difficulty of plug-in development is increased, and the safety of the game is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of a game data processing method according to an embodiment of the present application. It is understood that the game data processing method may be performed by a computer device, which may be a server, or a terminal device, or a system of a server and a terminal device, and may include a first process for executing game logic and a second process for executing rendering logic. As shown in fig. 4, the game data processing method may include the steps of:
step S201, when a call instruction for the rendering function interface in the first process is detected, interface call information corresponding to the call instruction and game data to be rendered are obtained from the first process through the proxy dynamic link library.
Specifically, when the computer device detects a call instruction for the rendering function interface in the first process, it may be understood that when the first process calls the rendering function interface to the proxy dynamic link library, the interface call parameter and the game data to be rendered, for the rendering function interface, of the first process may be acquired by the proxy dynamic link library. For a specific process of acquiring the interface call information and the game data to be rendered by the proxy dynamic link library, reference may be made to the description of step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
Step S202, an interface identifier corresponding to the rendering function interface is obtained through the proxy dynamic link library, the interface calling information and the interface identifier are packaged into a calling data packet, and interface category information corresponding to the rendering function interface is obtained.
Specifically, after the computer device obtains the interface calling information and the game data to be rendered through the proxy dynamic link library, the computer device may obtain an interface identifier of the rendering function interface in the proxy dynamic link library, and encapsulate the interface calling information and the interface identifier into a calling data packet, so as to obtain interface category information corresponding to the rendering function interface. It should be noted that the proxy dynamic link library may include an interface call information table, where the interface call information table may include related information corresponding to all rendering function interfaces included in Direct3D, such as an interface name, an interface identifier, interface category information, and interface program code of each rendering function interface. When a proxy dynamic link library is created, rendering function interfaces contained in Direct3D can be classified in advance, rendering function interfaces contained in Direct3D are classified into at least two categories, such as rendering function interface asynchronous call interface categories (no need to consider the processing condition of call data packets existing in a shared memory space, that is, the call sequence of a current call packet and the rest of call data packets) and sequential call interface categories (need to consider the processing condition of call data packets existing in the shared memory space, that is, call according to the time sequence corresponding to the call data packets) contained in Direct3D, or rendering function interfaces contained in Direct3D are classified into a-class interface categories, B-class interface categories, C-class interface categories, and the like, and the number of the interface categories and the classification principle of the interface categories are not limited in the present application, the interface identification may refer to a number, such as the numbers 1, 2, 3, … …, assigned to each rendering function interface.
Further, the computer device may obtain the interface call information table from the proxy dynamic link library, traverse the interface call information table according to the interface call information, obtain the interface identifier and the interface category information having a mapping relationship with the interface call information from the interface call information table, and further may encapsulate the interface call information and the interface identifier into a call data packet. If the interface calling information can include the interface name of the rendering function interface, traversal can be performed in the interface calling information table according to the interface name, the interface identification and the interface category information corresponding to the interface name are obtained, the rendering function interface corresponding to the interface calling information can be quickly located through the interface calling information table, and the searching efficiency of the rendering function interface can be improved.
For example, when the rendering function interface included in Direct3D is divided into a class a call category, a class B call category, and a class C call category, the interface call information table in the proxy dynamic link library includes the following information as shown in table 1 below:
TABLE 1
Interface identification Interface name Interface class information ……
1 XXXXXX1 Class A call categories ……
2 XXXXXX2 Class B call categories ……
3 XXXXXX3 Class B call categories ……
4 XXXXXX4 Class C call categories ……
5 XXXXXX5 Class B call categories ……
6 XXXXXX6 Class A call categories ……
…… …… …… ……
As shown in table 1 above, when the interface call information acquired through the proxy dynamic link library includes an interface name "XXXXXX 1", an interface identifier having a mapping relationship with the interface call information may be acquired from the interface call information table as number 1, and the interface category information is a class a call category.
Step S203, if the interface type information is asynchronous calling interface type, storing the calling data packet and the game data to be rendered to an empty slot in the annular queue through the proxy dynamic link library.
Specifically, the shared memory space may include a circular queue, and if the interface type information is an asynchronous call interface type, an empty slot at the head of the current queue may be found from the circular queue, the call data packet and the game data to be rendered are directly stored in the empty slot in the circular queue, and the call data packet and the game data to be rendered are returned to the first process to continue executing the subsequent rendering logic without waiting for the call data packet already existing in the circular queue to be emptied. The annular queue is created in the shared memory space, the memory space with a fixed size can be repeatedly used, dynamic memory release and allocation are not needed, and the communication efficiency between the first process and the second process can be improved.
Optionally, the asynchronous call interface type may include a set interface type, and if the interface type information is the set interface type, the interface call information in the first process may be transmitted to the state machine through the proxy dynamic link library, and at the same time, the call data packet and the game data to be rendered may be stored in an empty slot of the ring queue through the proxy dynamic link library. The state machine may include two states of obtaining (get) and setting (set), and when the rendering function interface is a state class function (for example, two states of on and off with high definition), and the state is the set state, it may be determined that the interface class information corresponding to the rendering function interface is the set interface class, and at this time, the interface call information corresponding to the rendering function interface needs to be transmitted to the state machine for recording, so as to provide for subsequent query.
The computer device may determine, from the interface call information, an interface name and a setting state corresponding to the rendering function interface, and store, in the state machine, the interface name and the setting state as key value pair information, that is, store, in the state set, the interface name as a key (key) and the setting state as a value (value), where the key value pair information may be used to instruct the first process to acquire the setting state from the state machine. For example, if the setting state in the interface call information corresponding to the rendering function interface of the interface category is set to off high resolution and the interface name is xxxa, xxxa and the "off high resolution" state may be stored as key value pair information. The purpose of setting the rendering function interface of the interface category is to set the state of a certain function control in the game, and the calling result of the rendering function interface of the category can be regarded as known, so that the calling result of the rendering function interface of the category by the second process does not need to be returned to the first process.
Optionally, the state machine further includes a get state, when the rendering function interface is a state-class function, and the state is the get state, the interface class information of the rendering function interface at this time may be referred to as an acquired interface class, and the interface call information corresponding to the rendering function interface also needs to be transmitted to the state machine for recording, so as to be used for subsequent query. Meanwhile, corresponding information can be directly acquired from the state machine and directly returned to the first process, and subsequent game logic is continuously executed in the first process. For example, if the purpose of obtaining the rendering function interface of the interface category is to obtain the current state of the function control a, the interface call information may be directly recorded in the state machine, and the state (e.g., "on" state) of the function control a may be obtained from the data cached in the state machine, and after obtaining the state of the function control a from the state machine, the subsequent game logic may be continuously executed in the first process. It should be understood that the rendering function interface of the get interface class is directly completed in the state machine during the calling process, and no communication is needed between the first process and the second process, i.e. the rendering function interface of the get interface class directly completes the calling process in the first process.
And step S204, when the second process acquires the interface calling information and the game data to be rendered, calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display.
Specifically, the second process may monitor the circular queue all the time in a circulating manner, and when the proxy dynamic link library stores the call data packet and the game data to be rendered into an empty slot in the circular queue, the second process may sense a change of the data in the circular queue, and may further obtain the call data packet and the game data to be rendered from the circular queue. And in the second process, the calling data packet is analyzed to obtain interface calling information and an interface identifier, a rendering function interface can be called from the proxy dynamic link library according to the interface calling information and the interface identifier, the game data to be rendered are rendered according to the rendering function interface, a game interface corresponding to the game data to be rendered is generated, and the game interface is displayed in game application.
Referring to fig. 5, fig. 5 is a schematic diagram of a game rendering according to an embodiment of the present disclosure. The first process shown in fig. 5 runs in the virtual machine 30a, and the second process runs in the terminal device of the game player (outside the virtual machine).
As shown in fig. 5, in some scenes of the game, the high resolution needs to be turned on, at this time, the first process may generate interface call information for a rendering function interface 2 (hereinafter referred to as interface 2, where the interface 2 may be used to turn on the high resolution and render current data in the game, and draw a game interface in the case of the high resolution) in Direct3D, that is, the first process may transmit the interface call information to the proxy dynamic link library, obtain, by the proxy dynamic link library, the interface call information and data to be rendered 1 (which may be understood as the game data to be rendered) for the interface 2, and obtain an interface identifier and interface category information corresponding to the interface 2.
If the interface type information of the interface 2 obtained from the proxy dynamic link library is the set interface type, the interface calling information corresponding to the interface 2 may be transmitted to the state machine 30b, the interface calling information is recorded in the state machine 30b, and the name and the open high resolution state of the interface 2 are stored as key value pair information in the state machine 30 b. Meanwhile, the interface calling information and the interface identifier may also be packaged into a calling data packet 1, an empty slot is searched for from the ring queue sharing the memory space, when the slot 30c is found to be an empty slot, the calling data packet 1 and the data 1 to be rendered may be stored in the slot 30c, for example, 11 data packets already exist in the ring queue shown in fig. 5, such as data packets a1-a11, and the calling data packet 1 and the data 1 to be rendered may be stored in adjacent empty slots of the data packet a 11.
The second process can monitor the ring queue in the shared memory space in real time, when the calling data packet 1 and the data 1 to be rendered are added to the ring queue, the calling data packet 1 and the data 1 to be rendered can be obtained from the ring queue, the calling data packet 1 is analyzed to obtain interface calling information and an interface identifier, the interface 2 can be called in the proxy dynamic link library according to the interface calling information and the interface identifier obtained through analysis, the data 1 to be rendered is rendered according to the interface 2 to generate a page 30e, the page 30e is displayed in a game, the content displayed in the page 30e is a game interface element rendered by the calling interface 2 of the second process, and the page 30d is game display data before the rendering of the data 1 to be rendered by the second process. In other words, the display content of the game when the high resolution is not turned on is shown as the page 30d, and the display content of the game when the high resolution is turned on is shown as the page 30 e.
Referring to fig. 6, fig. 6 is a schematic diagram of a game rendering according to an embodiment of the present disclosure. The first process shown in fig. 6 runs in the virtual machine 40a, and the second process runs in the terminal device of the game player (outside the virtual machine).
As shown in fig. 6, when a game player wins a game, the first process may acquire data to be rendered 2 at the time of winning the game, transmit interface call information for a rendering function interface 3 (hereinafter referred to as interface 3) in Direct3D to the proxy dynamic link library, acquire the interface call information for the interface 3 and the data to be rendered 2 (which may be understood as game data to be rendered) through the proxy dynamic link library, and acquire an interface identifier and interface category information corresponding to the interface 3.
If the interface type information of the interface 3 obtained from the proxy dynamic link library is an asynchronous call interface type (here, the default interface 3 does not belong to the set interface type), the interface call information and the interface identifier corresponding to the interface 3 may be packed into the call data packet 2, an empty slot is searched from the ring queue of the shared memory space, and when the slot 40b is found to be an empty slot, the call data packet 2 and the data 2 to be rendered may be stored in the slot 40b, for example, 11 data packets already exist in the ring queue shown in fig. 6, such as data packet a1-a11, and the call data packet 2 and the data 2 to be rendered may be stored in adjacent empty slots of the data packet a 11.
The second process may monitor the ring queue in the shared memory space in real time, when the ring queue is monitored to add the call data packet 2 and the data to be rendered 2, the call data packet 2 and the data to be rendered 2 may be obtained from the ring queue, the call data packet 2 is parsed to obtain interface call information and an interface identifier, according to the interface call information and the interface identifier obtained by parsing, the interface 3 may be called in the proxy dynamic link library, the data to be rendered 2 is rendered according to the interface 3, a page 40d is generated, and a page 40d is displayed in the game, the content displayed in the page 40d is a game interface element rendered by the second process call interface 3, the page 40d may also be referred to as a game end page, the page 40d may include a victory prompt effect 40e, a game name (for example, desert guard war) and game display data at the end of the game, the page 40c is the game display data before the second process renders the data to be rendered 2. The result of calling the data to be rendered 2 by the interface 3 is only to prompt the game player to finish the scene picture of the game, and the execution of the game logic in the first process is not affected, that is, the first process does not need to obtain the result of calling the data to be rendered 2 by the interface 3, so the result of calling the data to be rendered 2 by the interface 3 does not need to return to the first process.
In the embodiment of the application, the game can be separated into the game logic and the rendering logic, the game logic and the rendering logic are respectively executed in two different processes, and the game logic can be executed in a black box, so that the virtual character information and the process memory information in the game can be effectively hidden, the difficulty of plug-in development is increased, and the safety of the game is improved; the rendering function interfaces are classified, the process of calling the rendering function interfaces can be determined according to the classes of the rendering function interfaces, and the calling processing efficiency of the rendering function interfaces can be improved.
Referring to fig. 7, fig. 7 is a schematic flowchart of a game data processing method according to an embodiment of the present application. It is understood that the game data processing method may be performed by a computer device, which may be a server, or a terminal device, or a system of a server and a terminal device, and may include a first process for executing game logic and a second process for executing rendering logic. As shown in fig. 7, the game data processing method may include the steps of:
step S301, when a call instruction for the rendering function interface in the first process is detected, interface call information corresponding to the call instruction and game data to be rendered are obtained from the first process through the proxy dynamic link library.
Step S302, an interface identifier corresponding to the rendering function interface is obtained through the proxy dynamic link library, the interface calling information and the interface identifier are packaged into a calling data packet, and interface category information corresponding to the rendering function interface is obtained.
For a specific implementation manner of steps S301 to S302, reference may be made to the description of steps S201 to S202 in the embodiment corresponding to fig. 4, which is not described herein again.
Step S303, if the interface type information is the sequential calling interface type, monitoring the processing state of the historical calling data packet in the ring queue through the proxy dynamic link library, and storing the calling data packet and the game data to be rendered into an empty slot in the ring queue through the proxy dynamic link library when the processing state of the historical calling data packet is the processed state.
Specifically, the shared memory space may include a circular queue, and if the interface type information is a sequential call interface type, it is necessary to monitor a processing state of a history call data packet already existing in the shared memory space, and when the history call data packet does not exist in the circular queue of the shared memory space, or the history call data packets in the circular queue of the shared memory space are all in a processed state, that is, when the history call data packet has been read from the shared memory space by the second process, the proxy dynamic link library may search for an empty slot in the circular queue, and store the call data packet and the game data to be rendered to the empty slot in the circular queue.
When unprocessed historical calling data packets exist in the ring queue, calling data packets corresponding to rendering function interfaces of the sequential calling interface category and game data to be rendered cannot be directly stored in empty slots of the ring queue, but the historical calling data packets (namely the historical calling data packets and the calling data packets stored in the ring queue before the current calling data packet) already existing in the ring queue need to be emptied by a second process, and the historical calling data packets and the game data to be rendered can be stored in the empty slots of the ring queue only, and the second process is waited to return a calling result of the rendering function interfaces to the game data to be rendered. In other words, the render function interfaces of the sequential call interface class need to ensure that there are no unprocessed historical call packets in the ring queue at the time of call.
Optionally, if the ring queue in the shared memory space includes N (N is a positive integer) unprocessed historical calling data packets, the proxy dynamic link library needs to wait for all the N unprocessed historical calling data packets to be emptied by the second process, and for any two historical calling data packets in the N unprocessed historical calling data packets: calling data packet aiAnd call packet ai+1Call packet aiStore to ring queue earlier than call packet ai+1And storing the time to the circular queue, wherein i is a positive integer less than N. In other words, call packet aiIn the ring queue in the calling data packet ai+1So that the second process can first retrieve the call packet a from the ring queueiWhen the first process monitors that the second process obtains the calling data packet aiThe call packet a can beiThe processing state of (1) is determined as a processed state; the second process can then continue to retrieve the call packet a from the ring queuei+1When the first process monitors that the second process obtains the calling data packet a from the ring queuei+1The call packet a can bei+1When the processing states of the N unprocessed historical calling data packets are all the processed states, the calling data packets and the game data to be rendered can be stored in the empty slots of the annular queue through the proxy dynamic link library, and the second process is continuously waited to return the calling results aiming at the interface calling information and the game data to be rendered. By waiting for the history call packet in the ring queue to be emptiedSo as to ensure that the calling sequence of the rendering function interfaces in the second process is kept unchanged, and the game can run normally.
It should be noted that, in the second process, the calling processes of the plurality of rendering function interfaces may be processed simultaneously, or the calling processes of the rendering function interfaces may be processed sequentially according to the time for storing the calling packet in the ring queue. In other words, in the present application, the process of calling the rendering function interface to perform rendering processing on the game data to be rendered may be a parallel processing process or a serial processing process, and the present application is not particularly limited. Interface calling information corresponding to the rendering function interfaces of the sequentially calling interface types does not need to be transmitted to the state machine.
Step S304, when the second process obtains the interface calling information and the game data to be rendered, calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display.
The specific implementation manner of step S304 may refer to the description of step S204 in the embodiment corresponding to fig. 4, which is not described herein again.
In step S305, if the rendering function interface belongs to the sequential call interface category, the call result corresponding to the game interface is encapsulated as a result data packet in the second process, and the result data packet is transmitted to the shared memory space.
Step S306, if the first process monitors the result data packet in the shared memory space, the result data packet is obtained from the shared memory space through the first process, the result data packet is analyzed to obtain a calling result, and the subsequent game logic is continuously executed in the first process according to the calling result.
Specifically, if the rendering function interface belongs to the sequential call interface category, after the call of the rendering function interface is completed in the second process, the result of the call of the rendering game data by the rendering function interface may be packed into a result data packet, and the result data packet is transmitted to the shared memory space. The first process monitors the ring queue in the shared memory space in a circulating mode all the time, and waits for the second process to return the calling result aiming at the rendering function interface, so that after the second process transmits the result data packet to the ring queue in the shared memory space, the first process can monitor that the result data packet is added into the ring queue, take out the result data packet from the ring queue, obtain the calling result after analyzing the result data packet, and continue to execute subsequent game logic in the first process according to the calling result.
Referring to fig. 8, fig. 8 is a schematic view illustrating a game processing flow according to an embodiment of the present disclosure. As shown in fig. 8, a game processing flow will be described by taking an example in which a first process is executed in a virtual machine and a second process is executed on a terminal device used by a user.
The computer device may first initialize a runtime environment for the game (e.g., traversing firewire), prepare a shared memory space for the first process and the first process, which may be used to establish a circular queue, and initialize a state machine.
For the purpose of monitoring and transmitting the call Direct3D, an agent d3d9.dll (i.e., an agent dynamic link library) needs to be created and the game is loaded to replace the d3d9.dll (i.e., the original dynamic link library) of the original system. After the game loads the agent d3d9.dll, all Direct3D calls are intercepted by the agent d3d9.dll and passed to the second process.
When the agent d3d9.dll finds that the first process calls the rendering function interface 1 (for example, a Direct3DCreate9 interface which can be the first application program interface in a game call), the calling parameter 1 (which can be called interface calling information) transmitted when the first process calls the Direct3DCreate9 can be intercepted and analyzed, then the calling parameter 1 and the calling ID (which can also be called interface identification) are packaged into a calling data packet, an empty slot at the head of the current queue is found from the ring queue, and the packaged calling data packet is placed into the slot.
Knowing from the agent d3d9.dll that Direct3DCreate9 belongs to the sequential call interface category, the first process will enter a waiting state after putting the call data packet into the slot of the ring queue, wait for the historical call data packet in the ring queue to be emptied by the second process, and simultaneously check whether there is new data returned in the ring queue.
The second process will always circularly check the ring queue, and when the first process puts the call data packet into the slot of the ring queue, the ring queue adds new data, and at this time, the second process will monitor the added call data packet in the ring queue. The second process takes the call packet from the ring queue and calls Direct3DCreate9 in d3d9.dll in the second process according to the call ID and call parameter 1 in the call packet. After the second process call is finished, the call result 1 returned by Direct3DCreate9 is packaged, and the packaged call result 1 is stored in the slot of the circular queue.
Because the first process is always in a waiting state, when the second process stores the packaged calling result 1 into the slot of the ring queue, the first process can monitor that the returned calling result 1 is stored into the ring queue. The first process may take the returned call result 1 out of the ring queue, save the call result 1, and return the call result 1 to the first process.
The above is a complete processing flow of the call flow 1 in fig. 8, after the processing of the call flow 1 is completed, the call flow 2 in fig. 8 may be continuously processed, and the processing procedure of the call flow 2 is similar to the processing procedure of the call flow 1, and is not described here again.
It should be noted that, for the first process, the call transmission process of the rendering function interface is not visible, and the first process may refer to itself as a rendering function interface in the d3d9.dll being called normally, thereby ensuring normal operation of the game, and implementing asynchronous call of cross-process Direct 3D.
Referring to fig. 9, fig. 9 is a schematic diagram of a game rendering according to an embodiment of the present disclosure. The first process shown in fig. 9 runs in the virtual machine 50a, and the second process runs in the terminal device of the game player (outside the virtual machine).
As shown in fig. 9, in the game process, a game player hits a shoulder of an enemy camp member, at this time, the first process may acquire data to be rendered 3 including coordinates of the enemy camp member, transmit interface call information for a rendering function interface 4 (hereinafter referred to as interface 4) in Direct3D to the proxy dynamic link library, acquire the interface call information for the interface 4 and the data to be rendered 3 (which may be understood as the game data to be rendered) through the proxy dynamic link library, and acquire an interface identifier and interface category information corresponding to the interface 4.
If the interface type information of the interface 4 obtained from the proxy dynamic link library is the sequential call interface type, the interface call information and the interface identifier corresponding to the interface 4 may be packed into the call data packet 3, at this time, it is necessary to wait for the history call data packet already stored in the ring queue to be emptied, and when the ring queue does not contain the history call data packet, an empty slot (for example, slot 50b) adjacent to the head of the queue may be searched in the ring queue, and the call data packet 3 and the data 3 to be rendered may be stored in the slot 50 b.
The second process can monitor the ring queue in the shared memory space in real time, when the calling data packet 3 and the data 3 to be rendered are monitored to be added in the ring queue, the calling data packet 3 and the data 3 to be rendered can be obtained from the ring queue, the calling data packet 3 is analyzed to obtain interface calling information and interface identification, the interface 4 can be called in the proxy dynamic link library according to the interface calling information and interface identification obtained by analysis, rendering the data 3 to be rendered according to the interface 4 to generate a page 50d, displaying the page 50d in the game, wherein the content displayed in the page 50d is a game interface element which is rendered by the second process calling the interface 4, the data 50f of the wound display of the shoulder of the enemy camp player 50e may be included in this page 50d, and the page 50c is the game display data before rendering the data 3 to be rendered for the second process. After the second process completes the call of the interface 4, the call result may be packaged into a result data packet, which is stored in the ring queue, and returned to the first process to continue executing the subsequent rendering logic, and when the second process finds the slot 50g from the ring queue, the result data packet may be stored in the slot 50 g.
Because the first process is always in a waiting state, when the second process stores the result data packet into the circular queue, the first process can monitor that the result data packet is added into the circular queue, obtain the result data packet from the circular queue, obtain a calling result after analyzing the result data packet, and continue to execute subsequent game logic according to the calling result in the first process.
Referring to fig. 10, fig. 10 is a schematic diagram of communication between a first process and a second process according to an embodiment of the present disclosure. As shown in fig. 10, the first process may be configured to execute a game logic, and may generate a Direct3D call (the Direct3D call may include multiple application program interfaces), which may also be referred to as an application program interface stream in a drawing programming interface, when the first process calls a rendering function interface a in Direct3D, it may be determined whether the rendering function interface a is a state class function, and if the rendering function interface a is a state class function (a function used to characterize a state, such as an "on" state or an "off" state), interface call information corresponding to the rendering function interface a may be recorded in a state machine; the state machine comprises an acquisition state and a setting state, when the rendering function interface A belongs to the acquisition state (the rendering function interface A at the moment belongs to the acquisition interface category), a calling result corresponding to the rendering function interface A can be acquired from the state machine, namely the rendering function interface A belonging to the acquisition interface category can complete a calling process in a first process; when the rendering function interface a belongs to the set state (the rendering function interface a at this time belongs to the set interface type), the interface name and the set state may be stored as key value pair information in the state machine, and at the same time, the interface calling information and the interface identifier corresponding to the rendering function interface a may be encapsulated into a calling data packet, stored in the ring queue of the shared memory space, and returned to the first process.
If the rendering function interface a is not a state function, it may be further determined whether waiting is needed, and when the rendering function interface a does not need to wait for the ring queue to be empty (the rendering function interface a at this time belongs to the asynchronous call interface type), interface call information and an interface identifier corresponding to the rendering function interface a may be encapsulated into a call data packet, which is stored in the ring queue of the shared memory space, and returned to the first process.
When the rendering function interface a needs to wait for the ring queue to be empty (the rendering function interface a at this time belongs to the sequential call interface type), the interface call information and the interface identifier corresponding to the rendering function interface a may be encapsulated into a call data packet, which is stored in the ring queue of the shared memory space, and wait for the second process to return the call result of the rendering function interface a.
The second process is used for executing the rendering logic, the second process can monitor the circular queue all the time, when new data added in the circular queue is monitored, the calling data packet can be obtained from the circular queue, the rendering function interface A is called in the second process, the calling result is obtained, and the game interface elements generated by rendering are displayed in the graphical user interface of the game. In other words, the second process may continuously read the interface call information from the shared memory space, and call the corresponding rendering function interface according to the interface call information, and if the first process needs to obtain the call result, the second process may store the obtained call result in the shared memory space. Therefore, the normal operation of the game can be ensured under the condition that the game logic and the rendering logic are separated.
In the embodiment of the application, the game can be separated into the game logic and the rendering logic, the game logic and the rendering logic are respectively executed in two different processes, and the game logic is executed in the black box, so that the virtual character information and the process memory information in the game can be effectively hidden, the difficulty of plug-in development is increased, and the safety of the game is improved; the rendering function interfaces are classified, the process of calling the rendering function interfaces can be determined according to the classes of the rendering function interfaces, the rendering function interfaces of different classes correspond to different communication modes, and the calling processing efficiency of the rendering function interfaces can be improved.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a game data processing device according to an embodiment of the present application. As shown in fig. 11, the game data processing apparatus 1 may include: a transmission module 11, a rendering module 12;
the transmission module 11 is configured to acquire interface calling information and game data to be rendered for a rendering function interface in a first process, and transmit the interface calling information and the game data to be rendered between the first process and a second process; the first process is a process which runs in the black box and is used for executing game logic, and the second process is a process which runs outside the black box and is used for executing rendering logic;
and the rendering module 12 is configured to, when the second process acquires the interface calling information and the game data to be rendered, call a rendering function interface in the second process according to the interface calling information, perform rendering processing on the game data to be rendered according to the rendering function interface, and generate a game interface for display.
The specific functional implementation manners of the transmission module 11 and the rendering module 12 may refer to steps S101 to S102 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 11, the transmission module 11 may include: the call intercepting unit 111, the call transmitting unit 112 and the call acquiring unit 113;
the calling intercepting unit 111 is configured to, when a calling instruction for the rendering function interface in the first process is detected, obtain interface calling information and game data to be rendered, which correspond to the calling instruction, from the first process through the proxy dynamic link library;
the calling transmission unit 112 is used for transmitting the interface calling information and the game data to be rendered to the shared memory space through the proxy dynamic link library;
a call obtaining unit 113, configured to obtain, if the second process monitors the interface call information and the game data to be rendered in the shared memory space, the interface call information and the game data to be rendered from the shared memory space through the second process; the first process and the second process both have the right to access the shared memory space.
The specific functional implementation manners of the call intercepting unit 111, the call transmitting unit 112, and the call acquiring unit 113 may refer to step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
The shared memory space comprises a ring queue; the call transfer unit 112 may include: a call information encapsulation subunit 1121, a data storage subunit 1122;
a calling information encapsulation subunit 1121, configured to obtain, through the proxy dynamic link library, an interface identifier corresponding to the rendering function interface, encapsulate the interface calling information and the interface identifier into a calling data packet, and obtain interface category information corresponding to the rendering function interface;
and the data storage subunit 1122 is configured to, if the interface type information is the asynchronous call interface type, store the call data packet and the game data to be rendered into an empty slot in the circular queue through the proxy dynamic link library.
The specific functional implementation manners of the call information encapsulation subunit 1121 and the data storage subunit 1122 may refer to steps S202 to S203 in the embodiment corresponding to fig. 4, which are not described herein again.
Referring to fig. 11, the game digital processing device 1 may further include: a monitoring module 13 and a storage module 14;
a monitoring module 13, configured to monitor, if the interface type information is a sequential call interface type, a processing state of a history call data packet included in the ring queue through the proxy dynamic link library;
and the storage module 14 is used for storing the calling data packet and the game data to be rendered into an empty slot in the circular queue through the proxy dynamic link library when the processing state of the historical calling data packet is a processed state.
Wherein the history calling data packet comprises a calling data packet aiAnd call packet ai+1Call packet aiStore to ring queue earlier than call packet ai+1Storing time to a ring queue, i being a positive integer less than the number of call packets;
the game digital processing device 1 may further include: a processing state determination module 15;
a processing status determination module 15 for obtaining the call data packet a from the ring queue through the second processiWill call packet aiThe processing state of (1) is determined as a processed state;
the above processing stateModule 15 for calling data packet aiWhen the processing state of the call packet a is a processed state, the call packet a is acquired from the ring queue by the second processi+1Will call packet ai+1The processing state of (1) is determined as a processed state;
the processing status determination module 15 is further configured to determine the processing status when the data packet a is callediAnd call packet ai+1When the processing states of the history calling data packet are the processed states, the processing state of the history calling data packet is determined to be the processed state.
The specific functional implementation manners of the monitoring module 13, the storage module 14, and the processing state determining module 15 may refer to step S303 in the embodiment corresponding to fig. 7, which is not described herein again.
Referring also to fig. 11, the asynchronous call interface category includes a set interface category; the data storage subunit 1122 may include: a state machine transmission subunit 11221, a state machine storage subunit 11222;
a state machine transmission subunit 11221, configured to transmit, if the interface type information is the set interface type, interface call information in the first process to the state machine through the dynamic link library, and store the call data packet and the game data to be rendered to an empty slot in the ring queue through the proxy dynamic link library;
a state machine storage subunit 11222, configured to determine, according to the interface call information, an interface name and a setting state corresponding to the rendering function interface, and store, in the state machine, the interface name and the setting state as key value pair information; the key-value pair information is used to instruct the first process to obtain the setting state from the state machine.
The specific functional implementation manner of the state machine transmission subunit 11221 and the state machine storage subunit 11222 may refer to step S203 in the embodiment corresponding to fig. 4, which is not described herein again.
Referring to fig. 11, the game data processing apparatus 1 may further include: a result encapsulation module 17, a result acquisition module 18;
a result encapsulating module 17, configured to encapsulate, in a second process, a call result corresponding to the game interface into a result data packet if the rendering function interface belongs to the sequential call interface category, and transmit the result data packet to the shared memory space;
and the result obtaining module 18 is configured to, if the first process monitors the result data packet in the shared memory space, obtain the result data packet from the shared memory space through the first process, analyze the result data packet to obtain a calling result, and continue to execute subsequent game logic according to the calling result in the first process.
The specific functional implementation manners of the result encapsulating module 17 and the result obtaining module 18 may refer to steps S305 to S306 in the embodiment corresponding to fig. 7, which is not described herein again.
Referring to fig. 11, the call information encapsulation sub-unit 1121 may include: an information table acquisition subunit 11211, a traversal subunit 11212, and a packaging subunit 11213;
an information table obtaining subunit 11211, configured to obtain an interface call information table through the proxy dynamic link library;
the traversal subunit 11212 is configured to perform traversal in the interface invocation information table according to the interface invocation information, and acquire the interface identifier and the interface category information having a mapping relationship with the interface invocation information from the interface invocation information table;
an encapsulating subunit 11213, configured to encapsulate the interface invocation information and the interface identifier into an invocation packet.
The specific functional implementation manners of the information table obtaining subunit 11211, the traversal subunit 11212, and the encapsulation subunit 11213 may refer to step S202 in the embodiment corresponding to fig. 4, which is not described herein again.
Referring to fig. 11 together, the game data processing apparatus 1 may include: a replacement module 16;
a replacing module 16, configured to obtain an agent dynamic link library associated with the first process, load the agent dynamic link library in the first process, and replace an original dynamic link library corresponding to the first process with the agent dynamic link library; and the proxy dynamic link library is used for transmitting the interface calling information and the game data to be rendered in the first process to the shared memory space.
The specific functional implementation manner of the replacement module 16 may refer to step S101 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 11, the call acquisition unit 113 may include: a data acquisition subunit 1131, an analysis subunit 1132;
a data obtaining subunit 1131, configured to obtain, through a second process, a call data packet and game data to be rendered from the shared memory space;
the parsing subunit 1132 is configured to parse the call data packet to obtain interface call information and an interface identifier;
the rendering module 12 may include: an interface calling unit 121, a display unit 122;
an interface calling unit 121, configured to call, in the second process, a rendering function interface in the proxy dynamic link library according to the interface calling information and the interface identifier;
and the display unit 122 is configured to perform rendering processing on the game data to be rendered according to the rendering function interface, generate a game interface corresponding to the game data to be rendered, and display the game interface in a game application.
For specific functional implementation manners of the data obtaining subunit 1131, the parsing subunit 1132, the interface calling unit 121, and the display unit 122, reference may be made to step S204 in the embodiment corresponding to fig. 3, which is not described herein again.
In the embodiment of the application, the game can be separated into the game logic and the rendering logic, the game logic and the rendering logic are respectively executed in two different processes, and the game logic is executed in the black box, so that the virtual character information and the process memory information in the game can be effectively hidden, the difficulty of plug-in development is increased, and the safety of the game is improved; the rendering function interfaces are classified, the process of calling the rendering function interfaces can be determined according to the classes of the rendering function interfaces, the rendering function interfaces of different classes correspond to different communication modes, and the calling processing efficiency of the rendering function interfaces can be improved.
Referring to fig. 12, fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 12, the computer apparatus 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the computer apparatus 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 12, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 12, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring interface calling information and game data to be rendered for a rendering function interface in a first process, and transmitting the interface calling information and the game data to be rendered between the first process and a second process; the first process is a process which runs in the black box and is used for executing game logic, and the second process is a process which runs outside the black box and is used for executing rendering logic;
and when the second process acquires the interface calling information and the game data to be rendered, calling a rendering function interface according to the interface calling information in the second process, rendering the game data to be rendered according to the rendering function interface, and generating a game interface for display.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the game data processing method in the embodiment corresponding to any one of fig. 3, fig. 4, and fig. 7, and may also perform the description of the game data processing apparatus 1 in the embodiment corresponding to fig. 11, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, where the computer program executed by the aforementioned game data processing apparatus 1 is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the game data processing method in any one of the embodiments corresponding to fig. 3, fig. 4, and fig. 7 can be executed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application. As an example, the program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network, which may constitute a blockchain network.
Further, it should be noted that: embodiments of the present application also provide a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor can execute the computer instruction, so that the computer device executes the description of the game data processing method in the embodiment corresponding to any one of fig. 3, fig. 4, and fig. 7, which will not be described herein again. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product or the computer program referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the order of acts described, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device can be merged, divided and deleted according to actual needs.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (13)

1. A game data processing method, comprising:
acquiring interface calling information and game data to be rendered for a rendering function interface in a first process, and transmitting the interface calling information and the game data to be rendered between the first process and a second process through a shared memory space; the first process is a process which runs in a black box and is used for executing game logic, the second process is a process which runs outside the black box and is used for executing rendering logic, the game logic and the rendering logic belong to the same game, memories between the first process and the second process are isolated from each other, the black box comprises a virtual machine or a server, and the shared memory space is used for transmitting data between the first process and the second process;
when the second process obtains the interface calling information and the game data to be rendered in the shared memory space, calling the rendering function interface according to the interface calling information in the second process, and rendering the game data to be rendered according to the rendering function interface to generate a game interface for display; the rendering function interface refers to an application program interface called by the second process for drawing.
2. The method of claim 1, wherein the obtaining interface call information for a rendering function interface in a first process and game data to be rendered, and transmitting the interface call information and the game data to be rendered between the first process and a second process through a shared memory space comprises:
when a call instruction aiming at a rendering function interface in the first process is detected, acquiring interface call information and game data to be rendered, which correspond to the call instruction, from the first process through an agent dynamic link library;
transmitting the interface calling information and the game data to be rendered to a shared memory space through the proxy dynamic link library;
if the second process monitors the interface calling information and the game data to be rendered in the shared memory space, the second process acquires the interface calling information and the game data to be rendered from the shared memory space; and the first process and the second process both have the permission to access the shared memory space.
3. The method of claim 2, wherein the shared memory space comprises a circular queue;
the transmitting the interface calling information and the game data to be rendered to a shared memory space through the proxy dynamic link library, comprising:
acquiring an interface identifier corresponding to the rendering function interface through the proxy dynamic link library, packaging the interface calling information and the interface identifier into a calling data packet, and acquiring interface category information corresponding to the rendering function interface;
and if the interface type information is the asynchronous calling interface type, storing the calling data packet and the game data to be rendered to an empty slot in the annular queue through the proxy dynamic link library.
4. The method of claim 3, further comprising:
if the interface type information is the sequential calling interface type, monitoring the processing state of the historical calling data packet contained in the annular queue through the proxy dynamic link library;
and when the processing state of the historical calling data packet is a processed state, storing the calling data packet and the game data to be rendered to an empty slot in the annular queue through the proxy dynamic link library.
5. The method of claim 4, wherein the historical invocation data packet comprises invocation data packet aiAnd call packet ai+1Said calling data packet aiStoring the data packet to the ring queue earlier than the calling data packet ai+1Storing time to the ring queue, i being a positive integer less than the number of the call packets;
the method further comprises the following steps:
obtaining the ring queue by the second processCalling data packet aiThe calling data packet a isiThe processing state of (1) is determined as a processed state;
when the call data packet aiWhen the processing state of the call packet a is a processed state, the call packet a is acquired from the ring queue through the second processi+1The calling data packet a isi+1The processing state of (1) is determined as a processed state;
when the call data packet aiAnd the call packet ai+1When the processing states of the history calling data packet are processed states, the processing state of the history calling data packet is determined to be the processed state.
6. The method of claim 3, wherein the asynchronous call interface class comprises a set interface class;
if the interface type information is an asynchronous call interface type, storing the call data packet and the game data to be rendered to an empty slot in the circular queue through the proxy dynamic link library, including:
if the interface type information is the set interface type, transmitting the interface calling information in the first process to a state machine through the dynamic link library, and storing the calling data packet and the game data to be rendered to an empty slot in the annular queue through the proxy dynamic link library;
determining an interface name and a setting state corresponding to the rendering function interface according to the interface calling information, and storing the interface name and the setting state as key value pair information in the state machine; the key-value pair information is used for indicating the first process to acquire the setting state from the state machine.
7. The method of claim 4, further comprising:
if the rendering function interface belongs to the sequential calling interface category, packaging a calling result corresponding to the game interface into a result data packet in the second process, and transmitting the result data packet to the shared memory space;
if the first process monitors the result data packet in the shared memory space, the result data packet is obtained from the shared memory space through the first process, the result data packet is analyzed to obtain the calling result, and subsequent game logic is continuously executed in the first process according to the calling result.
8. The method according to claim 3, wherein the obtaining, by the proxy dynamic link library, the interface identifier corresponding to the rendering function interface, encapsulating the interface calling information and the interface identifier into a calling data packet, and obtaining the interface category information corresponding to the rendering function interface comprises:
acquiring an interface calling information table through the proxy dynamic link library;
traversing in the interface calling information table according to the interface calling information, and acquiring interface identification and interface category information which have a mapping relation with the interface calling information from the interface calling information table;
and encapsulating the interface calling information and the interface identification into the calling data packet.
9. The method of claim 2, further comprising:
acquiring the proxy dynamic link library associated with the first process, loading the proxy dynamic link library in the first process, and replacing an original dynamic link library corresponding to the first process with the proxy dynamic link library; and the proxy dynamic link library is used for transmitting the interface calling information and the game data to be rendered in the first process to the shared memory space.
10. The method according to claim 3, wherein the interface calling information and the game data to be rendered are obtained from the shared memory space through the second process; the method comprises the following steps:
acquiring the calling data packet and the game data to be rendered from the shared memory space through the second process;
analyzing the calling data packet to obtain the interface calling information and the interface identification;
the invoking the rendering function interface according to the interface invoking information in the second process, performing rendering processing on the game data to be rendered according to the rendering function interface, and generating a game interface for displaying, includes:
in the second process, calling the rendering function interface in the proxy dynamic link library according to the interface calling information and the interface identifier;
rendering the game data to be rendered according to the rendering function interface, generating a game interface corresponding to the game data to be rendered, and displaying the game interface in game application.
11. A game data processing apparatus characterized by comprising:
the transmission module is used for acquiring interface calling information aiming at a rendering function interface in a first process and game data to be rendered, and transmitting the interface calling information and the game data to be rendered between the first process and a second process through a shared memory space; the first process is a process which runs in a black box and is used for executing game logic, the second process is a process which runs outside the black box and is used for executing rendering logic, the game logic and the rendering logic belong to the same game, memories between the first process and the second process are isolated from each other, the black box comprises a virtual machine or a server, and the shared memory space is used for transmitting data between the first process and the second process;
the rendering module is configured to, when the second process obtains the interface calling information and the game data to be rendered in the shared memory space, call the rendering function interface in the second process according to the interface calling information, perform rendering processing on the game data to be rendered according to the rendering function interface, and generate a game interface for display; the rendering function interface refers to an application program interface called by the second process for drawing.
12. A computer arrangement comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, performs the steps of the method of any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the steps of the method of any one of claims 1 to 10.
CN202010910388.4A 2020-09-02 2020-09-02 Game data processing method, device, equipment and medium Active CN112023402B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010910388.4A CN112023402B (en) 2020-09-02 2020-09-02 Game data processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010910388.4A CN112023402B (en) 2020-09-02 2020-09-02 Game data processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112023402A CN112023402A (en) 2020-12-04
CN112023402B true CN112023402B (en) 2021-07-27

Family

ID=73592239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010910388.4A Active CN112023402B (en) 2020-09-02 2020-09-02 Game data processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112023402B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377451B (en) * 2021-06-09 2024-03-12 北京千丁互联科技有限公司 Application restarting method, device, computer equipment and readable storage medium
CN113515396B (en) * 2021-07-09 2024-01-30 北京字节跳动网络技术有限公司 Graphics rendering method, graphics rendering device, electronic equipment and storage medium
CN116233520B (en) * 2023-05-06 2023-07-25 海马云(天津)信息技术有限公司 Method and device for transmitting and acquiring video data, server device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176854A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Process-to-process communication method, device and system
CN108595177A (en) * 2018-04-28 2018-09-28 广东电网有限责任公司 interface development method and device
CN111158866A (en) * 2019-12-30 2020-05-15 珠海金山网络游戏科技有限公司 Engine system and rendering method thereof
CN111544886A (en) * 2020-04-30 2020-08-18 腾讯科技(深圳)有限公司 Picture display method and related device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542129A (en) * 2010-12-08 2012-07-04 杭州格诚网络科技有限公司 Three-dimensional (3D) scene display system
US9772889B2 (en) * 2012-10-15 2017-09-26 Famous Industries, Inc. Expedited processing and handling of events
KR102263326B1 (en) * 2014-09-18 2021-06-09 삼성전자주식회사 Graphic processing unit and method of processing graphic data using the same
CN105005473B (en) * 2015-06-29 2018-02-23 乐道互动(天津)科技有限公司 A kind of game engine system for being used to develop 3D game
CN110362405B (en) * 2019-07-02 2023-06-20 Oppo广东移动通信有限公司 Thread allocation method, device and equipment of application program and readable storage medium
CN110860086B (en) * 2019-11-08 2023-08-15 武汉微派网络科技有限公司 Data processing method, readable storage medium, and electronic device
CN111265883A (en) * 2019-12-24 2020-06-12 武汉勾勾互娱科技有限公司 Anti-plug-in system and method for PC game

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176854A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Process-to-process communication method, device and system
CN108595177A (en) * 2018-04-28 2018-09-28 广东电网有限责任公司 interface development method and device
CN111158866A (en) * 2019-12-30 2020-05-15 珠海金山网络游戏科技有限公司 Engine system and rendering method thereof
CN111544886A (en) * 2020-04-30 2020-08-18 腾讯科技(深圳)有限公司 Picture display method and related device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"使用 Electron 在两个进程 (主进程和渲染进程) 之间进行通讯";DemoPark;《https://segmentfault.com/a/1190000011507250》;SegmentFault论坛;20171011;1-5 *

Also Published As

Publication number Publication date
CN112023402A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CN112023402B (en) Game data processing method, device, equipment and medium
EP4122568A1 (en) Data processing method and device and storage medium
CN111767503B (en) Game data processing method, device, computer and readable storage medium
CN108563517B (en) Calling method and device of system interface
CN111736850B (en) Image processing method, apparatus, server and medium
CN109032793B (en) Resource allocation method, device, terminal and storage medium
US11977918B2 (en) Methods, systems and computer program products for optimizing computer system resource utilization during in-game resource farming
AU2019233201A1 (en) Resource configuration method and apparatus, terminal, and storage medium
US9349201B1 (en) Command sentinel
CN107018191B (en) Method and device for controlling game
CN112988400B (en) Video memory optimization method and device, electronic equipment and readable storage medium
JP7412594B2 (en) Data processing method, data processing device, computer equipment, and computer program
CN113034629B (en) Image processing method, image processing device, computer equipment and storage medium
CN110968395B (en) Method for processing rendering instruction in simulator and mobile terminal
CN110213265B (en) Image acquisition method, image acquisition device, server and storage medium
CN115065684B (en) Data processing method, apparatus, device and medium
CN110399214B (en) Method and device for optimizing display card load and computer equipment
CN115292020B (en) Data processing method, device, equipment and medium
CN112316433A (en) Game picture rendering method, device, server and storage medium
CN115955590A (en) Video processing method, video processing device, computer equipment and medium
US20120100912A1 (en) Method of reusing physics simulation results and game service apparatus using the same
CN115512019A (en) Rendering method, device and system
US20240165513A1 (en) Data processing method and apparatus for virtual scene, electronic device, computer-readable storage medium, and computer program product
CN118312297A (en) Rendering method and device of cloud terminal
CN116920414A (en) Access method, apparatus, device, readable storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40035259

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant