Method, device and related equipment for configuring inference service of game in cloud platform

By utilizing a general game algorithm framework and configuration files on a cloud platform, the game inference service is automatically configured, solving the problems of high cost and difficulty for game developers. This enables efficient and low-cost game inference services applicable to multiple games.

CN115193053BActive Publication Date: 2026-11-27HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110742189.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-04-09
Filing Date
2021-06-30
Publication Date
2026-11-27
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

Game developers face high costs and difficulties in acquiring AI-based game reasoning services, and small and medium-sized game companies often lack the resources and high-quality AI models required.

Method used

By utilizing a general game algorithm framework and configuration files on a cloud platform, the inference service for games can be automatically configured. By acquiring configuration information and training AI models, inference services for specific games can be provided.

Benefits of technology

It reduces the difficulty and cost of providing and using game reasoning services, improves efficiency, and supports universal reasoning services for multiple games, thus reducing the difficulty for small and medium-sized game developers to apply AI technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115193053B_ABST
    Figure CN115193053B_ABST
Patent Text Reader

Abstract

The application provides a method for configuring an inference service of a game on a cloud platform. When configuring the inference service of the game for a game developer on the cloud platform, a first configuration file including configuration information for a first game is acquired, so that the inference service of the first game is configured on the cloud platform based on a game algorithm framework of the cloud platform and the acquired first configuration file. Further, the inference service of a second game can also be configured on the cloud platform based on the game algorithm framework of the cloud platform and a second configuration file corresponding to the second game. In this way, for different games, the inference service of one or more games required by the game developer can be configured on the cloud platform, so that the cloud service provider does not need to design the inference service specially, and the difficulty of small and medium-sized game manufacturers in applying AI technology to obtain game inference results is also effectively reduced. In addition, corresponding devices and related equipment are also provided.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese Patent Application No. 202110379975.X, filed on April 9, 2021, entitled "A Game Development Method and System Based on Artificial Intelligence", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus and related equipment for configuring game reasoning services on a cloud platform. Background Technology

[0003] Currently, artificial intelligence (AI) technology is widely used in various fields. For example, in the gaming industry, game developers (such as game companies) can use AI technology to achieve functions such as training non-player characters (NPCs) in game scenes, predicting player behavior, and developing character combat strategies. Specifically, AI technology can be used to infer the combat actions or combat states of non-player characters during game combat.

[0004] To acquire AI-based game reasoning capabilities during game development, developers either need to independently build a dedicated reasoning service for their specific game, or they can request such a service from a service provider (e.g., a cloud service provider), who will then customize a custom reasoning service for that game. However, both of these methods make obtaining AI-based game reasoning services costly and difficult. Summary of the Invention

[0005] In view of this, embodiments of this application provide a method for configuring game inference services on a cloud platform, thereby reducing the cost and difficulty for cloud service providers to offer game inference services. This application also provides corresponding apparatus, computing device clusters, computer-readable storage media, and computer program products.

[0006] In a first aspect, embodiments of this application provide a method for configuring a game's inference service on a cloud platform. Specifically, when configuring an inference service for a first game for a game developer on a cloud platform, a first configuration file including configuration information for the first game can be obtained, thereby configuring the inference service for the first game on the cloud platform based on the game algorithm framework of the cloud platform and the obtained first configuration file.

[0007] In this way, for games developed by game developers, a general game algorithm framework and corresponding configuration files can be used to automatically configure a specific inference service on the cloud platform to meet the game developer's needs. This allows the configured inference service to perform inferences within the game, such as inferring the actions and / or states of any character. This eliminates the need for cloud service providers to design inference services specifically for each game, effectively reducing the difficulty and cost of providing and using game inference services, and significantly improving the efficiency of providing and using inference services.

[0008] Moreover, in practical applications, the application of AI technology is inseparable from training algorithms represented by reinforcement learning (RL) and the computing resources required to support the operation of training algorithms. However, for game developers such as small and medium-sized game companies, it may be difficult to have high-quality AI models and sufficient computing resources to realize game reasoning. By configuring reasoning services on cloud platforms for reasoning about the actions and / or states of characters in games, the difficulty for game developers to obtain game reasoning results by applying AI technology can be effectively reduced.

[0009] In one possible implementation, the cloud platform can configure not only the inference service for the first game but also the inference service for the second game. Specifically, a second configuration file containing configuration information for the second game can be obtained. Based on the cloud platform's game algorithm framework and the obtained second configuration file, the inference service for the second game can be configured on the cloud platform. This allows for the configuration of inference services for multiple different games on the cloud platform using a common game algorithm framework, thereby improving the versatility of the solution.

[0010] In one possible implementation, after configuring the inference service for the first game, the inference service can be used to respond to inference requests sent by the game client. The game client can be a device running a game application instance of the first game, such as a terminal and / or a server. The inference request includes unprocessed data for a target object within the game application instance of the first game, such as information images of the target object. The response from the inference service can include indications of the target object's actions and / or state. These indications could, for example, indicate actions the target object will perform in the future (such as attacking or jumping), and / or indicate the target object's state in the future (such as emotions or attack speed). In this way, game developers can use the inference service configured on a cloud platform to infer the actions and / or state of target objects, effectively reducing the difficulty for game developers to obtain game inference results using AI technology.

[0011] In one possible implementation, the first configuration file includes one or more of the following configuration information: the action space of the target object in the game application instance of the first game, the state space of the target object in the game application instance of the first game, a first type of target training algorithm, a second type of artificial intelligence (AI) model, a reward function, the training method of the AI ​​model, the inference method of the AI ​​model, the storage address of the AI ​​model, and the specifications of the computing resources used for training and inference of the AI ​​model, so as to configure the inference service on the cloud platform using this configuration information. The second configuration file is implemented similarly to the first configuration file and can be understood by referring to it; therefore, it will not be elaborated upon here.

[0012] In one possible implementation, when configuring the inference service for the first game, specifically, at least one AI model can be trained based on a first configuration file and the game algorithm framework of the cloud platform, thereby configuring the inference service for the first game based on the trained at least one AI model. Correspondingly, when using this inference service to infer actions and / or states of target objects in the game application instance of the first game, inference can be performed using the trained AI model.

[0013] In one possible implementation, when training at least one AI model, multiple training requests can be received from the game client. These multiple training requests originate from multiple game application instances of a first game, and each training request includes different training data for the same target object within the multiple game application instances. This allows the training data from the multiple training requests to be used to train at least one AI model. Thus, by running multiple game application instances simultaneously on the game client, multiple sets of training data can be generated in parallel, effectively improving the efficiency of generating training data, and consequently, improving the efficiency of training the AI ​​model.

[0014] Alternatively, the game client may run only one instance of the game application within the same time period, thereby using the training data generated by the single game application instance to train one or more AI models.

[0015] In one possible implementation, the at least one trained AI model includes a first AI model and a second AI model, wherein the first AI model and the second AI model have different hyperparameters, and / or the reward functions corresponding to the first AI model and the second AI model are different. Thus, by training AI models with different hyperparameters, hyperparameters that result in higher inference performance can be determined, leading to a higher quality AI model based on those hyperparameters, and consequently, a higher quality inference service configured based on those AI models. Furthermore, by training different AI models using different reward functions, AI models with different inference types can be trained; for example, multiple reward functions can be used to train AI models with various inference styles, thereby achieving diversification of inference capabilities.

[0016] In one possible implementation, when the trained AI model includes a first AI model and a second AI model, multiple processes can run on the cloud platform. Here, we take the first process and the second process as examples. Specifically, when training the first AI model and the second AI model, training data from multiple training requests can be sent to the first process and the second process based on the port number and / or IP address of the first process. The training data received by the first process and the second process can be different. Then, the first AI model is trained using the first process and the training data it received, and the second AI model is trained using the second process and the training data it received. In this way, multiple AI models can be trained in parallel on the cloud platform, thereby improving the training efficiency of the AI ​​models, and thus improving the efficiency of configuring the inference service for the first game.

[0017] In one possible implementation, the game algorithm framework of the cloud platform can predefine one or more different types of training algorithms and AI models. Thus, when configuring the inference service of the first game, the first type of target training algorithm and at least one type of AI model can be called from the game algorithm framework according to the first type of target training algorithm and the second type of AI model in the first configuration file.

