Artificial intelligence object control method and apparatus, electronic device, and storage medium
By interacting with the first and second artificial intelligence programs and utilizing multi-level subroutines for decision-making, the control complexity of the artificial intelligence object is simplified, enabling more comprehensive operation management and improving the rationality and flexibility of the operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-09-21
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, the complexity of AI programs controlling AI objects is too high, making it difficult to effectively manage the diverse operations of AI objects.
By interacting with the first and second AI programs and utilizing multi-level subroutines to make decisions layer by layer, the target state and operations of the AI object are determined, simplifying the complexity and avoiding the operational decision-making pressure of a single program.
It achieves more comprehensive artificial intelligence program control, simplifies the complexity of each artificial intelligence program, improves the rationality and flexibility of operation, and avoids the difficulties in implementation caused by the diversity of operations.
Smart Images

Figure CN117771671B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an artificial intelligence object control method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of AI (Artificial Intelligence) technology, AI objects are widely used in video games. AI objects are controlled by AI programs, rather than being manipulated by users via terminals. In video games, it's necessary to determine the operations that the AI object needs to perform, and then control the AI object to execute those operations.
[0003] In related technologies, terminals typically have an artificial intelligence program set up. Based on this program, the operation required by the AI object is determined, thereby controlling the AI object to perform that operation. However, the complexity of this AI program is often too high. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for controlling artificial intelligence objects, which can control artificial intelligence objects based on a more comprehensive set of artificial intelligence programs, and simplifies the complexity of individual artificial intelligence programs. The technical solution is as follows:
[0005] On the one hand, an artificial intelligence object control method is provided, the method comprising:
[0006] In response to an operation request from an AI object, current status information is collected, wherein the operation request is used to request determination of the target operation to be performed by the AI object;
[0007] The first artificial intelligence program determines the target state of the artificial intelligence object based on the state information and sends the target state to the second artificial intelligence program.
[0008] The second artificial intelligence program determines the target operation based on the target state and controls the artificial intelligence object to execute the target operation.
[0009] The target state is the state that the artificial intelligence object needs to reach, and the target operation is the operation that the artificial intelligence object needs to perform to switch from the current state to the target state.
[0010] On the other hand, an artificial intelligence object control device is provided, the device comprising:
[0011] The data acquisition module is used to collect current status information in response to the operation request of the artificial intelligence object. The operation request is used to request the determination of the target operation to be performed by the artificial intelligence object.
[0012] The target state determination module is used to determine the target state of the artificial intelligence object based on the state information through the first artificial intelligence program, and send the target state to the second artificial intelligence program;
[0013] The target operation determination module is used to determine the target operation based on the target state through the second artificial intelligence program, and to control the artificial intelligence object to execute the target operation;
[0014] The target state is the state that the artificial intelligence object needs to reach, and the target operation is the operation that the artificial intelligence object needs to perform to switch from the current state to the target state.
[0015] Optionally, the second artificial intelligence program includes N levels of subroutines, where N is a positive integer; the target operation determination module includes:
[0016] The determining unit is used to determine the first-level target operation of the artificial intelligence object based on the target state through the first-level subroutine, and to issue the first-level target operation to the second-level subroutine.
[0017] The determining unit is further configured to determine the i-th level target operation based on the received (i-1)-th level target operation through the i-th level subroutine, and the i-th level target operation is the operation required to implement the (i-1)-th level target operation, where i is an integer greater than 1 and not greater than N;
[0018] The control unit is configured to control the artificial intelligence object to execute the Nth-level target operation after the determining unit determines the Nth-level target operation through the Nth-level subroutine.
[0019] Optionally, the determining unit is used for:
[0020] The first level target operation is issued to the second level subroutine through the first level subroutine;
[0021] After the first-level target operation is completed, the first-level subroutine issues the second-level target operation to the second-level subroutine, and so on, until the last first-level target operation is completed.
[0022] Optionally, the control unit is used for:
[0023] After determining multiple Nth-level target operations through the Nth-level subroutine, the artificial intelligence object is controlled to execute the first Nth-level target operation;
[0024] After the first Nth-level target operation is completed, the Nth-level subroutine controls the artificial intelligence object to execute the second Nth-level target operation, and so on, until the last Nth-level target operation is completed. The execution result is then fed back to the (N-1)th-level subroutine, indicating that the (N-1)th-level target operations corresponding to the multiple Nth-level target operations have been completed.
[0025] Optionally, where i is less than N, the determining unit is further configured to:
[0026] The first target operation of level i is issued to the (i+1)th level subroutine through the i-th level subroutine.
[0027] After the first level i target operation is completed, the level i subroutine issues the second level i target operation to the level i+1 subroutine, and so on, until the last level i target operation is completed. Then, the level i-1 subroutine is fed back the execution result, which indicates that the level i-1 target operation has been completed.
[0028] Optionally, the configuration information of the first-level subroutine includes multiple preset operations and corresponding operation information for each preset operation. The operation information includes execution prerequisites, execution cost, and state impact information. The execution cost represents the virtual cost required to execute the preset operation, and the state impact information represents the impact of the preset operation on the state after execution. The determining unit is used for:
[0029] The first-level subroutine determines at least two candidate operation sequences applicable to the target state based on the target state and the configuration information, with each candidate operation sequence including at least one candidate operation.
[0030] Determine the execution cost of each candidate operation sequence;
[0031] The candidate operation in the sequence of candidate operations with the lowest execution cost is determined as the first-level target operation.
[0032] Optionally, the i-th level subroutine is configured with a behavior tree; the determining unit is used for:
[0033] The i-th level subroutine selects a behavior tree segment corresponding to the (i-1)-th level target operation from the behavior tree, and the behavior tree segment is used to implement the (i-1)-th level target operation.
[0034] Starting from the root node of the behavior tree segment, the search continues according to the instructions of the control nodes in the behavior tree segment until an operation located in a leaf node of the behavior tree segment is found. The found operation is then identified as the i-th level target operation.
[0035] Optionally, the target state determination module includes:
[0036] The parameter value determination unit is used to determine parameter values corresponding to multiple preset states based on the state information through the first artificial intelligence program, wherein the parameter values represent the degree of matching between the preset states and the state information.
[0037] The target state determination unit is used to select the target state from the multiple preset states based on the parameter values corresponding to the multiple preset states.
[0038] Optionally, the association function of the preset state is a function composed of the parameter value of the preset state and at least one target state value in the state information; the parameter value determination unit is used for:
[0039] The first artificial intelligence program processes at least one target state value associated with each preset state using the association function of each preset state to obtain the parameter value of each preset state.
[0040] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed by the artificial intelligence object control method as described above.
[0041] On the other hand, a server is provided, the server including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the artificial intelligence object control method as described above.
[0042] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the artificial intelligence object control method as described above.
[0043] On the other hand, a computer program product is provided, including a computer program loaded and executed by a processor to perform the operations performed by the artificial intelligence object control method as described above.
[0044] This application provides a scheme for controlling an artificial intelligence object, which enables interaction between different artificial intelligence programs to control the operation of the artificial intelligence object, eliminating the need for control through a single artificial intelligence program. This achieves a more comprehensive set of artificial intelligence programs and simplifies the complexity of each individual program. Furthermore, the first artificial intelligence program at the upper level only makes state decisions and does not need to make operation decisions. Since the number of states is smaller than the number of operations, it avoids the difficulty in implementing the artificial intelligence program due to the diversity of operations of the artificial intelligence object. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0047] Figure 2 This is a flowchart of an artificial intelligence object control method provided in an embodiment of this application;
[0048] Figure 3 This is a flowchart of another artificial intelligence object control method provided in the embodiments of this application;
[0049] Figure 4 This is a flowchart of another artificial intelligence object control method provided in the embodiments of this application;
[0050] Figure 5 This is a schematic diagram illustrating the determination of a first-level target operation provided in an embodiment of this application;
[0051] Figure 6 This is a flowchart of another artificial intelligence object control method provided in the embodiments of this application;
[0052] Figure 7 This is a schematic diagram of a behavior tree segment provided in an embodiment of this application;
[0053] Figure 8 This is a schematic diagram of a process for controlling an artificial intelligence object provided in an embodiment of this application;
[0054] Figure 9 This is a schematic diagram of a procedure provided in an embodiment of this application;
[0055] Figure 10This is a schematic diagram illustrating an operation flow for controlling an artificial intelligence object, provided in an embodiment of this application.
[0056] Figure 11 This is a schematic diagram of the structure of an artificial intelligence object control device provided in an embodiment of this application;
[0057] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0058] Figure 13 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0060] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first artificial intelligence program may be referred to as a second artificial intelligence program, and similarly, a second artificial intelligence program may be referred to as a first artificial intelligence program.
[0061] "At least one" refers to one or more. For example, at least one target operation can be one target operation, two target operations, three target operations, or any integer number of target operations greater than or equal to one. "Multiple" refers to two or more. For example, multiple target operations can be two target operations, three target operations, or any integer number of target operations greater than or equal to two. "Each" refers to each of the at least one target operation. For example, each target operation refers to each of the multiple target operations. If the multiple target operations are three target operations, then each target operation refers to each of the three target operations.
[0062] It is understood that in the embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0063] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0064] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies include computer vision and machine learning / deep learning.
[0065] Computer vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0066] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can 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 endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instruction-based learning.
[0067] Based on the aforementioned artificial intelligence technology, this application provides an artificial intelligence object method that can be applied to control artificial intelligence objects in a virtual scene.
[0068] The virtual scene involved in this application can be used to simulate a three-dimensional virtual space, which can be an open space. This virtual scene can simulate a real-world environment, such as sky, land, and ocean. The land can include environmental elements such as deserts and cities. Of course, the virtual scene can also include virtual items, such as buildings, vehicles, and weapons used to arm oneself or engage in combat with other virtual objects. This virtual scene can also be used to simulate real-world environments under different weather conditions, such as sunny days, rainy days, foggy days, or nighttime.
[0069] Users can control virtual objects to move within a virtual scene. These virtual objects can be virtual avatars representing the user, and can take any form, such as a person or animal; this application does not limit this. Taking shooting games as an example, users can control virtual objects to freely fall, glide, or deploy parachutes in the sky within the virtual scene; run, jump, crawl, or bend forward on land; swim, float, or dive in the ocean; and move within the virtual scene using vehicles. Users can also control virtual objects to enter and exit buildings, discover and pick up virtual items (e.g., weapons) within the scene, and use these items to engage in combat with other virtual objects. These virtual items can be clothing, helmets, bulletproof vests, medical supplies, melee weapons, or firearms, or they can be virtual items left behind after other virtual objects are eliminated. These scenarios are merely illustrative examples, and this application does not impose specific limitations on the embodiments described.
[0070] This application uses a video game scenario as an example. A user can perform operations on the electronic device beforehand. After detecting the user's operation, the electronic device can download the game configuration file. This configuration file may include the game's application, interface display data, or virtual scene data, so that when the user logs into the game on the electronic device, the configuration file can be called to render and display the game interface. The user can also perform touch operations on the electronic device. After detecting the touch operation, the electronic device can determine the game data corresponding to the touch operation and render and display that game data. This game data may include virtual scene data and behavioral data of virtual objects in the virtual scene.
[0071] When rendering and displaying a virtual scene, the electronic device can display the virtual scene in full screen. Simultaneously, it can display a global map independently in a first preset area of the current display interface. In practical applications, the electronic device can also display the global map only when a click on a preset button is detected. This global map displays a thumbnail of the virtual scene, describing its terrain, landforms, geographical location, and other geographical features. The electronic device can also display thumbnails of the virtual scene within a certain distance of the current virtual object on the current display interface. When a click on the global map is detected, a thumbnail of the entire virtual scene is displayed in a second preset area of the current display interface, allowing the user to view both the surrounding virtual scene and the overall virtual scene. The electronic device can also zoom in and out on the complete thumbnail when a zoom operation is detected. The specific display positions and shapes of the first and second preset areas can be set according to user operating habits. For example, in order not to cause excessive occlusion of the virtual scene, the first preset area can be a rectangular area in the upper right corner, lower right corner, upper left corner or lower left corner of the current display interface, and the second preset area can be a square area on the right or left side of the current display interface. Of course, the first preset area and the second preset area can also be a circular area or other shaped areas. The specific display position and shape of the preset area are not limited in the embodiments of this application.
[0072] This application applies to electronic devices, which may be terminals or servers, or other electronic devices. Terminals may be smartphones, tablets, laptops, desktop computers, etc., but are not limited to these. Servers may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0073] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also... Figure 1 The implementation environment includes electronic device 101 and server 102. Electronic device 101 and server 102 can be connected directly or indirectly via wired or wireless communication, which is not limited herein.
[0074] Server 102 provides a virtual scene for electronic device 101. Through the virtual scene provided by server 102, electronic device 101 can display virtual objects, virtual props, etc., and provides an operating environment for users to detect the operations performed by users. Server 102 can perform background processing on the operations detected by electronic device 101, providing background support for electronic device 101.
[0075] Optionally, electronic device 101 installs a game application provided by server 102. Through this game application, electronic device 101 and server 102 can interact. Electronic device 101 runs the game application, providing users with an operating environment for the game application. It can detect user operations on the game application and send operation commands to server 102. Server 102 responds according to the operation commands and returns the response results to electronic device 101, which then displays them, thereby realizing human-computer interaction.
[0076] The artificial intelligence object control method provided in this application embodiment can be applied to the scenario of video games. An electronic device 101 has a game application installed, which is associated with a server 102 and provided with services by the server 102. The game application includes a virtual scene and virtual objects. The server 102 can determine the game data of the virtual objects in the virtual scene, and the electronic device 101 renders and displays this game data. This game data may include virtual scene data, behavioral data of the virtual objects in the virtual scene, etc. Furthermore, the virtual scene includes an artificial intelligence object. The server 102, through an artificial intelligence program, controls the artificial intelligence object to perform a target operation based on the state information of the virtual scene, and the electronic device 101 displays the game screen of the artificial intelligence object performing the target operation.
[0077] Besides the aforementioned video game scenarios, the methods provided in this application embodiment can also be applied to other scenarios, and this application embodiment does not limit them.
[0078] Figure 2 This is a flowchart of an artificial intelligence object control method provided in an embodiment of this application, such as... Figure 2 As shown, the method is executed by an electronic device, which runs a first artificial intelligence program and a second artificial intelligence program. The method includes:
[0079] 201. Electronic devices respond to operation requests from artificial intelligence objects and collect current status information.
[0080] This application embodiment includes at least one virtual object. This virtual object can include virtual objects controlled by electronic devices, artificial intelligence objects, and objects such as defense towers. An artificial intelligence object refers to an object controlled by an artificial intelligence program, which can be an NPC (Non-Player Character) in a game application or other objects. The artificial intelligence program can determine the operations that the artificial intelligence object needs to perform, and thus control the artificial intelligence object to perform those operations. The operations that the artificial intelligence object can perform include approaching a virtual object, moving away from a virtual object, randomly wandering in the virtual scene, retreating, gathering, and releasing skills, etc., which are not limited in this application embodiment.
[0081] In this embodiment, after starting a virtual scene or an AI object completes an operation, it is necessary to determine the next target operation. Therefore, the AI object initiates an operation request, which requests the determination of the target operation to be performed by the AI object. The electronic device receives the operation request from the AI object and, in response, collects current state information. This state information includes the current state of the AI object, which includes its current health points, executed operations, released skills, and type. Additionally, the state information may also include the state of the virtual scene, which includes game duration, the state of other objects within a preset range of the AI object, the game score, and the state of the virtual object the AI object is currently fighting against. This embodiment does not limit this aspect.
[0082] 202. The electronic device determines the target state of the artificial intelligence object based on the state information through the first artificial intelligence program, and sends the target state to the second artificial intelligence program.
[0083] In this embodiment of the application, after the electronic device collects the current state information, it calls a first artificial intelligence program. The first artificial intelligence program determines the target state of the artificial intelligence object based on the state information and sends the target state to a second artificial intelligence program so that the second artificial intelligence program can subsequently determine the target operation based on the target state.
[0084] The first AI program determines the target state of the AI object and sends this target state to the second AI program. The target state is the state the AI object needs to achieve. The second AI program determines the target operation based on the target state. The target operation is the action the AI object needs to perform to switch from its current state to the target state. In other words, after executing the target operation determined by the second AI program, the AI object can reach the target state determined by the first AI program. The first and second AI programs cooperate with each other, with a clear division of labor, thereby achieving control over the AI object.
[0085] For example, this status information indicates that the AI object's health value is lower than a first preset value. Based on this status information, the first AI program determines a target state: the AI object's health value is higher than a second preset value. The first AI program sets both the first and second preset values, which measure the AI object's health status. It can be assumed that if the AI object's health value is lower than the first preset value, it is in an unhealthy state and needs to have its health value increased; conversely, if the AI object's health value is higher than the second preset value, it is in a healthy state and does not need to have its health value increased.
[0086] 203. The electronic device determines the target operation based on the target state through a second artificial intelligence program, and controls the artificial intelligence object to execute the target operation.
[0087] In this embodiment of the application, after the first artificial intelligence program sends the target state to the second artificial intelligence program, the second artificial intelligence program determines the target operation based on the target state and controls the artificial intelligence object to perform the target operation in order to control the artificial intelligence object to reach the target state.
[0088] Based on the example of step 202 above, if the target state is that the life value of the artificial intelligence object is higher than the second preset value, then the determined target operation is to use virtual props such as medical kits, painkillers, and energy drinks. The above virtual props can increase the life value of the artificial intelligence object, so that the life value of the artificial intelligence object is higher than the second preset value, that is, to control the artificial intelligence object to reach the target state.
[0089] This application provides a scheme for controlling an artificial intelligence object, which enables interaction between different artificial intelligence programs to control the operation of the artificial intelligence object, eliminating the need for control through a single artificial intelligence program. This achieves a more comprehensive set of artificial intelligence programs and simplifies the complexity of each individual program. Furthermore, the first artificial intelligence program at the upper level only makes state decisions and does not need to make operation decisions. Since the number of states is smaller than the number of operations, it avoids the difficulty in implementing the artificial intelligence program due to the diversity of operations of the artificial intelligence object.
[0090] Based on the above embodiments, the following embodiments will provide a more detailed description of the processing procedures of the first artificial intelligence program and the second artificial intelligence program. Figure 3 This is a flowchart of another artificial intelligence object control method provided in the embodiments of this application, such as... Figure 3 As shown, this method is performed by an electronic device. The method includes:
[0091] 301. In response to an operation request from an artificial intelligence object, the electronic device collects current status information. The operation request is used to request the determination of the target operation to be performed by the artificial intelligence object.
[0092] Step 301 is the same as step 201, and will not be repeated here.
[0093] 302. The electronic device uses a first artificial intelligence program to process at least one target state value associated with each preset state by employing the association function of each preset state, thereby obtaining the parameter value of each preset state.
[0094] The first artificial intelligence program has several preset states as candidate states. The target state that the AI object needs to achieve can be selected from these preset states. Furthermore, based on this state information, the parameter values corresponding to the preset states can be determined. The parameter values of the preset states represent the degree of matching between the preset state and the state information. Higher parameter values indicate a higher degree of matching between the preset state and the state information, meaning that setting that preset state as the target state for the AI object is more reasonable. Therefore, the target state can be selected based on the parameter values corresponding to the multiple preset states.
[0095] Furthermore, for each preset state, a correlation function is set for that preset state. The correlation function for a preset state is a function consisting of the parameter value of the preset state and at least one target state value in the state information. This function defines the relationship between the parameter value of the preset state and at least one target state value in the state information. That is, a change in the state information will cause a change in the parameter value corresponding to the preset state, thereby affecting the selection of the target state.
[0096] Therefore, after the status information is collected, at least one target status value in the status information can be determined. Then, the electronic device uses the first artificial intelligence program to process at least one target status value associated with each preset status using the association function of each preset status, and obtains the parameter value of each preset status.
[0097] Optionally, the state information includes state values across multiple dimensions, such as the current health of the AI object, executed operations, and released skills. At least one target state value refers to the state value of the target dimension within the state information. For each of these preset states, a target dimension can be associated with each preset state; the target dimensions associated with different preset states can be the same or different. Then, for each preset state, after collecting the state information, the state value of the target dimension associated with the preset state can be extracted from the state information. The association function of that preset state is then used to process the state value of the target dimension associated with that preset state to obtain the parameter value of that preset state.
[0098] For example, as shown in Table 1 below, the first artificial intelligence program has several preset states: preset state A, preset state B, and preset state C. Target state value X, target state value Y, and target state value Z are the state values from the collected state information.
[0099] Table 1
[0100]
[0101] The correlation function of the preset state A is f ax (X), the input of this correlation function is the target state value X, and the output is f. ax (X) represents the parameter value of preset state A. In Table 1, the position corresponding to preset state A and target state values Y and Z is 0, indicating that the correlation function of preset state A does not include target state values Y and Z, that is, the parameter value of preset state A is unrelated to target state values Y and Z.
[0102] The correlation function of the preset state B is f by (Y)·W by +f bz (Z)·W bz Among them, W by and W bz The weights W represent the target state values Y and Z, respectively. by +W bz =1. The input to this correlation function is the target state value Y and the target state value Z associated by the preset function B, and the output is f. by (Y)·W by +f bz(Z)·W bz This refers to the parameter values corresponding to the preset state B. In Table 1, the position corresponding to the preset state B and the target state value X is 0, indicating that the correlation function of the preset state B does not include the target state value X, that is, the parameter values of the preset state B are unrelated to the target state value X.
[0103] The correlation function of the preset state C is f cx (X)·W cx +f cy (Y)·W cy +f cz (Z)·W cz Among them, W cx W cy and W cz Let W be the weights corresponding to the target state values X, Y, and Z, respectively, and let W be the weights corresponding to the target state values X, Y, and Z. cx +W cy +W cz =1. Output f cx (X)·W cx +f cy (Y)·W cy +f cz (Z)·W cz This refers to the parameter value corresponding to the preset state C.
[0104] Optionally, the parameter values for each preset state fall within the range of [0, 1].
[0105] It should be noted that step 302 above is only one possible solution for determining the parameter value corresponding to the preset state. In another embodiment, other methods can be used to determine the parameter value corresponding to multiple preset states based on the state information.
[0106] 303. The electronic device selects a target state from multiple preset states based on the parameter values corresponding to multiple preset states, and sends the target state to the second artificial intelligence program.
[0107] In this embodiment, after the electronic device determines the parameter values for each preset state through a first artificial intelligence program, it selects the target state with the highest parameter value from among the multiple preset states based on the parameter values corresponding to the preset states, and sends the target state to a second artificial intelligence program. This method ensures that the preset state that best matches the state information is selected as the target state, guaranteeing that the determined target state is the state expected to be reached by the artificial intelligence object, thus improving the rationality of the operations performed by the artificial intelligence object.
[0108] 304. The electronic device determines the first-level target operation of the artificial intelligence object based on the target state through the first-level subroutine, and issues the first-level target operation to the second-level subroutine.
[0109] The second artificial intelligence program comprises N levels of subroutines, where N is a positive integer. The first-level subroutine is the first subroutine in the N-level subroutines, and the Nth-level subroutine is the last subroutine in the N-level subroutines. The first-level target operation is determined by the first-level subroutine based on the target state, indicating that after the artificial intelligence object executes the first-level target operation, it can switch from the current state to the target state.
[0110] Optionally, the first-level subroutine has a variety of preset operations. Based on the target state, the first-level target operation of the artificial intelligence object can be determined from these preset operations. These preset operations can be pre-set by technicians or automatically set by the first-level subroutine.
[0111] In this embodiment, after receiving the target state, the first-level subroutine in the second artificial intelligence program determines the first-level target operation of the artificial intelligence object based on the target state, and issues the first-level target operation to the second-level subroutine. The second-level subroutine is used to determine the second-level target operation, and the second-level target operation is the operation required to implement the first-level target operation. That is, the second-level target operation is a sub-operation of the first-level target operation. After executing the second-level target operation, it is equivalent to executing the first-level target operation. For example, the first-level target operation is one operation, while the second-level target operations include multiple operations. After executing multiple second-level target operations, it is equivalent to executing the first-level target operation.
[0112] 305. The electronic device determines the target operation at level i based on the target operation at level i-1 received through the level i-1 subroutine.
[0113] Where i is an integer greater than 1 and not greater than N, the target operation of level i-1 is the target operation determined by the subroutine of level i-1, and the target operation of level i is the operation required to achieve the target operation of level i-1. The processing of the subroutine of level i is the same as that of the subroutine of level i.
[0114] Optionally, the i-th level subroutine has multiple preset operations. Based on the (i-1)-th level target operation, the i-th level target operation of the artificial intelligence object can be determined from these preset operations. The multiple preset operations set by the i-th level subroutine can be pre-set by technicians or automatically set by the i-th level subroutine.
[0115] In this embodiment, each subroutine from the second level to the Nth level receives a target operation from its parent subroutine, thereby determining the target operation of its current level to implement the parent subroutine's target operation. The current level target operation is then sent to the next level subroutine. This process of determining more specific target operations through layers of subroutines ensures that the final AI object executes the specific target operation. Optionally, the target operation determined by each subroutine level may include one or more.
[0116] It should be noted that different subroutines can be set with different preset operations, and the preset operations of lower-level subroutines can be used to implement the preset operations of higher-level subroutines.
[0117] Optionally, taking a second artificial intelligence program comprising first-level and second-level subroutines as an example, the various preset operations set by the first-level subroutines are relatively flexible and do not have a fixed execution order. However, the various preset operations set by the second-level subroutines are subject to an execution order constraint. Therefore, the first-level and second-level subroutines cooperate with each other, with a clear division of labor. This not only enables control of the artificial intelligence object but also avoids overly rigid target operations for the artificial intelligence object, ensuring the flexibility of the executed operations.
[0118] 306. After determining the target operation of level N through the level N subroutine, the electronic device controls the artificial intelligence object to execute the target operation of level N.
[0119] Among them, the Nth level subroutine is the last subroutine in the Nth level subroutine, and the Nth level target operation is the target operation finally determined by the entire second artificial intelligence program.
[0120] In this embodiment of the application, after the electronic device determines the Nth level target operation through the Nth level subroutine, it controls the artificial intelligence object to execute the Nth level target operation, so that the target state is reached after the artificial intelligence object executes the Nth level target operation.
[0121] Optionally, the target state is that the AI object's health points are higher than a preset value. The first-level subroutine determines the first-level target operation, which is to use one or more virtual items such as a medical kit, painkillers, or energy drinks to increase the AI object's health points above the preset value. The second-level subroutine determines the second-level target operation, which includes moving to the warehouse and using one or more virtual items such as a medical kit, painkillers, or energy drinks in the warehouse. The second-level target operation includes more specific execution details of the first-level target operation. The Nth-level subroutine determines the Nth-level target operation, which is the specific operation of how to get to the warehouse and how to use the virtual items. For example, it controls the AI object to move 100 meters in the first direction, then 50 meters in the second direction, and finally arrive at the warehouse to find the virtual items stored there and use them to increase its health points.
[0122] This application provides a scheme for controlling an artificial intelligence object, which enables interaction between different artificial intelligence programs to control the operation of the artificial intelligence object. First, a top-level first artificial intelligence program determines a high-level target state. For this target state, multi-level subroutines in a second artificial intelligence program make decisions layer by layer to determine the target operations that can achieve the target state. Finally, the artificial intelligence object is controlled to execute each target operation, eliminating the need for control through a single artificial intelligence program. This achieves a more comprehensive set of artificial intelligence programs and simplifies the complexity of individual artificial intelligence programs. Furthermore, the top-level first artificial intelligence program only makes state decisions, not operation decisions. Since the number of states is smaller than the number of operations, the diversity of operations of the artificial intelligence object can be avoided, preventing the artificial intelligence program from becoming difficult to implement.
[0123] Furthermore, the method provided in this application embodiment can select the target state with the highest parameter value from multiple preset states through a first artificial intelligence program located at the top layer, based on parameter values corresponding to multiple preset states. This ensures that the determined target state is the state that the artificial intelligence object is expected to reach, thus improving the rationality of the determined target state. Moreover, this method of selecting a state based on reference values simulates the human thought process, enhancing the naturalness and anthropomorphism of the decision-making result.
[0124] Based on the above embodiments, the first-level subroutine can determine the target operation by determining the execution cost. The following embodiments will specifically explain the process of the first-level subroutine determining the target operation. Figure 4 This is a flowchart of another artificial intelligence object control method provided in the embodiments of this application, such as... Figure 4 As shown, this method is performed by an electronic device. The method includes:
[0125] 401. In response to an operation request from an artificial intelligence object, the electronic device collects current status information. The operation request is used to request the determination of the target operation to be performed by the artificial intelligence object.
[0126] 402. The electronic device determines the target state of the artificial intelligence object based on the state information through the first artificial intelligence program, and sends the target state to the second artificial intelligence program.
[0127] Steps 401-402 are the same as steps 201-202, and will not be repeated here.
[0128] 403. The electronic device, through a first-level subroutine, determines at least two candidate operation sequences applicable to the target state based on the target state and configuration information, with each candidate operation sequence including at least one candidate operation.
[0129] The configuration information for the first-level subroutine includes various preset operations and corresponding operation information for each preset operation. The operation information includes execution preconditions, execution cost, and state impact information. Execution preconditions indicate that the preset operation can only be executed if the preconditions are met. Execution cost indicates the virtual cost incurred in executing the preset operation. State impact information indicates the impact of the preset operation on the state after execution. The execution cost of each preset operation can be set by technical personnel or by the first-level subroutine based on factors such as the execution time and processing resources required. Furthermore, state impact information can be represented numerically or hierarchically to reflect the degree of impact after the preset operation is executed. Alternatively, state impact information can include one or more dimensions, indicating that the execution of the preset operation will affect the state value of those one or more dimensions.
[0130] In this embodiment, the electronic device calls a first-level subroutine to determine at least two candidate operation sequences from a variety of preset operations based on the current state information and the target state. Each candidate operation sequence includes at least one candidate operation, indicating that after the artificial intelligence object executes each candidate operation in a candidate operation sequence, it can switch from the current state to the target state. Where a candidate operation sequence includes multiple candidate operations, these multiple candidate operations are arranged sequentially. Furthermore, the candidate operation sequence needs to be determined based on the execution preconditions and state impact information of each preset operation. This ensures that the execution preconditions of each candidate operation are met before execution, and that the impact on the state after execution of each candidate operation does not prevent subsequent candidate operations from being executed, thus guaranteeing the successful execution of the candidate operation sequence.
[0131] 404. The electronic device determines the execution cost of each candidate operation sequence through the first-level subroutine.
[0132] Each candidate operation in the candidate operation sequence includes an execution cost value. The execution cost value of the candidate operation sequence can be determined based on the execution cost value of each candidate operation. This execution cost value represents the size of the virtual cost required to execute the candidate operation sequence.
[0133] Optionally, the electronic device determines the execution cost of the candidate operation sequence by using a first-level subroutine to sum or average the execution costs of each candidate operation in the candidate operation sequence.
[0134] 405. Electronic devices, through first-level subroutines, determine the candidate operation in the candidate operation sequence with the lowest execution cost as the first-level target operation.
[0135] The electronic device calls the first-level subroutine, determines the execution cost of each candidate operation sequence, and then identifies the candidate operation in the candidate operation sequence with the lowest execution cost as the first-level target operation.
[0136] The sequence of candidate operations with the lowest cost is the first-level target operation sequence, and the candidate operations in the sequence of candidate operations with the lowest cost are the first-level target operations.
[0137] When the candidate operation sequence with the minimum execution cost includes multiple candidate operations arranged in order, all of these multiple candidate operations are first-level target operations, that is, multiple first-level target operations arranged in order are determined.
[0138] The embodiments of this application can determine the first-level target operation with the lowest execution cost, thereby reducing the virtual cost of executing the first target operation.
[0139] like Figure 5 As shown, the first-level subroutine is GOAP (Goal-Oriented Action Planning) as an example. The configuration information of GOAP includes a variety of preset operations and the corresponding operation information for each preset operation. The operation information includes execution prerequisites, execution cost, and state impact information. GOAP determines the first-level target operation based on the current state information and the target state, combined with the various preset operations in the configuration information.
[0140] 406. Electronic devices send first-level target operations to second-level subroutines through first-level subroutines.
[0141] After the electronic device determines the first-level target operation through the first-level subroutine, it sends the first-level target operation to the second-level subroutine. The second-level subroutine is used to determine the second-level target operation, and the second-level target operation is the operation required to achieve the first-level target operation. That is, after the artificial intelligence object executes the second-level target operation determined by the second-level subroutine, it is equivalent to executing the first-level target operation.
[0142] 407. The electronic device determines the target operation at level i based on the target operation at level i-1 received through the level i-1 subroutine.
[0143] 408. After determining the target operation of level N through the level N subroutine, the electronic device controls the artificial intelligence object to execute the target operation of level N.
[0144] Steps 407-408 are similar to steps 305-306, and will not be repeated here.
[0145] This application provides a scheme for controlling an artificial intelligence object, which enables interaction between different artificial intelligence programs to control the operation of the artificial intelligence object. First, a top-level first artificial intelligence program determines a high-level target state. For this target state, multi-level subroutines in a second artificial intelligence program make decisions layer by layer to determine the target operations that can achieve the target state. Finally, the artificial intelligence object is controlled to execute each target operation, eliminating the need for control through a single artificial intelligence program. This achieves a more comprehensive set of artificial intelligence programs and simplifies the complexity of individual artificial intelligence programs. Furthermore, the top-level first artificial intelligence program only makes state decisions, not operation decisions. Since the number of states is smaller than the number of operations, the diversity of operations of the artificial intelligence object can be avoided, preventing the artificial intelligence program from becoming difficult to implement.
[0146] Furthermore, the method provided in this application embodiment can determine the first-level target operation with the lowest execution cost, thereby reducing the virtual cost of executing the first target operation.
[0147] Furthermore, the method provided in this application embodiment can determine the sequence of candidate operations based on the execution preconditions and state impact information of each preset operation, without randomly combining candidate operations. This ensures that the execution preconditions of each candidate operation are met before execution, and that the impact on the state after execution of each candidate operation does not prevent subsequent candidate operations from being executed.
[0148] Based on the above embodiments, considering that there can be multiple target operations for an artificial intelligence object, and that in the case of multiple target operations, it is necessary to control the artificial intelligence object to execute each target operation in sequence, the following embodiments will describe the specific process of controlling the artificial intelligence object.
[0149] Figure 6 This is a flowchart of another artificial intelligence object control method provided in the embodiments of this application, such as... Figure 6 As shown, this method is performed by an electronic device. The method includes:
[0150] 601. Electronic devices respond to operation requests from artificial intelligence objects and collect current status information.
[0151] 602. The electronic device determines the target state of the artificial intelligence object based on the state information through the first artificial intelligence program, and sends the target state to the second artificial intelligence program.
[0152] Steps 601-602 are the same as steps 401-402, and will not be repeated here.
[0153] 603. The electronic device determines multiple Nth-level target operations of the artificial intelligence object based on the target state through the first-level subroutines to the Nth-level subroutines, and controls the artificial intelligence object to execute the first Nth-level target operation.
[0154] In this embodiment of the application, the electronic device determines multiple Nth level target operations through the first level subroutines to the Nth level subroutines in the second artificial intelligence program. The multiple Nth level target operations are arranged in order. For example, the first Nth level target operation is executed first, and then the second Nth level target operation is executed. The artificial intelligence object will switch from the current state to the target state only after executing the above multiple Nth level target operations in order.
[0155] Optionally, the electronic device also runs a control program for controlling the artificial intelligence object. The Nth-level subroutine determines multiple Nth-level target operations, sends the first Nth-level target operation to the control program, and the control program receives the first Nth-level target operation and controls the artificial intelligence object to execute the first Nth-level target operation.
[0156] 604. After the electronic device determines that the first level N target operation has been completed through the level N subroutine, it controls the artificial intelligence object to execute the second level N target operation, and so on, until the last level N target operation is completed. The execution result is then fed back to the level N-1 subroutine. The execution result indicates that the level N-1 target operations corresponding to multiple level N target operations have been completed.
[0157] Optionally, the electronic device also runs a control program for controlling the artificial intelligence object. After the control program controls the artificial intelligence object to execute the first level N target operation, it sends an execution result to the level N subroutine. This execution result indicates that the first level N target operation has been completed. Then, the level N subroutine sends a second level N target operation to the control program. Upon receiving the second level N target operation, the control program controls the artificial intelligence object to execute the second level N target operation. This process continues until the artificial intelligence object has completed the last level N target operation. Afterward, the level N subroutine feeds back the execution result to the (N-1)th subroutine.
[0158] Optionally, the electronic device feeds back the execution result to the (N-1)th level subroutine through the Nth level subroutine. The execution result indicates that multiple Nth level target operations have been completed, which means that the (N-1)th level target operations corresponding to the multiple Nth level target operations have been completed.
[0159] For the (N-1)th level subroutine, upon receiving the execution result, if it determines that the currently executed (N-1)th level target operation is the first and last (N-1)th level target operation, it reports the execution result back to the parent subroutine so that the parent subroutine can reissue the target operation. If it determines that the currently executed (N-1)th level target operation is not the first and last (N-1)th level target operation, it continues to issue the next (N-1)th level target operation to the Nth level subroutine.
[0160] This application provides a scheme for controlling an artificial intelligence object, which enables interaction between different artificial intelligence programs to control the operation of the artificial intelligence object. First, a top-level first artificial intelligence program determines a high-level target state. For this target state, multi-level subroutines in a second artificial intelligence program make decisions layer by layer to determine the target operations that can achieve the target state. Finally, the artificial intelligence object is controlled to execute each target operation, eliminating the need for control through a single artificial intelligence program. This achieves a more comprehensive set of artificial intelligence programs and simplifies the complexity of individual artificial intelligence programs. Furthermore, the top-level first artificial intelligence program only makes state decisions, not operation decisions. Since the number of states is smaller than the number of operations, the diversity of operations of the artificial intelligence object can be avoided, preventing the artificial intelligence program from becoming difficult to implement.
[0161] Furthermore, the method provided in this application embodiment can control an artificial intelligence object to execute multiple Nth-level target operations in sequence, thereby controlling the artificial intelligence object to switch from the current state to the target state, ensuring the stability and controllability of the controlled artificial intelligence object.
[0162] It should be noted that the above embodiment is only illustrated using the example of multiple Nth-level target operations. In another embodiment, each level of subroutine may determine multiple target operations, and then sequentially issue target operations to lower-level subroutines according to these multiple target operations. After receiving the execution result from the lower-level subroutine, the next target operation is then issued. The following will use the first-level subroutine and the i-th-level subroutine as examples for explanation.
[0163] First, the processing flow of the first-level subroutine includes:
[0164] (1) Send the first first-level target operation to the second-level subroutine through the first-level subroutine.
[0165] In this embodiment, the first-level subroutine determines multiple first-level target operations and sequentially sends them to the second-level subroutine according to the order of these operations. Therefore, the first-level subroutine first sends the first first-level target operation to the second-level subroutine. The second-level subroutine determines multiple second-level target operations that implement each first-level target operation.
[0166] (2) After the first first-level target operation is completed by the first-level subroutine, the second first-level target operation is sent to the second-level subroutine until the last first-level target operation is completed.
[0167] In this embodiment, after the first-level subroutine issues the first first-level target operation, the AI object is controlled to execute the Nth-level target operation corresponding to the first first-level target operation through the first-level subroutine to the Nth-level subroutine. This is equivalent to completing the execution of the first first-level target operation. At this time, the first-level subroutine receives an execution result indicating that the first first-level target operation has been completed, thereby determining that the first first-level target operation has been completed.
[0168] For example, a first-level objective operation corresponds to at least one second-level objective operation, and at least one second-level objective operation may also correspond to at least one third-level objective operation, and so on. A first-level objective operation corresponds to at least one Nth-level objective operation. The first first-level objective operation is considered complete when all Nth-level objective operations corresponding to the first first-level objective operation have been executed.
[0169] Then, the same steps can be repeated to issue the second first-level target operation to the second-level subroutine until the last first-level target operation is completed.
[0170] Secondly, when i is greater than 1 and less than N, the processing flow of the i-th level subroutine includes:
[0171] (1) The electronic device determines the target operation of level i based on the target operation of level i-1 received through the level i-1 subroutine.
[0172] There can be multiple target operations of level i. The target operation of level i is the operation required to achieve the target operation of level i-1. i is an integer greater than 1 and not greater than N.
[0173] In this embodiment of the application, the i-th level subroutine can determine the i-th level target operation based on the received i-1 level target operation. The i-1 level target operation is the target operation determined by the i-1 level subroutine, and the i-th level target operation is the operation to be performed to achieve the i-1 level target operation.
[0174] Optionally, the i-th level subroutine has a behavior tree. This behavior tree includes one or more behavior tree segments, each corresponding to an operation, indicating that a sub-operation for implementing that operation can be found based on that behavior tree segment. The electronic device then selects the behavior tree segment corresponding to the (i-1)-th level target operation from the behavior tree through the i-th level subroutine. This behavior tree segment is used to implement the (i-1)-th level target operation. Starting from the root node of the behavior tree segment, the electronic device searches according to the instructions of the control nodes in the behavior tree segment until it finds an operation located in a leaf node of the behavior tree segment. The found operation is then identified as the i-th level target operation.
[0175] The behavior tree segment includes a root node and leaf nodes. The root node is a node without a parent node, while the leaf nodes are nodes without child nodes. In this embodiment, the leaf nodes are configured with operations, such as movement or attack, which can be performed by the artificial intelligence object. The operations in different leaf nodes can be the same or different. Reaching a leaf node by traversing the behavior tree segment indicates that the operation in that leaf node has been found.
[0176] In a behavior tree segment, nodes other than the leaf node can serve as control nodes. Control nodes define the way nodes are selected, indicating that when traversing to the control node, the next-level node should be selected according to the control node's instructions.
[0177] Control nodes include sequential nodes and selection nodes. A sequential node means that its child nodes are executed in order, and the next sibling node is executed only after any child node returns a successful result. A selection node means that any one of its child nodes can be selected. The selection order can be from left to right, from right to left, or according to probability, and this application does not limit the specific order.
[0178] like Figure 7The behavior tree segment shown consists of control nodes in the first three layers, and leaf nodes in the fourth layer containing operations that the AI object can perform. When searching this behavior tree segment, the process starts from the root node at the top and follows the instructions of the control nodes. For example, if the first selection node in the second layer is found, a child node of that selection node is selected. If the first sequence node is selected, the operations in the leaf nodes under that sequence node are executed sequentially. First, a distance judgment is performed. If the distance between the AI object and the player is determined to be greater than a preset threshold, it is considered a distance, and the AI object is then controlled to move closer to the player. Similarly, if the second selection node in the second layer is found, and the second sequence node under that second selection node is selected, it is determined that the AI object has released a prerequisite skill, and the AI object is then controlled to release a subsequent skill.
[0179] (2) The electronic device sends the first target operation of level i to level i+1 through level i subroutine.
[0180] The electronic device determines multiple target operations at level i through a level i subroutine, and sequentially issues these target operations to the (i+1)th level subroutine. The (i+1)th level subroutine is used to determine the multiple (i+1)th level target operations corresponding to each level i target operation. Therefore, the electronic device first issues the first level i target operation to the (i+1)th level subroutine through the level i subroutine.
[0181] (3) After the electronic device determines the first i-th level target operation through the i-th level subroutine, it sends the second i-th level target operation to the i+1 level subroutine until the last i-th level target operation is determined to be completed. Then it sends the execution result back to the i-1 level subroutine. The execution result indicates that the i-1 level target operation has been completed.
[0182] In this embodiment, after the electronic device controls the artificial intelligence object to execute the first i-th level target operation, the i-th level subroutine receives the execution result indicating that the first i-th level target operation has been completed. After confirming the completion of the first i-th level target operation, it issues a second i-th level target operation to the (i+1)-th level subroutine. The (i+1)-th level subroutine determines multiple (i+1)-th level target operations to implement the second i-th level target operation. Thus, through subsequent subroutines, it controls the artificial intelligence object to execute the N-th level target operation corresponding to the second i-th level target operation. This process is repeated until the last i-th level target operation is completed. The execution result is then fed back to the (i-1)-th level subroutine, indicating that the (i-1)-th level target operations corresponding to the multiple completed i-th level target operations have been completed.
[0183] Furthermore, each subroutine not only needs to distribute the target operations to its subordinate subroutines, but also needs to report the execution results back to its superior subroutine after all target operations at this level have been executed. The following will use the first-level subroutine and the i-th-level subroutine as examples to illustrate this.
[0184] First, the feedback process for the first-level subroutine includes:
[0185] (1) The first-level subroutine receives the execution result fed back by the second-level subroutine. The execution result indicates that the second-level subroutine has completed the first-level target operation.
[0186] In this embodiment, a first-level subroutine determines multiple first-level target operations and sequentially sends them to a second-level subroutine. The second-level subroutine then determines multiple second-level target operations to implement each first-level target operation. After completing a first-level target operation, the second-level subroutine returns the execution result to the first-level subroutine, indicating that the second-level subroutine has now completed the execution of that first-level target operation.
[0187] (2) If there is a first-level target operation that has not yet been executed, issue the next first-level target operation that has not yet been executed to the second-level subroutine.
[0188] After receiving the execution result from the second-level subroutine, the first-level subroutine, if there are still unexecuted first-level target operations, will continue to send the next unexecuted first-level target operation to the second-level subroutine. After the first-level subroutine sends the operation to the second-level subroutine, the second-level subroutine or more lower-level subroutines can send target operations down the hierarchy to control the artificial intelligence object.
[0189] (3) If there is no first-level target operation that has not yet been executed, the execution result is fed back to the first artificial intelligence program, which indicates that the artificial intelligence object has been controlled to reach the target state.
[0190] After receiving the execution result from the second-level subroutine, if there are no unexecuted first-level target operations, meaning that the first-level target operation currently being executed by the second-level subroutine is the last first-level target operation, then the first-level subroutine will send the execution result back to the first artificial intelligence program. This execution result indicates that the artificial intelligence object has been controlled to reach the target state.
[0191] Subsequently, the first AI program can also report the execution result to the higher-level program to await new operation instructions. Alternatively, the first AI program can perform another round of control on the AI object, redetermine the new target state, and repeat the processing flow of this embodiment.
[0192] Secondly, when i is greater than 1 and less than N, the feedback flow of the i-th level subroutine includes:
[0193] (1) Receive the execution result fed back by the (i+1) level subroutine through the (i-th level subroutine). The execution result indicates that the (i+1) level subroutine has completed the target operation of the (i-th level) level.
[0194] In this embodiment, after each subroutine completes all target operations at its level, it will report the execution result to the higher-level subroutine. Therefore, the i-th level subroutine can also receive the execution result reported by the (i+1)-th level subroutine, which indicates that the (i+1)-th level subroutine has completed the i-th level target operation.
[0195] (2) If there is an i-th level target operation that has not yet been executed, issue the next i-th level target operation that has not yet been executed to the (i+1)-th level subroutine.
[0196] After the i-th level subroutine receives the execution result from the (i+1)-th level subroutine, if there are still unexecuted i-th level target operations, it will continue to send the next unexecuted i-th level target operation to the (i+1)-th level subroutine. After the i-th level subroutine sends the operation to the (i+1)-th level subroutine, the (i+1)-th level subroutine or more lower-level subroutines can send the target operation down layer by layer to control the artificial intelligence object.
[0197] (3) If there is no unexecuted target operation of level i, the execution result is fed back to the (i-1) level subroutine. The execution result indicates that the target operation of level i has been completed by the (i-1) level subroutine.
[0198] After receiving the execution result from the (i+1)th level subroutine, if there are no unexecuted level i target operations (meaning the (i+1)th level subroutine has completed its last level i target operation), it sends an execution result to the (i-1)th level subroutine, indicating that the level i subroutine has completed its (i-1)th level target operation. The (i-1)th level subroutine will then perform the same operations as the level i subroutine.
[0199] Figure 8 This is a schematic diagram of a process for controlling an artificial intelligence object provided in an embodiment of this application. Figure 9 This is a schematic diagram of a procedure provided in an embodiment of this application. Figure 10 This is a schematic diagram illustrating an operation flow for controlling an artificial intelligence object, as provided in an embodiment of this application. Figures 8 to 10 As shown, the electronic device runs game applications and an artificial intelligence control system.
[0200] Among them, such as Figure 8As shown, the artificial intelligence object control system includes a first artificial intelligence program and a second artificial intelligence program, which are connected. The artificial intelligence object provides its current status information to the first artificial intelligence program. After the first artificial intelligence program determines the target status, it sends it to the second artificial intelligence program. After the second artificial intelligence program determines the target operation, it controls the artificial intelligence object to execute the target operation.
[0201] like Figure 9 As shown, taking the second artificial intelligence program, which includes two levels of subroutines, as an example, the programs involved in the artificial intelligence object control system include:
[0202] High-level decision-making, namely, utilizing AI (first artificial intelligence program);
[0203] The middle decision-making level, namely GOAP AI (first-level subroutine);
[0204] The lower decision-making level is behavior tree AI (second-level subroutines).
[0205] Among them, utility AI determines the target state, GOAP AI determines the first-level target operation based on the target state, and behavior tree AI determines the second-level target operation based on the first-level target operation.
[0206] The decision-making mechanism of utility AI, which calculates parameter values based on the target state, simulates the human thinking process. The decision results are relatively natural and human-like. However, a very precise algorithm must be designed for each operation. As the scale of operations that artificial intelligence objects can perform gradually expands, the design complexity and the difficulty of controlling artificial intelligence objects also increase exponentially.
[0207] GOAP AI's decision-making process is a process of finding the target state from the initial state. Compared with other decision-making methods, its output is a well-determined chain of operations, which is a sequence of ordered operations. Therefore, it can make relatively long-term and flexible operation decisions for the operation of artificial intelligence objects. However, GOAP AI's decision-making process only relies on the initial state and the target state, and the prerequisite state and the subsequent state of each operation. Therefore, it cannot restrict the order between the decided operations.
[0208] Behavior tree AI can make decisions based on a pre-configured behavior tree, remaining consistent with the configuration and offering high controllability. However, behavior tree AI tends to be somewhat rigid, and the difficulty and complexity of configuring behavior trees increases significantly when faced with requirements involving numerous operational branches.
[0209] The embodiments of this application combine the advantages of the above three procedures and avoid their disadvantages, thus achieving a complementary effect.
[0210] First, by using utility AI as the highest decision-making layer, making decisions only about goals rather than specific operations, we can absorb the advantages of its more natural and human-like decision results. At the same time, since the number of goals of artificial intelligence objects is much smaller than the number of operations, we can also avoid the disadvantage of utility AI being difficult to design and control when the scale is large.
[0211] Secondly, GOAP AI is used as a mid-level decision-making layer to decompose the target and output the operation sequence. Its long-term and flexible advantages can be fully preserved. As for its disadvantage that the order of the decision results is difficult to control completely, operations with flexible requirements and no need to strictly control the execution order can be kept at this layer, while operations without flexible requirements and needing to strictly control the execution order can be avoided through a lower-level behavior tree AI.
[0212] Finally, by using behavior tree AI as the bottom layer of decision-making, it can only handle decision-making needs for operations that do not require flexibility and only require strict control of the execution order. This fully utilizes its easy-to-control advantage. Furthermore, since there are two more flexible decision-making layers above behavior tree AI, the disadvantage of its rigid decision-making results is also avoided.
[0213] like Figure 10 As shown, the electronic device runs a game application and an artificial intelligence control system. The game application includes an AI object, a state collection interface, and an AI object control module. The AI object control system includes three AI programs, a system input interface, and a state collector.
[0214] The system input interface is used to receive operation requests sent by artificial intelligence objects in the game application, and the state collector is used to collect various state information in the game application through the state collection interface provided by the game application.
[0215] The specific operation process of the AI object control system for controlling AI objects in game applications is as follows:
[0216] 1. In the game application, the AI object calls the system input interface of the AI object control system to request the determination of the target operation to be performed by the AI object.
[0217] 2. The system input interface calls the state collector to obtain state information.
[0218] 3. The state collector collects various state information from the game application through the state collection interface provided in the game application, and stores the collected state information in the artificial intelligence object control system, waiting for further reading.
[0219] 4. After the status information is collected, the system input interface sends a request to the utility AI to request the utility AI to determine the target status of the artificial intelligence object.
[0220] 5. The utility AI determines the target state based on the collected state information and sends the target state to GOAPAI.
[0221] 6. GOAP AI determines the operation chain based on the target state. This operation chain includes multiple first-level target operations, which are then distributed to the behavior tree AI one by one.
[0222] 7. Behavior Tree AI is equipped with a behavior tree. Based on the behavior tree and the first-level target operation, the second-level target operation is determined and provided to the artificial intelligence object control module.
[0223] 8. The AI object control module controls the AI object to execute the target operation it receives.
[0224] 9. After the AI object completes its execution, the AI object control module sends the execution result back to the behavior tree AI.
[0225] 10. After the behavior tree AI determines that the second-level target operation has been executed, it reports the execution result to the GOAP AI, which then continues to issue the next first-level target operation until the last first-level target operation is completed. The process of the artificial intelligence object control system ends, and it waits for the next call of the artificial intelligence object in the game application.
[0226] Figure 11 This is a schematic diagram of the structure of an artificial intelligence object control device provided in an embodiment of this application. The device is configured in an electronic device, which runs a first artificial intelligence program and a second artificial intelligence program, such as... Figure 11 As shown, the device includes:
[0227] The acquisition module 1101 is used to collect current status information in response to the operation request of the artificial intelligence object. The operation request is used to request the determination of the target operation to be performed by the artificial intelligence object.
[0228] The target state determination module 1102 is used to determine the target state of the artificial intelligence object based on state information through the first artificial intelligence program, and send the target state to the second artificial intelligence program.
[0229] The target operation determination module 1103 is used to determine the target operation based on the target state through a second artificial intelligence program, and to control the artificial intelligence object to execute the target operation;
[0230] Here, the target state is the state that the artificial intelligence object needs to reach, and the target operation is the operation that the artificial intelligence object needs to perform to switch from the current state to the target state.
[0231] Optionally, the second artificial intelligence program includes N levels of subroutines, where N is a positive integer; the target operation determination module 1103 includes:
[0232] The determination unit is used to determine the first-level target operation of the artificial intelligence object based on the target state through the first-level subroutine, and to issue the first-level target operation to the second-level subroutine.
[0233] The determining unit is also used to determine the i-th level target operation based on the received (i-1)-th level target operation through the i-th level subroutine, where the i-th level target operation is the operation required to implement the (i-1)-th level target operation, and i is an integer greater than 1 and not greater than N;
[0234] The control unit is used to control the artificial intelligence object to execute the Nth level target operation after the determining unit determines the Nth level target operation through the Nth level subroutine.
[0235] Optionally, the determining unit is used for:
[0236] The first-level target operation is issued to the second-level subroutine through the first-level subroutine;
[0237] Once the first level-one target operation is completed, the second level-one target operation is sent to the second level-one subroutine, and so on, until the last level-one target operation is completed.
[0238] Optionally, the control unit is used for:
[0239] After determining multiple Nth-level target operations through the Nth-level subroutine, control the artificial intelligence object to execute the first Nth-level target operation;
[0240] After the first Nth-level target operation is completed by the Nth-level subroutine, the AI object is controlled to execute the second Nth-level target operation, and so on, until the last Nth-level target operation is completed. The execution result is then fed back to the N-1th-level subroutine, indicating that the N-1th-level target operations corresponding to multiple Nth-level target operations have been completed.
[0241] Optionally, the determining unit is also used for:
[0242] The first target operation of level i is issued to the (i+1)th level subroutine through the level i-th subroutine.
[0243] After the first target operation of level i is completed by the level i subroutine, the second target operation of level i is issued to the level i+1 subroutine, and so on, until the last target operation of level i is completed. Then, the execution result is fed back to the level i-1 subroutine, and the execution result indicates that the target operation of level i-1 has been completed.
[0244] Optionally, the configuration information of the first-level subroutine includes multiple preset operations and corresponding operation information for each preset operation. The operation information includes execution preconditions, execution cost, and state impact information. The execution cost represents the virtual cost required to execute the preset operation, and the state impact information represents the impact of the preset operation on the state after execution. The determining unit is used for:
[0245] Using the first-level subroutine, based on the target state and configuration information, at least two candidate operation sequences applicable to the target state are determined, and each candidate operation sequence includes at least one candidate operation.
[0246] Determine the execution cost of each candidate operation sequence;
[0247] The candidate operations in the sequence of candidate operations with the lowest execution cost are identified as the first-level target operations.
[0248] Optionally, the i-th level subroutine is configured with a behavior tree; the determination unit is used for:
[0249] The behavior tree segment corresponding to the target operation at level i-1 is selected from the behavior tree through the i-1 level subroutine. The behavior tree segment is used to implement the target operation at level i-1.
[0250] Starting from the root node of the behavior tree segment, search according to the instructions of the control nodes in the behavior tree segment until the operation located in the leaf node of the behavior tree segment is found, and the found operation is identified as the i-th level target operation.
[0251] Optionally, the target state determination module 1102 includes:
[0252] The parameter value determination unit is used to determine the parameter values corresponding to various preset states based on state information through a first artificial intelligence program. The parameter values represent the degree of matching between the preset states and the state information.
[0253] The target state determination unit is used to select a target state from multiple preset states based on parameter values corresponding to multiple preset states.
[0254] Optionally, the association function of the preset state is a function consisting of the parameter value of the preset state and at least one target state value in the state information; the parameter value determination unit is used for:
[0255] The first artificial intelligence program uses the association function of each preset state to process at least one target state value associated with each preset state to obtain the parameter value of each preset state.
[0256] This application provides a device for controlling an artificial intelligence object, which enables interaction between different artificial intelligence programs to control the operation of the artificial intelligence object without requiring control through a single artificial intelligence program. This achieves a more comprehensive set of artificial intelligence programs and simplifies the complexity of each program. Furthermore, the first artificial intelligence program at the upper level only makes state decisions and does not need to make operation decisions. Since the number of states is smaller than the number of operations, the difficulty in implementing the artificial intelligence program due to the diversity of operations of the artificial intelligence object can be avoided.
[0257] It should be noted that the artificial intelligence object control device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above. In addition, the artificial intelligence object control device and the artificial intelligence object control method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0258] This application also provides an electronic device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the electronic device in the artificial intelligence object control method of the above embodiments.
[0259] Figure 12 A schematic diagram of the structure of an electronic device 1200 provided in an exemplary embodiment of this application is shown.
[0260] The electronic device 1200 includes a processor 1201 and a memory 1202.
[0261] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor for handling computational operations related to machine learning.
[0262] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 are used to store at least one computer program, which is used by the processor 1201 to implement the artificial intelligence object control method provided in the method embodiments of this application.
[0263] In some embodiments, the electronic device 1200 may also optionally include: a peripheral device interface 1203 and at least one peripheral device. The processor 1201, memory 1202, and peripheral device interface 1203 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1203 via a bus, signal line, or circuit board. Optionally, the peripheral device includes at least one of: a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, and an audio circuit 1207.
[0264] Peripheral interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1201 and memory 1202. In some embodiments, processor 1201, memory 1202 and peripheral interface 1203 are integrated on the same chip or circuit board.
[0265] The radio frequency (RF) circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1204 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
[0266] Display screen 1205 is used to display a user interface (UI). This UI may include graphics, text, icons, video, and any combination thereof. When display screen 1205 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1201 for processing. In this case, display screen 1205 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard.
[0267] The camera assembly 1206 is used to capture images or videos. Optionally, the camera assembly 1206 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the electronic device 1200, and the rear-facing camera is disposed on the back of the electronic device 1200. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions.
[0268] The audio circuit 1207 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to realize voice communication.
[0269] In some embodiments, the electronic device 1200 further includes one or more sensors 1208. The one or more sensors 1208 include, but are not limited to: an acceleration sensor 1209, a gyroscope sensor 1210, a pressure sensor 1211, an optical sensor 1212, and a proximity sensor 1213.
[0270] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on the electronic device 1200, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0271] This application also provides a server, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the artificial intelligence object control method of the above embodiments.
[0272] Optionally, Figure 13This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1300 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1301 and one or more memories 1302. The memories 1302 store at least one computer program, which is loaded and executed by the processor 1301 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0273] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the operations performed by the artificial intelligence object control method of the above embodiments.
[0274] This application also provides a computer program product, including a computer program loaded and executed by a processor to perform operations as described in the artificial intelligence object control method of the above embodiments.
[0275] In some embodiments, the computer program involved in the present application embodiments may be deployed and executed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network may constitute a blockchain system.
[0276] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0277] The above are merely optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.
Claims
1. A method for controlling an artificial intelligence object, characterized in that, The method is applied to an electronic device running a first artificial intelligence program and a second artificial intelligence program, the second artificial intelligence program comprising N levels of subroutines, where N is a positive integer; the method includes: In response to an operation request from an AI object, current status information is collected, wherein the operation request is used to request determination of the target operation to be performed by the AI object; The first artificial intelligence program determines the target state of the artificial intelligence object based on the state information and sends the target state to the second artificial intelligence program. The first-level target operation of the artificial intelligence object is determined based on the target state through the first-level subroutine in the N-level subroutine, and the first-level target operation is issued to the second-level subroutine in the N-level subroutine. The i-th level subroutine in the N-level subroutine determines the i-th level target operation based on the received (i-1)-th level target operation, and the i-th level target operation is the operation required to implement the (i-1)-th level target operation, where i is an integer greater than 1 and not greater than N; After determining the Nth level target operation through the Nth level subroutine in the Nth level subroutine, control the artificial intelligence object to execute the Nth level target operation; Wherein, the target state is the state that the artificial intelligence object needs to reach, and the Nth level target operation is the operation that the artificial intelligence object needs to perform to switch from the current state to the target state.
2. The method according to claim 1, characterized in that, The step of issuing the first-level target operation to the second-level subroutine in the N-level subroutine includes: The first level target operation is issued to the second level subroutine through the first level subroutine; After the first-level target operation is completed, the first-level subroutine issues the second-level target operation to the second-level subroutine, and so on, until the last first-level target operation is completed.
3. The method according to claim 1, characterized in that, After determining the Nth-level target operation through the Nth-level subroutine in the Nth-level subroutine, controlling the artificial intelligence object to execute the Nth-level target operation includes: After determining multiple Nth-level target operations through the Nth-level subroutine, the artificial intelligence object is controlled to execute the first Nth-level target operation; After the first Nth-level target operation is completed, the Nth-level subroutine controls the artificial intelligence object to execute the second Nth-level target operation, and so on, until the last Nth-level target operation is completed. The execution result is then fed back to the (N-1)th-level subroutine in the Nth-level subroutine, and the execution result indicates that the (N-1)th-level target operation corresponding to the multiple Nth-level target operations has been completed.
4. The method according to claim 1, characterized in that, When i is less than N, after determining the target operation of level i based on the received target operation of level i-1 through the level i-th subroutine in the N-level subroutine, the method further includes: The first target operation of level i is issued to the (i+1)th level subroutine in the N-level subroutine through the level i-level subroutine. After the first i-th level target operation is completed, the i-th level subroutine issues the second i-th level target operation to the (i+1)-th level subroutine, and so on, until the last i-th level target operation is completed. Then, the execution result is fed back to the (i-1)-th level subroutine in the N-level subroutine, and the execution result indicates that the (i-1)-th level target operation has been completed.
5. The method according to claim 1, characterized in that, The configuration information of the first-level subroutine includes a variety of preset operations and operation information corresponding to each preset operation. The operation information includes execution preconditions, execution cost, and state impact information. The execution cost represents the size of the virtual cost required to execute the preset operation, and the state impact information represents the impact of the preset operation on the state after execution. The step of determining the first-level target operation of the artificial intelligence object based on the target state through the first-level subroutine in the N-level subroutines includes: The first-level subroutine determines at least two candidate operation sequences applicable to the target state based on the target state and the configuration information, with each candidate operation sequence including at least one candidate operation. Determine the execution cost of each candidate operation sequence; The candidate operation in the sequence of candidate operations with the lowest execution cost is determined as the first-level target operation.
6. The method according to claim 1, characterized in that, The i-th level subroutine is configured with a behavior tree; the step of determining the i-th level target operation based on the received (i-1)-th level target operation through the i-th level subroutine in the N-th level subroutine includes: The i-th level subroutine selects a behavior tree segment corresponding to the (i-1)-th level target operation from the behavior tree, and the behavior tree segment is used to implement the (i-1)-th level target operation. Starting from the root node of the behavior tree segment, the search continues according to the instructions of the control nodes in the behavior tree segment until an operation located in a leaf node of the behavior tree segment is found. The found operation is then identified as the i-th level target operation.
7. The method according to claim 1, characterized in that, The step of determining the target state of the artificial intelligence object based on the state information through the first artificial intelligence program includes: The first artificial intelligence program determines parameter values corresponding to multiple preset states based on the state information, and the parameter values represent the degree of matching between the preset states and the state information. Based on the parameter values corresponding to the various preset states, the target state is selected from the various preset states.
8. The method according to claim 7, characterized in that, The association function of the preset state is: a function composed of the parameter value of the preset state and at least one target state value in the state information; The step of determining parameter values corresponding to multiple preset states based on the state information through the first artificial intelligence program includes: The first artificial intelligence program processes at least one target state value associated with each preset state using the association function of each preset state to obtain the parameter value of each preset state.
9. An artificial intelligence object control device, characterized in that, The device is configured in an electronic device, the electronic device running a first artificial intelligence program and a second artificial intelligence program, the second artificial intelligence program including N levels of subroutines, where N is a positive integer; the device includes: The data acquisition module is used to collect current status information in response to the operation request of the artificial intelligence object. The operation request is used to request the determination of the target operation to be performed by the artificial intelligence object. The target state determination module is used to determine the target state of the artificial intelligence object based on the state information through the first artificial intelligence program, and send the target state to the second artificial intelligence program; The target operation determination module includes: a determination unit and a control unit; The determining unit is configured to determine the first-level target operation of the artificial intelligence object based on the target state through the first-level subroutine in the N-level subroutine, and issue the first-level target operation to the second-level subroutine in the N-level subroutine. The determining unit is further configured to determine the i-th level target operation based on the received (i-1)-th level target operation through the i-th level subroutine in the N-level subroutine, and the i-th level target operation is the operation required to implement the (i-1)-th level target operation, where i is an integer greater than 1 and not greater than N; The control unit is configured to control the artificial intelligence object to execute the Nth level target operation after determining the Nth level target operation through the Nth level subroutine in the Nth level subroutine; Wherein, the target state is the state that the artificial intelligence object needs to reach, and the Nth level target operation is the operation that the artificial intelligence object needs to perform to switch from the current state to the target state.
10. The apparatus according to claim 9, characterized in that, The determining unit is used for: The first level target operation is issued to the second level subroutine through the first level subroutine; After the first-level target operation is completed, the first-level subroutine issues the second-level target operation to the second-level subroutine, and so on, until the last first-level target operation is completed.
11. The apparatus according to claim 9, characterized in that, The control unit is used for: After determining multiple Nth-level target operations through the Nth-level subroutine, the artificial intelligence object is controlled to execute the first Nth-level target operation; After the first Nth-level target operation is completed, the Nth-level subroutine controls the artificial intelligence object to execute the second Nth-level target operation, and so on, until the last Nth-level target operation is completed. The execution result is then fed back to the (N-1)th-level subroutine in the Nth-level subroutine, and the execution result indicates that the (N-1)th-level target operation corresponding to the multiple Nth-level target operations has been completed.
12. The apparatus according to claim 9, characterized in that, When i is less than N, the determining unit is further configured to: The first target operation of level i is issued to the (i+1)th level subroutine in the N-level subroutine through the level i-level subroutine. After the first i-th level target operation is completed, the i-th level subroutine issues the second i-th level target operation to the (i+1)-th level subroutine, and so on, until the last i-th level target operation is completed. Then, the execution result is fed back to the (i-1)-th level subroutine in the N-level subroutine, and the execution result indicates that the (i-1)-th level target operation has been completed.
13. The apparatus according to claim 9, characterized in that, The configuration information of the first-level subroutine includes a variety of preset operations and operation information corresponding to each preset operation. The operation information includes execution preconditions, execution cost, and state impact information. The execution cost represents the size of the virtual cost required to execute the preset operation, and the state impact information represents the impact of the preset operation on the state after execution. The determining unit is used for: The first-level subroutine determines at least two candidate operation sequences applicable to the target state based on the target state and the configuration information, with each candidate operation sequence including at least one candidate operation. Determine the execution cost of each candidate operation sequence; The candidate operation in the sequence of candidate operations with the lowest execution cost is determined as the first-level target operation.
14. The apparatus according to claim 9, characterized in that, The i-th level subroutine is configured with a behavior tree; the determining unit is used for: The i-th level subroutine selects a behavior tree segment corresponding to the (i-1)-th level target operation from the behavior tree, and the behavior tree segment is used to implement the (i-1)-th level target operation. Starting from the root node of the behavior tree segment, the search continues according to the instructions of the control nodes in the behavior tree segment until an operation located in a leaf node of the behavior tree segment is found. The found operation is then identified as the i-th level target operation.
15. The apparatus according to claim 9, characterized in that, The target state determination module includes: The parameter value determination unit is used to determine parameter values corresponding to multiple preset states based on the state information through the first artificial intelligence program, wherein the parameter values represent the degree of matching between the preset states and the state information. The target state determination unit is used to select the target state from the multiple preset states based on the parameter values corresponding to the multiple preset states.
16. The apparatus according to claim 15, characterized in that, The association function of the preset state is: a function composed of the parameter value of the preset state and at least one target state value in the state information; The parameter value determination unit is used for: The first artificial intelligence program processes at least one target state value associated with each preset state using the association function of each preset state to obtain the parameter value of each preset state.
17. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations performed by the artificial intelligence object control method as described in any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the artificial intelligence object control method as described in any one of claims 1 to 8.
19. A computer program product, comprising a computer program, characterized in that, The computer program is loaded and executed by a processor to perform the operations performed by the artificial intelligence object control method as described in any one of claims 1 to 8.