A method and device for realizing simulation model behavior based on behavior tree
Through the behavior implementation method of simulation model based on behavior tree, the target simulation model behavior information is dynamically generated, which solves the problem that the simulation model behavior is difficult to change in the existing technology, improves the ease of use and scalability of the model, and adapts to the simulation needs in different dynamic scenarios.
Patent Information
- Application Number
- CN202411123536.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Existing military simulation models are difficult to dynamically change model behavior, resulting in insufficient ease of use and scalability of the model, and it is difficult to adapt to simulation in different dynamic scenarios.
The behavioral implementation method of simulation model based on behavior tree is adopted. By obtaining the simulation model information and behavior tree information set, the simulation model task information is analyzed and processed, and the target simulation model behavior information is fused with the behavior tree information to dynamically generate the target simulation model behavior information.
It improves the ability of the simulation platform to dynamically change the model behavior through different simulation model information, enhances the ease of use and scalability of the model, and can more flexibly adapt to simulation needs in different scenarios.
Smart Images

Figure CN119106544B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation models, and in particular to a method and device for realizing simulation model behavior based on a behavior tree. Background Art
[0002] In recent years, with the development of system simulation technology in the military field, a series of simulation model frameworks have been produced according to different simulation needs. At present, the simulation platform in the field of military simulation mainly solves the interaction problem between models, and does not pay attention to the behavior of the model itself. After the model is written, the implementation functions of its functions are fixed, and the order of calling the functions is also fixed. When the simulation system is running, the simulation platform calls the model functions in a predetermined logical order, which makes it difficult to change the model behavior after the simulation system is built. If the simulation object changes, the source code of the model needs to be modified, which is very inefficient. In addition, this method is difficult to adapt to simulations in different dynamic scenarios. When simulating in different scenarios, only the model input parameters can be changed, and the model workflow and behavior cannot be changed, resulting in the consistency of each running result. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method and device for realizing simulation model behavior based on behavior tree, which is beneficial to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0004] In order to solve the above technical problems, a first aspect of an embodiment of the present invention discloses a method for realizing a simulation model behavior based on a behavior tree, the method comprising:
[0005] S1, obtaining simulation model information and a behavior tree information set; the behavior tree information set includes a plurality of behavior tree information; the behavior tree information includes root node information, state node information and leaf node information;
[0006] S2, analyzing and processing the simulation model information to obtain simulation model task information; the simulation model task information includes simulation model task basic information and simulation model task behavior information; the simulation model task behavior information includes a plurality of simulation model task behavior vectors;
[0007] S3, fusing the simulation model task information and the behavior tree information set to obtain target simulation model behavior information; the target simulation model behavior information includes target simulation model behavior initial information and target simulation model behavior execution information.
[0008] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the analyzing and processing the simulation model information to obtain the simulation model task information includes:
[0009] S21, preprocessing the simulation model information to obtain preprocessed simulation model information;
[0010] S22, segmenting the preprocessing simulation model information to obtain preprocessing simulation model task basic information and preprocessing simulation model task behavior information;
[0011] S23, extracting the preprocessed simulation model task basic information to obtain the simulation model task basic information;
[0012] S24, performing an extraction operation on the pre-processed simulation model task behavior information to obtain the simulation model task behavior information.
[0013] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the fusion processing of the simulation model task information and the behavior tree information set to obtain the target simulation model behavior information includes:
[0014] S31, fusing the simulation model task basic information and the behavior tree information set to obtain target behavior tree information;
[0015] S32, determining target simulation model behavior initial information based on the target behavior tree information;
[0016] S33, analyzing and processing the simulation model task behavior information and the target behavior tree information to obtain target simulation model behavior execution information.
[0017] As an optional implementation, in the first aspect of the embodiment of the present invention, the fusing the simulation model task basic information and the behavior tree information set to obtain the target behavior tree information includes:
[0018] S311, calculating and processing the simulation model task basic information and the behavior tree information set to obtain simulation model task similarity information;
[0019] S312, determining target behavior tree information based on the simulation model task similarity information; the target behavior tree information is the behavior tree information corresponding to the simulation model task similarity value with the highest numerical value in the simulation model task similarity information.
[0020] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the analyzing and processing the simulation model task behavior information and the target behavior tree information to obtain the target simulation model behavior execution information includes:
[0021] S331, performing feature analysis processing on the simulation model task behavior information and the state node information in the target behavior tree information to obtain first simulation model behavior state information;
[0022] S332, analyzing and processing the simulation model task behavior information and the first simulation model behavior state information to obtain second simulation model behavior state information;
[0023] S333, fusing the simulation model task behavior information and the second simulation model behavior state information to obtain target simulation model behavior state information;
[0024] S334, analyzing and processing the target simulation model behavior state information to obtain target simulation model behavior execution information.
[0025] As an optional implementation, in the first aspect of the embodiment of the present invention, the feature analysis processing of the simulation model task behavior information and the state node information in the target behavior tree information to obtain the first simulation model behavior state information includes:
[0026] S3311, extracting features from the state node information in the target behavior tree information to obtain state node feature vector information;
[0027] S3312, using the first simulation model behavior calculation model, calculating and processing the simulation model task behavior information and the state node feature vector information to obtain a target behavior tree metric matrix;
[0028] Wherein, the first simulation model behavior calculation model is:
[0029]
[0030] Where DL is the target behavior tree metric matrix, DL(FZ i1 ,XW i2 ) is the metric value of the i1th row and i2th column in the metric matrix of the target behavior tree, FZ i1 is the i1th simulation model task behavior vector in the simulation model task behavior information, XW i2is the i2th state node feature vector in the state node feature vector information, M and N respectively represent the number of the simulation model task behavior vectors in the simulation model task behavior information and the number of the state node feature vectors in the state node feature vector information, || represents the modulus of the vector, · represents the vector inner product, and α1 is the first weight parameter;
[0031] S3313, preset a first screening value; the first screening value is a positive integer;
[0032] S3314: Fusing the target behavior tree information, the target behavior tree metric matrix, and the first screening value to obtain first simulation model behavior state information.
[0033] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the analyzing and processing the target simulation model behavior state information to obtain the target simulation model behavior execution information includes:
[0034] S3341, judging whether any state node information in the target simulation model behavior state information is consistent with preset simulation model task state information, and obtaining a behavior state judgment result;
[0035] When the behavior state judgment result is yes, all leaf node information in the state node information is added to the simulation model behavior execution information, and S3347 is executed;
[0036] When the behavior status judgment result is no, executing S3342;
[0037] S3342, obtaining the node weight values corresponding to all the leaf node information in the state node information;
[0038] S3343, performing size determination processing on the node weight values corresponding to all the leaf node information in the state node information to obtain a maximum node weight value and a minimum node weight value;
[0039] S3344, randomly generating a node weight threshold within the range of the minimum node weight value and the maximum node weight value;
[0040] S3345 performs judgment processing on the node weight values corresponding to all leaf node information in the state node information and the node weight threshold to obtain a target node weight value; the target node weight value is the node weight value closest to the node weight threshold;
[0041] S3346, adding the leaf node information corresponding to the target node weight value to the simulation model behavior execution information;
[0042] S3347, determining that the simulation model behavior execution information is the target simulation model behavior execution information.
[0043] A second aspect of an embodiment of the present invention discloses a device for realizing a behavior of a simulation model based on a behavior tree, wherein the device comprises:
[0044] An acquisition module, used to acquire simulation model information and a behavior tree information set; the behavior tree information set includes a plurality of behavior tree information; the behavior tree information includes root node information, state node information and leaf node information;
[0045] A first calculation module is used to analyze and process the simulation model information to obtain simulation model task information; the simulation model task information includes simulation model task basic information and simulation model task behavior information; the simulation model task behavior information includes a plurality of simulation model task behavior vectors;
[0046] The second calculation module is used to fuse the simulation model task information and the behavior tree information set to obtain target simulation model behavior information; the target simulation model behavior information includes target simulation model behavior initial information and target simulation model behavior execution information.
[0047] A third aspect of an embodiment of the present invention discloses another device for realizing a behavior of a simulation model based on a behavior tree, wherein the device comprises:
[0048] processor;
[0049] a memory coupled to the processor and storing executable program code;
[0050] The processor calls the executable program code stored in the memory to execute part or all of the steps of the method for realizing the behavior of a simulation model based on a behavior tree disclosed in the first aspect of an embodiment of the present invention.
[0051] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the computer instructions are called, they are used to execute part or all of the steps of the behavior tree-based simulation model behavior implementation method disclosed in the first aspect of the embodiment of the present invention.
[0052] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0053] In an embodiment of the present invention, simulation model information and a behavior tree information set are obtained; the behavior tree information set includes a number of behavior tree information; the behavior tree information includes root node information, state node information and leaf node information; the simulation model information is analyzed and processed to obtain simulation model task information; the simulation model task information includes simulation model task basic information and simulation model task behavior information; the simulation model task behavior information includes a number of simulation model task behavior vectors; the simulation model task information and the behavior tree information set are fused to obtain target simulation model behavior information; the target simulation model behavior information includes target simulation model behavior initial information and target simulation model behavior execution information. It can be seen that the present application is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the ease of use and scalability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0055] Figure 1 A flow chart of a method for realizing a simulation model behavior based on a behavior tree disclosed in an embodiment of the present invention;
[0056] Figure 2 A schematic diagram of the structure of a device for realizing a behavior of a simulation model based on a behavior tree disclosed in an embodiment of the present invention;
[0057] Figure 3 The present invention is a schematic diagram of the structure of another device for realizing the behavior of a simulation model based on a behavior tree according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.
[0060] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0061] The present invention discloses a method and device for realizing simulation model behavior based on behavior tree, which is beneficial to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model. The following are detailed descriptions.
[0062] Embodiment 1
[0063] See also Figure 1 , Figure 1 : is a flow chart of a method for implementing a behavior tree-based simulation model behavior disclosed in an embodiment of the present invention. Figure 1 The described method for implementing the behavior of a simulation model based on a behavior tree is applied to a device for implementing the behavior of a simulation model based on a behavior tree, such as a local server or a cloud server for optimizing the management of the behavior of a simulation model based on a behavior tree, and the embodiments of the present invention do not limit this. Figure 1 As shown, the simulation model behavior implementation method based on the behavior tree may include the following operations:
[0064] S1, obtaining simulation model information and a behavior tree information set; the behavior tree information set includes a plurality of behavior tree information; the behavior tree information includes root node information, state node information and leaf node information;
[0065] It should be noted that the simulation model information is the information description of the simulation model to be executed. Different simulation model information corresponds to different behavior descriptions of simulation models or different behavior descriptions of the same simulation model. The information description of the simulation model to be executed includes the simulation model name information and several behavior descriptions of the simulation model to be executed in sequence.
[0066] It should be noted that the behavior tree information set includes all executable behavior information in each simulation model, wherein the behavior tree information describes all executable behavior information of a specific simulation model; the behavior tree information includes 1 root node information, the root node information corresponds to a number of state node information, each state node information corresponds to a number of leaf node information, the root node information includes the initial information when the simulation model is executed, such as parameter initialization information, etc.; the state node information is used to describe the leaf node information corresponding to the state node information, such as whether the corresponding leaf node information is executed in sequence or a certain leaf node information of the corresponding leaf node information is executed randomly; each leaf node information includes the execution information of the simulation model behavior.
[0067] S2, analyzing and processing the simulation model information to obtain simulation model task information; the simulation model task information includes simulation model task basic information and simulation model task behavior information; the simulation model task behavior information includes a plurality of simulation model task behavior vectors;
[0068] S3, fusing the simulation model task information and the behavior tree information set to obtain target simulation model behavior information; the target simulation model behavior information includes target simulation model behavior initial information and target simulation model behavior execution information.
[0069] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0070] In an optional embodiment, the analyzing and processing the simulation model information to obtain the simulation model task information includes:
[0071] S21, preprocessing the simulation model information to obtain preprocessed simulation model information;
[0072] It should be noted that the above preprocessing includes removing redundant spaces and punctuation marks.
[0073] S22, segmenting the preprocessing simulation model information to obtain preprocessing simulation model task basic information and preprocessing simulation model task behavior information;
[0074] It should be noted that the above-mentioned segmentation process is to distinguish the simulation model name information and the simulation model behavior information in the pre-processing simulation model information. For example, the pre-processing simulation model information is "Model Name: Robot Simulation Model Behavior 1: Moving Forward, Parameters: Speed = 1m / s, Time = 5s; Behavior 2: Turning, Parameters: Angle = 90 degrees, Direction = Right; Behavior 3: Stopping, Parameters: Time = 2s; Behavior 4: Grasping, Parameters: Object = Box; Behavior 5: Placing, Parameters: Position = Target Point". After the distinction, the obtained basic information of the pre-processing simulation model task is "Model Name: Robot Simulation Model", and the obtained pre-processing simulation model task behavior information is "Behavior 1: Moving Forward, Parameters: Speed = 1m / s, Time = 5s; Behavior 2: Turning, Parameters: Angle = 90 degrees, Direction = Right; Behavior 3: Stopping, Parameters: Time = 2s; Behavior 4: Grasping, Parameters: Object = Box; Behavior 5: Placing, Parameters: Position = Target Point".
[0075] It should be noted that the above segmentation process is performed by a segmentation tool set by the user, or by a general information segmentation tool, which is not specifically limited in the embodiment of the present invention.
[0076] S23, extracting the preprocessed simulation model task basic information to obtain the simulation model task basic information;
[0077] It should be noted that the above extraction operation is performed through the TF-IDF tool. For example, the basic information of the pre-processed simulation model task is "model name: robot simulation model", and the basic information of the simulation model task after extraction is "robot simulation model".
[0078] S24, performing an extraction operation on the pre-processed simulation model task behavior information to obtain the simulation model task behavior information.
[0079] It should be noted that the above extraction operation is performed through the bag-of-words model. For example, the pre-processed simulation model task behavior information is "Behavior 1: move forward, parameter: speed = 1m / s, time = 5s; Behavior 2: turn, parameter: angle = 90 degrees, direction = right; Behavior 3: stop, parameter: time = 2s; Behavior 4: grab, parameter: object = box; Behavior 5: place, parameter: position = target point". The obtained simulation model task behavior information includes 5 simulation model task behavior vectors, and the 5 simulation model task behavior vectors correspond to "Behavior 1: move forward, parameter: speed = 1m / s, time = 5s", "Behavior 2: turn, parameter: angle = 90 degrees, direction = right", "Behavior 3: stop, parameter: time = 2s", "Behavior 4: grab, parameter: object = box" and "Behavior 5: place, parameter: position = target point".
[0080] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0081] In another optional embodiment, the step of fusing the simulation model task information and the behavior tree information set to obtain the target simulation model behavior information includes:
[0082] S31, fusing the simulation model task basic information and the behavior tree information set to obtain target behavior tree information;
[0083] S32, determining target simulation model behavior initial information based on the target behavior tree information;
[0084] It should be noted that the target simulation model behavior initial information is the root node information in the target behavior tree information;
[0085] S33, analyzing and processing the simulation model task behavior information and the target behavior tree information to obtain target simulation model behavior execution information.
[0086] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0087] In yet another optional embodiment, the fusing the simulation model task basic information and the behavior tree information set to obtain target behavior tree information includes:
[0088] S311, calculating and processing the simulation model task basic information and the behavior tree information set to obtain simulation model task similarity information;
[0089] It should be noted that the above calculation process uses a string similarity calculation algorithm to calculate the root node information corresponding to the simulation model task basic information and all the behavior tree information in the behavior tree information set.
[0090] S312, determining target behavior tree information based on the simulation model task similarity information; the target behavior tree information is the behavior tree information corresponding to the simulation model task similarity value with the highest numerical value in the simulation model task similarity information.
[0091] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0092] In an optional embodiment, the analyzing and processing the simulation model task behavior information and the target behavior tree information to obtain the target simulation model behavior execution information includes:
[0093] S331, performing feature analysis processing on the simulation model task behavior information and the state node information in the target behavior tree information to obtain first simulation model behavior state information;
[0094] S332, analyzing and processing the simulation model task behavior information and the first simulation model behavior state information to obtain second simulation model behavior state information;
[0095] S333, fusing the simulation model task behavior information and the second simulation model behavior state information to obtain target simulation model behavior state information;
[0096] It should be noted that the above-mentioned fusion processing of the simulation model task behavior information and the second simulation model behavior state information to obtain the target simulation model behavior state information is obtained by calculating and processing through a preset BERT model, and the embodiment of the present invention does not make specific limitations;
[0097] It should be noted that the preset BERT model is a model that has been trained and optimized using a simulation model training dataset.
[0098] It should be noted that after the above-mentioned fusion processing, the target simulation model behavior state information obtained includes several of the state node information, and corresponds one-to-one to the simulation model task behavior vectors in the simulation model task behavior information, and is arranged in the target simulation model behavior state information according to the arrangement order of the simulation model task behavior vectors in the simulation model task behavior information.
[0099] S334, analyzing and processing the target simulation model behavior state information to obtain target simulation model behavior execution information.
[0100] It should be noted that the target simulation model behavior state information is analyzed and processed to obtain the target simulation model behavior execution information, which is analyzed and processed in accordance with the arrangement order of the state node information in the target simulation model behavior state information, and the obtained result information is stored in the target simulation model behavior execution information in order. Since all behavior executions in the simulation model information are executed in order, the result information obtained in order is stored in the target simulation model behavior execution information, which ensures that the simulation model behavior information is ultimately in order.
[0101] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0102] In an optional embodiment, the performing feature analysis on the simulation model task behavior information and the state node information in the target behavior tree information to obtain the first simulation model behavior state information includes:
[0103] S3311, extracting features from the state node information in the target behavior tree information to obtain state node feature vector information;
[0104] It should be noted that the above feature extraction is performed through sentence embedding BERT, and can also be TF-IDF, bag-of-words model, etc., which is not specifically limited in the embodiment of the present invention.
[0105] S3312, using the first simulation model behavior calculation model, calculating and processing the simulation model task behavior information and the state node feature vector information to obtain a target behavior tree metric matrix;
[0106] Wherein, the first simulation model behavior calculation model is:
[0107]
[0108] Where DL is the target behavior tree metric matrix, DL(FZ i1 ,XW i2 ) is the metric value of the i1th row and i2th column in the metric matrix of the target behavior tree, FZ i1 is the i1th simulation model task behavior vector in the simulation model task behavior information, XW i2is the i2th state node feature vector in the state node feature vector information, M and N respectively represent the number of the simulation model task behavior vectors in the simulation model task behavior information and the number of the state node feature vectors in the state node feature vector information, || represents the modulus of the vector, · represents the vector inner product, and α1 is the first weight parameter;
[0109] It should be noted that the metric value of the i1th row and the i2th column in the target behavior tree metric matrix represents the metric value of the i1th simulation model task behavior vector and the i2th state node feature vector in the state node feature vector information;
[0110] It should be noted that the first weight parameter may be set by a user or obtained based on historical data, and the embodiment of the present invention does not make any specific limitation thereto.
[0111] S3313, preset a first screening value; the first screening value is a positive integer;
[0112] S3314: Fusing the target behavior tree information, the target behavior tree metric matrix, and the first screening value to obtain first simulation model behavior state information.
[0113] It should be noted that the target behavior tree information, the target behavior tree metric matrix and the first filtering value are fused to obtain the first simulation model behavior state information, which is to sort all the metric values in any row of the target behavior tree metric matrix from large to small, and then filter out all the columns in the row whose column subscripts are less than or equal to the first filtering value according to the first filtering value, and the state node information corresponding to the state node feature vectors corresponding to all the columns of the row is the first state information of the simulation model task behavior vector; and then merge the first state information obtained after the above processing of all the simulation model task behavior vectors to obtain the first simulation model behavior state information.
[0114] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0115] In an optional embodiment, the analyzing and processing the simulation model task behavior information and the first simulation model behavior state information to obtain the second simulation model behavior state information includes:
[0116] S3321, for any of the simulation model task behavior vectors in the simulation model task behavior information, obtain first usage count information and second usage count information;
[0117] It should be noted that the first usage count information is the total historical usage count information of the first simulation model behavior state information; the second usage count information is the number of times the first simulation model behavior state information is used by the simulation model task behavior vector;
[0118] S3322: For the simulation model task behavior vector, using the second simulation model behavior calculation model, calculate and process the first simulation model behavior state information, the first usage count information, and the second usage count information to obtain the simulation model behavior weight information corresponding to the simulation model task behavior vector;
[0119] Wherein, the second simulation model behavior calculation model is:
[0120]
[0121] Where DS is the behavior weight information of the simulation model, DS i3 is the i3th simulation model behavior weight value in the simulation model behavior weight information, DY i3 is the i3th state node information in the first simulation model behavior state information, is the i3th first usage count value in the first usage count information, is the i3th second usage count value in the second usage count information, L is the number of state node information in the first simulation model behavior state information, and α2 is a second weight parameter;
[0122] It should be noted that the i3th first usage count value in the first usage count information represents the total historical usage count value of the i3th state node information in the first simulation model behavior state information; the i3th second usage count value in the second usage count information represents the number of times the i3th state node information in the first simulation model behavior state information is used by the simulation model task behavior vector;
[0123] It should be noted that the second weight parameter may be set by a user or obtained based on historical data, and the embodiment of the present invention does not make any specific limitation thereto.
[0124] S3323, preset a second screening value; the second screening value is a positive integer;
[0125] S3324, analyzing and processing the simulation model behavior weight information, the first simulation model behavior state information, and the second screening value corresponding to the simulation model task behavior vector to obtain second state information corresponding to the simulation model task behavior vector;
[0126] It should be noted that the above analysis and processing is to extract the node status information of the second screening value number having the largest weight value in the simulation model behavior weight information of the first simulation model behavior status information to obtain the second status information.
[0127] S3325, merging the second state information corresponding to all the simulation model task behavior vectors in the simulation model task behavior information to obtain second simulation model behavior state information.
[0128] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0129] In an optional embodiment, the analyzing and processing the target simulation model behavior state information to obtain the target simulation model behavior execution information includes:
[0130] S3341, judging whether any state node information in the target simulation model behavior state information is consistent with preset simulation model task state information, and obtaining a behavior state judgment result;
[0131] It should be noted that the state node information includes sequential execution and random execution. When the state node information is consistent with the preset simulation model task state information, all leaf node information under the state node information is executed sequentially, otherwise a certain leaf node information under the state node information is executed randomly.
[0132] When the behavior state judgment result is yes, all leaf node information in the state node information is added to the simulation model behavior execution information, and S3347 is executed;
[0133] When the behavior status judgment result is no, executing S3342;
[0134] S3342, obtaining the node weight values corresponding to all the leaf node information in the state node information;
[0135] S3343, performing size determination processing on the node weight values corresponding to all the leaf node information in the state node information to obtain a maximum node weight value and a minimum node weight value;
[0136] It should be noted that the maximum node weight value is the node weight value with the largest value among the node weight values corresponding to the leaf node information; the minimum node weight value is the node weight value with the smallest value among the node weight values corresponding to the leaf node information.
[0137] S3344, randomly generating a node weight threshold within the range of the minimum node weight value and the maximum node weight value;
[0138] S3345 performs judgment processing on the node weight values corresponding to all leaf node information in the state node information and the node weight threshold to obtain a target node weight value; the target node weight value is the node weight value closest to the node weight threshold;
[0139] S3346, adding the leaf node information corresponding to the target node weight value to the simulation model behavior execution information;
[0140] S3347, determining that the simulation model behavior execution information is the target simulation model behavior execution information.
[0141] It can be seen that implementing the simulation model behavior realization method based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0142] Embodiment 2
[0143] See also Figure 2 , Figure 2 is a structural diagram of a device for realizing a behavior tree-based simulation model behavior disclosed in an embodiment of the present invention. Figure 2 The described behavior tree-based simulation model behavior realization device is applied to a behavior tree-based simulation model behavior realization optimization system, such as a local server or cloud server for a behavior tree-based simulation model behavior realization, and the embodiments of the present invention do not limit this. Figure 2 As shown, the simulation model behavior implementation device based on the behavior tree includes:
[0144] An acquisition module 201 is used to acquire simulation model information and a behavior tree information set; the behavior tree information set includes a plurality of behavior tree information; the behavior tree information includes root node information, state node information and leaf node information;
[0145] The first calculation module 202 is used to analyze and process the simulation model information to obtain simulation model task information; the simulation model task information includes simulation model task basic information and simulation model task behavior information; the simulation model task behavior information includes a plurality of simulation model task behavior vectors;
[0146] The second calculation module 203 is used to fuse the simulation model task information and the behavior tree information set to obtain target simulation model behavior information; the target simulation model behavior information includes target simulation model behavior initial information and target simulation model behavior execution information.
[0147] It can be seen that implementing the simulation model behavior realization device based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0148] Embodiment 3
[0149] See also Figure 3 , Figure 3 is a schematic diagram of the structure of another device for realizing the behavior of a simulation model based on a behavior tree according to an embodiment of the present invention. Figure 3 The described behavior tree-based simulation model behavior realization device is applied to a behavior tree-based simulation model behavior realization optimization system, such as a local server or cloud server for a behavior tree-based simulation model behavior realization, and the embodiments of the present invention do not limit this. Figure 3 As shown, the simulation model behavior implementation device based on the behavior tree includes:
[0150] Processor 301;
[0151] A memory 302 coupled to the processor 301 and storing executable program codes;
[0152] The processor 301 calls the executable program code stored in the memory 302 to execute part or all of the steps of the method for realizing the behavior of a simulation model based on a behavior tree described in the first embodiment.
[0153] It can be seen that implementing the simulation model behavior realization device based on behavior tree described in the embodiment of the present invention is conducive to improving the ability of the simulation platform to dynamically change the model behavior through different simulation model information, thereby enhancing the usability and scalability of the model.
[0154] Embodiment 4
[0155] An embodiment of the present invention discloses a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the computer instructions are called, they are used to execute some or all steps of the method for realizing simulation model behavior based on behavior tree described in Example 1.
[0156] Embodiment 5
[0157] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute part or all of the steps in the behavior tree-based simulation model behavior implementation method described in Example 1.
[0158] The system embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative labor.
[0159] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0160] Finally, it should be noted that the method and device for realizing the behavior of a simulation model based on a behavior tree disclosed in the embodiment of the present invention disclose only the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for realizing the behavior of a simulation model based on a behavior tree, characterized in that: The method comprises: S1, obtaining simulation model information and a behavior tree information set; the behavior tree information set includes a plurality of behavior tree information; the behavior tree information includes root node information, state node information and leaf node information; S2, analyzing and processing the simulation model information to obtain simulation model task information; the simulation model task information includes simulation model task basic information and simulation model task behavior information; the simulation model task behavior information includes a plurality of simulation model task behavior vectors; S3, fusing the simulation model task information and the behavior tree information set to obtain target simulation model behavior information; the target simulation model behavior information includes target simulation model behavior initial information and target simulation model behavior execution information; The step of fusing the simulation model task information and the behavior tree information set to obtain target simulation model behavior information includes: S31, fusing the simulation model task basic information and the behavior tree information set to obtain target behavior tree information; S32, determining target simulation model behavior initial information based on the target behavior tree information; S33, analyzing and processing the simulation model task behavior information and the target behavior tree information to obtain target simulation model behavior execution information; The fusing the simulation model task basic information and the behavior tree information set to obtain target behavior tree information includes: S311, calculating and processing the simulation model task basic information and the behavior tree information set to obtain simulation model task similarity information; S312, determining target behavior tree information based on the simulation model task similarity information; the target behavior tree information is the behavior tree information corresponding to the simulation model task similarity value with the highest value in the simulation model task similarity information.
2. The method for realizing the behavior of a simulation model based on a behavior tree according to claim 1, characterized in that: The analyzing and processing the simulation model information to obtain the simulation model task information includes: S21, preprocessing the simulation model information to obtain preprocessed simulation model information; S22, segmenting the preprocessing simulation model information to obtain preprocessing simulation model task basic information and preprocessing simulation model task behavior information; S23, extracting the preprocessed simulation model task basic information to obtain the simulation model task basic information; S24, performing an extraction operation on the pre-processed simulation model task behavior information to obtain the simulation model task behavior information.
3. The method for realizing the behavior of a simulation model based on a behavior tree according to claim 1, characterized in that: The analyzing and processing the simulation model task behavior information and the target behavior tree information to obtain the target simulation model behavior execution information includes: S331, performing feature analysis processing on the simulation model task behavior information and the state node information in the target behavior tree information to obtain first simulation model behavior state information; S332, analyzing and processing the simulation model task behavior information and the first simulation model behavior state information to obtain second simulation model behavior state information; S333, fusing the simulation model task behavior information and the second simulation model behavior state information to obtain target simulation model behavior state information; S334, analyzing and processing the target simulation model behavior state information to obtain target simulation model behavior execution information.
4. The method for realizing the behavior of a simulation model based on a behavior tree according to claim 3, characterized in that: The performing feature analysis on the simulation model task behavior information and the state node information in the target behavior tree information to obtain the first simulation model behavior state information includes: S3311, extracting features from the state node information in the target behavior tree information to obtain state node feature vector information; S3312, using the first simulation model behavior calculation model, calculating and processing the simulation model task behavior information and the state node feature vector information to obtain a target behavior tree metric matrix; Wherein, the first simulation model behavior calculation model is: Where DL is the target behavior tree metric matrix, DL(FZ i1 ,XW i2 ) is the metric value of the i1th row and i2th column in the metric matrix of the target behavior tree, FZ i1 is the i1th simulation model task behavior vector in the simulation model task behavior information, XW i2 is the i2th state node feature vector in the state node feature vector information, M and N respectively represent the number of the simulation model task behavior vectors in the simulation model task behavior information and the number of the state node feature vectors in the state node feature vector information, || represents the modulus of the vector, · represents the vector inner product, and α1 is the first weight parameter; S3313, preset a first screening value; the first screening value is a positive integer; S3314: Fusing the target behavior tree information, the target behavior tree metric matrix, and the first screening value to obtain first simulation model behavior state information.
5. The method for realizing the behavior of a simulation model based on a behavior tree according to claim 3, characterized in that: The analyzing and processing the target simulation model behavior state information to obtain the target simulation model behavior execution information includes: S3341, judging whether any state node information in the target simulation model behavior state information is consistent with preset simulation model task state information, and obtaining a behavior state judgment result; When the behavior state judgment result is yes, all leaf node information in the state node information is added to the simulation model behavior execution information, and S3347 is executed; When the behavior status judgment result is no, executing S3342; S3342, obtaining the node weight values corresponding to all the leaf node information in the state node information; S3343, performing size determination processing on the node weight values corresponding to all the leaf node information in the state node information to obtain a maximum node weight value and a minimum node weight value; S3344, randomly generating a node weight threshold within the range of the minimum node weight value and the maximum node weight value; S3345 performs judgment processing on the node weight values corresponding to all leaf node information in the state node information and the node weight threshold to obtain a target node weight value; the target node weight value is the node weight value closest to the node weight threshold; S3346, adding the leaf node information corresponding to the target node weight value to the simulation model behavior execution information; S3347, determining that the simulation model behavior execution information is the target simulation model behavior execution information.
6. A simulation model behavior realization device based on behavior tree, characterized in that: The device comprises: processor; a memory coupled to the processor and storing executable program code; The processor calls the executable program code stored in the memory to execute the simulation model behavior implementation method based on behavior tree according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the simulation model behavior implementation method based on behavior tree according to any one of claims 1 to 5.
Citation Information
Patent Citations
Encapsulation management method of new quality capability model constructed for functional model library
CN114297817A
CGF task planning simulation method, device and equipment based on customized behavior tree
CN118446034A