[0018] For example, the target training algorithm may be any one of the following: deep reinforcement learning algorithm, proximal policy optimization algorithm, flexible action evaluation algorithm, deep deterministic policy gradient algorithm, dual-delay deep deterministic policy gradient algorithm, rainbow algorithm, or other applicable algorithms. The AI ​​model may be any one of the following: deep neural network model, recurrent neural network model, convolutional neural network model, or other applicable models.

[0019] In one possible implementation, when the data formats of the game client and the cloud platform differ, before responding to the inference request sent by the game client using the inference service of the first game, the data format in the inference request sent by the game client can be processed to obtain data in a format that the cloud platform can recognize. This avoids the cloud platform's inability to recognize the inference request sent by the game client due to differences in deployment environments between the game client and the cloud platform.

[0020] In one possible implementation, a persistent connection can be maintained between the cloud platform and the game client, through which the cloud platform can receive and respond to inference requests sent by the game client. Thus, after establishing a persistent connection, the cloud platform and the game client can communicate with each other multiple times without needing to re-establish a connection for each data communication, thereby effectively reducing communication latency between the cloud platform and the game client.

[0021] In one possible implementation, the first configuration file can be obtained based on the configuration information selected by the game developer. For example, the cloud platform can provide a configuration interface to the game developer, presenting multiple configuration information items for the developer to choose from. The cloud platform can then automatically generate the corresponding first configuration file based on the developer's selection. This effectively improves the configuration efficiency and enhances the configuration experience for game developers.

[0022] Secondly, this application provides an apparatus for configuring a game's inference service on a cloud platform. The apparatus includes a communication module for acquiring a first configuration file, the first configuration file including configuration information for a first game; and a configuration module for configuring the inference service of the first game on the cloud platform based on the game algorithm framework of the cloud platform and the first configuration file.

[0023] In one possible implementation, the communication module is further configured to acquire a second configuration file, which includes configuration information for the second game; the configuration module is further configured to configure the inference service of the second game on the cloud platform based on the game algorithm framework of the cloud platform and the second configuration file.

[0024] In one possible implementation, the apparatus further includes: an inference module for responding to an inference request sent by a game client using the inference service of a first game, wherein the game client includes a device running a game application instance of the first game, the inference request includes pending data for a target object in the game application instance of the first game, and the response includes indication information for the action and / or state of the target object.

[0025] In one possible implementation, the first configuration file includes one or more of the following configuration information: the action space of the target object in the game application instance of the first game, the state space of the target object in the game application instance of the first game, the first type of target training algorithm, the second type of artificial intelligence (AI) model, the reward function, the training method of the AI ​​model, the inference method of the AI ​​model, the storage address of the AI ​​model, and the specifications of the computing resources used for training and inference of the AI ​​model.

[0026] In one possible implementation, the configuration module is specifically used for: training at least one AI model based on a first configuration file and a game algorithm framework; and configuring the inference service of the first game according to the trained at least one AI model.

[0027] In one possible implementation, the configuration module is specifically configured to: receive multiple training requests from the game client, the multiple training requests originating from multiple game application instances of the first game, and the different training requests including different training data for the same target object in the multiple game application instances; and train at least one AI model based on the training data in the multiple training requests.

[0028] In one possible implementation, when at least one AI model includes a first AI model and a second AI model, the hyperparameters of the first AI model and the second AI model are different, and / or the reward functions corresponding to the first AI model and the second AI model are different.

[0029] In one possible implementation, when at least one AI model includes a first AI model and a second AI model, the cloud platform runs a first process and a second process. The configuration module is specifically used to: send training data from multiple training requests to the first process and the second process according to the port number and / or IP address of the first process and the port number and / or IP address of the second process; train the first AI model using the first process and the training data received by the first process, and train the second AI model using the training data received by the second process and the second process.

[0030] In one possible implementation, the configuration module is specifically used to: invoke a target training algorithm of the first type and at least one AI model of the second type in the game algorithm framework according to a first type of target training algorithm and a second type of AI model in a first configuration file; and train at least one AI model of the second type based on the invoked target training algorithm of the first type.

[0031] In one possible implementation, when the data formats of the game client and the cloud platform are different, before responding to the inference request sent by the game client using the inference service of the first game, the method further includes: processing the format of the data in the inference request sent by the game client to obtain data in a format that the cloud platform can recognize.

[0032] In one possible implementation, a persistent connection is maintained between the cloud platform and the game client, and the cloud platform receives and responds to inference requests sent by the game client through the persistent connection.

[0033] In one possible implementation, the communication module is specifically used to obtain a first configuration file based on the configuration information items selected by the game developer.

[0034] Thirdly, this application provides a computing device cluster, the computing device cluster including at least one computing device, wherein each computing device includes a processor and a memory. The processor is used to execute instructions stored in the memory to cause the at least one computing device to perform a method for configuring a game inference service on a cloud platform, as described in the first aspect or any implementation thereof.

[0035] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a computing device, cause the computing device to perform the method for configuring a game reasoning service on a cloud platform as described in the first aspect or any implementation thereof.

[0036] Fifthly, this application provides a computer program product containing instructions that, when run on a computing device, cause the computing device to execute the method for configuring a game reasoning service on a cloud platform as described in the first aspect or any implementation thereof.

[0037] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0039] Figure 1 A schematic diagram of an exemplary application scenario provided in this application embodiment;

[0040] Figure 2 This is a schematic diagram of the structure of a game reasoning device provided in an embodiment of this application;

[0041] Figure 3 A flowchart illustrating a method for configuring a game's reasoning service on a cloud platform, provided as an embodiment of this application;

[0042] Figure 4 A schematic diagram of a configuration interface provided in an embodiment of this application;

[0043] Figure 5 A schematic diagram illustrating the transmission of training data from the game terminal 200 to the game reasoning device 300, as provided in this embodiment of the application.

[0044] Figure 6 A flowchart illustrating a method for configuring game reasoning services on a cloud platform in accordance with a specific scenario, as provided in this application embodiment;

[0045] Figure 7 A schematic diagram of the structure of another game reasoning device provided in the embodiments of this application;

[0046] Figure 8 A diagram showing the health of characters A and B at the end of a battle, provided as an embodiment of this application.

[0047] Figure 9 This is a diagram illustrating the win rate of a match between character A and character B, provided in an embodiment of this application.

[0048] Figure 10 A schematic diagram illustrating the win rates of character A in battles for three different combat styles, as provided in this application embodiment;

[0049] Figure 11 This is a schematic diagram of the hardware structure of a computing device cluster provided in an embodiment of this application. Detailed Implementation

[0050] The solutions in the embodiments provided in this application will now be described with reference to the accompanying drawings.

[0051] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application.

[0052] like Figure 1 The image shown is a schematic diagram of an exemplary application scenario. Figure 1In the application scenario shown, game developer 101 can develop a game through game client 200. For example, game developer 101 can develop the game environment, design the game map, and define the actions and states of various characters on game client 200. The game developed by game developer 101 on game client 200 can provide a game experience for game player 102. For example, the developed game can be run on game client 200, allowing game player 102 to trigger game operations to experience the game. It should be understood that game developer 101 in this application refers to the entity that develops and designs the game or develops game reasoning capabilities. It should be understood that... Figure 1 The game client 200 may include devices for game development and devices for deploying games. For example, the game client 200 may include a server for game development and devices for running games (e.g., the backend server of game developer 101, and / or the terminal device of game player 102 for installing the game). It should be understood that... Figure 1 This example uses one game client 200 as an example. In actual applications, the number of game clients 200 can also be multiple.

[0053] During game operation, the game client 200 can send inference requests to the cloud platform to request inference services specific to the game. For example, the game on the game client 200 can support a "player vs. computer" mode, where the player character controlled by player 102 competes against a non-player character controlled by a machine. The game client 200 can request information from the cloud platform regarding the non-player character's combat actions (such as attacking, jumping, etc.) and / or combat status (such as increased attack speed, decreased movement speed, etc.). Based on this information provided by the cloud platform, the game client 200 can then control the non-player character to fight against the player character controlled by player 102. Figure 1 As shown, the cloud platform may include a game reasoning device 300, which includes a reasoning service for the game. Specifically, the game client 200 may request the reasoning service from the game reasoning device 300 on the cloud platform, and the game reasoning device 300 will perform the corresponding game reasoning for the game client 200.

