A method, device and equipment for training an intelligent agent and a computer storage medium

By pre-setting character behavior styles and reward information, and using reinforcement learning to train agents, the problem of single agent behavior styles and high training costs is solved, the training of diversified agents is realized, and the game experience and efficiency are improved.

CN118036694BActive Publication Date: 2024-09-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410275839.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2024-09-10
Estimated Expiration
2044-03-12

AI Technical Summary

Technical Problem

When training agents, existing reinforcement learning methods lead to a single behavioral style of the agent, resulting in a boring game experience for players. Moreover, the cost of acquiring agents with multiple behavioral styles is high, making it difficult to train multiple target agents quickly and conveniently.

Method used

By pre-setting a variety of character behavior styles, behavior style information and reward information, we provide a data basis for agent training, and use reinforcement learning to train target agents with different behavior styles through interaction and feedback with the environment. , reduce training costs.

Benefits of technology

It achieves the training of a variety of agents with different behavioral styles at low cost, improves the richness of game players' experience, and reduces the cost and computing resources of training multiple target agents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118036694B
    Figure CN118036694B
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and computer storage medium for training an intelligent agent, which are applied to the field of computer technology. The method comprises: obtaining at least one preset role behavior style, wherein the role behavior style is used to indicate the strategic tendency of the intelligent agent when making an execution action decision; configuring corresponding behavior style information for the intelligent agent to be trained based on at least one role behavior style, wherein the behavior style information comprises: the execution tendency probability of the intelligent agent to be trained for each preset action under different environmental conditions; based on the behavior style information, obtaining target reward information corresponding to the behavior style information from at least one preset reward information, wherein the target reward information represents: the reward weight corresponding to the intelligent agent to be trained with the behavior style information when executing each preset action under different environmental conditions; based on the target reward information, performing multiple rounds of iterative training on the intelligent agent to be trained to obtain the corresponding target intelligent agent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to the field of artificial intelligence (AI), and provides a method, apparatus, device, and computer storage medium for training an intelligent agent. Background Art

[0002] In video game matches, some game AI (hereinafter referred to as intelligent agents) are sometimes configured in the game that can imitate human gaming behavior. These intelligent agents can participate in the game process as virtual players and interact with real game players.

[0003] In order to enable the agent to successfully complete the game, reinforcement learning is generally used to enable the agent to have the ability to complete the game, that is, through the reward signal fed back by the environment to the agent's behavior, the agent is trained to be able to successfully complete the game. For example, when the agent performs a desired behavior, the environment can give it a positive reward, and conversely, when the agent performs an unwanted behavior, it can give it a negative reward.

[0004] However, under the current reinforcement learning framework, the trained agents tend to adopt a single behavior style to face all games and players. This will make the player's gaming experience boring and monotonous, thus reducing the player's fun.

[0005] Therefore, in order to enrich the game experience of gamers, the intelligent agent needs to show a variety of game styles and decision-making abilities as much as possible. To this end, when training intelligent agents, the alliance training (AlphaStar League) method can be adopted. By introducing "sparring" intelligent agents with different game styles as "alliances", the intelligent agents to be trained are iteratively trained, and then a variety of intelligent agents with different game styles are obtained.

[0006] However, this training method requires the use of a large number of old models as "sparring" agents to iteratively train the training agents, which means that this training process consumes a lot of model costs. At the same time, the behavior style of the target agent trained with the "sparring" agent is determined by the "sparring" agent. In other words, a "sparring" agent of one style can only train a target agent with a corresponding behavior style. If you want to obtain target agents with different behavior styles, you need more "sparring" agents of different styles, which further increases the model cost of obtaining the target agent.

[0007] Therefore, how to obtain a variety of intelligent agents with different behavioral styles at a lower training cost is an urgent problem to be solved. Summary of the invention

[0008] The embodiments of the present application provide a method, apparatus, device and computer storage medium for training an intelligent agent, which are used to reduce the training cost during the training process of diverse intelligent agents.

[0009] In one aspect, a method for training an agent is provided, the method comprising:

[0010] Acquire at least one preset role behavior style, wherein the role behavior style is used to indicate the strategic tendency of the agent when making an execution action decision;

[0011] Based on the at least one character behavior style, corresponding behavior style information is configured for the intelligent agent to be trained, wherein the behavior style information includes: the execution tendency probability of the intelligent agent to be trained for each preset action under different environmental conditions;

[0012] Based on the behavior style information, obtaining target reward information corresponding to the behavior style information from at least one preset reward information, wherein the target reward information represents: the reward weight corresponding to when the to-be-trained intelligent agent with the behavior style information performs each preset action under different environmental conditions;

[0013] Based on the target reward information, multiple rounds of iterative training are performed on the agent to be trained to obtain a corresponding target agent.

[0014] In one aspect, a device for training an agent is provided, the device comprising:

[0015] A style determination module is used to obtain at least one preset character behavior style, wherein the character behavior style is used to indicate the strategic tendency of the agent when making an execution action decision; based on the at least one character behavior style, corresponding behavior style information is configured for the to-be-trained agent, wherein the behavior style information includes: the execution tendency probability of the to-be-trained agent for each preset action under different environmental conditions;

[0016] A reward configuration module, configured to obtain target reward information corresponding to the behavior style information from at least one preset reward information based on the behavior style information, wherein the target reward information represents: a reward weight corresponding to when the to-be-trained intelligent agent having the behavior style information performs each preset action under different environmental conditions;

[0017] The iterative training module is used to perform multiple rounds of iterative training on the intelligent agent to be trained based on the target reward information to obtain the corresponding target intelligent agent.

[0018] Optionally, the iterative training module is used to perform multiple rounds of iterative training on the to-be-trained intelligent agent based on the target reward information, and when obtaining the corresponding target intelligent agent, is specifically used to:

[0019] Based on the reward weights in the target reward information, the agent to be trained is trained for multiple rounds to obtain a corresponding target agent; wherein the following operations are performed during one round of iterative training:

[0020] Acquire first model data when the intelligent agent to be trained performs at least one preset action in a preset frame; wherein the first model data includes: role state information corresponding to the intelligent agent to be trained and interaction information between the intelligent agent to be trained and the environment;

[0021] Based on the first model data, obtaining a state reward value corresponding to at least one preset action performed by the to-be-trained agent in the preset frame;

[0022] Based on the reward weight in the target reward information corresponding to the intelligent agent to be trained, each state reward value obtained is weighted, and the weighted state reward value is fed back to the intelligent agent to be trained for parameter adjustment.

[0023] Optionally, the iterative training module is used to feed back the weighted state reward value to the to-be-trained agent for parameter adjustment, specifically for:

[0024] Feeding back the weighted state reward value to the to-be-trained agent;

[0025] When the intelligent agent to be trained triggers a preset task, second model data of the intelligent agent to be trained within a preset task time range is obtained, wherein the second model data represents: overall evaluation information corresponding to the intelligent agent to be trained after performing the preset action within the task time range;

[0026] Based on the overall evaluation information and the role behavior style corresponding to the intelligent agent to be trained, a corresponding evaluation reward value is obtained, and the evaluation reward value is fed back to the intelligent agent to be trained;

[0027] Based on the weighted state reward value and the evaluation reward value fed back to the agent to be trained, parameters of the agent to be trained are adjusted.

[0028] Optionally, the target reward information also represents: the corresponding reward weight when the intelligent agent to be trained with the behavioral style information holds preset props under different environmental conditions.

[0029] Optionally, the character behavior style is also used to indicate the ability level of the agent when performing each preset action.

[0030] Optionally, the behavior style information further includes: one or more of the execution hit probability, execution delay time and execution time interval of each preset action of the intelligent agent to be trained under different environmental conditions.

[0031] Optionally, when the style determination module is used to configure corresponding behavior style information for the to-be-trained agent based on the at least one character behavior style, it is specifically used to:

[0032] Acquire a preset behavior type set, wherein the behavior type set includes: a plurality of execution tendency probabilities corresponding to the to-be-trained intelligent agents with different role behavior styles when executing the preset actions;

[0033] For each character behavior style, based on the preset extraction rules, the execution tendency probability corresponding to each preset action corresponding to the character behavior style of the intelligent agent to be trained is obtained from the behavior type set, and the corresponding behavior style information is configured for the intelligent agent to be trained.

[0034] Optionally, the style determination module is used to obtain, from the behavior type set, the execution tendency probabilities corresponding to the preset actions corresponding to the role behavior style of the to-be-trained intelligent agent based on a preset extraction rule, specifically to:

[0035] Based on the role behavior style corresponding to the to-be-trained intelligent agent, randomly obtaining an execution tendency probability corresponding to at least one preset action from a plurality of execution tendency probabilities corresponding to the role behavior style in the behavior type set;

[0036] The reward configuration module is used to obtain target reward information corresponding to the behavior style information from at least one preset reward information based on the behavior style information, specifically for:

