Interactive behavior control method and device, electronic equipment and storage medium
By obtaining interactive data to generate target execution mode, controlling chess robots to adjust their behavior, solving the problem of poor flexibility in the execution of interactive behaviors in the prior art, and improving the interactive experience of chess games.
Patent Information
- Application Number
- CN202510417370.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, chess robots cannot effectively control interactive behavior, resulting in poor execution flexibility.
By obtaining the interaction data of the first object and the second object in executing the interactive behavior, determining the execution information, and generating the target execution mode based on this, the first object is controlled to adjust the behavior according to the mode switching instruction.
Improves the flexibility of execution of interactive behaviors and enhances the interactive experience of chess games.
Smart Images

Figure CN120393429A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control technologies, and in particular, to a control method, device, electronic device, and storage medium for interactive behaviors. Background Art
[0002] As a classic intellectual competitive activity, board games have long received extensive attention. Board games are not only an important part of human culture but also a symbol of intelligence and strategy. Through simple rules and complex strategies, board games provide users with unlimited thinking space and competitive fun, becoming a universal entertainment form that transcends age, culture, and region.
[0003] In the related art, with the development of technology, board games have gradually moved from traditional physical boards to electronic and intelligent forms. Users can perform interactive behaviors with board game robots, making it easier for users to learn board games.
[0004] However, in the above-mentioned related art, board game robots can only perform interactive behaviors with users simply and cannot control the interactive behaviors, resulting in poor flexibility in the execution of interactive behaviors. Summary of the Invention
[0005] The present invention provides a control method, device, electronic device, and storage medium for interactive behaviors to solve the defect in the prior art that leads to poor flexibility in the execution of interactive behaviors.
[0006] The present invention provides a control method for interactive behaviors, including the following steps.
[0007] Obtain interaction data of a first object and a second object during the execution of an interactive behavior; Based on the interaction data, determine the execution information of the first object; Based on the execution information, generate a target execution mode, where the target execution mode is a mode available to the first object during the execution of the interactive behavior; When receiving a mode switching instruction input by the first object, control the first object to execute the interactive behavior based on the target execution mode.
[0008] According to the control method for interactive behaviors provided by the present invention, the generating the target execution mode based on the execution information includes: Based on the execution information, determine an additional resource value; Based on the additional resource value, update the cumulative resource value of the first object; Based on the updated cumulative resource value, determine the target execution mode.
[0009] A control method for interactive behavior provided by the present invention, wherein the interaction data includes multiple images; determining an additional resource value based on the execution information includes: Determine a target image including the execution information among the multiple images; Annotate the execution information in the target image to obtain an annotated target image; Based on the annotated target image, determine the target behavior level of the first object; Based on the correspondence between the behavior level and the resource value, determine the additional resource value corresponding to the target behavior level.
[0010] A control method for interactive behavior provided by the present invention, wherein based on the annotated target image, determining the target behavior level of the first object includes: Input the annotated target image into a behavior level detection model to obtain the target behavior level output by the behavior level detection model. The behavior level detection model is trained based on sample annotated images and the level labels corresponding to the sample annotated images. The sample annotated image is obtained by annotating the sample execution information of the sample object in the first sample image collected during the execution of the interactive behavior.
[0011] A control method for interactive behavior provided by the present invention, the method further includes: Determine the target resource value corresponding to the target execution mode; Based on the target resource value, update the updated cumulative resource value to obtain the cumulative remaining resource value of the first object.
[0012] A control method for interactive behavior provided by the present invention, wherein based on the updated cumulative resource value, determining the target execution mode includes: When receiving an execution mode selection instruction input by the first object, based on the resource values of all execution modes and the updated cumulative resource value, determine the target execution mode; or, When the execution mode selection instruction includes an execution mode, and it is determined that the resource value of the execution mode included in the execution mode selection instruction is less than or equal to the updated cumulative resource value, determine the execution mode included in the execution mode selection instruction as the target execution mode.
[0013] A control method for interactive behavior provided by the present invention, the method further includes: When the target execution mode includes an execution behavior prompt mode, obtain the current image; Input the current image into the behavior prompt model to obtain the next execution behavior prompt information of the first object and / or the behavior execution strategy prompt information of the second object output by the behavior prompt model. The behavior prompt model is trained based on the second sample image and the execution behavior label and / or execution strategy label corresponding to the second sample image.
[0014] The present invention also provides a control device for interactive behavior, including: A first acquisition unit, configured to acquire interaction data of a first object and a second object during the execution of an interactive behavior; A first determination unit, configured to determine the execution information of the first object based on the interaction data; A generation unit, configured to generate a target execution mode based on the execution information, where the target execution mode is a mode available to the first object during the execution of an interactive behavior; A control unit, configured to control the first object to execute an interactive behavior based on the target execution mode when receiving a mode switching instruction input by the first object.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the control method for interactive behavior as described in any one of the above is implemented.
[0016] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the control method for interactive behavior as described in any one of the above is implemented.
[0017] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the control method for interactive behavior as described in any one of the above is implemented.
[0018] For the control method, device, electronic device, and storage medium for interactive behavior provided by the present invention, the interaction data of the first object and the second object during the execution of the interactive behavior is acquired, the execution information of the first object is determined based on the interaction data, the target execution mode is generated based on the execution information, the target execution mode is a mode available to the first object during the execution of the interactive behavior, and when receiving a mode switching instruction input by the first object, the first object is controlled to execute the interactive behavior based on the target execution mode. It can be seen that the present invention can generate a target execution mode based on the execution information of the first object, and then control the first object to continue executing the interactive behavior based on the target execution mode, thereby improving the flexibility of the execution of the interactive behavior. Description of the Drawings
[0019] To more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0020] Figure 1 It is one of the schematic flowcharts of the control method for interactive behavior provided by the embodiments of the present invention.
[0021] Figure 2 It is another schematic flowchart of the control method for interactive behavior provided by the embodiments of the present invention.
[0022] Figure 3 It is the third schematic flowchart of the control method for interactive behavior provided by the embodiments of the present invention.
[0023] Figure 4 It is the schematic structural diagram of the control device for interactive behavior provided by the embodiments of the present invention.
[0024] Figure 5 It is the schematic physical structure diagram of the electronic device provided by the embodiments of the present invention. Detailed implementation manners
[0025] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0026] The terms "first", "second", etc. in the specification and claims of the present invention and the above accompanying drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing when describing objects with the same attributes in the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product, or device including a series of units does not necessarily have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products, or devices.
[0027] The following will be combined with Figures 1-3Describe the control method for the interactive behavior of the present invention. The execution subject of the control method for the interactive behavior can be an electronic device such as a robot, a terminal, a tablet computer, or a computer, or it can be a control device for the interactive behavior provided in the electronic device. The control device for the interactive behavior can be implemented by software, hardware, or a combination of both.
[0028] Figure 1 is one of the schematic flowcharts of the control method for the interactive behavior provided by the embodiments of the present invention. As Figure 1 shown, the control method for the interactive behavior includes the following steps: Step 1, obtain the interaction data of the first object and the second object during the execution of the interactive behavior.
[0029] Among them, the first object and the second object can be users participating in the execution of the interactive behavior, the interactive behavior can be an action of playing a board game or an action of playing a ball game, etc., and the interaction data can be multiple images taken by the first object and the second object during the execution of the interactive behavior. The multiple images can be images in the form of a video or images in the form of discrete frames. The present invention does not limit this.
[0030] Exemplarily, the interaction data can be obtained by photographing the process of the first object and the second object executing the interactive behavior through a camera device.
[0031] Step 102, determine the execution information of the first object based on the interaction data.
[0032] Exemplarily, when multiple images are obtained, analyze the multiple images to obtain the execution information of the first object. For example, if the interactive behavior is an action of playing a board game, the execution information can be the move behavior of the first object. Another example is that if the interactive behavior is an action of playing a ball game (for example, badminton), the execution information can be the ball-drop behavior of the first object.
[0033] Step 103, generate a target execution mode based on the execution information, where the target execution mode is a mode available to the first object during the execution of the interactive behavior.
[0034] Exemplarily, when the execution information of the first object is obtained, the execution information of the first object is analyzed to determine the execution position of the first object. The execution position is matched with at least one preset position. When the execution position matches the target preset position among the at least one preset position, it indicates that the execution position of the first object is a position where the target execution mode can be obtained. Then, a random execution mode among all the execution modes is used as the target execution mode, or the execution mode corresponding to the target preset position matched by the execution position of the first object is used as the target execution mode. For example, taking the interactive behavior as the behavior of playing a board game, the execution position of the first object is the position of placing a piece, and if the position of placing a piece matches the target preset position, it indicates that this position of placing a piece is an optimal position. Then, it can be determined that the target execution mode can be a random execution mode among all the execution modes. For example, the target execution mode is the mode of taking back a move. The mode of taking back a move means having the right to let the first object take back the previous X moves of the chess, so as to enable the first object to adjust the chess-playing strategy. Another example is that the target execution mode is the continuous serving mode. The continuous serving mode means a mode that allows the first object to continuously serve a preset number of balls.
[0035] It should be noted that taking the interactive behavior as the behavior of playing a board game as an example, the target execution mode may include a restriction mode, a mode of taking back a move, a mode of moving a piece, a mode of exchanging a piece, and an execution behavior prompting mode, etc. Among them, the restriction mode means restricting the other party from playing chess. For example, when it is the turn of the other party to play chess, making the other party stop and the own side play one more piece or multiple pieces; or, requiring the other party to place a piece at a limited number of selectable positions. The mode of moving a piece means having the ability to transfer the piece currently placed by the own side or the other side to other positions, so as to interfere with the strategy of the own side or the other side. The mode of exchanging a piece means exchanging the piece currently placed by the other side with the piece of the own side. The execution behavior prompting mode means being able to output the prompting information of the position of placing a piece of the own side, or being able to output the chess-playing strategy of the other party.
[0036] Step 104, in the case of receiving the mode switching instruction input by the first object, control the first object to execute the interactive behavior based on the target execution mode.
[0037] Exemplarily, if the first object wants to use the target execution mode during the execution of the interactive behavior, it can input a mode switching instruction in the control interface, specifically by clicking the mode switching button. When the electronic device receives the mode switching instruction, in response to this mode switching instruction, it controls the first object to execute the interactive behavior based on the target execution mode. For example, if the target execution mode is the mode of taking back a move, directly take back the positions of placing the previous X moves of the first object, facilitating the first object to re-determine the positions of placing the previous X moves of the chess to continue playing chess. Another example is that if the target execution mode is the continuous serving mode, switch to the target execution mode so that the first object can continuously serve a preset number of balls.
[0038] The control method for interactive behavior provided by the present invention obtains interaction data of a first object and a second object during the execution of the interactive behavior. Based on the interaction data, the execution information of the first object is determined, and a target execution mode is generated based on the execution information. The target execution mode is a mode available to the first object during the execution of the interactive behavior. When a mode switching instruction input by the first object is received, the first object is controlled to execute the interactive behavior based on the target execution mode. It can be seen that the present invention can generate a target execution mode based on the execution information of the first object, and then control the first object to continue to execute the interactive behavior based on the target execution mode, thereby improving the flexibility of the execution of the interactive behavior.
[0039] In one embodiment, Figure 2 is the second schematic flowchart of the control method for interactive behavior provided by the embodiments of the present invention. As Figure 2 shown, the above step 103 generates a target execution mode based on the execution information, which can be specifically implemented through the following steps: Step 1031: Determine an additional resource value based on the execution information.
[0040] Exemplarily, the corresponding relationship between the execution information and the resource value can be preset in advance. When the execution information of the first object is obtained, the resource value matching the execution information of the first object is searched in the corresponding relationship, and the resource value matching the execution information of the first object is determined as the additional resource value. For example, the execution information of the first object is a piece-placement behavior, and the piece-placement position is a preset preferred position. If the resource value corresponding to the preset preferred position stored in the corresponding relationship is 50 points, then the additional resource value is determined to be 50 points. Another example, the execution information of the first object is a ball-dropping behavior, and the ball-dropping position is a preset preferred position. If the resource value corresponding to the preset preferred position stored in the corresponding relationship is 3 points, then the additional resource value is determined to be 3 points.
[0041] It should be noted that the resource value mentioned here can be in the form of integral points, or in the form of experience values, etc. The present invention does not limit this.
[0042] Step 1032: Update the cumulative resource value of the first object based on the additional resource value.
[0043] Exemplarily, when the additional resource value is obtained, the cumulative resource value of the first object is added to the additional resource value, thereby realizing the update of the cumulative resource value of the first object. For example, the cumulative resource value of the first object is 500 points, and the additional resource value is 50 points, then the updated cumulative resource value is 550 points.
[0044] Step 1033: Determine the target execution mode based on the updated cumulative resource value.
[0045] Exemplarily, when obtaining the updated cumulative resource value, check the resource values required for each execution mode. If the number of target execution modes is one, determine any execution mode with a resource value less than the updated cumulative resource value as the target execution mode; if the number of target execution modes is K and K is greater than or equal to 2, select all candidate execution modes with resource values less than the updated cumulative resource value from all execution modes, and then select K candidate execution modes with the sum of resource values less than the updated cumulative resource value from all candidate execution modes, and use these K candidate execution modes as the target execution modes.
[0046] In this embodiment, the additional resource value can be determined based on the execution information, and then the cumulative resource value before the first object is updated based on the additional resource value. Furthermore, the target execution mode is determined based on the updated cumulative resource value, and the automatic determination of the execution mode is realized through the resource value, improving the efficiency of determining the execution mode.
[0047] In one embodiment, the interaction data includes multiple images; step 1031 above determines the additional resource value based on the execution information, which can be specifically implemented in the following manner: Determine a target image including the execution information among the multiple images; annotate the execution information in the target image to obtain the annotated target image; determine the target behavior level of the first object based on the annotated target image; determine the additional resource value corresponding to the target behavior level based on the correspondence between the behavior level and the resource value.
[0048] Exemplarily, after determining the execution information of the first object, each acquired image is detected to detect a target image including the execution information, and the execution information is boxed in the target image to implement the annotation of the execution information in the target image, obtaining the annotated target image; combining all the interaction behaviors of the first object and the second object in the annotated target image, determining the behavior level of the execution information of the annotated first object. Taking the execution information of the first object as the piece-placement behavior as an example, if the piece-placement position corresponding to the piece-placement behavior is a preset preferred position, then the target behavior level is determined to be the first behavior level; if the piece-placement position corresponding to the piece-placement behavior is not a preset preferred position, then the target behavior level is determined to be the second behavior level, and the second behavior level is lower than the first behavior level. Furthermore, based on the pre-set correspondence between the behavior level and the resource value, the additional resource value corresponding to the target behavior level is determined. Taking the execution information of the first object as the ball-dropping behavior as another example, if the ball-dropping position corresponding to the ball-dropping behavior is a preset preferred position, then the target behavior level is determined to be the first behavior level; if the ball-dropping position corresponding to the ball-dropping behavior is not a preset preferred position, then the target behavior level is determined to be the second behavior level, and the second behavior level is lower than the first behavior level. Furthermore, based on the pre-set correspondence between the behavior level and the resource value, the additional resource value corresponding to the target behavior level is determined. The higher the level, the greater the corresponding resource value.
[0049] In this embodiment, based on the annotated target image, the target behavior level of the first object can be determined, and then based on the correspondence between the behavior level and the resource value, the additional resource value corresponding to the target behavior level is determined, improving the accuracy of determining the additional resource value.
[0050] In one embodiment, the above-mentioned determining the target behavior level of the first object based on the annotated target image can be specifically implemented by the following method: Input the annotated target image into a behavior level detection model to obtain the target behavior level output by the behavior level detection model. The behavior level detection model is trained based on sample annotated images and the level labels corresponding to the sample annotated images. The sample annotated image is obtained by annotating the sample execution information of the sample object in the first sample image collected during the execution of the interactive behavior.
[0051] Exemplarily, when the annotated target image is obtained, the annotated target image is input into a pre-trained behavior level detection model. The behavior level detection model performs feature analysis on the annotated target image, and finally obtains the target behavior level corresponding to the execution information of the first object output by the behavior level detection model.
[0052] It should be noted that the specific training method of the behavior level detection model is as follows: Obtain a plurality of first sample images collected during the execution of the interactive behavior. For each first sample image, frame the sample execution information of the sample object in the first sample image to achieve the annotation of the sample execution information of the sample object, obtain the sample annotation image, and add a level label to the sample annotation image based on the sample execution information annotated in the sample annotation image; Input the sample annotation image into the initial behavior level detection model to obtain the predicted behavior level output by the initial behavior level detection model. Construct the first loss information based on the predicted behavior level and the corresponding level label, and iteratively adjust the model parameters of the initial behavior level detection model based on the first loss information until the convergence condition is reached, and finally obtain the behavior level detection model.
[0053] It should be noted that the initial behavior level detection model can be a detection model constructed based on deep learning technologies such as Transformer or BERT, etc. The present invention does not make any limitations in this regard.
[0054] In this embodiment, the detection of the target behavior level is realized through the trained behavior level detection model, which improves the detection efficiency and detection accuracy of the target behavior level.
[0055] In one embodiment, Figure 3 is the third flowchart of the control method for the interactive behavior provided by the embodiment of the present invention. As Figure 3 shown, after the above step 1033, the control method for the interactive behavior further includes the following steps: Step 301, determine the target resource value corresponding to the target execution mode.
[0056] Exemplarily, after determining the target execution mode based on the updated cumulative resource value, the target resource value corresponding to the target execution mode can be found in the pre-set resource value database.
[0057] Step 302, update the updated cumulative resource value based on the target resource value to obtain the cumulative remaining resource value of the first object.
[0058] Exemplarily, when the target resource value corresponding to the target execution mode is found, subtract the target resource value from the updated cumulative resource value to obtain the cumulative remaining resource value of the first object; for example, if the updated cumulative resource value is 550 points and the target resource value of the target execution mode is 20 points, then the cumulative remaining resource value of the first object is 530 points.
[0059] In this embodiment, the cumulative resource value can be updated in real time based on the determined target execution mode, which improves the accuracy of the cumulative remaining resource value.
[0060] In one embodiment, the above step 1033 determines the target execution mode based on the updated cumulative resource value, which can be specifically implemented in the following ways: When receiving the execution mode selection instruction input by the first object, determine the target execution mode based on the resource value of each execution mode and the updated cumulative resource value; or, When the execution mode selection instruction includes an execution mode, and it is determined that the resource value of the execution mode included in the execution mode selection instruction is less than or equal to the updated cumulative resource value, determine the execution mode included in the execution mode selection instruction as the target execution mode.
[0061] Exemplarily, if the first object wants to select an execution mode during the execution of an interactive behavior, it can input an execution mode selection instruction in the control interface, specifically by clicking on the mode selection button. When the electronic device receives the execution mode selection instruction and determines that the execution mode selection instruction does not include an execution mode, in response to this execution mode selection instruction, it searches for the resource value of each execution mode in the pre-set resource value database. If the number of target execution modes is one, determine any execution mode with a resource value less than the updated cumulative resource value as the target execution mode; if the number of target execution modes is K and K is greater than or equal to 2, select all candidate execution modes with a resource value less than the updated cumulative resource value from all execution modes, and then select K candidate execution modes with the sum of resource values less than the updated cumulative resource value from all candidate execution modes, and use these K candidate execution modes as the target execution modes.
[0062] Or, when the execution mode selection instruction includes an execution mode, search for the resource value of the execution mode included in the execution mode selection instruction in the pre-set resource value database, and compare the resource value of this execution mode with the updated cumulative resource value. When the resource value of this execution mode is less than or equal to the updated cumulative resource value, determine the execution mode included in the execution mode selection instruction as the target execution mode.
[0063] In this embodiment, when receiving the execution mode selection instruction input by the first object, the automatic determination of the target execution mode is realized based on the resource value of each execution mode and the updated cumulative resource value; and when the execution mode selection instruction includes an execution mode and it is determined that the resource value of the execution mode included in the execution mode selection instruction is less than or equal to the updated cumulative resource value, determine the execution mode included in the execution mode selection instruction as the target execution mode, making the determined target execution mode more in line with the user's needs.
[0064] In one embodiment, the above step 103 generates a target execution mode based on the execution information, which can be specifically implemented in the following ways: In the case of determining that the execution information matches the preset execution information, determine the execution mode corresponding to the preset execution information or a randomly selected execution mode as the target execution mode.
[0065] Exemplarily, when the execution information of the first object is obtained, the execution information of the first object is matched with the preset execution information. When the execution information of the first object matches the preset execution information, it indicates that the execution information of the first object is the preferred execution information during the execution of the interactive behavior. Then, determine the execution mode corresponding to the preset execution information as the target execution mode, or randomly select at least one execution mode from all execution modes as the target execution mode, or select at least one execution mode from all execution modes based on a preset rule as the target execution mode. For example, the preset rule is the execution mode in which the usage times of the first object are greater than the preset times, or the preset rule is the execution mode that the first object has never used, etc.
[0066] In this embodiment, by matching the execution information with the preset execution information and determining that the execution information matches the preset execution information, determining the execution mode corresponding to the preset execution information or a randomly selected execution mode as the target execution mode, the diversification of the target execution mode determination method is realized.
[0067] In one embodiment, after the above step 103, the control method of the interactive behavior further includes the following steps: In the case where the target execution mode includes an execution behavior prompt mode, obtain the current image; input the current image into the behavior prompt model to obtain the next execution behavior prompt information of the first object and / or the behavior execution strategy prompt information of the second object output by the behavior prompt model. The behavior prompt model is trained based on the second sample image and the execution behavior label and / or execution strategy label corresponding to the second sample image.
[0068] Exemplarily, when the target execution mode is the execution behavior prompt mode, obtain the current image during the execution of the interactive behavior of the first object and the second object, input the current image into the pre-trained behavior prompt model, perform feature analysis on the current image through the behavior prompt model, and finally obtain the next execution behavior prompt information of the first object and / or the behavior execution strategy prompt information of the second object output by the behavior prompt model. Finally, display the next execution behavior prompt information of the first object and / or the behavior execution strategy prompt information of the second object on the control interface, so that the first object can know the displayed information and further continue to execute the interactive behavior based on the displayed information.
[0069] It should be noted that when the behavior prompting model only outputs the next execution behavior prompting information of the first object, the specific training method of the behavior prompting model is as follows: Obtain a plurality of second sample images collected during the execution of the interactive behavior. For each second sample image, based on all the execution behaviors of the first sample object in the second sample image, add an execution behavior label to the second sample image, input the second sample image into the initial behavior prompting model, obtain the predicted execution behavior prompting information output by the initial behavior prompting model, construct a second loss information based on the predicted execution behavior prompting information and the corresponding execution behavior label, and iteratively adjust the model parameters of the initial behavior prompting model based on the second loss information until the convergence condition is reached, and finally obtain the behavior prompting model.
[0070] It should be noted that when the behavior prompting model only outputs the behavior execution strategy prompting information of the second object, the specific training method of the behavior prompting model is as follows: Obtain a plurality of second sample images collected during the execution of the interactive behavior. For each second sample image, based on all the execution behaviors of the second sample object in the second sample image, add an execution strategy label to the second sample image, input the second sample image into the initial behavior prompting model, obtain the predicted behavior execution strategy prompting information output by the initial behavior prompting model, construct a third loss information based on the predicted behavior execution strategy prompting information and the corresponding execution strategy label, and iteratively adjust the model parameters of the initial behavior prompting model based on the third loss information until the convergence condition is reached, and finally obtain the behavior prompting model.
[0071] It should be noted that when the behavior prompting model simultaneously outputs the next execution behavior prompting information of the first object and the behavior execution strategy prompting information of the second object, the specific training method of the behavior prompting model is as follows: Obtain a plurality of second sample images collected during the execution of the interactive behavior. For each second sample image, based on all the execution behaviors of the first sample object and the second sample object in the second sample image, add an execution behavior label and an execution strategy label to the second sample image, input the second sample image into the initial behavior prompting model, obtain the predicted execution behavior prompting information and the predicted behavior execution strategy prompting information output by the initial behavior prompting model, construct a fourth loss information based on the predicted execution behavior prompting information and the corresponding execution behavior label, and the predicted behavior execution strategy prompting information and the corresponding execution strategy label, and iteratively adjust the model parameters of the initial behavior prompting model based on the fourth loss information until the convergence condition is reached, and finally obtain the behavior prompting model.
[0072] It should be noted that the initial behavior prompting model can be a prompting model constructed based on deep learning technologies such as Transformer or BERT, etc., and the present invention does not limit this.
[0073] In this embodiment, when the target execution mode is the execution behavior prompt mode, the next execution behavior prompt information of the first object and / or the behavior execution strategy prompt information of the second object can be automatically output based on the behavior prompt model, so as to facilitate guiding the first object to continue executing the interactive behavior and further improve the flexibility of the interactive behavior execution.
[0074] The control device for interactive behavior provided by the present invention will be described below. The control device for interactive behavior described below can be correspondingly referred to the control method for interactive behavior described above.
[0075] Figure 4 It is a schematic structural diagram of the control device for interactive behavior provided by an embodiment of the present invention. As Figure 4 shown, the control device 400 for interactive behavior includes a first acquisition unit 401, a first determination unit 402, a generation unit 403, and a control unit 404; where: The first acquisition unit 401 is configured to acquire the interaction data of the first object and the second object during the execution of the interactive behavior; The first determination unit 402 is configured to determine the execution information of the first object based on the interaction data; The generation unit 403 is configured to generate a target execution mode based on the execution information, where the target execution mode is a mode available to the first object during the execution of the interactive behavior; The control unit 404 is configured to control the first object to execute the interactive behavior based on the target execution mode when receiving a mode switching instruction input by the first object.
[0076] The control device for interactive behavior provided by the present invention acquires the interaction data of the first object and the second object during the execution of the interactive behavior, determines the execution information of the first object based on the interaction data, generates a target execution mode based on the execution information, where the target execution mode is a mode available to the first object during the execution of the interactive behavior, and controls the first object to execute the interactive behavior based on the target execution mode when receiving a mode switching instruction input by the first object. It can be seen that the present invention can generate a target execution mode based on the execution information of the first object, and then control the first object to continue executing the interactive behavior based on the target execution mode, thereby improving the flexibility of the interactive behavior execution.
[0077] Based on any of the above embodiments, the generation unit 403 is specifically configured to: Determine an additional resource value based on the execution information; Update the cumulative resource value of the first object based on the additional resource value; Determine the target execution mode based on the updated cumulative resource value.
[0078] Based on any of the above embodiments, the interaction data includes a plurality of images; the generating unit 403 is further specifically configured to: Determine a target image including the execution information from the plurality of images; Annotate the execution information in the target image to obtain an annotated target image; Based on the annotated target image, determine the target behavior level of the first object; Based on the correspondence between the behavior level and the resource value, determine the additional resource value corresponding to the target behavior level.
[0079] Based on any of the above embodiments, the generating unit 403 is further specifically configured to: Input the annotated target image into a behavior level detection model to obtain the target behavior level output by the behavior level detection model. The behavior level detection model is trained based on sample annotated images and the level labels corresponding to the sample annotated images. The sample annotated images are obtained by annotating the sample execution information of the sample object in the sample images collected during the execution of the interactive behavior.
[0080] Based on any of the above embodiments, the control device 400 for the interactive behavior further includes: A second determination unit, configured to determine the target resource value corresponding to the target execution mode; An update unit, configured to update the updated cumulative resource value based on the target resource value to obtain the cumulative remaining resource value of the first object.
[0081] Based on any of the above embodiments, the generating unit 403 is further specifically configured to: When receiving an execution mode selection instruction input by the first object, determine the target execution mode based on the resource values of all execution modes and the updated cumulative resource value; or, When the execution mode selection instruction includes an execution mode and it is determined that the resource value of the execution mode included in the execution mode selection instruction is less than or equal to the updated cumulative resource value, determine the execution mode included in the execution mode selection instruction as the target execution mode.
[0082] Based on any of the above embodiments, the first determination unit 402 is further specifically configured to: When determining that the chess-playing behavior matches a preset chess-playing behavior, determine the skill corresponding to the preset chess-playing behavior or a randomly selected skill as the target skill.
[0083] Based on any of the above embodiments, the control device 400 for the interactive behavior further includes: A second acquisition unit, configured to acquire a current image during an execution of an interactive behavior when the target execution mode includes an execution behavior prompt mode; An output unit, configured to input the current image into a behavior prompt model to obtain next execution behavior prompt information of the first object and / or behavior execution strategy prompt information of the second object output by the behavior prompt model, where the behavior prompt model is trained based on a sample image and an execution behavior label and / or an execution strategy label corresponding to the sample image.
[0084] Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 5 shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the communication bus 540. The processor 510 may call logic instructions in the memory 530 to execute a control method for an interactive behavior, and the method includes: acquiring interaction data of a first object and a second object during an execution of an interactive behavior; Determining execution information of the first object based on the interaction data; Generating a target execution mode based on the execution information, where the target execution mode is a mode available to the first object during an execution of an interactive behavior; When receiving a mode switching instruction input by the first object, controlling the first object to execute an interactive behavior based on the target execution mode.
[0085] In addition, when the logic instructions in the foregoing memory 530 are implemented in the form of a software functional unit and sold or used as an independent product, they may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention essentially or the part that contributes to the prior art or a part of the technical solution may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the control method of the interactive behavior provided by the above-mentioned various methods. The method includes: obtaining interaction data of a first object and a second object during the execution of the interactive behavior; Based on the interaction data, determining the execution information of the first object; Based on the execution information, generating a target execution mode, where the target execution mode is a mode available to the first object during the execution of the interactive behavior; When a mode switching instruction input by the first object is received, controlling the first object to execute the interactive behavior based on the target execution mode.
[0087] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the control method of the interactive behavior provided by the above-mentioned various methods. The method includes: obtaining interaction data of a first object and a second object during the execution of the interactive behavior; Based on the interaction data, determining the execution information of the first object; Based on the execution information, generating a target execution mode, where the target execution mode is a mode available to the first object during the execution of the interactive behavior; When a mode switching instruction input by the first object is received, controlling the first object to execute the interactive behavior based on the target execution mode.
[0088] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0089] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment 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 essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A control method for an interactive behavior, characterized in that, Including: Obtain interaction data of a first object and a second object during the execution of an interactive behavior; Based on the interaction data, determine the execution information of the first object; Based on the execution information, generate a target execution mode, where the target execution mode is a mode available to the first object during the execution of the interactive behavior; When receiving a mode switching instruction input by the first object, control the first object to execute the interactive behavior based on the target execution mode.
2. The control method for the interactive behavior according to claim 1, wherein The generating the target execution mode based on the execution information includes: Based on the execution information, determine an additional resource value; Based on the additional resource value, update the cumulative resource value of the first object; Based on the updated cumulative resource value, determine the target execution mode.
3. The control method for the interactive behavior according to claim 2, wherein The interaction data includes multiple images; The determining the additional resource value based on the execution information includes: Determine a target image including the execution information from the multiple images; Annotate the execution information in the target image to obtain an annotated target image; Based on the annotated target image, determine the target behavior level of the first object; Based on the correspondence between the behavior level and the resource value, determine the additional resource value corresponding to the target behavior level.
4. The control method for the interactive behavior according to claim 3, wherein, The determining the target behavior level of the first object based on the annotated target image includes: Input the annotated target image into a behavior level detection model to obtain the target behavior level output by the behavior level detection model. The behavior level detection model is trained based on sample annotated images and the level labels corresponding to the sample annotated images. The sample annotated image is obtained by annotating the sample execution information of a sample object in a first sample image collected during the execution of the interactive behavior.
5. The control method for the interactive behavior according to claim 2, wherein The method further includes: Determine the target resource value corresponding to the target execution mode; Based on the target resource value, update the updated cumulative resource value to obtain the cumulative remaining resource value of the first object.
6. The control method of the interactive behavior according to claim 2, wherein The determining the target execution mode based on the updated cumulative resource value includes: When receiving an execution mode selection instruction input by the first object, based on the resource values of all execution modes and the updated cumulative resource value, determine the target execution mode; or, When the execution mode selection instruction includes an execution mode and it is determined that the resource value of the execution mode included in the execution mode selection instruction is less than or equal to the updated cumulative resource value, determine the execution mode included in the execution mode selection instruction as the target execution mode.
7. The control method for an interactive behavior according to any one of claims 1-6, characterized in that The method further includes: When the target execution mode includes an execution behavior prompt mode, obtain the current image during the execution of the interactive behavior; Input the current image into a behavior prompt model to obtain the output of the behavior prompt model The next execution behavior prompt information of the first object, and / or, the behavior execution policy prompt information of the second object, where the behavior prompt model is trained based on a second sample image and an execution behavior label and / or an execution policy label corresponding to the second sample image.
8. A control device for an interactive behavior, characterized in that, Including: A first acquisition unit configured to acquire interaction data of a first object and a second object during an interactive behavior; A first determination unit configured to determine execution information of the first object based on the interaction data; A generation unit configured to generate a target execution mode based on the execution information, where the target execution mode is a mode available to the first object during an interactive behavior; A control unit configured to, when receiving a mode switching instruction input by the first object, control the first object to execute an interactive behavior based on the target execution mode.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the control method for the interactive behavior according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the control method for the interactive behavior according to any one of claims 1 to 7.