[0054] For example, the game client 200 may specifically include Figure 2The diagram shows a client 201 and a server 202. Client 201 interacts with player 102, while server 202 deploys the core content of the developed game. Simultaneously, client 201 receives game actions from player 102 and sends inference requests to server 202. When server 202 needs information such as non-player character actions and / or battle status during the response to the inference request, it can request inference services from game inference device 300. Server 202 then forwards the non-player character actions and / or battle status from game inference device 300 to client 201, allowing client 201 to control a non-player character to interact with player 102. In practical applications, server 202 can simultaneously process inference requests from multiple clients 201.

[0055] In another embodiment, the game client 200 may consist only of the client 201. For example... Figure 2 As shown, at this time, a complete game is deployed in client 201, which can send a reasoning request to game reasoning device 300. Then, game reasoning device 300 feeds back the reasoning information to client 201, so that client 201 can interact with game player 102 based on the reasoning information.

[0056] The game reasoning device 300 may include, for example Figure 2 The diagram shows a communication module 301 and an inference module 302. During the inference service provided by the game inference device 300, the communication module 301 can communicate with the game client 200 via the seventh layer protocol (i.e., the application layer) of the Open Systems Interconnection Model (OSI). Specifically, the communication module 301 can receive inference requests sent by the game client 200 based on this protocol and send the inference request, or the data to be processed carried in the inference request, to the inference module 302. The inference module 302 can use a corresponding AI model to perform the corresponding inference process for the game client 200 and send the inference result to the game client 200 through the communication module 301.

[0057] The game inference device 300 can be deployed on a server in a cloud center, or it can be deployed on a server in an edge center. In another possible implementation, the communication module 301 and the inference module 302 on the game inference device 300 can be deployed separately. For example, the communication module 301 can be deployed on a server in an edge center, while the inference module 302 can be deployed on a server in a cloud center. In this embodiment, the deployment method of the game inference device 300 is not limited. It should be understood that the cloud center in this application refers to a collection of devices established by a cloud service provider to provide services to cloud tenants in a region (e.g., East China region). The cloud center typically includes a large number of resources and can provide basic resource services and / or software application services to cloud tenants in various regions of the region. The cloud center includes multiple computing devices (such as servers), and the hardware resources in each computing device and the virtual resources abstracted from the hardware resources (hardware resources and virtual resources can also be called computing nodes, such as containers or virtual machines) can be used to deploy the aforementioned game inference device 300.

[0058] However, for some application scenarios with high latency requirements, using cloud centers to provide services to some cloud tenants may result in latency not meeting the requirements. Therefore, cloud service providers also set up edge centers.

[0059] In this application, an edge center refers to a collection of devices established by a cloud service provider in at least one specific region within a region. An edge center also includes multiple computing devices that can be used to provide services to tenants in that specific region. Because edge centers are geographically closer to cloud tenants in a specific region compared to cloud centers, they can provide service responses more quickly.

[0060] Cloud service providers can offer cloud services through a cloud platform. The cloud platform includes software and hardware resources owned by the cloud service provider. Specifically, the cloud platform includes software systems that interact with cloud tenants to sell, configure, and operate cloud services, as well as the cloud service provider's cloud center or edge center. The cloud platform can present at least one cloud service to users. After a cloud tenant purchases and configures a cloud service on the cloud platform, when the cloud tenant uses the cloud service, the cloud platform can invoke the corresponding cloud service device deployed in the nodes of the cloud center or edge center to respond to the service. For example, in this application, when a user configures the game's inference service in the graphical user interface of the cloud platform, the game inference device 300 deployed in the cloud center or edge center can process the inference request from the game client 200 and return a response.

[0061] Before requesting the game's reasoning service, the game client 200 can pre-configure the reasoning service on the cloud platform. In this case, the game reasoning device 300 can be a device that configures the game's reasoning service on the cloud platform. Specifically, as follows: Figure 2 As shown, the game inference device 300 may also include a configuration module 303. During the configuration of the inference service, the game developer 101 can provide a configuration file for a specific game to the cloud platform. Thus, the configuration module 303 in the game inference device 300 can configure the inference service for the game developer 101 on the cloud platform based on the game algorithm framework of the cloud platform and the configuration file provided by the game developer 101. This allows the inference module 302 to perform game inference for the game client 200 using the successfully configured inference service. The game algorithm framework can predefine various training algorithms and AI models, allowing the configuration module 303 to select the necessary training algorithms, AI models, etc., from the game algorithm framework to configure the inference service based on the configuration file.

[0062] Thus, for each game developed by different game developers 101, the game inference device 300 can automatically configure the inference service required by the game developer 101 on the cloud platform using a general game algorithm framework and the configuration file provided by the game developer 101. For example, when the game inference device 300 obtains a first configuration file containing configuration information for a first game, it can configure the inference service for the first game on the cloud platform based on the game algorithm framework and the first configuration file; and when the game inference device obtains a first configuration file containing configuration information for a second game, it can configure the inference service for the second game on the cloud platform based on the game algorithm framework and the second configuration file. The first game and the second game are different games. In this way, the game inference device 300 can further utilize the configured inference service to perform game inference for the game client 200. This eliminates the need for cloud service providers to design specialized inference services for each game, effectively reducing the difficulty and cost of providing inference services and significantly improving the efficiency of inference services provided by cloud service providers.

[0063] Moreover, in practical applications, the application of AI technology is inseparable from training algorithms represented by reinforcement learning (RL) and the computing resources required to support the operation of training algorithms. However, for game developers such as small and medium-sized game companies, it may be difficult to have high-quality AI models and sufficient computing resources to realize game reasoning. Therefore, the game side can use the reasoning service on the cloud platform to realize game reasoning, which can effectively reduce the difficulty for game developers to obtain game reasoning results by applying AI technology.

[0064] It should be understood that Figure 2 The structure of the game reasoning device 300 shown is merely an illustrative example. In actual applications, the structure of the game reasoning device 300 can also adopt other possible implementations. For example, in one possible implementation, the game reasoning device 300 can be divided into a configuration device and a reasoning device. The configuration device is used to configure the game's reasoning service on the cloud platform, while the reasoning device is used to perform corresponding game reasoning for the game client 200 based on the configured reasoning service. Alternatively, the game reasoning device 300 can also include an online service module, which can be used to publish the reasoning service as an online cloud service on the cloud platform after the configuration module 303 completes the configuration of the game's reasoning service. Alternatively, in other game reasoning devices 300, the configuration module 303 and the reasoning module 302 can be integrated into one module, etc. This embodiment does not limit the specific implementation of the game reasoning device 300.

[0065] Next, various non-limiting specific implementations of methods for configuring game reasoning services on a cloud platform will be described in detail.

[0066] See Figure 3 This is a flowchart illustrating a method for configuring a game's reasoning service on a cloud platform, as described in an embodiment of this application. This method can be applied to the above-mentioned... Figure 2 The game reasoning device 300 is shown. In this embodiment, the game reasoning device 300 can configure reasoning services for various games on a cloud platform according to configuration files for multiple games. For ease of understanding and description, the following example illustrates how the game reasoning device 300 configures the reasoning service for the first game on the cloud platform according to the first configuration file corresponding to the first game. The implementation process of the game reasoning device 300 configuring the reasoning service for the second game (and other games) according to the second configuration file corresponding to the second game (and other games) can be understood by referring to the specific implementation of the following embodiments; this embodiment does not limit this aspect. Figure 3 The method for configuring game reasoning services on a cloud platform, as shown, may specifically include:

[0067] S301: The game reasoning device 300 acquires a first configuration file, which includes configuration information for a first game.

[0068] Typically, the data processing capabilities of the game client 200 and the quality of its AI model are limited, making it difficult to perform real-time reasoning on the actions and / or states of target objects. Therefore, in this embodiment, during the development of the first game, the game developer 101 can request the game reasoning device 300 to configure a reasoning service for the first game, so as to utilize the stronger data processing capabilities and higher-quality AI models of the cloud platform to reason on the target objects (such as game characters in the game application instance) in the game application instance of the first game. This reasoning service can be used to reason on the actions and / or states performed by one or more game characters in the game.

[0069] As an implementation example, game developer 101 can provide a first configuration file to game inference device 300, so that game inference device 300 can configure the inference service of a first game on the cloud platform according to the first configuration file. It should be understood that game developer 101 can send the first configuration file to game inference device 300 based on game client 200, such as... Figure 3 As shown. In other embodiments, the game developer 101 may also use any other device to provide the first configuration file to the game inference device 300. For example, the game developer 101 may use any terminal device to log in to the cloud platform's webpage via a webpage and perform configuration operations on the webpage interface to provide the first configuration file to the game inference device 300.