[0037] Based on at least one preset action included in the behavior style information, reward information including a reward weight of each preset action in the at least one preset action is obtained from at least one preset reward information as the target reward information.

[0038] On the one hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.

[0039] In one aspect, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0040] On the one hand, a computer program product is proposed, comprising a computer program, wherein when the computer program is executed by a processor, any of the above methods is implemented.

[0041] The beneficial effects of this application are as follows:

[0042] In this scheme, by presetting different role behavior styles, behavior style information and reward information, a data basis is provided for the training process of the intelligent agent. The role behavior style is used to calibrate the behavior style of the corresponding target intelligent agent after training for the intelligent agent to be trained. The behavior style information is used to determine the execution tendency probability of the intelligent agent to be trained when performing different preset actions. The reward information is used to determine the amount of reward fed back to the intelligent agent to be trained. In this way, the training method of reinforcement learning is used to enable the intelligent agent to be trained to obtain a target intelligent agent with a certain behavior style through continuous interaction and feedback between itself and the environment, and by trial and error. In this method, target intelligent agents with different behavior styles can be trained only through the interaction between the intelligent agent to be trained and the environment, and the reward feedback given to the intelligent agent to be trained after the interaction, which reduces the training model cost required to train intelligent agents with different behavior styles.

[0043] In addition, this solution pre-configures multiple role behavior styles, multiple behavior style information, and multiple reward information. The server can directly train target intelligent agents with different behavior styles based on these multiple configuration information. In this way, the server can quickly and conveniently train each intelligent agent to be trained, and then directly obtain multiple target intelligent agents with different behavior styles, which also reduces the training cost and computing resources for training multiple target intelligent agents. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0045] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0046] Figure 2A A flowchart of a method for training an intelligent agent provided in an embodiment of the present application;

[0047] Figure 2B A schematic diagram of execution action tendencies corresponding to different behavior styles provided in an embodiment of the present application;

[0048] Figure 3A and Figure 3BA schematic diagram of the correspondence between the character behavior style and the behavior style information provided in the embodiment of the present application;

[0049] Figure 4 A flowchart of a method for obtaining behavior style information provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of the corresponding relationship between the character behavior style, preset actions and execution tendency probability provided in an embodiment of the present application;

[0051] Figure 6 A logical schematic diagram of obtaining execution tendency probability provided in an embodiment of the present application;

[0052] Figure 7 Another logical schematic diagram for obtaining execution tendency probability provided by an embodiment of the present application;

[0053] Fig. 8A A flowchart of a method for one-round iterative training provided in an embodiment of the present application;

[0054] Figure 8B A schematic diagram of a real-time feedback reward value provided in an embodiment of the present application;

[0055] Fig. 9A A flowchart of another one-round training method provided in an embodiment of the present application;

[0056] Fig. 9B A schematic diagram of a phased feedback reward value provided in an embodiment of the present application;

[0057] Fig.10 A schematic diagram of a system architecture provided for an embodiment of the present application;

[0058] Fig.11 A schematic diagram of a structure of a device for training an intelligent agent is provided for an embodiment of the present application;

[0059] Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;

[0060] Fig.13 A schematic diagram of the composition structure of another computer device to which an embodiment of the present application is applied. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0062] It is understandable that in the following specific implementation methods of this application, data related to game players is involved. When the various embodiments of this application are applied to specific products or technologies, relevant permissions or consents need to be obtained, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0063] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0064] Reinforcement learning: also known as reinforcement learning, evaluation learning or enhanced learning, is one of the paradigms and methodologies of machine learning, used to describe and solve the problem of how an agent can maximize its rewards or achieve specific goals through learning strategies during its interaction with the environment. Unlike supervised learning and unsupervised learning, reinforcement learning does not require any data to be given in advance, but instead obtains learning information and updates model parameters by receiving rewards (feedback) from the environment for actions.

[0065] Specifically, reinforcement learning is a learning method in which an intelligent agent learns in a "trial and error" manner, and the rewards obtained through interaction with the environment guide behavior. The goal is to enable the intelligent agent to obtain the maximum reward. Reinforcement learning is different from supervised learning in connectionist learning, mainly in the reinforcement signal. The reinforcement signal provided by the environment in reinforcement learning is an evaluation of the quality of the action. Since the external environment provides little information, the reinforcement learning system must rely on its own experience to learn. In this way, the reinforcement learning system acquires knowledge in an action-evaluation environment and improves the action plan to adapt to the environment. Its basic principles are:

[0066] If a behavior strategy of the agent leads to a positive reward (reinforcement signal) from the environment, then the tendency of the agent to produce this behavior strategy in the future will be strengthened. The goal of the agent is to find the optimal strategy in each discrete state to maximize the expected discounted reward. The goal of reinforcement learning is to dynamically adjust the parameters to maximize the reinforcement signal.

[0067] Virtual character: refers to a character in a virtual game scene that can be controlled to complete the relevant process of the virtual game scene. Taking the virtual game scene as the game scene corresponding to the game as an example, the virtual character refers to an object that can uniquely identify a game object. Multiple virtual characters can be created under one game account. Of course, in addition to the virtual characters created in the official player account, the embodiments of this application also involve virtual characters that assist in completing the game game. In some game clients, it is necessary to create a virtual character to play a game in the virtual game scene, and the virtual character can refer to an active object in the virtual game scene.

[0068] Intelligent agent: also known as AI character, AI is a technology developed to simulate and expand human intelligence and methods, and to implement AI characters simulating real players in games. In other words, except that the AI ​​characters are not controlled by real players, their behavior in virtual game scenarios is achieved by simulating virtual characters of real players.

[0069] Behavioral style: refers to the strategic style presented during a virtual game, which expresses the tendency of the options for the required decision when a decision is required. In the game, it presents a style of playing the game. For example, when there are multiple branching choices in the game, the performance of a game character's game style is which branch the game character tends to take, or when the game needs to go from the birth point to the target point to perform a task, the performance of the game character's game style is the game character's starting path choice. Of course, in addition to these performances, it can also include other tendency decisions in the game, such as whether to tend to defeat the enemy character or complete the task in the game in a game, etc.

[0070] The embodiments of the present application relate to artificial intelligence and machine learning (ML) technology, and are mainly designed based on machine learning in artificial intelligence.

[0071] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0072] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, pre-trained models are also called large models and basic models. After fine-tuning, they can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0073] Machine Learning (ML) is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by teaching. The pre-trained model is the latest development of deep learning, which integrates the above technologies.

[0074] Artificial Neural Network (ANN) abstracts the human brain neural network from the perspective of information processing, establishes a simple model, and forms different networks according to different connection methods. A neural network is a computing model composed of a large number of nodes (or neurons) connected to each other. Each node represents a specific output function, called an activation function. The connection between each two nodes represents a weighted value for the signal passing through the connection, called a weight, which is equivalent to the memory of the artificial neural network. The output of the network varies depending on the network connection method, weight value and activation function. The network itself is usually an approximation of a certain algorithm or function in nature, or it may be an expression of a logical strategy.

[0075] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless cars, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence generated content (AIGC), conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0076] The solution provided in the embodiment of the present application involves using machine learning to perform corresponding iterative training on the intelligent agent to be trained, and then using the trained target intelligent agent in the actual game scene to simulate players with different styles, manipulate virtual characters, and interact with real game players. Among them, the intelligent agent to be trained is an artificial neural network model based on reinforcement learning, that is, the embodiment of the present application uses a machine learning method to obtain a target intelligent agent that can operate a virtual character with different behavioral styles, and the target intelligent agent realizes the ability to control the movement and game actions of the virtual character in the virtual game scene based on machine learning.

[0077] The following is a brief description of the technical ideas of the technical solutions of the embodiments of the present application.

[0078] In related technologies, because the intelligent agents trained by reinforcement learning want to obtain the highest rewards, their behavior styles eventually tend to be fixed and single after multiple rounds of training. Facing players with different styles, it is difficult to adopt targeted strategies, which greatly limits the richness of the player experience. At the same time, the upper limit of the level of game intelligent agents is not high, and they are easily targeted by players using extreme strategies, which cannot meet the needs of actual games.

[0079] Therefore, in order to train agents with various behavioral styles and be able to face players with different styles, the relevant technology will also adopt the alliance training method, using multiple "sparring" agents to train the training agent. However, in this method, first of all, multiple "sparring" agents that have been trained are required. Through the feedback of the interactive operation between the training agent and the "sparring" agent, the training agent is trained accordingly, so as to obtain the target agent corresponding to the style of the "sparring" agent (usually, the target agent that can restrain the behavioral style of the "sparring" agent will be obtained). This leads to the need to use multiple batches of "sparring" agents with different styles for interactive training when training agents with different behavioral styles, which makes the training cost required to train agents with multiple behavioral styles high, and the training process is also relatively complicated, making it difficult to quickly and conveniently obtain more target agents with different behavioral styles.

[0080] In view of this, an embodiment of the present application provides a method for training an intelligent agent, in which a plurality of different role behavior styles are pre-set, the desired strategic tendency of the target intelligent agent when specifying the role to perform an action is set, and corresponding behavior style information is set according to the corresponding tendency, so as to regulate the execution tendency probability of the target intelligent agent for each preset action under different environmental conditions during the training process. In this way, the different role behavior styles that the target intelligent agent can correspond to are first determined, and a plurality of training goals are set for the subsequent training process.

[0081] At the same time, at least one reward information is set to indicate the reward weight corresponding to the intelligent agent to be trained when performing each preset action under different environmental conditions, and different types of reward information set correspond to different behavior style information. In this way, when the intelligent agent to be trained is subsequently iteratively trained, the corresponding target reward information can be obtained from the at least one reward information set according to the expected role behavior style and behavior style information of the intelligent agent to be trained, so as to carry out targeted training for the intelligent agent to be trained.

[0082] After completing the configuration of the above basic information, in the process of iterative training of the intelligent agent to be trained in order to obtain the target intelligent agent, at least one role behavior style can be obtained from the role behavior styles set above, and based on the obtained role behavior style, the behavior style information is configured for the corresponding intelligent agent to be trained, and then based on the behavior style information of each intelligent agent to be trained, the target reward information corresponding to the behavior style information is set. In this way, finally, based on the target reward information corresponding to each intelligent agent to be trained, multiple rounds of iterative training can be performed on the intelligent agent to be trained, and then the corresponding target intelligent agent can be obtained.

[0083] In this way, when training the intelligent agents to be trained, different rewards can be directly fed back to the preset actions performed by different intelligent agents to be trained according to different reward weights, so that the intelligent agents to be trained with different role behavior styles can obtain the maximum reward value through different behavior strategies, and then obtain their own behavior style.

[0084] The following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0085] The solution provided in the embodiment of the present application can be applied to most virtual scene applications, such as game application scenarios in which multiple virtual characters including intelligent agents participate in a game. Figure 1As shown, it is a schematic diagram of an application scenario provided by an embodiment of the present application. In this scenario, multiple terminal devices 101 and a server 102 may be included. Each terminal device 101 may be installed with a client corresponding to the server 102, such as a game application that supports a three-dimensional virtual scene. The game application may be any one of a virtual reality (VR) game program, a third-person shooting game (TPS), a first-person shooting game (FPS), a multiplayer online tactical competitive game (MOBA), a massively multiplayer online role-playing game (MMORPG), a multiplayer gunfight survival game, and a multiplayer party game. Optionally, the application may be a stand-alone application, such as a stand-alone 3D game program, or a network-connected application. The client involved in the embodiment of the present application may be a software client, or a client such as a web page or a small program, and the server 102 is a server corresponding to the software or a web page, a small program, etc., without limiting the specific type of the client.

[0086] The terminal device 101 may be any device that has the function of running a virtual scene application (such as a game application), such as a mobile phone, a laptop, a tablet computer (PAD), a notebook computer, a desktop computer, a smart TV, a smart car device, a smart wearable device, an e-book reader, etc. The server 102 is used to provide background services for the client, such as an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, i.e., content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited thereto.

[0087] It should be noted that the method for controlling the intelligent agent to play a game in the embodiment of the present application can be executed by the terminal device 101 or the server 102 alone, or can be executed by the server 102 and the terminal device 101 together. In other words, in the process of running the game client on each terminal device 101, the server 102 undertakes the main computing work, and each terminal device 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and each terminal device 101 undertakes the main computing work; or, the server 102 and each terminal device 101 adopt a distributed computing architecture for collaborative computing.

[0088] Both the server 102 and the terminal device 101 may include one or more processors, memories, and I / O interfaces for interaction, etc. In addition, the server 102 may also be configured with a database, which may be used to store data involved in the virtual game scene, such as agent data, game data, etc. Among them, the memories of the server 102 and the terminal device 101 may also store program instructions required to be executed in the training agent method provided in the embodiment of the present application, and these program instructions, when executed by the processor, can be used to implement the process of training the agent provided in the embodiment of the present application.

[0089] When the virtual scene is a game scene, in the actual application process, different game players can run the game client through their respective terminal devices 101, wherein the applications running on different terminal devices 101 can be the same, or the same type of applications on different operating system platforms. When the terminal device 101 runs the game client, a game interface including a virtual character is presented. In addition, the intelligent agent in the embodiment of the present application does not have a real player, so it does not have a corresponding game interface, but from the perspective of the intelligent agent, it can also include a corresponding imaginary game screen.

[0090] In a possible implementation, the terminal device 101 is locally installed with a game client and is used to present the game screen. The terminal device 101 is used to interact with the player through a graphical user interface, that is, the game client is downloaded and installed and run through the terminal device 101. Of course, the successful operation of the game client also requires the server 102 to provide background services. The terminal device 101 can provide the graphical user interface to the player in a variety of ways, for example, it can be rendered and displayed on the terminal display screen, or provided to the player through holographic projection.

[0091] In a possible implementation, the game application in the embodiment of the present application can also be implemented based on a cloud interaction system, and various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operation subject of the game client and the game screen presentation subject are separated, and the storage and operation of the AI ​​character control method in the virtual scene are completed on the cloud server. The function of the terminal device 101 is to receive and send data and present the game screen. For example, the terminal device 101 can be a display device with a data transmission function close to the user side, but the AI ​​character control method in the virtual scene is performed by the cloud server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud server. The cloud server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0092] In the embodiment of the present application, each terminal device 101 and the server 102 may be directly or indirectly connected to each other through one or more networks 103. The network 103 may be a wired network or a wireless network, for example, a mobile cellular network, or a wireless fidelity (Wireless-Fidelity, WIFI) network, or other possible networks, which are not limited in the embodiment of the present application.

[0093] It should be noted that Figure 1 The figure is only an example. In fact, the number of terminal devices and servers is not limited and is not specifically limited in the embodiments of the present application.

[0094] The following describes the method of training an intelligent agent provided by an exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard.

[0095] See also Figure 2A , which is a flow chart of a method for training an intelligent agent provided in an embodiment of the present application. The subject executing the training method may be as follows Figure 1 The server 102 shown in FIG. 1 may be an independent physical server or a distributed system or a cloud server, or may be a physical server or a distributed system or a cloud server. Figure 1 The computer in the terminal device 101 shown is not limited in this application. For the convenience of subsequent description, the embodiment of this application will take the server as the execution subject of the method for training an intelligent agent as an example to specifically introduce the subsequent implementation details.

[0096] like Figure 2AAs shown, the specific steps of the method for training an agent are as follows:

[0097] Step S201: Acquire at least one pre-set role behavior style, wherein the role behavior style is used to indicate the strategic tendency of the agent when making an execution action decision.

[0098] Before performing multiple rounds of iterative training on the training agent, some parameters of the training agent need to be determined first, among which the first thing to be determined is the behavior style that the training agent is expected to achieve.

[0099] Therefore, in step S201, it is necessary to obtain at least one pre-set role behavior style, which can indicate the strategy tendency of the to-be-trained intelligent agent when making a decision on a specified execution action.

[0100] In order to clarify the meaning of strategic tendency in character behavior style, the following two examples will be used to illustrate this content.

[0101] Take multiplayer party games as an example. In the virtual game provided by the game, multiple players will work together to pass levels and constantly eliminate other players until the last player wins. The process of passing levels may include: players need to constantly pass through obstacles or avoid interfering objects on the way forward, use occasional boost props, and race with other players until they reach the target end; or, players need to compete against players in the same game in an elimination match. Players are divided into two teams and achieve the final victory by improving their own team's score and reducing the opponent's score. In these processes, players with different behavioral styles will choose different actions to perform in the face of the same game environment. For example, Figure 2B As shown, players with an offensive style will choose Route 1, actively pick up props, and use props to create obstacles for players on the same field so that other players slow down or are eliminated. Players with a conservative style will choose Route 2 to increase their own speed or score so that they can meet the requirements for passing the level.

[0102] It should be noted that the above two styles are only rough classifications. Under different style types, there can be more behavioral style types, for example, a more conservative type, a more radical type, or a very radical type, etc. This application does not limit the specific character behavioral style types and their corresponding numbers.

[0103] Take a multiplayer online tactical competitive game as an example. In the virtual scene provided by the game, there are two opposing teams. The goal of both sides is to destroy the enemy's guarded target. Therefore, in the process of completing their own goals, they will perform tactical operations against the players in the enemy team. Players with different behavioral styles will also adopt different behavioral logics. For example, players who tend to be confrontational will actively confront the enemy players, while conservative players will avoid confrontation with the enemy players and tend to interact with the environment content in the virtual game.