[0070] As an example, the first configuration file may include one or more of the following: the action space of the target object in the game application instance of the first game; the state space of the target object in the game application instance of the first game; the reward function; the type of the AI ​​model; the type of the target training algorithm used to train the AI ​​model; the training method of the AI ​​model; the inference method of the AI ​​model; the storage address of the AI ​​model; and the specifications of the computing resources used for training and inference of the AI ​​model. Optionally, when the first configuration file includes some of the above information, the remaining information can be determined by the game inference device 300 itself, such as the remaining information being pre-set on a cloud platform.

[0071] The action space of the target object includes at least one action of the target object, such as moving forward, backward, left, right, jumping, attacking, or dodging in the first game. Correspondingly, the action inferred by the game inference device 300 for the target object is an action within this action space. In this embodiment, the target object can be a non-player character in the game application instance of the first game running on the game client 200, such as a "human-machine" or "monster" controlled by the game client 200 to fight against players in a multiplayer online battle arena (MOBA). Alternatively, the target object can also be an object whose actions or states need to be predicted in a future time period (or other time periods). For example, player A can predict the behavior of player B at multiple future moments through the inference service of the first game. In this case, player A's experience of predicting the behavior and / or state of player B can be considered as player A's experience of the game.

[0072] The state space of the target object includes at least one state of the target object, such as the health, mana, attack power, defense, skill cooldown time, and mood of a non-player character in a game scene. Correspondingly, the state inferred by the game reasoning device 300 for the target object is a state in this state space.

[0073] The type of target training algorithm refers to the type of algorithm used when training the AI ​​model for inferring the actions and / or states of the target object. This type of target training algorithm can be specified by the game developer 101 before configuring the inference service, or it can be determined by the game inference device 300. For example, the target training algorithm can be any one of the following reinforcement learning algorithms: deep reinforcement learning (DQN), proximal policy optimization (PPO), soft actor-critic (SAC), deep deterministic policy gradient (DDPG), twin delayed deep deterministic policy gradient (TD3), or rainbow algorithm, or other applicable algorithms.

[0074] The type of AI model refers to the type of AI model used to achieve reasoning about the actions and / or states of the target object. For example, the AI ​​model can be any of the following neural network models: deep neural network (DNN), recurrent neural network (RNN), convolutional neural network (CNN), or other applicable models.

[0075] During the execution of the target training algorithm, training data can be input into the AI ​​model, and the parameters and / or network structure in the AI ​​model can be adjusted according to the difference between the output of the AI ​​model and the actual results in the training data, thereby achieving the training of the AI ​​model.

[0076] A reward function is a function used to control the direction of parameter adjustment in an AI model during training. Specifically, during model training, the game inference device 300 can calculate the corresponding reward value based on the output of the AI ​​model using this reward function. The direction of parameter adjustment in the AI ​​model can then be determined based on the magnitude of this reward value relative to a preset threshold. Through multiple iterative adjustments, model training is ultimately completed.

[0077] The training method for AI models can be, for example, self-play training. Self-play refers to the model itself playing against a virtual opponent, which can be the model itself with past experience, or an agent trained by other models. Specifically, the game inference device 300 can acquire training data for object A generated by one or more game application instances, input this training data into the AI ​​model, and the AI ​​model outputs inference actions for object A based on the training data. It then uses these inference actions to play against object B, thereby adjusting the parameters in the AI ​​model based on the game results between object A and object B.

[0078] Reasoning methods can be, for example, a way of reasoning about a style of action and / or state for a target object, or a way of reasoning about multiple styles of action and / or state in parallel.

[0079] The storage address of the AI ​​model indicates where the AI ​​model is stored on the cloud platform after training is complete.

[0080] The specifications of computing resources used for AI model training and inference refer to the specifications of computing resources that the service inference device 300 relies on when training an AI model or using the AI ​​model for inference. For example, the size of these specifications can be defined by the game developer 101 through a first configuration file.

[0081] In practical applications, the first configuration file may also include other information, such as heuristic algorithms. These heuristic algorithms can be used to impose reasonable constraints on the actions and / or states obtained by the target training algorithm using the AI ​​model. In this embodiment, the specific implementation of the first configuration file is not limited.

[0082] In one possible implementation, the game client 200 can present the user with, such as Figure 4 The configuration interface shown prompts game developer 101 to input relevant configuration information, allowing game developer 101 to configure the target object's action space, state space, reward function, target training algorithm, AI model, etc. (configuration of other content is not shown). The game client 200 can display configuration information items for game developer 101 to select on this configuration interface, such as... Figure 4 The different types of candidate options for the target training algorithm and AI model shown can be pre-provided to the game client 200 by the game inference device 300. This allows the game developer 101 to directly select the training algorithm and AI model on the configuration interface without having to input specific training algorithm files and AI model files, thus further simplifying the configuration for the game developer 101. Then, the game client 200 can automatically generate the corresponding first configuration file based on the configuration information selected by the game developer 101 and send it to the game inference device 300. In practical applications, the game developer 101 can also provide the first configuration file to the game inference device 300 in other ways; this is only an example, and the specific implementation is not limited.

[0083] S302: The game reasoning device 300 uses a cloud platform-based game algorithm framework and the acquired first configuration file to configure the reasoning service of the first game on the cloud platform.

[0084] A game algorithm framework can be a predefined library of one or more different types of training algorithms and AI models. Various training algorithms and AI models within this framework can be pre-built. When pre-building the AI ​​models within the game algorithm framework, one can choose to build the AI ​​model based on a general fully connected network structure or a convolutional neural network structure used in reinforcement learning. Furthermore, L2 regularization terms and / or Dropout layers can be added to the network architecture of the AI ​​model to improve its generalization performance and minimize the low universality of the inference actions output by the trained AI model. In practical applications, the number of network layers and / or neurons in the AI ​​model can be adaptively adjusted according to specific application requirements. When configuring the inference service for the first game, the game inference device 300 can call the training algorithms and AI models within the game algorithm framework through an Application Programming Interface (API). In practical applications, game developers 101 can subscribe to the game algorithm framework on a cloud platform, allowing the game inference device 300 to configure the inference service for the first game based on the subscribed framework.

[0085] As an example of configuring a reasoning service, the game reasoning device 300 may include, for example: Figure 2 The diagram shows a communication module 301 and a configuration module 303. After receiving the first configuration file provided by game developer 101, communication module 301 can send the first configuration file to configuration module 303. Configuration module 303 can call the corresponding type of target training algorithm in the game algorithm framework according to the type of target training algorithm defined in the first configuration file, and call one or more AI models of the corresponding type in the game algorithm framework according to the type of AI model defined in the first configuration file. Since the AI ​​models in the game algorithm framework usually have poor inference performance before model training, configuration module 303 can use the called target training algorithm to train the AI ​​model, so that configuration module 303 can further configure the inference service required by game developer 101 based on the trained AI model. The specifications of the computing resources required by configuration module 303 for AI model training and subsequent inference module 302 for game inference using the AI ​​model can be determined according to the first configuration file provided by game developer 101.

[0086] For example, the configuration module 303 can train the AI ​​model through hyperparameter search. Here, hyperparameters in the AI ​​model refer to parameters pre-set before model training, while other parameters can be determined through subsequent model training. In practical applications, pre-set hyperparameters may not necessarily enable the AI ​​model to achieve a high or highest level of reasoning performance regarding the target object. Therefore, in this embodiment, the game reasoning device 300 can train the AI ​​model through hyperparameter search to determine the hyperparameters that enable the trained AI model to achieve a high level of reasoning performance.