[0104] From the above content, we can see that in the game, players have various behavioral styles, and players with different behavioral styles perform differently in the game. Therefore, if the agents put into the virtual game provided by the game are only agents with one behavioral logic, then players will not only easily discover the existence of the agents, but also find restraint operations against such agents, and then complete multiple game wins. This not only fails to provide players with a diverse gaming experience, but also easily makes players bored.

[0105] Therefore, the present application proposes to pre-set a variety of role behavior styles, which characterize the behavior style types of target intelligent agents that users expect to obtain by simulating a variety of behavior styles, such as conservative, radical, moderate, etc.

[0106] Based on the above-set character style information, when training the intelligent agent to be trained, the server can obtain at least one character behavior style from these pre-set character behavior styles as the training target of the corresponding intelligent agent to be trained.

[0107] After completing the acquisition of the character's behavior style, the server can continue with the following operations:

[0108] Step S202: Based on at least one character behavior style, corresponding behavior style information is configured for the intelligent agent to be trained, and the behavior style information includes: the execution tendency probability of the intelligent agent to be trained for each preset behavior action under different environmental conditions.

[0109] In the above step S201, the server obtains at least one role behavior style for the intelligent agent to be trained. In order to enable the server to be trained to become the desired target intelligent agent, the server also needs to configure corresponding behavior style information for the intelligent agent to be trained based on the obtained role behavior style. The behavior style information includes the execution tendency probability of the intelligent agent to be trained for each preset behavior action under different environmental conditions.

[0110] For example, in the racing mode of a multiplayer party game, the target agent to be trained may face the choice of whether to sprint forward directly or turn to obtain props that increase the debuff status of other players. At this time, the target agent with different character behavior styles will have different choices. For example, the target agent with a conservative character behavior style will choose to continue sprinting forward, while the target agent with a highly confrontational character behavior style will choose to obtain debuff props in order to provide obstacles for other players.

[0111] It should be noted that the execution tendency probability included in the behavior style information is for various probabilities of preset actions, and the number of preset actions and specific actions can be determined by the user in actual applications. For example, some key actions can be selected from the actions that the agent may make as the above preset actions, such as picking up props, interfering with other players, using props, etc., or the actions that may appear under different environmental conditions can be selected as the above preset actions based on the environmental conditions that the agent may face, for example, in an environment where there are only two players left, actions under special environmental conditions such as sprinting forward, interfering with other players, using props, etc., or in an environment where there are multiple props to choose from, actions of selecting different props, etc.

[0112] After clarifying the execution tendency probability included in the behavioral style information, the following will introduce how to configure the corresponding behavioral style information for the agent.

[0113] In a possible implementation, Figure 3A As shown, corresponding one-to-one corresponding behavior style information can be set in advance for different character behavior styles, and the corresponding behavior style information includes the execution tendency probability corresponding to the preset action under different environmental conditions. In this way, whenever the server obtains the corresponding character behavior style for the intelligent agent to be trained, the corresponding behavior style information can be configured for the intelligent agent to be trained according to the behavior style information corresponding to the preset character behavior style.

[0114] In a possible implementation, Figure 3B As shown, the execution tendency probabilities corresponding to different behavioral actions can be pre-set. After the character behavior style is obtained for the intelligent agent to be trained, part of the probability information can be extracted from the pre-set execution tendency probability as the behavior style information and configured into the intelligent agent to be trained.

[0115] For details, see Figure 4 , which is a flow chart of a method for obtaining behavior style information provided in an embodiment of the present application, such as Figure 4 As shown, the specific implementation steps of this method are as follows:

[0116] Step S401: Obtain a preset behavior type set, where the behavior type set includes: a plurality of corresponding execution tendency probabilities when the to-be-trained intelligent agent with different role behavior styles performs each preset action.

[0117] First, a behavior type set may be pre-set in the server, and the behavior type set is used to include a plurality of execution tendency probabilities corresponding to various preset actions corresponding to different character behavior styles.

[0118] like Figure 5 As shown, the correspondence between the character behavior style, the preset action and the execution tendency probability can be in a many-to-many form, that is, there are multiple preset actions corresponding to different character behavior styles, and there are also multiple execution tendency probabilities corresponding to the preset actions. In order to increase the diversity of the behavior style of the intelligent agent, the implementation of this application proposes that even under the same character behavior style, the execution tendency probability for a preset action can be multiple. Among them, the multiple execution tendency probabilities are within a certain probability range. For example, when an aggressive character behavior style performs a preset action that interferes with other players, the corresponding execution tendency probability can be any probability within the range of 70%-90%.

[0119] It should be noted that the setting of the behavior type set can be either manually set by the developer based on his or her own actual experience, or learned from existing player data using a machine learning method, and this application does not impose any restrictions on this.

[0120] After the behavior type set is set, the server can obtain the preset behavior type set during the execution of the above method, and then continue to perform the following operations:

[0121] Step S402: For each character behavior style, based on the preset extraction rules, obtain the execution tendency probability of each preset action corresponding to the character behavior style of the intelligent agent to be trained from the behavior type set, and configure the corresponding behavior style information for the intelligent agent to be trained.

[0122] From the above content, we can know that the behavior type set obtained by the server contains multiple execution tendency probabilities. Therefore, to configure the corresponding behavior style information for the intelligent agent to be trained, it is necessary to obtain the execution tendency probability of each preset action that matches the character behavior style corresponding to the intelligent agent to be trained from the behavior type set. Then, the obtained information can be used as the behavior style information corresponding to the intelligent agent to be trained.

[0123] To obtain the expected execution tendency probability from multiple execution tendency probabilities, it is also necessary to follow certain extraction rules. The extraction rules can also be configured by personnel or obtained through machine learning, just like the setting of the behavior type set, and this application does not limit it.

[0124] In a possible implementation, the extraction rule for obtaining the execution tendency probability from the behavior type set may be: directly obtaining the execution tendency probability that satisfies the preset numerical condition among the execution tendency probabilities corresponding to each preset action under a certain role behavior style from the behavior type set, for example Figure 6 As shown, the maximum execution tendency probability or the minimum execution tendency probability corresponding to each preset action is obtained.

[0125] In this way, the server can quickly obtain appropriate behavior style information from the behavior type set to configure the intelligent agent to be trained.

[0126] In a possible implementation, the extraction rule for obtaining the execution tendency probability from the behavior type set may be: based on the character behavior style corresponding to the to-be-trained agent, the execution tendency probability is randomly obtained from the multiple execution tendency probabilities corresponding to the preset actions under the character behavior style in the behavior type set. Figure 7 As shown, since in the behavior type set, even under the same character behavior style, the execution tendency probability corresponding to the same preset action also corresponds to multiple execution tendency probabilities (such as 70%-90% in the above example), therefore, in this embodiment, the server can randomly obtain the execution tendency probability of each preset action from the behavior type set. In this way, under different training processes, even if a certain same character behavior style is specified, the server can still obtain a target intelligent agent with different behavioral characteristics, thereby greatly increasing the diversity of behavioral styles that the intelligent agent can simulate, thereby improving the richness of the player experience.

[0127] In this way, after completing the acquisition and configuration of the behavior style information, the server can continue to configure the corresponding target reward information for the intelligent agent to be trained.

[0128] Step S203: Based on the behavior style information corresponding to the intelligent agent to be trained, obtain target reward information corresponding to the behavior style information from at least one preset reward information, and the target reward information represents: the reward weight corresponding to the intelligent agent to be trained with the behavior style information when performing each preset action under different environmental conditions.

[0129] It should be noted that in the reinforcement learning process of artificial intelligence, the feedback received by the trained agent for each action is generally called a reward. The reward is divided into positive rewards and negative rewards. When the agent performs the expected action, it can get a positive reward (such as +1, +2, etc.), and when the agent performs an unexpected action, it will get a negative reward (such as -1, -2, etc.). Since the training goal of the agent is to obtain the maximum reward value, the agent will continuously correct its actions in multiple rounds of iterations in order to obtain a higher reward value. Therefore, by setting different feedback rewards for different actions, the agent can be trained to achieve the target action.

[0130] In the embodiment of the present application, a training goal is to obtain agents with different behavior styles, and different behavior styles mean that different actions will be taken in the face of the same situation. Therefore, in order to achieve this training goal, the embodiment of the present application proposes that: different reward information can be set to correspond to different character behavior styles, wherein the reward information includes: the corresponding reward weight when the agent performs each preset action. In this way, in the subsequent process of training the agent to be trained, the server can assign corresponding weights to the reward value fed back to the agent to be trained. Since different behaviors can obtain different reward values, the agent to be trained will perform more actions that can obtain greater rewards. In this way, the target agent obtained after training can perform corresponding actions according to the character behavior style configured for it.

[0131] Therefore, in order to obtain multiple target agents with different character behavior styles, at least one corresponding reward information can be set in advance in the server. These reward information correspond to a combination of multiple reward weights, and these combinations correspond to different character behavior styles.