[0087] In specific implementation, the configuration module 303 can predetermine multiple possible values ​​for hyperparameters, thereby constructing multiple AI models based on different hyperparameter values. Taking the construction of a first AI model and a second AI model as an example (in practical applications, even more AI models can be constructed based on multiple possible hyperparameter values). The first AI model and the second AI model have different hyperparameters, but both belong to the AI ​​model type defined in the first configuration file. Thus, the configuration module 303 can use pre-acquired training data to train the first AI model and the second AI model respectively. Typically, among the multiple possible values ​​of the hyperparameters, at least one set of values ​​allows the AI ​​model trained based on that set of values ​​to have a higher inference performance, such as higher applicability of the actions and / or states inferred by the AI ​​model. In this embodiment, the inference performance of the AI ​​model can be measured by the reward value. Specifically, when training the first AI model and the second AI model, the configuration module 303 can use the reward function defined in the first configuration file to calculate the reward value corresponding to the first AI model and the reward value corresponding to the second AI model respectively. At this point, if the reward value corresponding to the first AI model is greater than the reward value corresponding to the second AI model, the configuration module 303 will use the hyperparameters of the first AI model as the hyperparameters to be searched, and will consider the first AI model as the AI ​​model with a relatively high training effect. The reward value corresponding to the AI ​​model can be calculated using the reward function pre-configured by the game developer 101. In practical applications, when more than two AI models are constructed, the configuration module 303 can use the hyperparameters of the AI ​​model with the highest reward value among the multiple AI models as the hyperparameters to be searched. Correspondingly, the AI ​​model with these hyperparameters is the AI ​​model with the highest training effect. It should be understood that this example illustrates hyperparameter search based on reward value; in practical applications, hyperparameter search can also be performed in other possible ways, and this embodiment does not limit this.

[0088] During the hyperparameter search process, the configuration module 303 can create a process on the cloud platform, which can then be used to train various AI models with different hyperparameters in sequence. The same reward function is used when training each AI model with different hyperparameters.

[0089] Alternatively, the configuration module 303 can create multiple processes on the cloud platform, each process responsible for training at least one AI model, with different processes training AI models with different hyperparameters. For example, when the configuration module 303 constructs a first AI model and a second AI model, it can create a first process and a second process on the cloud platform. The first process is used to train the first AI model, and the second process is used to train the second AI model. Exemplarily, the processes created by the configuration module 303 can be represented as workers, each implemented through processes, etc. In this way, the configuration module 303 can simultaneously train multiple AI models in parallel using multiple processes, thereby effectively improving the efficiency of hyperparameter search. In practical applications, when the number of processes is the same as the number of AI models, there can be a one-to-one correspondence between processes and AI models, allowing the configuration module 303 to train the AI ​​model corresponding to each process in parallel. When the number of processes is less than the number of AI models (different AI models have different hyperparameters), one process can correspond to multiple AI models. In this case, the configuration module 303 can utilize multiple processes to train a subset of AI models in parallel. After training this subset of AI models is complete, the configuration module 303 can use the same multiple processes to continue training the remaining AI models. Optionally, after training a subset of AI models is complete, the multiple processes can exchange hyperparameter data. This allows processes to reuse the hyperparameters of well-performing AI models and randomly explore new hyperparameters from the remaining ones, thereby reducing the computational overhead required to train multiple AI models.

[0090] In the above embodiments, the optimal AI model trained by the configuration module 303 through hyperparameter search can be used to infer an action / state of a certain style. In a further embodiment, the configuration module 303 can also obtain AI models capable of inferring multiple different action / state styles through population-based training (PBT) and other methods. The configuration module 303 uses different reward functions when training AI models of different styles. For example, the configuration module 303 can build a first AI model and a second AI model on a cloud platform. The first AI model can correspond to reward function 1, and the configuration module 303 can use reward function 1 to train an AI model for inferring an action / state of the first style. Simultaneously, the second AI model can correspond to reward function 2, and the configuration module 303 can use reward function 2 to train an AI model for inferring an action / state of the second style. Population evolution is an asynchronous automatic hyperparameter tuning optimization method that combines parallel search and sequence optimization. During population evolution, the configuration module 303 can train AI models for inferring different styles using predefined reward functions; that is, each reward function can correspond to an AI model for a specific inference style. For example, in a combat game scenario, for a non-player character A, the configuration module 303 can train three AI models with different combat styles—"aggressive," "conservative," and "balanced"—through a population evolution process. Each of these three combat style AI models corresponds to a different reward function: the "aggressive" combat style AI model corresponds to reward function 1, the "conservative" combat style AI model corresponds to reward function 2, and the "balanced" combat style AI model corresponds to reward function 3. For each combat style, the configuration module 303 can train an AI model with high inference performance (e.g., the AI ​​model with the highest reward value) belonging to that combat style through the aforementioned hyperparameter search method. The different reward functions used in the population evolution process can be determined by the configuration module 303 based on the first configuration file, or they can be set by the configuration module 303 itself.

[0091] During population evolution, an AI model may evolve into a new AI model through iterative training. If a port is allocated to each AI model (including both new and old models), the sheer number of generated AI models would lead to an excessive number of ports occupied by the processes. Therefore, when the configuration module 303 uses processes to iteratively train AI models, it can replace old AI models with new ones. This allows the processes to reuse the ports corresponding to the old AI models to receive training data and use that data to train the new AI models. This effectively avoids the excessive number of AI models generated before and after population evolution, which would otherwise lead to an excessive number of ports occupied by the processes in the game reasoning device 300.

[0092] When the configuration module 303 iteratively trains the AI ​​model through hyperparameter search and / or population evolution, it can complete the training of the AI ​​model based on the self-game training method defined in the first configuration file.

[0093] In this embodiment, the training data required for training the AI ​​model can be provided by the game client 200 to the game inference device 300. After receiving the training data, the communication module 301 in the game inference device 300 can send the training data to the configuration module 303. For example, the training data can be generated by a game application instance of a first game running on the game client 200, such as game data like attack power, defense power, and health of non-player characters and player characters at different moments in the game application instance of the first game.

[0094] As an implementation example, the game client 200 can send multiple training requests to the communication module 301, with each training request including different training data for the target object. For example... Figure 5 As shown, the multiple training requests originate from multiple game application instances of the first game running on the game client 200. For the same target object, multiple game application instances can generate multiple sets of data about that target object during runtime. Thus, multiple game application instances on the game client 200 can generate more training data per unit time, thereby accelerating the training process of the AI ​​model by the game inference device 300. Of course, this embodiment uses the parallel generation of training data by multiple game application instances on the game client 200 as an example. In other embodiments, the game client 200 may also have only one game application instance running the first game generating training data.

[0095] Furthermore, the training data generated by the game application instance running on the game client 200 for the target object may contain some invalid data, such as data used to mark the data generation time and data size. This part of the data has no guiding significance for the configuration module 303 to train the AI ​​model. Therefore, the game client 200 can filter this part of the data as invalid data. In this way, the amount of training data sent by the game client 200 to the game inference device 300 can be reduced, thereby reducing the latency caused by data communication between the game client 200 and the game inference device 300 and improving the model training efficiency.

[0096] In the process of training multiple AI models in parallel using multiple processes, taking the example of a first process training a first AI model and a second process training a second AI model, after receiving multiple inference requests, the communication module 301 can send the training data from the multiple training requests to the first process and / or the second process, based on the port number and / or IP address of the first process and the port number and / or IP address of the second process. Thus, when the configuration module 303 trains multiple AI models in parallel using multiple processes, it can use the first process and the training data it receives to train the first AI model, and use the second process and the training data it receives to train the second AI model. Similarly, when a single process is responsible for training multiple AI models (e.g., the number of processes is less than the number of AI models), the process of a single process training any one of the multiple AI models can be similar to the above process and will not be elaborated upon here.

[0097] Optionally, the training data used by different processes when training their corresponding AI models can come from one or more game application instances of the first game. In this way, after obtaining the training data generated by different game application instances of the first game, the communication module 301 can send the training data to one or more processes according to a pre-configured system. For example, such as... Figure 5As shown, the game inference device 300 can create processes 1 and 2, and the game client 200 can run game application instances 1, 2, and n of the first game. When the communication module 301 receives the training data generated by these three game application instances, it can send the training data 1 of game application instance 1 and the training data 2 of game application instance 2 to process 1, and send the training data n of game application instance n to process 2. The communication module 301 can be pre-configured with a correspondence between processes and game application instances, allowing it to send training data generated by game application instances to the corresponding processes based on this correspondence. Of course, in other possible examples, the communication module 301 could also send the training data 1 of game application instance 1 to both process 1 and process 2 simultaneously. This embodiment does not limit the specific implementation method of the communication module 301 allocating training data. Thus, the game inference device 300 can simultaneously train multiple AI models using the training data generated by different game application instances on the game client 200. Furthermore, the game client 200 can provide training data to the communication module 301 through a single output port, instead of providing training data to AI models with different inference styles through multiple output ports, thereby reducing the port requirements of the game client 200.

[0098] After the game inference device 300 successfully configures the inference service for the first game, it can also generate a notification message and send it to the game client 200 via the communication module 301 to notify the game client 200 of the training process. In practical applications, the game inference device 300 can also feed back the training results (such as game results) for each training session to the game client 200 via the communication module 301. This allows the game developer 101 to view relevant data during the model training process on the game client 200 through a corresponding interface or window.

[0099] In this embodiment, the game inference device 300 creates a new AI model and trains it as an example for illustrative purposes. In other practical applications, an existing AI model can be reused and trained through a "surgery" method. That is, a new network layer can be added to the network structure of the existing AI model. When training the AI ​​model, the hyperparameters in the newly added network layer are mainly searched and the parameters in the network layer are trained. This can improve the efficiency of model training and reduce the amount of computation required for model training.

[0100] In this embodiment, after configuring the inference service for the first game on the cloud platform, the game inference device 300 can utilize this inference service to respond to the inference request for the first game sent by the game client 200, thereby performing corresponding game inference for the game client 200. Based on this, this embodiment may further include:

[0101] S303: When the game client 200 is running a game application instance, it sends an inference request to the game inference device 300. The inference request includes the unprocessed data of the target object in the game application instance of the first game.

[0102] For example, in a game battle scenario, the data to be processed carried in the inference request may be data indicating the state of the non-player character (i.e., the target object) and the opposing player character in the first game, such as the game screen of the non-player character and the opposing player character. The content of the game screen may include information such as the health, mana, attack power, defense power, and skill status of the non-player character and the opposing player character, or it may be text information describing the battle state of the non-player character and the opposing player character. In a user behavior prediction scenario, the data to be processed may be, for example, video or image data including the user's past actions. In this embodiment, the specific implementation method of the data to be processed is not limited.

[0103] In practical applications, the game reasoning device 300 can provide an API interface to the game client 200, so that the game client 200 can send multiple reasoning requests to the communication module 301 in the game reasoning device 300 through the API interface. These multiple reasoning requests are used to request the reasoning actions and / or states of the target object at multiple future times.

[0104] Since establishing a communication connection between the game client 200 and the communication module 301 (such as a TCP connection established based on a three-way handshake) typically takes a certain amount of time, the latency of each request for action inference service by the game client 200 may be increased due to the connection establishment process between the game client 200 and the communication module 301. Therefore, in one possible implementation, the game client 200 can establish a persistent connection with the communication module 301, such as using Hypertext Transfer Protocol Version 1.1 (HTTP 1.1). In this way, after successfully establishing a connection with the communication module 301, subsequent requests for inference services from the game inference device 300 do not require re-establishing a connection; instead, the game client 200 can directly send inference requests to the game inference device 300 based on the established persistent connection, effectively reducing the latency for the game client 200 to obtain the inference results of the target object. Correspondingly, when the game inference device 300 obtains the training data provided by the game client 200, it can also receive the training data sent by the game client 200 through a pre-established long connection.

[0105] In a further possible implementation, the game client 200 and the game inference device 300 can have different deployment environments. For example, the game client 200 may be deployed in an environment corresponding to a Windows operating system, while the game inference device 300 may be deployed in an environment corresponding to a Linux operating system. In this case, the game inference device 300 deployed in the environment corresponding to a Linux operating system may have difficulty directly performing action inference based on the data to be processed generated in the environment corresponding to a Windows operating system. Therefore, the communication module 301 can first determine whether the format of the data to be processed is the target format. If not, it indicates that the game client 200 and the game inference device 300 may be deployed in different environments. Then, the communication module 301 can decode the data to be processed in the first format to obtain the data to be processed in the target format that the game inference device 300 (i.e., the cloud platform) can recognize, and provide it to the inference module 302. The specific implementation of decoding data of one format to obtain data of another format has relevant applications in real-world scenarios, and this embodiment will not elaborate on this process. If the format of the data to be processed in the inference request is the target format, the communication module 301 can directly send the data to be processed to the inference module 302. Correspondingly, when the game client 200 provides training data to the game inference device 300, it can also process the format of the training data accordingly to obtain data in a format that conforms to the deployment environment of the cloud platform.

[0106] When other clients send reasoning requests to the game reasoning device 300, the communication module 301 can also detect whether the second format of the data to be processed in the reasoning request sent by the other client is the same as the target format. When the second format is inconsistent with the target format, the communication module 301 can convert the data to be processed in the second format into the data to be processed in the target format.

[0107] S304: The game reasoning device 300 uses the reasoning service of the first game that has been configured to reason about the data to be processed in the reasoning request, and obtains indication information about the action and / or state of the target object.

[0108] In specific implementation, after receiving the data to be processed provided by the communication module 301, the inference module 302 can call the pre-configured inference service. The inference service relies on the AI ​​model that has been pre-trained through the target training algorithm. Thus, the inference module 302 can first input the data to be processed into the AI ​​model and obtain the AI ​​model outputting the action (such as attack, escape, etc.) and / or state (such as increased defense, emotion) inferred from the target object.

[0109] Optionally, before receiving the instruction information, the inference module 302 can also use a heuristic algorithm to constrain the instruction information output by the AI ​​model. A heuristic algorithm is an algorithm constructed based on intuition or experience, capable of providing a feasible solution to each instance of the combinatorial optimization problem under acceptable time and space complexity. The given feasible solution may or may not be the optimal solution, and the deviation between the feasible solution and the optimal solution is often difficult to predict. In practical applications, heuristic algorithms can predefine constraint rules. For example, in a battle game scenario, the inference module 302 infers the action "move backward" for the non-player character (i.e., the target object), which is to "escape" in a direction away from the player character. However, there is an insurmountable obstacle behind the non-player character's current position on the battle map, while there are no obstacles in other directions; that is, the non-player character cannot "move backward" on this battle map. At this point, the reasoning module 302 can use heuristic algorithms to constrain the reasoning actions output by the AI ​​model, specifically constraining the reasoning action of "moving backward" to "moving left" or "moving right", so as to improve the rationality of the actions reasoned by the reasoning module 302 for non-player characters.

[0110] S305: The game reasoning device 300 returns instruction information on the action and / or state of the target object to the game client 200.

[0111] In practical applications, if the game client 200 and the game reasoning device 300 are deployed in different environments, the communication module 301 encodes the action and / or state indication information of the target object output by the reasoning module 302 into indication information in a first format that the game client 200 can recognize, and sends the first format action indication information to the game client 200, so that the game client 200 can recognize the indication information and set the target object to perform the action corresponding to the indication information or display the state corresponding to the indication information in the next moment. Thus, since the game reasoning device 300 can provide action reasoning services for the game client 200 deployed in various environments, the requirements of the game client 200 on the deployment environment can be reduced, and the universality of the game reasoning device 300 in providing game-specific reasoning services to the game client 200 can be improved.

[0112] The above embodiments describe the process of the game reasoning device 300 training an AI model and using the trained AI model to reason about the actions and / or states of a target object. To facilitate further understanding of the technical solutions of this application embodiment, an application example in a game scenario will be provided below. In this application scenario, the game developer expects the game reasoning device 300 to provide a series of reasoning actions for a non-player character A (hereinafter referred to as Character A) in the game application instance, enabling Character A to defeat a non-player character B (hereinafter referred to as Character B) in the game. Character A can use three different combat styles of reasoning actions to defeat Character B, including "aggressive," "conservative," and "balanced" combat styles. Character A and Character B have the same initial health, attack power, defense power, and the possible actions they can perform. When, within a specified number of steps, Character A attacks Character B and reduces Character B's health to 0 while Character A still has health, then Character A wins. Character A and Character B are set to have the same strength and the same available moves.

[0113] See Figure 6 This document illustrates a flowchart of a method for configuring game inference services on a cloud platform in conjunction with a specific game scenario, according to an embodiment of this application. This method can be applied to... Figure 7 The game reasoning device 300 shown. Among them, in Figure 2 Based on the game reasoning device 300 shown, Figure 7 The game reasoning device 300 shown may also include an object storage service module 304, a deployment module 305, and an online cloud service module 306.

[0114] like Figure 6 As shown, the method may specifically include:

[0115] S601: Object storage service module 304 pre-stores program code that implements communication module 301, game algorithm framework, reasoning module 302 and configuration module 303.

[0116] The program code for the communication module 301, the game algorithm framework, the inference module 302, and the configuration module 303 can be pre-developed by technical personnel and stored in the object storage service module 304. In practical applications, the communication module 301 can be implemented, for example, using the Flask framework.