[0132] For example, for an aggressive character behavior style, the corresponding reward weights for the agent's actions that interfere with other players can be relatively large, and the reward weights for the negative rewards the agent receives after losing health can be relatively small. In this way, the trained agent will perform various preset actions in a style that does not care about blood loss and tends to interfere with other players. For a conservative character behavior style, the corresponding reward weights for the agent's actions that interfere with other players can be relatively small, and the reward weights for the negative rewards the agent receives after losing health can be relatively large. In this way, the trained agent will perform various preset actions in a style that cares about its own blood and tries not to deliberately interfere with other players.

[0133] In a possible implementation, in order to further refine the behavioral style of the intelligent agent to be trained, the server can also perform more detailed training on the intelligent agent to be trained according to the reward weights corresponding to the intelligent agent to be trained when holding different game props. Exemplarily, the target reward information can also represent: the reward weights corresponding to the intelligent agent to be trained with corresponding behavioral style information when holding preset props under different environmental conditions. For example, for an aggressive intelligent agent to be trained, when holding props that have a disruptive effect on other players, its corresponding reward weight can be greater than the reward weight of holding props that have a gain effect on itself. In this way, the aggressive intelligent agent to be trained will be further encouraged to perform operations that are more in line with the aggressive behavioral style.

[0134] In an embodiment of the present application, after configuring the corresponding behavioral style information for the intelligent agent to be trained, the server also needs to configure corresponding target reward information for it. The target reward information is a corresponding reward information selected from at least one preset reward information based on the behavioral style information of the intelligent agent to be trained.

[0135] In this way, after completing the acquisition of the target reward information, the server can continue to perform the following operations:

[0136] Step S204: Based on the target reward information, multiple rounds of iterative training are performed on the training agent to obtain the corresponding target agent.

[0137] After obtaining the target reward information and behavior style information, the server can perform multiple rounds of iterative training on the agent to be trained based on the obtained information. In this way, in each round of training, the server will control the agent to be trained to perform various preset actions according to the behavior style information, and after the reward feedback of a round of training process, in the next round of training, adjust its strategy for performing various preset actions, so as to obtain more reward values. In this way, after multiple rounds of iterations, the reward value obtained by the agent to be trained will tend to be stable, and at this time, the server can obtain the corresponding target agent.

[0138] In this scheme, by presetting different role behavior styles, behavior style information and reward information, a data basis is provided for the training process of the intelligent agent. The role behavior style is used to calibrate the behavior style of the corresponding target intelligent agent after training for the intelligent agent to be trained. The behavior style information is used to determine the execution tendency probability of the intelligent agent to be trained when performing different preset actions. The reward information is used to determine the amount of reward fed back to the intelligent agent to be trained. In this way, the training method of reinforcement learning is used to enable the intelligent agent to be trained to obtain a target intelligent agent with a certain behavior style through continuous interaction and feedback between itself and the environment, and by trial and error. In this method, target intelligent agents with different behavior styles can be trained only through the interaction between the intelligent agent to be trained and the environment, and the reward feedback given to the intelligent agent to be trained after the interaction, which reduces the training model cost required to train intelligent agents with different behavior styles.

[0139] In addition, this solution pre-configures multiple role behavior styles, multiple behavior style information, and multiple reward information. The server can directly train target intelligent agents with different behavior styles based on these multiple configuration information. In this way, the server can quickly and conveniently train each intelligent agent to be trained, and then directly obtain multiple target intelligent agents with different behavior styles, which also reduces the training cost and computing resources for training multiple target intelligent agents.

[0140] The above introduces the process of the server obtaining configuration information before training the intelligent agent to be trained. When the server has obtained the behavior style information and target reward information corresponding to the intelligent agent to be trained, it can perform corresponding training operations based on this information.

[0141] In a possible implementation, the server performs multiple rounds of iterative training on the agent to be trained based on the reward weights in the target reward information until an iteration termination condition is met, thereby obtaining a target agent.

[0142] Among them, since the process of each round of iterative training is similar, the following mainly takes one round of iterative training as an example to introduce the training process of the embodiment of the present application. In each round of iterative training, the following process is included:

[0143] See also Fig. 8A , is a flowchart of a method for one-round iterative training provided in an embodiment of the present application, such as Fig. 8A As shown, the specific implementation steps of this method are as follows:

[0144] Step S801: Obtain first model data when the intelligent agent to be trained performs at least one preset action in a preset frame; wherein the first model data includes: role state information corresponding to the intelligent agent to be trained and interaction information between the intelligent agent to be trained and the environment.

[0145] In an embodiment of the present application, when this round is the first iteration, the agent to be trained used in this round is the original agent to be trained, and the network parameters included therein can be assigned by random initialization, or it can be an agent trained to convergence, and then fine-tuned through this training. This application does not impose any restrictions on this; when this round is not the first iteration, the agent to be trained used in this round is the agent to be trained after the last parameter adjustment. The training samples used in the training process come from the game data generated by the interaction between the agent and the virtual environment provided by the game. During this training process, the server can control one agent to be trained to train in a virtual game scene, or control multiple agents to be trained to train in multiple virtual game scenes, or control multiple agents to be trained to train simultaneously in a virtual game scene. This application does not impose any restrictions on this.

[0146] In one possible implementation, the intelligent agent to be trained can be put into a virtual game scene for training. At this time, each action of the intelligent agent to be trained in the game scene will be split and calculated by the server into each game frame. Therefore, in each game frame, the server will obtain the first model data related to the intelligent agent to be trained, and the first model data includes: the character state information corresponding to the intelligent agent to be trained and the interaction information between the intelligent agent to be trained and the environment.

[0147] For an intelligent agent to be trained, the data it contains, in addition to the character behavior style and behavior style information mentioned above, will also include some information used to perceive the virtual environment provided by the game, information to clarify its own game tasks, and information about objects provided in the virtual environment. One or more of these information will be introduced below.

[0148] (1) Environmental perception information, used to provide environmental information to the agent. This information is obtained through the rays of the height map corresponding to the agent and the circular rays. The length of the ray of the height map is 500 cm, the interval between the rays is 150 cm, and the number of rays is 17x17. The circular ray emits 17x17 rays at the position of the head (for example, the height is 240 cm) and the position of the feet (for example, the height is 0 cm) of the virtual character corresponding to the agent. Through the interactive feedback of these rays and the environment, the agent can perceive the changes in the surrounding environment and better understand the surrounding environment.

[0149] (2) Task information, which is used to provide the agent with information about tasks that exist between levels in the virtual scene. This includes task attribute information and task target information. For example, if the virtual character corresponding to the agent needs to get close to a certain coordinate point to gain benefits, then the task will be described as getting close to this coordinate. If the character needs to move away from a certain coordinate to avoid danger, then the task will be described as moving away from this coordinate.

[0150] (3) Object information: This is used to provide the agent with information about objects in the environment, including props, obstacles, mechanisms, etc. This information includes the real-time status information of objects in the environment, such as the shape and size of the object, the movement pattern and movement information of the object, the association information with the virtual character, etc., and also includes the current location information of the object, etc.

[0151] (4) Character information, which is used to provide the agent with relevant information about the currently controlled virtual character, including the status information of the virtual character itself, such as the movement status and current status of the virtual character, whether it holds props, the skill status of the virtual character, etc. In addition, there is also the association information between each virtual character, such as the distance between characters.

[0152] Therefore, during the training process, in each game frame, the first model data corresponding to the intelligent agent to be trained includes the character state information corresponding to the training intelligent agent and the interaction information with the environment, wherein the character state information may include the blood volume information, movement status, skill status, etc. of the virtual character proposed above, and the interaction information with the environment may include the position information of the virtual character, the distance between the virtual character and other characters, the distance between the virtual character and the object, and other information.

[0153] In step S801, it is proposed to obtain the first model data when executing a preset action in a preset frame, wherein the preset frame can be a preset fixed game frame, such as the first frame, the fifth frame, the tenth frame, etc., or it can be the first frame or the last frame, etc. when the trained intelligent agent executes each preset action. The specific details are determined by the user, and this application does not impose any restrictions on this.

[0154] After completing the acquisition of the first model data, the server can continue to perform the following operations:

[0155] Step S802: Based on the first model data, obtain a state reward value corresponding to at least one preset action performed by the to-be-trained intelligent agent in a preset frame.

[0156] Through the first model data, the server can obtain the corresponding role state information and environment feedback information when the intelligent agent to be trained performs a preset action, and then can assign a corresponding state reward value to the intelligent agent to be trained based on this information.

[0157] For example, if the virtual character controlled by the agent to be trained picks up a prop in the environment, a corresponding state reward value can be assigned to it. Since props usually have a certain gain effect, positive rewards can be used to encourage the agent to be trained to learn some strategies for picking up props.