[0117] S602: Deployment module 305 deploys the program code stored in object storage service module 304 to the cloud platform and publishes it as an online service.

[0118] In this embodiment, the communication module 301 and the inference module 302, which provide game inference services to the game client 200, can form a cloud service deployed on a cloud platform, etc., to support online services for game developers. In practical applications, the game inference device 300 (or the communication module 301, the game algorithm framework, the inference module 302, and the configuration module 303) can be deployed as a game AI framework in a cloud center or edge center.

[0119] S603: When game developer 101 subscribes to the online service, the online service module 306 pulls the program code of the storage node's implementation communication module 301, game algorithm framework, inference module 302, and configuration module 303, and deploys them on computing nodes in the cloud center or edge center so as to utilize the computing resources on the computing nodes to support the training of AI models and the action inference process.

[0120] In practical applications, after the deployment module 305 publishes the program code that implements the game's reasoning service as an online service, the game developer 101 can subscribe to the online service on the cloud platform through the game client 200 to trigger the game reasoning device 300 to configure the game's reasoning service for the game developer 101 on the cloud platform.

[0121] Furthermore, after the program code of the communication module 301, game algorithm framework, inference module 302, and configuration module 303 is successfully deployed on the computing node, the online service module 306 can provide an API interface to the game client 200, so that the game client 200 can establish a communication connection with the game inference device 300 through the API interface. For example, the game client 200 and the communication module 301 can establish a long connection based on protocols such as HTTP 1.1.

[0122] S604: The game client 200 receives the configuration file provided by the game developer 101, which defines the action space, state space, type of training algorithm, type of AI model trained by the training algorithm, reward function used to train the AI ​​model, environmental variables indicating the storage address of the AI ​​model, and specifications of computing resources for character A and character B, and forwards the configuration file to the game inference device 300.

[0123] S605: The configuration module 303 in the game reasoning device 300 calls the corresponding type of training algorithm and AI model from the game algorithm framework according to the configuration file received by the communication module 301.

[0124] The action space for characters A and B can include actions such as walking forward, walking backward, walking left, walking right, attacking 1, attacking 2, attacking 3, attacking 4, attacking 5, running forward, jumping backward, running left, and running right. The status space includes the health, position, orientation, mana, attack power, and defense of characters A and B.

[0125] Different reward functions are used to train AI models that infer different combat styles. As an example, when training an AI model with a "balanced" combat style, the reward function defined by the game developer can be as shown in the following formula (1):

[0126]

[0127] in, The reward value is calculated using the reward function, hp represents health, t and t-1 represent different time points, and α is a preset coefficient value.

[0128] After receiving the configuration file, the configuration module 303 in the game inference device 300 can allocate computing resources that meet the specifications on the computing nodes to the game inference device 300 according to the computing resource specifications in the configuration file, so that the inference service of the game configured by the game inference device 300 can run through the computing resources. Furthermore, the configuration module 303 can call the corresponding type of training algorithm and AI model from the game algorithm framework according to the type of training algorithm and AI model specified in the configuration file, so as to train at least one AI model using the selected training algorithm. For example, the network structure of the AI ​​model in the game algorithm framework may include Dropout layers and L2 regularization terms, thereby improving the generalization performance of the AI ​​model.

[0129] Since the AI ​​model called from the game algorithm framework has not been trained, its reasoning performance is poor. Therefore, the game reasoning device 300 can further execute step S606 to obtain training data for training the AI ​​model.

[0130] S606: Multiple instances of the same game application are launched on the game client 200, and multiple sets of training data are sent to the communication module 301 by running a preset script. Each game application instance includes character A and character B, and each game application instance generates a set of training data for character A and character B.

[0131] The script on the game client 200 can be developed in advance by technicians, and the script can support communication between the game client 200 and the game reasoning device 300 when it is running.

[0132] In this embodiment, multiple game application instances run simultaneously on the game client 200 and generate multiple sets of training data in parallel, which can speed up the acquisition of training data by the game inference device 300, thereby accelerating the model training process of the game inference device 300.

[0133] S607: The communication module 301 decodes the training data sent by the game terminal 200 to obtain the training data in the target format that the inference module 302 can recognize, and provides it to the configuration module 303.

[0134] In practical applications, the game client 200 and the game inference device 300 may be deployed in different environments. Therefore, after receiving the training data sent by the game client 200, the communication module 301 can decode the training data into training data in a target format that the game inference device 300 can recognize.

[0135] In one possible implementation, the communication module 301 may preprocess the training data before sending it to the configuration module 303. For example, the communication module 301 may standardize information such as the game map and location coordinates in each set of training data, and add corresponding features to describe information such as character distance and orientation.

[0136] S608: Configuration module 303 runs multiple processes and uses training data forwarded by communication module 301 to train multiple AI models in parallel.

[0137] As an implementation example, the configuration module 303 can train AI models in a distributed manner. Specifically, the configuration module 303 can include multiple processes, and each process can train an AI model based on one or more sets of training data. For each AI model, the configuration module 303 can input the data of role A from the training data into the AI ​​model, obtain the inference action of role A output by the AI ​​model, and then use the inferred action of role A to play a game with role B. The game result is then used to adjust the parameters in the AI ​​model. In this way, the efficiency of the configuration module 303 in training multiple AI models can be improved. Similarly, the process of training the model for role B is similar to the process of training the model for role A, and can be referred to the relevant descriptions, which will not be repeated here. Figure 8 As shown, in the initial training phase of the AI ​​model, after approximately 200 iterations of training, character A's remaining health at the end of a battle is lower than character B's. However, as the number of training iterations increases, when the number of iterations reaches 100, character A's remaining health at the end of a battle begins to exceed character B's, meaning character A can defeat B. This can also be seen in... Figure 9 In the win rate curves shown, when the training iterations reach 100, the win rate of role A approaches 100%. When the iterative training of the AI ​​model reaches the convergence condition, such as when the AI ​​model can make the win rate of role A reach the preset value (e.g., 98%) in the most recent preset number of iterations (e.g., 20), the configuration module 303 can continue to train the AI ​​model for role B in a similar manner.

[0138] Then, through hyperparameter search and population evolution, the aforementioned three combat styles—"aggressive," "conservative," and "balanced"—can be trained into AI models. The specific implementation processes of hyperparameter search and population evolution can be found in the relevant descriptions of the preceding embodiments, and will not be repeated here.

[0139] The AI ​​model trained can be saved by the configuration module 303 according to the storage address specified in the configuration file.

[0140] S609: The configuration module 303 sends a notification to the game client 200 that the AI ​​model training is complete via the communication module 301.

[0141] In this embodiment, when the game terminal 200 and the game reasoning device 300 communicate with each other, the communication module 301 can perform the format conversion of the communication data so that the two parties can recognize the communication data sent by each other.

[0142] In practical applications, game developers can view the data generated by the game inference device 300 during the training of the AI ​​model through the game client 200. For example, game developer 101 can view the training results on the cloud platform interface through the game client 200. Figure 10 As shown, Game Developer 101 can view the win rate curves of three combat styles AI models obtained through population evolution on the cloud platform interface, during the model training process, for character A; or, Game Developer 101 can view, on the cloud platform interface, as... Figure 8 The curves showing the changes in health between the two sides in a battle, or as shown... Figure 9 The curves showing the changes in the winning percentages of both sides in a head-to-head match are shown.

[0143] S610: The game client 200 sends an action reasoning request to the game reasoning device 300 to request action reasoning for character A. The action reasoning request includes the game screen and combat style identifiers of character A and character B.

[0144] S611: After converting the game screen and combat style identifier into the target format, the communication module 301 sends them to the inference module 302.

[0145] S612: The reasoning module 302 uses the AI ​​model corresponding to the identifier of the combat style to infer the action instruction information of character A based on the game screen of the target format.

[0146] S613: The reasoning module 302 sends the action instruction information of character A to the communication module 301.

[0147] S614: After completing the format conversion of the action instruction information, the communication module 301 sends the action instruction information in a format that the game client 200 can recognize to the game client 200.

[0148] The above combination Figures 1 to 10 The method for configuring game reasoning services on a cloud platform according to the embodiments of this application will be introduced. Next, with reference to the accompanying drawings, the computing device for implementing the functions of the game reasoning device 300 in the above method embodiments will be introduced.