[0158] For example, when the health of a virtual character drops to a certain threshold, a negative reward can be given to the agent to be trained, allowing the agent to be trained to learn some strategies to avoid damage.

[0159] For example, when a virtual character causes damage to other characters (including damage caused by props or damage caused by skills), the intelligent agent to be trained can also be given a certain reward to encourage the intelligent agent to be trained to learn the strategy of using its own skills or props to actively attack other virtual characters.

[0160] For example, when a virtual character is damaged (damage from props in the environment or damage from skills or props of other characters, etc.), a corresponding negative reward can be given to the agent to be trained to encourage the agent to be trained to learn strategies to avoid damage to itself.

[0161] Through the above-mentioned reward method, the server can guide the intelligent agent to be trained to quickly learn the core gameplay of a game, thereby obtaining an intelligent agent that can basically complete the game.

[0162] Step S803: Based on the reward weight in the target reward information corresponding to the intelligent agent to be trained, weighted processing is performed on each state reward value obtained, and the weighted state reward value is fed back to the intelligent agent to be trained for parameter adjustment.

[0163] In the process of training the agent to be trained, as described in step S802, basic reward values ​​are assigned to different preset actions, and this set of reward values ​​can motivate the agent to be trained to learn the basic core operations of completing the game. However, the present application hopes to obtain target agents with different behavior styles, so corresponding reward weights are added to this set of reward values ​​to guide the agent to be trained towards different behavior styles.

[0164] Therefore, when the server obtains the state reward value, it can weight the state reward value based on the reward weight in the target reward information, and feed back the weighted state reward value to the intelligent agent to be trained for parameter adjustment.

[0165] like Figure 8B As shown, the above-mentioned reward value feedback method is to give the corresponding reward value to the trained intelligent agent in time after each preset action is performed. For example, Figure 8B As shown, each time the virtual character obtains a boost item, it will receive feedback of the corresponding reward value in real time, thereby adding up the reward value obtained in this round of training.

[0166] In this way, in order to obtain more reward values, the trained agent will tend to choose actions that can obtain more reward values. After training to the convergence state, the target agent's choice of execution actions tends to be stable. In this way, in the game, the virtual character controlled by the target agent will have a relatively fixed behavior style.

[0167] The above introduces the process of training the agent to be trained by continuously providing dense rewards to the agent to be trained.

[0168] In a possible implementation, the server may also add new types of reward values ​​for the intelligent agent to be trained, so as to perform corresponding training on the gaming ability of the intelligent agent to be trained.

[0169] For details, see Fig. 9A , is a flow chart of another one-round training method provided in an embodiment of the present application, and the specific implementation steps of the method are as follows:

[0170] Step S901: Feedback the weighted state reward value to the agent to be trained.

[0171] After the server feeds back the weighted state reward value corresponding to each preset action performed by the to-be-trained agent to the to-be-trained agent in real time, the server also needs to continue to perform the following operations:

[0172] Step S902: When the intelligent agent to be trained triggers a preset task, second model data of the intelligent agent to be trained within the preset task time range is obtained.

[0173] The second model data is used to represent: the overall evaluation information corresponding to the intelligent agent to be trained after performing a preset action within the task time range.

[0174] The preset task can be a settlement task for a match in a virtual game. For example, in a multiplayer party game, since the game structure is a combination of multiple competitive levels, there will be a settlement task at the end of each level to calculate the ranking information of each participating character in the level. For another example, in a multiplayer competitive game, when a virtual match ends, a settlement task will also be triggered to calculate the game information of each player in the game, such as the amount of damage caused, the amount of damage suffered, or the amount of treatment provided, etc.

[0175] Therefore, when the agent to be trained triggers a preset task, the server can obtain the second model data of the agent to be trained within the preset task time range. The preset task time range can be the time interval between two triggering preset tasks, or a fixed time length, for example, the fixed time length of this round of checkpoints.

[0176] The second model data is used to represent the overall evaluation information corresponding to the intelligent agent to be trained after performing preset actions within the task time range. The actual performance of the overall evaluation information can be the ranking of the virtual character controlled by the intelligent agent to be trained in a certain level, or the game record of the virtual character controlled by the intelligent agent in a certain game, etc.

[0177] Step S903: Based on the overall evaluation information and the role behavior style corresponding to the intelligent agent to be trained, a corresponding evaluation reward value is obtained, and the evaluation reward value is fed back to the intelligent agent to be trained.

[0178] After completing the acquisition of the overall evaluation information, the server can assign a corresponding evaluation reward value to the intelligent agent to be trained according to the corresponding role behavior style of the intelligent agent to be trained.

[0179] In a possible implementation, the server may assign a corresponding reward evaluation value to the intelligent agent to be trained based on the evaluation of the overall operation of the intelligent agent to be trained in the overall evaluation information, and the matching degree between the evaluation and the character behavior style. For example, assuming that the overall evaluation information includes the battle record information of the virtual character controlled by the intelligent agent to be trained in the current game, the server may assign corresponding evaluation reward values ​​to the intelligent agents to be trained with different character behavior styles based on the number of enemy players defeated, the number of times the agent is defeated, and other information. For example, when the intelligent agent to be trained has an aggressive character behavior style, if the number of enemy players defeated is greater than the number of times the agent is defeated, a positive reward may be assigned to the intelligent agent to be trained, and the value of the positive reward may be positively correlated with the difference between the number of enemy players defeated and the number of times the agent is defeated.

[0180] In a possible implementation, the character behavior style can be used to define the game ability of the training agent in addition to the behavior style of the training agent. In different games, it can be understood as the ranking of the agent among the overall players when the agent controls the virtual character to compete in the game.

[0181] In this way, the server can assign a corresponding reward evaluation value to the agent to be trained based on the ranking information of the virtual character operated by the agent to be trained in the overall evaluation information, and the matching degree between the ranking information and the game ability limit of the agent to be trained in the character behavior style. Fig. 9BAs shown, in the ranking settlement information, the server can obtain the current ranking information of the virtual character operated by the agent to be trained, and based on the gap between the current ranking and the target ranking, feedback the corresponding reward value to the agent to be trained. For another example, in the racing level of a multiplayer party game, assuming that the game ability of the corresponding agent is specified as medium in the character behavior style, then for a game with 20 people, the virtual character operated by the agent to be trained can obtain the highest evaluation reward value when it ranks 10, and when the ranking deviates, the evaluation reward value obtained can be negatively correlated with the deviation value.

[0182] Correspondingly, when the character behavior style limits the gaming ability of the intelligent agent to be trained, the behavior style information corresponding to the character behavior style also includes one or more of the execution hit probability, execution delay time and execution time interval of the intelligent agent to be trained for each preset action under different environmental conditions.

[0183] Compared with ordinary real players, the hit rate of the intelligent agent and the grasp of the release timing will have a greater advantage. However, when the intelligent agent to be trained needs to simulate a lower-level player, the higher skill hit rate will obviously conflict with the actual situation. Therefore, during the training process, when the game ability of the intelligent agent to be trained is limited in the character behavior style, the corresponding execution hit rate of the intelligent agent to be trained when releasing skills also needs to be limited accordingly. Similarly, the execution delay time, execution time interval, etc. are also limitations on the game ability of the intelligent agent to be trained.

[0184] In this way, through the restriction of the above-mentioned behavioral style information, the trained target intelligent agent can more realistically simulate the operations of real players and provide game players with a richer gaming experience.

[0185] Step S904: Based on the weighted state reward value and evaluation reward value fed back to the intelligent agent to be trained, the parameters of the intelligent agent to be trained are adjusted.

[0186] After completing this round of training, the server can adjust the model parameters of the intelligent agent to be trained based on the weighted state reward value and evaluation reward value fed back to the intelligent agent to be trained, so that the intelligent agent to be trained can obtain a higher reward value in the next round of training.

[0187] After completing multiple rounds of iterative training in the above manner, until the virtual character controlled by the intelligent agent to be trained can obtain a relatively stable reward value, it can be determined that the intelligent agent to be trained has reached a convergence state. At this time, the iterative training of the intelligent agent to be trained can be stopped to obtain the corresponding target intelligent agent.

[0188] The above introduces the method for training an intelligent agent provided in the embodiments of the present application and its various possible implementations. Below, the above method will be generally introduced.

[0189] See also Fig.10 , is a schematic diagram of a system architecture provided in an embodiment of the present application, wherein the system architecture includes an information input unit, a reward calculation unit, an action decoding unit, and a neural network unit.

[0190] The information input unit is used to provide the intelligent agent to be trained with corresponding character behavior style, behavior style information, and environmental information in the virtual scene provided by the game, and includes a style restriction subunit, an ability restriction subunit, and an environmental information subunit. Among them, the style restriction subunit is used to provide the intelligent agent to be trained with relevant information about the desired behavior style, the ability restriction subunit is used to provide the intelligent agent to be trained with relevant information about the desired game ability, and the environmental information subunit is used to provide the intelligent agent to be trained with environmental information in the virtual game provided by the game. The input information unit can convert the various information provided in the above subunits into feature signals and input them into the intelligent agent to be trained.