[0149] Figure 11 A computing device cluster is provided. For example... Figure 11 As shown, the computing device cluster 1100 can be specifically used to implement the above. Figure 3 The functions of the game reasoning device 300 shown.

[0150] The computing device cluster 1100 includes at least one computing device, wherein each computing device may include a bus 1101, a processor 1102, and a memory 1103. The processor 1102 and the memory 1103 communicate with each other via the bus 1101.

[0151] Bus 1101 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0152] The processor 1102 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), digital signal processor (DSP), neural network processing unit (NPU).

[0153] The memory 1103 may include volatile memory, such as random access memory (RAM). The memory 1103 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0154] The memory 1103 stores executable program code, and the processor 1102 executes the executable program code to perform the method of configuring the game reasoning service on the cloud platform executed by the aforementioned game reasoning device 300.

[0155] This application embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the method of configuring game reasoning services on a cloud platform, as performed by the game reasoning device 300 described above.

[0156] This application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application are generated.

[0157] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0158] The computer program product can be a software installation package. When any of the aforementioned object identification methods is required, the computer program product can be downloaded and executed on a computing device.

[0159] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

Claims

1. A method for configuring a game's reasoning service on a cloud platform, characterized in that, The method includes: Obtain the first configuration file, which includes configuration information for the first game; Based on the game algorithm framework of the cloud platform and the first configuration file, the inference service of the first game is configured on the cloud platform. The game algorithm framework includes one or more different types of training algorithms and AI models. Obtain the second configuration file, which includes configuration information for the second game; Based on the game algorithm framework of the cloud platform and the second configuration file, the reasoning service of the second game is configured on the cloud platform.

2. The method according to claim 1, characterized in that, The method further includes: The inference service of the first game is used to respond to the inference request sent by the game client, wherein the game client includes a device running a game application instance of the first game, the inference request includes pending data of a target object in the game application instance of the first game, and the response includes indication information of the action and / or state of the target object.

3. The method according to claim 1, characterized in that, The first configuration file includes one or more of the following configuration information: the action space of the target object in the game application instance of the first game, the state space of the target object in the game application instance of the first game, the first type of target training algorithm, the second type of artificial intelligence (AI) model, the reward function, the training method of the AI ​​model, the inference method of the AI ​​model, the storage address of the AI ​​model, and the specifications of the computing resources used for training and inference of the AI ​​model.

4. The method according to claim 1, characterized in that, The game algorithm framework based on the cloud platform and the first configuration file configure the reasoning service of the first game on the cloud platform, including: Based on the first configuration file and the game algorithm framework, at least one AI model is trained; Configure the inference service of the first game based on the at least one AI model that has been trained.

5. The method according to claim 4, characterized in that, The training of at least one AI model includes: Receive multiple training requests from the game client, the multiple training requests coming from multiple game application instances of the first game, and different training requests including different training data for the same target object in the multiple game application instances; The at least one AI model is trained based on the training data from the plurality of training requests.

6. The method according to claim 4, characterized in that, When the at least one AI model includes a first AI model and a second AI model, the hyperparameters of the first AI model and the second AI model are different, and / or the reward functions corresponding to the first AI model and the second AI model are different.

7. The method according to claim 5, characterized in that, When the at least one AI model includes a first AI model and a second AI model, the cloud platform runs a first process and a second process. Training the at least one AI model based on training data from the plurality of training requests includes: Based on the port number and / or IP address of the first process and the port number and / or IP address of the second process, the training data in the plurality of training requests is sent to the first process and the second process; The first AI model is trained using the first process and the training data received by the first process, and the second AI model is trained using the second process and the training data received by the second process.

8. The method according to claim 4, characterized in that, The step of training at least one AI model based on the first configuration file and the game algorithm framework includes: Based on the first type of target training algorithm and the second type of AI model in the first configuration file, the first type of target training algorithm and the at least one AI model of the second type are invoked in the game algorithm framework; The first type of target training algorithm is invoked to train the at least one AI model of the second type.

9. The method according to claim 1, characterized in that, When the data formats of the game client and the cloud platform are different, the method further includes the following before responding to the inference request sent by the game client using the inference service of the first game: The data format in the reasoning request sent by the game client is processed to obtain data in a format that the cloud platform can recognize.

10. The method according to claim 1, characterized in that, The cloud platform maintains a long-term connection with the game client, and the cloud platform receives and responds to inference requests sent by the game client through the long-term connection.

11. The method according to any one of claims 1-10, characterized in that, The process of obtaining the first configuration file includes: The first configuration file is obtained based on the configuration information items selected by the game developer.

12. An apparatus for configuring a reasoning service for a game, characterized in that, The device includes: A communication module is used to obtain a first configuration file, which includes configuration information for the first game; A configuration module is used to configure the inference service of the first game on the cloud platform based on the game algorithm framework and the first configuration file. The game algorithm framework includes one or more different types of training algorithms and AI models. The communication module is also used to obtain a second configuration file, which includes configuration information for the second game; The configuration module is also used to configure the inference service of the second game on the cloud platform based on the game algorithm framework of the cloud platform and the second configuration file.

13. The apparatus according to claim 12, characterized in that, The device further includes: The inference module is used to respond to inference requests sent by the game client using the inference service of the first game. The game client includes a device running a game application instance of the first game. The inference request includes pending data for a target object in the game application instance of the first game. The response includes indication information for the action and / or state of the target object.

14. The apparatus according to claim 12, characterized in that, The first configuration file includes one or more of the following configuration information: the action space of the target object in the game application instance of the first game, the state space of the target object in the game application instance of the first game, the first type of target training algorithm, the second type of artificial intelligence (AI) model, the reward function, the training method of the AI ​​model, the inference method of the AI ​​model, the storage address of the AI ​​model, and the specifications of the computing resources used for training and inference of the AI ​​model.

15. The apparatus according to claim 12, characterized in that, The configuration module is specifically used for: Based on the first configuration file and the game algorithm framework, at least one AI model is trained; Configure the inference service of the first game based on the at least one AI model that has been trained.

16. The apparatus according to claim 15, characterized in that, The configuration module is specifically used for: Receive multiple training requests from the game client, the multiple training requests coming from multiple game application instances of the first game, and different training requests including different training data for the same target object in the multiple game application instances; The at least one AI model is trained based on the training data from the plurality of training requests.

17. The apparatus according to claim 15, characterized in that, When the at least one AI model includes a first AI model and a second AI model, the hyperparameters of the first AI model and the second AI model are different, and / or the reward functions corresponding to the first AI model and the second AI model are different.

18. The apparatus according to claim 16, characterized in that, When the at least one AI model includes a first AI model and a second AI model, the cloud platform runs a first process and a second process, and the configuration module is specifically used for: Based on the port number and / or IP address of the first process and the port number and / or IP address of the second process, the training data in multiple training requests is sent to the first process and the second process; The first AI model is trained using the first process and the training data received by the first process, and the second AI model is trained using the second process and the training data received by the second process.

19. The apparatus according to claim 15, characterized in that, The configuration module is specifically used for: Based on the first type of target training algorithm and the second type of AI model in the first configuration file, the first type of target training algorithm and the at least one AI model of the second type are invoked in the game algorithm framework; The first type of target training algorithm is invoked to train the at least one AI model of the second type.

20. The apparatus according to claim 12, characterized in that, When the data formats of the game client and the cloud platform are different, before responding to the reasoning request sent by the game client using the reasoning service of the first game, the communication module is further configured to: The data format in the reasoning request sent by the game client is processed to obtain data in a format that the cloud platform can recognize.

21. The apparatus according to claim 12, characterized in that, The cloud platform maintains a long-term connection with the game client, and the cloud platform receives and responds to inference requests sent by the game client through the long-term connection.

22. The apparatus according to any one of claims 12-21, characterized in that, The communication module is specifically used to obtain the first configuration file based on the configuration information items selected by the game developer.

23. A computing device cluster, characterized in that, The computing device cluster includes at least one computing device, and each computing device includes a processor and a memory. The processor is configured to execute instructions stored in the memory to cause the at least one computing device to perform the method as described in any one of claims 1 to 11.

24. A computer-readable storage medium, characterized in that, Includes instructions that, when the computing device is running, cause the computing device to perform the method as described in any one of claims 1 to 11.

25. A computer program product comprising instructions that, when run on a computing device, cause the computing device to perform the method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Learning service provision device

    CN108701265A

  • Adding deep learning based ai control

    US20190197402A1