[0191] The reward calculation unit is used to determine the benefits (or rewards) brought by the intelligent agent to be trained when performing preset actions under different environmental conditions, and based on the combination of various reward weights in the preset reward information, weighted processing is performed on the reward values ​​corresponding to different preset actions to obtain the final reward value fed back to the intelligent agent to be trained, and it is converted into a corresponding feature signal and input into the intelligent agent to be trained.

[0192] The neural network unit is used to provide the trained agent with the ability to learn three-dimensional environment perception and diverse action execution strategies. The neural network unit includes the corresponding neural network model, which consists of an encoding subnetwork and a timing subnetwork. The encoding subnetwork is used to extract the hidden encoding vector of the input feature. It consists of a multi-layer fully connected network and a multi-scale convolutional neural network. Units of the same type, such as the speed, direction, and status of the virtual character, are all attributes of the character and share a set of encoding network weights. For image features, multi-scale convolutional neural networks are used to process spatial information. The timing subnetwork is composed of a long short-term memory recursive neural network (LSTM), which uses adjacent game frame data to provide timing decision information for the trained agent. After the sequential subnetwork completes its output of the logical value (logits) for each preset action label, the neural network unit can be trained using the proximal policy optimization (PPO) method or other different reinforcement learning algorithms, such as the Deep Deterministic Policy Gradient (DDPG) algorithm, the SAC algorithm (Soft Actor Critic algorithm), the A3C algorithm (Asynchronous Advantage Actor-Critic algorithm), and other algorithms. This application does not impose any restrictions on this.

[0193] The action encoding and decoding unit is used to encode the preset actions that may be performed by virtual characters in different game applications into a series of labels for the neural network unit to learn. In actual application, the action encoding and decoding unit can also encode the results output by the neural network unit into specific action instructions to achieve control of the virtual character.

[0194] The above introduces the training process of the agent and the system architecture of the training process. After completing the iterative training of the agent to be trained, the target agent can be deployed to the game server, and when the game starts, the target agent with different game styles can be put into the game to interact with real players. This process can be implemented through a server or a terminal device. For example, for a game, when a player participates in an online game involving an agent, the agent's game control can be achieved through the server, and when a player participates in an offline game involving an agent, the agent's game control can be achieved through a terminal device.

[0195] In the embodiments of the present application, in actual application, the virtual game scene can be any virtual scene, such as a 1V1 game scene, a 2V2 game scene, a 5V5 game scene, or a scene with hundreds of people online. When an intelligent agent is needed to participate in a virtual game, for example, the number of real players participating in the current game is too small, and a suitable game cannot be matched for a long time, or the real player selects the human-computer battle mode, or starts the game test mode, at least one target intelligent agent participating in the game will be loaded into the virtual game scene. After these target intelligent agents are trained in the above-mentioned training agent method, they can simulate a variety of different game styles and abilities.

[0196] When the server controls the target intelligent agent to perform game operations, it can obtain the above-mentioned environmental information, character information, object information, task information and other data from each frame of game data and input it into the target intelligent agent, so that the target intelligent agent can make a forward prediction of the next frame of game data based on this information. The server can select the action with the highest probability from the forward prediction results of the target intelligent agent, decode it into frame instructions for execution, so that the virtual character controlled by the target intelligent agent can interact in the game like a virtual character controlled by a real player.

[0197] See also Fig.11 Based on the same inventive concept, the embodiment of the present application further provides a device 1100 for training an intelligent agent, the device comprising:

[0198] The style determination module 1101 is used to obtain at least one preset role behavior style, wherein the role behavior style is used to indicate the strategic tendency of the agent when making an execution action decision; based on the at least one role behavior style, corresponding behavior style information is configured for the to-be-trained agent, wherein the behavior style information includes: the execution tendency probability of the to-be-trained agent for each preset action under different environmental conditions;

[0199] The reward configuration module 1102 is used to obtain target reward information corresponding to the behavior style information from at least one preset reward information based on the behavior style information, wherein the target reward information represents: the reward weight corresponding to when the to-be-trained intelligent agent with the behavior style information performs each preset action under different environmental conditions;

[0200] The iterative training module 1103 is used to perform multiple rounds of iterative training on the to-be-trained intelligent agent based on the target reward information to obtain a corresponding target intelligent agent.

[0201] Optionally, the iterative training module 1103 is used to perform multiple rounds of iterative training on the to-be-trained agent based on the target reward information to obtain a corresponding target agent, specifically for:

[0202] Based on the reward weights in the target reward information, the agent to be trained is trained for multiple rounds to obtain a corresponding target agent; wherein the following operations are performed during one round of iterative training:

[0203] Acquire first model data when the intelligent agent to be trained performs at least one preset action in a preset frame; wherein the first model data includes: role state information corresponding to the intelligent agent to be trained and interaction information between the intelligent agent to be trained and the environment;

[0204] Based on the first model data, obtaining a state reward value corresponding to at least one preset action performed by the to-be-trained agent in the preset frame;

[0205] Based on the reward weight in the target reward information corresponding to the intelligent agent to be trained, each state reward value obtained is weighted, and the weighted state reward value is fed back to the intelligent agent to be trained for parameter adjustment.

[0206] Optionally, the iterative training module 1103 is used to feed back the weighted state reward value to the to-be-trained agent for parameter adjustment, specifically for:

[0207] Feeding back the weighted state reward value to the to-be-trained agent;

[0208] When the intelligent agent to be trained triggers a preset task, second model data of the intelligent agent to be trained within a preset task time range is obtained, wherein the second model data represents: overall evaluation information corresponding to the intelligent agent to be trained after performing the preset action within the task time range;

[0209] Based on the overall evaluation information and the role behavior style corresponding to the intelligent agent to be trained, a corresponding evaluation reward value is obtained, and the evaluation reward value is fed back to the intelligent agent to be trained;

[0210] Based on the weighted state reward value and the evaluation reward value fed back to the agent to be trained, parameters of the agent to be trained are adjusted.

[0211] Optionally, the target reward information also represents: the corresponding reward weight when the intelligent agent to be trained with the behavioral style information holds preset props under different environmental conditions.

[0212] Optionally, the character behavior style is also used to indicate the ability level of the agent when performing each preset action.

[0213] Optionally, the behavior style information further includes: one or more of the execution hit probability, execution delay time and execution time interval of each preset action of the intelligent agent to be trained under different environmental conditions.

[0214] Optionally, the style determination module 1101 is used to configure corresponding behavior style information for the to-be-trained agent based on the at least one character behavior style, specifically for:

[0215] Acquire a preset behavior type set, wherein the behavior type set includes: a plurality of execution tendency probabilities corresponding to the to-be-trained intelligent agents with different role behavior styles when executing the preset actions;

[0216] For each character behavior style, based on the preset extraction rules, the execution tendency probability corresponding to each preset action corresponding to the character behavior style of the intelligent agent to be trained is obtained from the behavior type set, and the corresponding behavior style information is configured for the intelligent agent to be trained.

[0217] Optionally, the style determination module 1101 is used to obtain, from the behavior type set, the execution tendency probabilities corresponding to the preset actions corresponding to the role behavior style of the to-be-trained agent based on a preset extraction rule, specifically to:

[0218] Based on the role behavior style corresponding to the to-be-trained intelligent agent, randomly obtaining an execution tendency probability corresponding to at least one preset action from a plurality of execution tendency probabilities corresponding to the role behavior style in the behavior type set;

[0219] The reward configuration module 1102 is used to obtain target reward information corresponding to the behavior style information from at least one preset reward information based on the behavior style information, specifically for:

[0220] Based on at least one preset action included in the behavior style information, reward information including a reward weight of each preset action in the at least one preset action is obtained from at least one preset reward information as the target reward information.

[0221] The device can be used to execute the methods shown in the various embodiments of the present application. Therefore, for the functions that can be implemented by the various functional modules of the device, reference can be made to the description of the aforementioned embodiments and no further details will be given.

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

[0223] See also Fig.12 Based on the same technical concept, the present application also provides a computer device. In one embodiment, the computer device can be Figure 1 The server shown in FIG. Fig.12 As shown, it includes a memory 1201 , a communication module 1203 and one or more processors 1202 .

[0224] The memory 1201 is used to store computer programs executed by the processor 1202. The memory 1201 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required to run the functions of the embodiment of the present application, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0225] The memory 1201 may be a volatile memory, such as a random-access memory (RAM); the memory 1201 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 1201 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1201 may be a combination of the above memories.

[0226] The processor 1202 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1202 is configured to implement the above-mentioned method for training an intelligent agent when calling a computer program stored in the memory 1201 .

[0227] The communication module 1203 is used to communicate with terminal devices and other servers.

[0228] The specific connection medium between the memory 1201, the communication module 1203 and the processor 1202 is not limited in the embodiment of the present application. Fig.12 In the embodiment, the memory 1201 and the processor 1202 are connected via a bus 1204. The bus 1204 is connected to the processor 1202 via a bus 1204. Fig.12 The connections between the other components are only for illustration and are not intended to be limiting. The bus 1204 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.12 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0229] The memory 1201 stores a computer storage medium, and the computer storage medium stores computer executable instructions. The computer executable instructions are used to implement the method for training an intelligent agent in the embodiments of the present application. The processor 1202 is used to execute the method for training an intelligent agent in the above-mentioned embodiments.

[0230] In another embodiment, the computer device may also be a terminal device, such as Figure 1 In this embodiment, the structure of the computer device can be as follows: Fig.13 As shown, it includes: a communication component 1310, a memory 1320, a display unit 1330, a camera 1340, a sensor 1350, an audio circuit 1360, a Bluetooth module 1370, a processor 1380 and other components.

[0231] The communication component 1310 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The computer device can help the user to send and receive information through the WiFi module.

[0232] The memory 1320 can be used to store software programs and data. The processor 1380 executes various functions and data processing of the terminal device by running the software programs or data stored in the memory 1320. The memory 1320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The memory 1320 stores an operating system that enables the terminal device to run. In the present application, the memory 1320 can store an operating system and various application programs, and can also store code for executing the method for training an intelligent agent in the embodiment of the present application.

[0233] The display unit 1330 can also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal device. Specifically, the display unit 1330 may include a display screen 1332 disposed on the front of the terminal device. The display screen 1332 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 1330 may be used to display the virtual game scene interface in the embodiment of the present application.

[0234] The display unit 1330 can also be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal device. Specifically, the display unit 1330 may include a touch screen 1331 arranged on the front of the terminal device, which can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.

[0235] The touch screen 1331 can be covered on the display screen 1332, or the touch screen 1331 and the display screen 1332 can be integrated to realize the input and output functions of the terminal device, and the integrated touch screen can be referred to as a touch display screen. In this application, the display unit 1330 can display the application and the corresponding operation steps.

[0236] The camera 1340 can be used to capture still images, and users can post comments on the images taken by the camera 1340 through the application. The camera 1340 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the processor 1380 to convert it into a digital image signal.

[0237] The terminal device may further include at least one sensor 1350, such as an acceleration sensor 1351, a distance sensor 1352, a fingerprint sensor 1353, and a temperature sensor 1354. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0238] The audio circuit 1360, the speaker 1361, and the microphone 1362 can provide an audio interface between the user and the terminal device. The audio circuit 1360 can transmit the electrical signal converted from the received audio data to the speaker 1361, which is converted into a sound signal for output. The terminal device can also be equipped with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1360 and converted into audio data, and then the audio data is output to the communication component 1310 to be sent to, for example, another terminal device, or the audio data is output to the memory 1320 for further processing.

[0239] The Bluetooth module 1370 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable computer device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1370 to exchange data.

[0240] The processor 1380 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 1320 and calling data stored in the memory 1320. In some embodiments, the processor 1380 may include one or more processing units; the processor 1380 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1380. In the present application, the processor 1380 can run the operating system, application programs, user interface display and touch response, as well as the method for training an intelligent agent in the embodiment of the present application. In addition, the processor 1380 is coupled to the display unit 1330.

[0241] Based on the same inventive concept, an embodiment of the present application also provides a storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes the steps of the method for training an intelligent agent according to various exemplary embodiments of the present application described above in this specification.

[0242] In some possible implementations, various aspects of the method for training an intelligent agent provided by the present application may also be implemented in the form of a computer program product, which includes a computer program. When the program product is run on a computer device, the computer program is used to enable the computer device to execute the steps of the method for training an intelligent agent according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the steps of each embodiment.

[0243] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0244] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on a computer device. However, the program product of the present application is not limited thereto. In the present application, the readable storage medium may be any tangible medium containing or storing a program, and the computer program included therein may be used by or in combination with a command execution system, apparatus or device.

[0245] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0246] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0247] Computer programs for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages.

[0248] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0249] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0250] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0251] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0252] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for training an intelligent agent, characterized in that: The method comprises: Acquire at least two preset role behavior styles, wherein the role behavior styles are used to indicate the strategic tendency of the agent when making an execution action decision; Obtaining a preset behavior type set, the behavior type set comprising: a plurality of execution tendency probabilities corresponding to each preset action when the to-be-trained intelligent agent with different role behavior styles executes each preset action, wherein a preset action under one role behavior style corresponds to a plurality of execution tendency probabilities; Based on the role behavior style corresponding to the to-be-trained intelligent agent, randomly obtain at least one execution tendency probability corresponding to a preset action from the multiple execution tendency probabilities corresponding to the role behavior style in the behavior type set, and configure corresponding behavior style information for the to-be-trained intelligent agent, the behavior style information including: the execution tendency probability of the to-be-trained intelligent agent for each preset action under different environmental conditions; Based on at least one preset action included in the behavior style information, obtaining reward information including a reward weight of each preset action in the at least one preset action from at least one preset reward information as target reward information corresponding to the behavior style information, wherein the target reward information represents: the reward weight corresponding to when the to-be-trained intelligent agent having the behavior style information performs each preset action under different environmental conditions; Based on the target reward information, multiple rounds of iterative training are performed on the agent to be trained to obtain a corresponding target agent.

2. The method according to claim 1, characterized in that The step of performing multiple rounds of iterative training on the to-be-trained intelligent agent based on the target reward information to obtain a corresponding target intelligent agent includes: Based on the reward weights in the target reward information, the agent to be trained is trained for multiple rounds to obtain a corresponding target agent; wherein the following operations are performed during one round of iterative training: Acquire first model data when the intelligent agent to be trained performs at least one preset action in a preset frame; wherein the first model data includes: role state information corresponding to the intelligent agent to be trained and interaction information between the intelligent agent to be trained and the environment; Based on the first model data, obtaining a state reward value corresponding to at least one preset action performed by the to-be-trained agent in the preset frame; Based on the reward weight in the target reward information corresponding to the intelligent agent to be trained, each state reward value obtained is weighted, and the weighted state reward value is fed back to the intelligent agent to be trained for parameter adjustment.

3. The method according to claim 2, characterized in that Feeding back the weighted state reward value to the to-be-trained agent for parameter adjustment includes: Feeding back the weighted state reward value to the to-be-trained agent; When the intelligent agent to be trained triggers a preset task, second model data of the intelligent agent to be trained within a preset task time range is obtained, wherein the second model data represents: overall evaluation information corresponding to the intelligent agent to be trained after performing the preset action within the task time range; Based on the overall evaluation information and the role behavior style corresponding to the intelligent agent to be trained, a corresponding evaluation reward value is obtained, and the evaluation reward value is fed back to the intelligent agent to be trained; Based on the weighted state reward value and the evaluation reward value fed back to the agent to be trained, parameters of the agent to be trained are adjusted.

4. The method according to any one of claims 1 to 3, characterized in that: The target reward information also represents: the corresponding reward weight when the intelligent agent to be trained with the behavioral style information holds the preset props under different environmental conditions.

5. The method according to any one of claims 1 to 3, characterized in that: The character behavior style is also used to indicate the ability level of the agent when performing each preset action.

6. The method according to claim 5, characterized in that The behavior style information further includes: one or more of the execution hit probability, execution delay time and execution time interval of each preset action of the intelligent agent to be trained under different environmental conditions.

7. A device for training an intelligent agent, characterized in that: The device comprises: A style determination module is used to obtain at least two preset role behavior styles, wherein the role behavior style is used to indicate the strategic tendency of the intelligent agent when making an execution action decision; obtain a preset behavior type set, wherein the behavior type set includes: a plurality of execution tendency probabilities corresponding to each preset action of the intelligent agent to be trained with different role behavior styles, wherein a preset action under a role behavior style corresponds to a plurality of execution tendency probabilities; based on the role behavior style corresponding to the intelligent agent to be trained, randomly obtain the execution tendency probability corresponding to at least one preset action from the plurality of execution tendency probabilities corresponding to the role behavior style in the behavior type set, and configure corresponding behavior style information for the intelligent agent to be trained, wherein the behavior style information includes: the execution tendency probability of each preset action of the intelligent agent to be trained under different environmental conditions; A reward configuration module, configured to obtain, based on at least one preset action included in the behavior style information, reward information including a reward weight for each preset action in the at least one preset action from the preset at least one reward information as target reward information corresponding to the behavior style information, wherein the target reward information represents: the reward weight corresponding to when the to-be-trained intelligent agent having the behavior style information performs each preset action under different environmental conditions; The iterative training module is used to perform multiple rounds of iterative training on the intelligent agent to be trained based on the target reward information to obtain the corresponding target intelligent agent.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.