Control method of robot and robot

By classifying and converting the natural language input by the user into JSON format, a sequence of action instructions is generated, which solves the semantic fragmentation problem of robots in complex natural language and achieves the accuracy and reliability of robot actions.

CN122245321APending Publication Date: 2026-06-19UBTECH ROBOTICS CORP LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UBTECH ROBOTICS CORP LTD
Filing Date
2026-04-22
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

During interactions with users, robots struggle to accurately understand and execute complex, multimodal, and ambiguous natural language instructions, resulting in a semantic gap between the output and execution layers and a lack of standardized instructions that directly drive the robot.

Method used

By classifying the natural language input from users to obtain question categories, and converting them into a sequence of action instructions in JSON format, the robot is driven to perform actions by uniformly representing cross-modal information using JSON format.

Benefits of technology

It achieves accuracy and reliability for robots in complex natural language, solves the semantic gap problem, and ensures the accuracy and consistency of action execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122245321A_ABST
    Figure CN122245321A_ABST
Patent Text Reader

Abstract

This application discloses a robot control method and a robot. The method classifies user-input natural language to obtain the user's question category. When the question category instructs the robot to perform an action task, the natural language is converted into JSON format to obtain an action instruction sequence. This sequence drives the robot to perform actions, resolving the semantic gap between the output of a large language model and the robot's execution layer in a natural language control system. This avoids manual secondary development and conversion, ensuring the accuracy and reliability of the robot's actions even in complex natural language environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robotics technology, and more particularly to a robot control method and a robot. Background Technology

[0002] During the interaction between the robot and the user, the robot's natural language control system usually relies on predefined keyword matching, finite state machines or manually programmed action scripts to understand and execute the natural language input by the user. Although it can understand natural language, the output is mostly descriptive text. There is a gap between the descriptive text and the robot's execution layer. There is a lack of standardized instructions that can directly drive the robot, which makes it difficult for the robot to cope with complex natural language containing multi-step, multi-modal, fuzzy descriptions or combined semantics. Summary of the Invention

[0003] Based on this, this application provides a robot control method and a robot, ensuring the accuracy and reliability of the robot's actions in complex natural language.

[0004] In a first aspect, this application provides a robot control method, including: In response to the user's input of natural language, the natural language is classified to obtain the user's question category; If the problem category instructs the robot to perform an action task, the natural language is converted into JSON format to obtain a sequence of action instructions. The robot is controlled to perform actions based on a sequence of action commands.

[0005] Secondly, this application also provides a robot control device, comprising: The classification unit is used to classify natural language input from the user to obtain the user's question category; The conversion unit is used to convert natural language into JSON format to obtain a sequence of action instructions if the problem category instructs the robot to perform an action task. The control unit is used to control the robot to perform actions based on a sequence of motion instructions.

[0006] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the robot control method provided in the first aspect above.

[0007] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the robot control method provided in the first aspect.

[0008] Fifthly, this application also provides a computer program product, including a computer program or instructions, which are executed by a processor using the robot control method provided in the first aspect.

[0009] Sixthly, this application also provides a robot that performs actions using the robot control method provided in the first aspect.

[0010] The robot control method provided in this application classifies the user's questions by responding to the user's input natural language to obtain the user's question category. When the question category instructs the robot to perform an action task, the natural language is converted into JSON format to obtain an action instruction sequence. The robot is driven to perform actions by the action instruction sequence. This method can solve the semantic gap problem between the output of the large language model and the robot execution layer in the natural language control system, avoid manual secondary development and conversion, and ensure the accuracy and reliability of the robot in performing actions under complex natural language. Attached Figure Description

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

[0012] Figure 1 A flowchart illustrating the robot control method provided in an embodiment of this application; Figure 2 A schematic block diagram of the robot control device provided in the embodiments of this application; Figure 3 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0016] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0017] Furthermore, in this application, unless otherwise explicitly specified or limited in the embodiments, the terms "installation," "connection," "joining," and "fixing" appearing in the embodiments should be interpreted broadly. For example, a connection can be a fixed connection, a detachable connection, or an integral part; it can also be a mechanical connection, an electrical connection, etc. Of course, it can also be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication between two components, or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific implementation.

[0018] The robot control method provided in this application can be applied to a terminal device, which can be the robot's control terminal. This terminal device can receive voice or text input from the user, classify the question category to obtain the user's question category, and when the question category instructs the robot to perform an action task, convert the natural language into JSON format to obtain an action instruction sequence. The robot is then driven to perform actions through this action instruction sequence. The terminal device can be a mobile phone, laptop, desktop computer, tablet, or other similar device.

[0019] It should be noted that the application scenarios described in the above embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0020] The control method of the robot provided in this application will be described in detail below.

[0021] like Figure 2 As shown, the method includes the following steps S110 to S130.

[0022] S110. In response to the natural language input by the user, classify the natural language to obtain the user's question category; S120. If the problem category instructs the robot to perform an action task, convert the natural language into JSON format to obtain a sequence of action instructions. S130: Control the robot to perform actions based on the sequence of action instructions.

[0023] In this embodiment, the natural language input by the user can be text converted by the speech recognition module, or text directly input by the user on the interactive interface.

[0024] This application can use a pre-trained text classification model or rule engine as a question classifier. In a large language model, it can classify the natural language input by the user through semantic keywords, sentence structure and contextual features to obtain the user's question category. Then, when it is determined to be an action task category, a JSON format conversion process is initiated to accurately control the robot to perform actions.

[0025] The question categories include at least those that instruct the robot to perform action tasks and those that instruct the robot to perform voice interactions.

[0026] As an example, this application can perform semantic encoding of natural language based on a binary classification model finely tuned to BERT, and select the question category corresponding to the highest probability by outputting a probability distribution through a fully connected layer.

[0027] As another example, this application can also match whether action-related trigger words appear in the input text based on a preset keyword library (such as walk, turn, jump, play, stand up, happy, proud) and regular expression rules. If the match is successful, it is classified as an action task category.

[0028] In addition, this application can also combine syntactic dependency analysis to identify the predicate verb and its arguments in the subject-verb-object structure, determine whether they refer to the robot's actions, and thus determine the problem category.

[0029] For example, if the user inputs "Please turn 90 degrees to the right", it is classified as containing a description of turning and angle, belonging to the category of instructing the robot to perform an action task; if the user inputs "How is the weather today", it can be classified as a voice interaction category. The user input does not enter the JSON conversion process, but instead calls the dialogue generation module to generate the corresponding response.

[0030] Specifically, in the process of converting natural language into JSON format, this application can pre-establish a set of universal JSON structured instruction protocols to map the robot's heterogeneous capabilities such as motion control, facial expression display, audio playback, and balance maintenance into structured data in a unified key-value pair format, so as to achieve seamless integration between large model output and robot execution system.

[0031] A sequence of motion instructions can include JSON objects containing multiple motion instruction units, each corresponding to a type of robot capability module. Examples include motion, emotion, rotation, audio, balance, and logic.

[0032] It should be noted that when generating action instruction sequences, you should avoid generating action instruction sequences in Markdown format.

[0033] As an example, this application can decompose and structurally generate natural language instructions based on a Large Language Model (LLM). This is achieved by designing a Prompt with explicit output constraints (e.g., "Please convert the following instructions to standard JSON." Standard JSON may include an Action root node, a motion field, a rotation field, an emotion field, and a logic field. The motion field includes a direction field and a distance field; the rotation field includes a direction field and an angel field; the emotion field's values ​​are limited to fields such as Smile / Proud / Anger / Doubt / Weakness; and the logic field's values ​​are limited to fields such as serial / parallel.)

[0034] As another example, this application can also use a rule template engine, combined with keyword extraction and parameter filling mechanisms, to sequentially fill in the corresponding positions of a pre-set JSON template with elements such as direction, distance, emotion words, and rhythm identified in natural language.

[0035] For example, if the user inputs natural language as "while making a proud facial expression, playing music at a C5 pitch of 1 / 4 beat, and moving forward 3 cm," and this is classified as an action task, the large language model will generate the following JSON instruction sequence: JSON { "Action": { "logic": "parallel", "emotion": "Proud", "audio": {"beat": "1 / 4", "pitch": "C5"}, "motion": [{"direction": "forward", "distance": "3cm"}] } } After generating the sequence of motion instructions, the sequence of motion instructions can be input into the robot to control the robot to perform actions that match the natural language input by the user.

[0036] For example, if the user inputs "walk a square with a side length of 4cm" in natural language, after classification and confirmation as an action task, the large language model will generate the following JSON instruction sequence: JSON { "Action": { "logic": "serial", "motion": [{"direction": "forward", "distance": "4cm"}], "rotation": [{"direction": "right", "angel": "90"}], / / Repeat 4 times (4 edges + 4 corners in total) } The fields of structured JSON can be defined as shown in Table 1: Table 1

[0037] In this application, the problem category is classified in response to the natural language input of the user. JSON format conversion is triggered only when the action is confirmed as the target, and the robot is then driven to execute based on this structured instruction sequence, thus realizing end-to-end mapping from natural language intent to physical action. At the same time, this application uses JSON as a unified intermediate representation across modalities to solve the semantic gap problem between the output of the large language model and the robot execution layer, ensuring the accuracy and reliability of action execution, and enabling the robot to truly understand and execute complex, multimodal, and unstructured natural language instructions.

[0038] In some embodiments, converting natural language into JSON format to obtain an action instruction sequence includes: analyzing and decomposing the natural language based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language; the set of JSON subfields includes at least one of motion fields, expression fields, rotation fields, audio fields, balance fields, and logic fields; and generating an action instruction sequence based on at least one of the motion subfields, expression subfields, rotation subfields, audio subfields, balance subfields, and logic subfields.

[0039] In this embodiment, the JSON field set can be understood as a pre-configured set of JSON fields with clear semantic boundaries and execution capability mapping relationships.

[0040] The JSON field set includes at least motion, expression, rotation, audio, balance, and logic fields.

[0041] Motion fields can be understood as fields used to characterize the displacement behavior of a robot in space. Their inherent function is to trigger the underlying motion actuators to generate directional movement actions. Motion fields can serve as structured semantic carriers corresponding to spatial verbs or phrases in natural language, such as forward, backward, left, and right, providing a basis for the subsequent generation of motion subfields such as direction (movement direction) and distance (movement distance).

[0042] The expression field can be understood as a field that represents the specific emotional state presented by the robot's facial display module. Its inherent function is to drive the expression rendering unit to call preset expression resources and complete the visualization output. The expression field can serve as a structured semantic carrier object corresponding to emotional adjectives or phrases such as happy, proud, angry, doubtful, and sad in natural language, providing a basis for the subsequent generation of expression subfields such as Smile, Proud, Anger, and Doubt.

[0043] The rotation field can be understood as a field used to characterize the change in orientation of a robot around its own vertical axis. Its inherent function is to trigger the rotation actuator to produce an angular deflection action. The rotation field can serve as a structured semantic carrier object corresponding to rotation verbs or phrases such as left turn, right turn, and turn direction in natural language, providing a basis for the subsequent generation of rotation subfields such as direction (rotation direction) and angel (rotation angle).

[0044] An audio field can be understood as a field used to characterize the speech or music signal played by the robot's speaker module at a specified beat and pitch. Its inherent function is to drive the audio synthesis unit to generate a playable audio stream according to parameters. The audio field can serve as a structured semantic carrier object corresponding to audio-related descriptions in natural language such as singing, playing music, using C5 pitch, and 1 / 4 time signature, providing a basis for subsequent generation of audio subfields such as beat and pitch.

[0045] The balance field can be understood as a semantic unit used to characterize the stability of a robot's static or dynamic posture. Its inherent function is to trigger the posture control unit to start the balance algorithm and adjust the joint torque output. The balance field can serve as a structured semantic carrier object corresponding to posture stability descriptions such as standing up, standing still, and maintaining balance in natural language, providing a semantic basis for the subsequent generation of balance subfields such as balance (standing up, maintaining balance).

[0046] Logical fields can be understood as semantic units used to represent the execution sequence or concurrency relationship between multiple instructions. Their inherent function is to define the scheduling strategy for the sequence of action instructions. Logical fields can serve as structured semantic carriers corresponding to sequential or concurrent conjunctions in natural language, such as first…then…, then, next, while…while…, simultaneously, and together, providing a basis for the subsequent generation of logical subfields such as serial and parallel.

[0047] A JSON subfield set can be understood as a set of JSON subfields that are identified from the natural language parsing process based on one of the following: motion field, expression field, rotation field, audio field, balance field, and logic field.

[0048] As an example, this application can perform semantic role labeling and dependency parsing on natural language based on a large language model to identify predicates and arguments related to motion, expression, rotation, audio, balance, and logic, thereby determining the semantic existence and parameter content of the corresponding JSON field set, i.e., the JSON subfield set.

[0049] As another example, this application can also perform pattern recognition and slot filling on natural language according to preset keyword matching rules and contextual semantic constraints, and extract the structured parameters corresponding to the JSON fields in the JSON field set from the natural language.

[0050] For example, when the user inputs the natural language "first smile proudly, then turn 90 degrees to the right, while simultaneously playing music in 1 / 4 time at C5 pitch," the system can identify the following based on a preset JSON field set: the "smile proudly" field corresponds to the "emoji" field, the "turn 90 degrees to the right" field corresponds to the "rotation" field, the "play music in 1 / 4 time at C5 pitch" field corresponds to the "audio" field, and "first...then..." and "simultaneously" correspond to the "logic" field. After analysis and decomposition, a JSON subfield set containing the emoji, rotation, audio, and logical subfields is obtained. Specifically, the emoji subfield content is "Proud," the rotation subfield content is "direction=right, angle=90," the audio subfield content is "beat=['1 / 4'], pitch=['C5']," and the logical subfield content is "parallel."

[0051] A motion subfield can be understood as a semantic instance of motion with complete direction and distance parameters. A motion subfield contains an object with two keys: direction and distance. Motion subfields can transform abstract descriptions of displacement in natural language into structured parameters that can be recognized by the robot's motion controller.

[0052] The expression subfield can be understood as a semantic instance of an expression with a clear emotional identifier. The expression subfield can be a preset expression code (such as Smile, Proud). The expression subfield can transform the abstract description of emotion expression in natural language into a resource index that can be called by the robot's expression rendering module.

[0053] A rotation subfield can be understood as a rotation semantic instance with complete direction and angle parameters. A rotation subfield contains an object with two keys: direction and angle. Rotation subfields can transform abstract descriptions of orientation changes in natural language into structured parameters that can be recognized by a robot's rotation actuator.

[0054] The audio subfield can be understood as an audio semantic instance with complete beat and pitch parameters. The audio subfield contains two keys: beat and pitch, each with a string array as its value. The audio subfield can transform abstract descriptions of sound output from natural language into structured parameters that can be generated by the robot's audio synthesis unit.

[0055] The balance subfield can be understood as a balance semantic instance with explicit attitude stability semantics. The balance subfield can be the string "balance". The balance subfield can transform the abstract description of attitude maintenance in natural language into a trigger signal that the robot's attitude control unit can respond to. A logical subfield can be understood as a logical semantic instance with explicit serial or parallel semantics. A logical subfield can be either a string (serial) or a string (parallel). Logical subfields can transform abstract descriptions of execution order in natural language into scheduling strategies that can be executed by the robot instruction scheduler.

[0056] For example, when the JSON subfield set contains the logical subfield (parallel), the emoji subfield (Proud), the audio subfield (beat=[1 / 4], pitch=[C5]), and the motion subfield (direction=forward, distance=3), filling it into the JSON-formatted action instruction template yields the following action instruction sequence: JSON { Action: { logic: parallel, emotion: [Proud], audio: {beat: [1 / 4], pitch: [C5]}, motion: [{direction: forward, distance: 3}] } } In this application, the multimodal action intent contained in natural language is semantically recognized and structurally decomposed based on a preset JSON field set to achieve unified encoding of cross-modal instructions. This enables heterogeneous capabilities such as motion, facial expression, rotation, audio, balance, and logic to be co-expressed in the same data structure. The robot can automatically route to the corresponding execution module according to the field type and select serial or parallel scheduling strategy according to the logic field. This solves problems such as inconsistent multimodal action protocols, non-standard instruction expression, and uncontrollable collaborative execution, and improves the end-to-end conversion accuracy and execution consistency of natural language to robot actions.

[0057] Furthermore, this application can extend the design of the JSON field set by adding new JSON fields (such as "dance"). This is achieved by adding a corresponding field (e.g., "dance": {"type": "waltz"}) to the JSON field set and adapting the executor at the parsing layer. Simultaneously, the applicable model must be marked in the JSON field set (e.g., "left" direction only applies to the Myron car). When adding a new JSON field, the adaptation list must be updated. The adaptation list is shown in Table 2. Table 2

[0058] In some embodiments, the natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: if there is a motion field in the natural language, extracting motion parameters from the natural language; the motion parameters include at least one of the robot's movement direction, movement distance, and movement time; obtaining the robot's target movement distance and target movement direction based on at least one of the movement direction, movement distance, and movement time; and generating motion subfields based on the target movement distance and target movement direction.

[0059] In this embodiment, the direction of movement can be any of the following: forward, back, left, and right. The identification is based on directional adverbs, verbs, or prepositional structures related to displacement in natural language (for example, forward corresponds to forward, left corresponds to left, and back corresponds to back).

[0060] The distance traveled can be expressed as a quantity with units, such as 30 centimeters, 1 meter, or two steps. The value is then converted to centimeters as the base unit. When no value is explicitly given, a default distance value (such as 30 centimeters) is used.

[0061] Movement time can be expressed as a continuous quantity with a time unit, such as 3 seconds, 5 seconds, or completed within 2 seconds. The value is normalized to the second as the base unit. When no time is explicitly given, it is not included in subsequent target distance calculations.

[0062] As an example, this application can perform semantic parsing of natural language using a large language model to identify key verbs, locative words, and quantity phrases related to displacement actions, and extract the direction of movement, distance of movement, and time of movement based on predefined keyword mapping rules.

[0063] As another example, this application can also be based on a combination of regular expression matching and dependency parsing to locate time adverbs, manner adverbs and quantity complements that modify displacement actions in natural language, thereby extracting the above three motion parameters in a structured manner.

[0064] For example, if the user inputs "move 50 centimeters to the right" in natural language, the direction of movement to the right is identified as "right," and the distance of movement to the right is 50 centimeters. Since no time description is given, the movement time is null. If the user inputs "move forward in 4 seconds," the direction of movement is identified as "forward," and the movement time is 4 seconds. However, no distance is specified, so the movement distance is temporarily empty. If the user inputs "move back two steps," the two steps are converted into a movement distance of 60 centimeters according to the preset step length conversion rule (single step = 30 cm), and the movement direction is "back."

[0065] The target movement direction can be the movement direction itself, or it can be a direction obtained by logically modifying the movement direction. When the movement direction is explicitly specified, the target movement direction is that specified direction; when the movement direction is not specified but there are other clues to the direction that can be deduced (such as contextual implicit orientation or the initial attitude of the device), the target movement direction can be determined based on the preset default direction.

[0066] The target movement distance can be the movement distance itself, or a distance value calculated based on the movement distance or movement time. When the movement distance is explicitly specified, the target movement distance is that specified distance. When only the movement time is specified, the target movement distance can be obtained by multiplying the preset movement speed by that time. When both movement distance and movement time exist and the calculated distances are inconsistent, the movement distance shall prevail. When neither is specified, the target movement distance adopts the preset default distance value.

[0067] The preset movement speed can be the standard linear velocity used by the robot when performing motion subfields, such as 15 cm / s. It can be an inherent configuration parameter that does not change dynamically with user input.

[0068] The default distance can be 30 cm, which can be used to fill in the missing distance information in natural language and ensure the executability of the motion subfield.

[0069] The default direction can be forward, which can be used to fill in the missing direction information in natural language and ensure that the motion subfield has complete direction semantics.

[0070] As an example, this application can determine whether to directly use the direction as the target movement direction based on whether the movement direction exists; if it exists, the direction is assigned as the target movement direction; if it does not exist, the preset default direction is used as the target movement direction.

[0071] As another example, this application can also select a corresponding distance determination strategy based on the combination of movement distance and movement time: when only movement distance exists, it is directly used as the target movement distance; when only movement time exists, it is multiplied by the preset movement speed and rounded to obtain the target movement distance; when both exist, the movement distance is preferred as the target movement distance.

[0072] For example, if the user's input in natural language means "go left", the movement direction is identified as "left", with no movement distance or time. Therefore, the target movement direction is "left", and the target movement distance is the default distance of 30 cm. If the user's input in natural language means "move forward for 2 seconds", the movement direction is "forward", and the movement time is 2 seconds. Based on this, the target movement distance is calculated as 15cm / s × 2s = 30cm, and the target movement direction is "forward". If the user's input in natural language means "move backward for 1.5m", then 1.5m is converted to 150 cm, the target movement distance is 150 cm, and the target movement direction is "back".

[0073] Specifically, this application can generate a motion subfield of {direction: right, distance: 50} for the case where the target movement direction is right and the target movement distance is 50 cm; generate a motion subfield of {direction: forward, distance: 30} for the case where the target movement direction is forward and the target movement distance is 30 cm; and generate a motion subfield of {direction: back, distance: 150} for the case where the target movement direction is back and the target movement distance is 150 cm.

[0074] In this application, by accurately identifying motion fields from natural language, key parameters such as movement direction, movement distance, and movement time are extracted. Combined with preset default values, unit conversion rules, and speed calculation logic, target movement parameters with clear directional and distance semantics are generated. Finally, structured, verifiable, and executable motion subfields are output. This eliminates the need for manually preset path trajectories or action sequences, and does not rely on fixed template matching. By relying on semantic understanding capabilities, it achieves automatic mapping from fuzzy input to precise instructions, thereby effectively addressing common expression problems in user instructions such as missing direction, fuzzy distance, and time replacing distance. This improves the robot's robustness in understanding and executing natural language motion subfields.

[0075] In some embodiments, obtaining the target moving distance and target moving direction of the robot based on at least one of moving direction, moving distance, and moving time includes: if the motion parameter includes moving direction, obtaining the target moving direction and target moving distance based on the moving direction and a preset moving distance respectively; if the motion parameter includes moving direction and moving distance, obtaining the target moving direction and target moving distance based on the moving direction and moving distance respectively; if the motion parameter includes moving direction and moving time, obtaining the moving distance based on the moving time and a preset moving speed, and obtaining the target moving direction and target moving distance based on the moving direction and moving distance respectively.

[0076] Specifically, this application enables preset distance and movement direction in motion parameters when the motion parameters only contain direction; directly adopts movement direction and movement distance in motion parameters when the motion parameters contain both direction and distance; and introduces preset speed for conversion when the motion parameters contain both direction and time. This achieves robust completion of missing, ambiguous, or heterogeneous expressions of motion parameters in natural language, thereby providing a sequence of action instructions with complete structure, clear semantics, and controllable boundaries for robot action execution, significantly improving the adaptability to low-information input and the consistency of action response.

[0077] In some embodiments, obtaining the target movement direction and target movement distance based on the movement direction and movement distance respectively includes: if the movement distance is greater than or equal to a distance threshold, using the distance threshold as the target movement distance and the movement direction as the target movement direction; if the movement distance is less than the distance threshold, using the movement distance as the target movement distance and the movement direction as the target movement direction.

[0078] In this embodiment, the distance threshold can be understood as the maximum allowable movement distance boundary value set to ensure the safety and feasibility of robot movement. It can perform legality verification on the original movement distance extracted from natural language, preventing the command from exceeding the robot's physical movement capability range due to excessively large user input values ​​(e.g., moving forward one kilometer), thereby avoiding the risks of execution failure, mechanical overload, or environmental collision. The distance threshold can be 200 cm.

[0079] Specifically, when the moving distance exceeds the preset distance threshold, the distance parameter is forcibly constrained to the upper limit of the threshold, while the original direction information is fully preserved to ensure that the directionality of the action intention is not weakened, and only the amplitude is safely normalized; when the moving distance does not exceed the preset distance threshold, that is, the moving distance specified by the user is within the safe execution range of the robot, the original extraction result is directly used as the target parameter without truncation or replacement, ensuring the integrity of the instruction semantics and the accuracy of the response.

[0080] For example, when the user inputs to walk forward 300 cm, the system extracts the movement direction as forward and the movement distance as 300 cm from the natural language. After judgment, 300 cm is greater than the preset distance threshold of 200 cm, so the target movement distance is set to 200 cm, and the target movement direction is still forward. The final generated motion subfield is {direction:forward, distance: 200}. When the user inputs to walk to the left 15 cm, the extracted movement distance of 15 cm is less than 200 cm, so the system directly uses this value and generates the motion subfield as {direction: left, distance: 15}.

[0081] In this application, by comparing the moving distance with a preset distance threshold and selectively using the threshold or the original distance as the target moving distance based on the comparison result, while always retaining the original moving direction as the target moving direction, robust adaptation and safety constraints of motion parameters in natural language are achieved. This effectively solves the problem of actions being unexecutable due to user mis-input or exaggerated expression, and improves the engineering practicality, operational stability and human-computer interaction safety of the robot control system.

[0082] In some embodiments, the natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: if there is a rotation field in the natural language, extracting rotation parameters from the natural language; the rotation parameters include at least one of the robot's rotation direction and rotation angle; obtaining the robot's target rotation direction and target rotation angle based on at least one of the rotation direction and rotation angle; and generating an audio subfield based on the target rotation direction and target rotation angle.

[0083] In this embodiment, rotation parameters are used as inputs for subsequently determining the target rotation direction and angle, and their extraction process relies on the structured parsing capability of the large language model for natural language semantics. The rotation parameters include at least one of the robot's rotation direction and rotation angle.

[0084] The direction of rotation can be understood as the reference orientation of the robot's rotation around its vertical axis, which can be left, right, clockwise, counterclockwise, or back.

[0085] Rotation angle can be understood as the angular value covered by the robot's rotation around the vertical axis, with the unit being degrees (°) and the value range being 0° to 360°. It can be expressed explicitly (such as 90 degrees, half a circle) or implicitly (such as a full rotation corresponding to 360°, a right angle corresponding to 90°).

[0086] As an example, this application can identify the rotation direction and rotation angle based on the co-occurrence relationship between locative verbs and angle adverbs in natural language, combined with a preset keyword database.

[0087] As another example, this application can also infer the implicit rotation direction and rotation angle based on the semantic orientation of time adverbs or path descriptions in natural language.

[0088] In addition, this application can also directly output standardized rotation direction and rotation angle by using a large language model to perceive the context of the semantics of the whole sentence.

[0089] For example, when the user inputs "turn left once", the large language model recognizes the directional verb "turn left" as the rotation direction "left", and the degree adverb "once" is mapped to a rotation angle of 90° by default in this embodiment; when the user inputs "turn half a circle clockwise", the large language model maps clockwise to the rotation direction "right" (according to the robot coordinate system convention, clockwise is equivalent to turning right), and resolves half a circle to a rotation angle of 180°; when the user inputs "turn in place", the large language model recognizes the complete rotation intention, determines the rotation angle to be 360°, and sets the rotation direction to "right" according to the default rules.

[0090] The target rotation direction can be understood as the direction of the actuator's movement after parameter verification and default filling, and its value is left or right; the target rotation angle can be understood as the angle of the actuator's movement after unit normalization, numerical truncation and sign processing, and its value is 0° to 360°.

[0091] Specifically, if the rotation parameters only include the rotation direction, then the rotation direction is taken as the target rotation direction, and the preset rotation angle 90° is taken as the target rotation angle; if the rotation parameters only include the rotation angle, then the preset rotation direction right is taken as the target rotation direction, and the rotation angle is taken as the target rotation angle; if the rotation parameters include both the rotation direction and the rotation angle, then the rotation direction is taken as the target rotation direction, and the rotation angle is taken as the target rotation angle.

[0092] For example, when the user inputs "turn left," no explicit angle is extracted, so the default rotation angle of 90° is used, determining the target rotation direction as "left" and the target rotation angle as 90°; when the user inputs "turn 180°," no explicit direction is extracted, so the default rotation direction as "right" is used, determining the target rotation direction as "right" and the target rotation angle as 180°; when the user inputs "turn right 270°," the rotation direction "right" and rotation angle of 270° are extracted, directly determining the target rotation direction as "right" and the target rotation angle as 270°; when the user inputs "turn left..." If the angle is 45°, then the absolute value of the negative angle is 45°, and the rotation direction is reversed to right. Finally, the target rotation direction is determined to be right and the target rotation angle is 45°.

[0093] In this application, the target rotation direction and target rotation angle can be assigned to the direction key and angel key under the rotation field, respectively, to form a key-value pair in the form of {direction: right, angel: 90}; or multiple rotation subfields can be organized into an array form, and when the natural language implies multiple rotation intentions (such as four consecutive right turns), a rotation array containing four identical elements can be generated.

[0094] In addition, this application may omit the rotation field or set its value to an empty array when the target rotation angle is an integer multiple of 0° or 360°, in order to avoid invalid execution.

[0095] For example, when the target rotation direction is left and the target rotation angle is 90°, the generated rotation instruction is {direction: left, angel: 90}; when the target rotation direction is right and the target rotation angle is 360°, the generated rotation instruction is {direction: right, angel: 360}; when the natural language indicates a left turn followed by a right turn, it is marked as serial in the logical field, and two rotation instructions are generated and placed in different action cycles.

[0096] This application parses rotation intentions in natural language into rotation direction and rotation angle, standardizes and maps them into target rotation direction and target rotation angle, and finally generates rotation instructions that conform to the JSON protocol specification. This enables the robot to accurately respond to the user's abstract description of orientation changes. At the same time, rotation instructions can cooperate with other instructions such as motion and emotion to participate in serial or parallel scheduling, thereby supporting complex task scenarios that require multi-step rotation coordination, such as square trajectory planning and dance choreography.

[0097] In some embodiments, obtaining the target rotation direction and target rotation angle of the robot based on at least one of rotation direction and rotation angle includes: if the rotation parameter includes rotation direction, using the rotation direction and preset rotation angle as the target rotation direction and target rotation angle respectively; if the rotation parameter includes rotation angle, using the preset rotation direction and rotation angle as the target rotation direction and target rotation angle respectively; if the rotation parameter includes rotation direction and rotation angle, using the rotation direction and rotation angle as the target rotation direction and target rotation angle respectively.

[0098] Specifically, this application achieves robust parsing of diverse rotation expressions in natural language by using preset rotation angles to complete the direction when rotation parameters are incomplete, preset rotation directions to complete the angle, and directly using the original parameters when parameters are complete. At the same time, by using the regular setting of preset values ​​(such as preset angle of 90° and preset direction of right) and boundary constraint mechanisms (such as angle ≤ 360°), it ensures the completeness and determinism of command generation, and avoids action failure or abnormal deflection caused by vague or brief user expressions, thereby improving the robot's ability to understand and tolerate unstructured voice commands and the stability of action execution.

[0099] In some embodiments, the natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: if there is an audio subfield in the natural language, extracting beat information and pitch information from the natural language; and generating the audio subfield based on the beat information and pitch information.

[0100] Specifically, beat information can be understood as rhythm units implicitly or explicitly expressed in the user's language, used to indicate the relationship between the time granularity and duration of audio playback. It usually corresponds to standard music beat symbols, such as any one or a combination of 1 / 8, 1 / 4, 1 / 2, 1, 2.

[0101] Pitch information can be understood as an audio frequency level identifier implicit or explicit in the user's language, used to indicate the position of the phonetic note in the scale. In the relevant technical field, it usually corresponds to a single note or group of notes in the international standard pitch name system, such as any one or a combination of C5, D5, E5, F5, G5, A5, B5, C6.

[0102] In this embodiment, beat information and pitch information together constitute the two basic parameter dimensions of the audio subfield. They are extracted synchronously and used as the direct basis for subsequent generation of the audio subfield. When the user input is to play music with a proud expression while playing music at C5 pitch and 1 / 4 beat, the C5 pitch and 1 / 4 beat are identified as corresponding to pitch information and beat information, respectively, and are temporarily stored in the current instruction parsing context in a structured form for use in the next step of generation. When the input is to sing a song, the system generates a combination of beat and pitch arrays of consistent length and semantically reasonable according to preset rules to ensure that the audio subfield is executable.

[0103] For example, if the user's input is to play a 1 / 2 beat rhythm at the G5 pitch, the rhythm information is identified as [1 / 2] and the pitch information as [G5]. If the user's input is to sing a cheerful song and no explicit rhythm and pitch description is obtained, a rhythm array [1 / 4, 1 / 4, 1 / 4] of length 3 and a corresponding pitch array [C5, E5, G5] are randomly generated according to preset rules. If the user's input is to play two pitches, C5 and D5, each lasting 1 / 8 beat, the rhythm information is extracted as [1 / 8, 1 / 8] and the pitch information as [C5, D5].

[0104] In the process of generating audio subfields based on beat information and pitch information, there is no need to change the original semantics of beat information and pitch information; they are simply organized into a data structure that can be parsed by the robot actuator according to a preset JSON template.

[0105] Meanwhile, when both beat and pitch information are not empty, an audio object containing two subfields, beat and pitch, is generated; when either information is empty, the audio field is not generated; when the input is to sing a song, a default audio subfield {beat: [1 / 4], pitch: [C5]} is generated, which can be expanded into a multi-element array according to the context.

[0106] In this application, by extracting beat and pitch information from natural language and generating structured audio subfields accordingly, the accurate capture and executable transformation of user music-related intentions are achieved. With the help of dual-parameter modeling of beat and pitch, various audio expression forms such as single-note prompts, multi-note melodies and rhythmic playback are supported. At the same time, combined with the standardized encapsulation of JSON templates, the audio subfields can coexist with other modal instructions (such as motion and emotion) in the same action instruction sequence, thereby providing a data foundation for subsequent serial or parallel scheduling.

[0107] In some embodiments, the logical subfield includes serial instructions or parallel instructions; based on a preset JSON field set, the natural language is analyzed and decomposed to obtain a JSON subfield set of the natural language, including: if logical fields exist in the natural language, extracting the order information of the instructions in the robot's action instruction sequence from the natural language; and generating serial instructions or parallel instructions according to the order information.

[0108] In this embodiment, logical fields can be chronological words, parallel words, or their semantic equivalents that appear explicitly in the user's natural language.

[0109] Among them, sequential words can be linguistic components that indicate the order of actions, such as first…then…, then, next, after, subsequently, first step…second step…; parallel words can be linguistic components that indicate multiple actions occurring simultaneously, such as while…while…, at the same time, together, together, synchronously, at the same time.

[0110] Sequence information is used to determine the scheduling relationship between each instruction module (including motion subfield, expression subfield, rotation subfield, audio subfield, and balance subfield) in the action instruction sequence, which is the direct basis for generating serial or parallel instructions.

[0111] As an example, this application can identify whether natural language contains the aforementioned sequential or parallel words by keyword matching, and use the matching results as sequence information.

[0112] As another example, this application can also perform semantic parsing of natural language through a large language model, determine its implicit execution logic relationship, and output structured sequence labels.

[0113] In addition, this application can also combine dependency parsing and rule template joint identification to infer action execution constraints from the subject-verb-object structure and the position of conjunctions in a sentence.

[0114] For example, when the user inputs natural language as "walk forward 5 cm, then turn 90 degrees to the right", the system recognizes the "first...then..." structure and extracts the sequence information as "motion" → "rotation", meaning the motion subfield should be executed before the rotation subfield. When the user inputs natural language as "play C5-pitch music while smiling proudly", the system recognizes the "while..." structure and extracts the sequence information as "audio" and "emotion" are executed synchronously, meaning the audio subfield and the emotion subfield should be scheduled in parallel. When the user inputs natural language as "walk forward 3 cm, turn 45 degrees to the right, and display the Proud expression simultaneously", the system recognizes the word "simultaneously" and extracts the sequence information as "motion", "rotation", and "emotion" are executed in parallel.

[0115] Serial instructions can be understood as logical control instructions that instruct a robot to execute multiple action instructions sequentially in a specified order; parallel instructions can be understood as logical control instructions that instruct a robot to start and execute multiple action instructions synchronously. Serial instructions can be key-value pairs in JSON format with the key name "logic" and the value "serial," while parallel instructions can be key-value pairs in JSON format with the key name "logic" and the value "parallel."

[0116] In this embodiment, serial instructions are used to drive the robot's underlying actuator to call each instruction module in sequence, with the next module starting only after the previous module has finished executing; parallel instructions are used to drive the robot's underlying actuator to trigger the execution entry points of multiple modules at the same time, with multi-threading or hardware-level synchronization mechanisms ensuring that the start times of the actions are consistent.

[0117] As an example, this application can generate serial instructions based on whether there are sequence-related words in the sequence information, and if so, generate them.

[0118] As another example, this application can also generate parallel instructions based on whether parallel words exist in the sequence information, and if so, generate parallel instructions.

[0119] In addition, when the sequential information contains both temporal and parallel structures, this application can also generate composite scheduling instructions by using nested logical fields (e.g., the outer layer is parallel and the inner subsequence contains serial).

[0120] For example, when the user inputs natural language as "take a step and then jump", a JSON field {logic: serial} is generated, and the robot executes the two types of instructions, motion and jump, in sequence (although the latter is not listed in the original six categories of this application, it belongs to the scope of the extensible instruction set and does not affect the explanation of this step); when the user inputs natural language as "wave and speak", a JSON field {logic: parallel} is generated, and the robot simultaneously starts the hand_wave sub-instruction in motion and the speech sub-instruction in audio; when the user inputs natural language as "smile proudly first and then move forward while playing music", a nested logical structure of outer serial and inner parallel is generated (see the extended implementation of embodiment 9), in which the proud smile is executed alone, and moving forward and playing music are executed in parallel.

[0121] In this application, by identifying sequential or parallel words in natural language that represent the execution order, the scheduling constraints between action instructions are extracted, and corresponding serial or parallel instructions are generated accordingly. This enables the robot to accurately respond to the user's semantic expression of the rhythm and coordination of action execution. At the same time, the serial or parallel logic is mapped to the logic field in a unified JSON structure. Thus, without changing the underlying action executor interface, the orderly arrangement and synchronous response of multimodal actions are achieved, so as to achieve high-fidelity reproduction of complex interaction intentions and improve the task completion rate and behavior realism of human-computer natural language interaction.

[0122] In some embodiments, after classifying the natural language in response to user input to obtain the user's question category, the method further includes: generating chat information in natural language if the question category instructs the robot to perform voice interaction.

[0123] In this embodiment, voice interaction can be understood as user input content that does not semantically possess action triggering conditions, such as not containing instruction type keywords such as movement, rotation, facial expression, audio, balance, or logical scheduling, nor possessing a syntactic structure that can be parsed into structured action parameters.

[0124] Specifically, this application adds a voice interaction path judgment mechanism after natural language classification. By combining the semantic attributes of the question category with the action trigger dictionary matching results, it can achieve accurate recognition and independent response to non-action inputs. This allows for the differentiation of two interaction paradigms under the same input interface: instruction execution and daily dialogue. This avoids misprocessing of chat statements by the action parsing module, thereby improving the robustness, naturalness, and user acceptance of the overall interaction system.

[0125] In some embodiments, controlling a robot to perform actions based on an action command sequence includes: verifying the action command sequence to obtain verification information of the action command sequence; if the verification information is a preset first information, controlling the robot to perform actions based on the action command sequence.

[0126] In this embodiment, during the verification of the action instruction sequence, a consistency check can be performed on the syntax structure, field existence, parameter value range, and modal compatibility of the action instruction sequence based on a preset set of legality rules.

[0127] Specifically, this application can identify and mark instruction content that does not meet the execution prerequisites by verifying the action instruction sequence, including but not limited to: JSON format parsing failure, missing required fields (such as the logic field not appearing), movement distance exceeding the preset distance threshold, rotation angle exceeding the preset angle upper limit, pitch or beat value not within the predefined set, expression type not belonging to the preset expression code set, and modal combinations with logical conflicts in the same instruction sequence (such as specifying indivisible composite motion parameters simultaneously under serial logic).

[0128] Verification information can be understood as a status indicator representing the verification result. Verification information includes preset first information and preset second information. The first information indicates that the verification passed, that is, the action instruction sequence satisfies all legality constraints and is executable; the second information indicates that the verification failed, that is, there is at least one parameter or structure in the action instruction sequence that does not satisfy the legality constraints.

[0129] Specifically, this application can trigger the robot's underlying execution engine to load and distribute the sequence of motion instructions to the corresponding modal actuators (including motion control module, expression display module, rotation drive module, audio playback module, and balance adjustment module) only when the verification information is the first information, thereby avoiding execution abnormalities, hardware malfunctions, or system crashes caused by parameter out-of-bounds errors, missing fields, or semantic conflicts.

[0130] In this application, by introducing parameter boundary checks, field integrity verification, and modal compatibility assessment in the verification process, the legality of the action instruction sequence is filtered before it enters the execution stage. The verification information can be used as an execution gating signal to ensure that the robot action response is activated only when all constraints are met. This significantly improves the system's operational stability and user interaction security without changing the original instruction generation logic. It effectively prevents illegal instructions from being executed due to natural language understanding bias or large model illusion, and provides a standardized interface foundation for subsequent extended enhanced security mechanisms such as energy consumption verification, timing conflict detection, and multi-robot collaborative verification.

[0131] The robot control method provided in this application supports multi-step, multi-modal commands (such as square trajectories and simultaneous movement and facial expressions), eliminating the need for users to break down simple commands and improving interaction efficiency by more than 50%. Simultaneously, it achieves synchronized execution of facial expressions, movements, and music through parallel logic, resulting in a natural interaction approaching that of humans. It also supports complex path planning (polygons, curves) and dynamic task combinations, making it suitable for scenarios ranging from simple movements to complex performances. Furthermore, it allows for scalable command set design; adding new functions (such as new facial expressions and new movement modes) only requires expanding parameter mapping, reducing adaptation costs to as low as 70%.

[0132] In some embodiments, the present invention also provides a robot control device 200, which is used to execute any of the aforementioned robot control methods.

[0133] Specifically, please refer to Figure 2 , Figure 2 This is a schematic block diagram of the robot control device 200 provided in an embodiment of the present invention.

[0134] like Figure 2 As shown, the robot control device 200 provided in this application includes: a classification unit 210, a conversion unit 220, and a control unit 230.

[0135] The classification unit 210 is used to classify the natural language input by the user in response to the natural language input to obtain the user's question category; the conversion unit 220 is used to convert the natural language into JSON format to obtain the action instruction sequence if the question category instructs the robot to perform an action task; the control unit 230 is used to control the robot to perform actions based on the action instruction sequence.

[0136] The robot control device 200 provided in this application embodiment can classify the user's question category in response to the user's input natural language to obtain the user's question category. When the question category instructs the robot to perform an action task, the natural language is converted into JSON format to obtain an action instruction sequence. The robot is driven to perform actions through the action instruction sequence. This can solve the semantic gap problem between the output of the large language model and the robot execution layer in the natural language control system, avoid manual secondary development and conversion, and ensure the accuracy and reliability of the robot in performing actions under complex natural language.

[0137] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the robot's control device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0138] The control device for the aforementioned robot can be implemented as a computer program, which can, for example... Figure 3 It runs on the electronic device shown.

[0139] Please see Figure 3 , Figure 3 This is a schematic block diagram of the electronic device 300 provided in an embodiment of the present invention.

[0140] See Figure 3 The electronic device 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a storage medium 303 and internal memory 304.

[0141] The storage medium 303 can store the operating system 3031 and the computer program 3032. When the computer program 3032 is executed, it enables the processor 302 to execute the robot's control method.

[0142] The processor 302 provides computing and control capabilities to support the operation of the entire electronic device 300.

[0143] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute the robot control method.

[0144] The network interface 305 is used for network communication, such as providing data transmission. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device 300 to which the present invention is applied. The specific electronic device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0145] The processor 302 is used to run the computer program 3032 stored in the memory to perform the following functions: responding to the natural language input by the user, classifying the natural language to obtain the user's question category; if the question category instructs the robot to perform an action task, converting the natural language into JSON format to obtain an action instruction sequence; and controlling the robot to perform actions based on the action instruction sequence.

[0146] Those skilled in the art will understand that Figure 3 The embodiments of the electronic device 300 shown do not constitute a limitation on the specific configuration of the electronic device 300. In other embodiments, the electronic device 300 may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, in some embodiments, the electronic device 300 may include only a memory and a processor 302. In such embodiments, the structure and function of the memory and processor 302 are different from those shown. Figure 3 The embodiments shown are consistent and will not be described again here.

[0147] It should be understood that, in this embodiment of the invention, the processor 302 may be a Central Processing Unit (CPU), or it may be another general-purpose processor 302, a digital signal processor 302 (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor 302 may be a microprocessor 302, or it may be any conventional processor 302, etc.

[0148] According to one aspect of this application, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the following steps: in response to natural language input by a user, classifying the natural language to obtain a user's question category; if the question category instructs a robot to perform an action task, converting the natural language into JSON format to obtain a sequence of action instructions; and controlling the robot to perform actions based on the sequence of action instructions.

[0149] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0150] In another embodiment of the invention, a computer storage medium is provided. This storage medium can be a non-volatile computer-readable storage medium or a volatile storage medium. The storage medium stores a computer program 3032, which, when executed by a processor 302, performs the following steps: in response to natural language input by a user, classifying the natural language to obtain the user's question category; if the question category instructs the robot to perform an action task, converting the natural language into JSON format to obtain an action instruction sequence; and controlling the robot to perform actions based on the action instruction sequence.

[0151] The storage medium can be any computer-readable storage medium that can store program code, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0152] In some embodiments, this application also provides a robot that performs actions using the robot control method provided in this application, or includes the robot control device provided in this application, or includes the electronic device provided in this application, or includes the computer-readable storage medium provided in this application, or includes the computer program product provided in this application.

[0153] In this application, the robot may be a service robot, an educational robot, or an entertainment robot. The robot includes a main controller, a motion execution module, an expression display module, a rotation drive module, an audio playback module, a balance adjustment module, and a communication interface.

[0154] The main controller is connected to the motion execution module, expression display module, rotation drive module, audio playback module, and balance adjustment module via an internal bus. The communication interface is used to receive natural language commands input by the user and to feed back the processing results to external devices.

[0155] Specifically, the main controller is used to run the robot control method provided in this application, realizing the classification of natural language commands, JSON format conversion, and action execution control; the motion execution module is used to respond to the direction and distance parameters in the motion field, driving the wheeled chassis or articulated motors to complete forward, backward, left, and right movements; the expression display module is used to respond to the expression codes in the emotion field, displaying the expression images corresponding to Smile, Proud, Anger, Doubt, or Weakness through an LED array or LCD screen; the rotation drive module is used to respond to the direction and angel parameters in the rotation field, controlling the servo motors or servo motors to complete left or right turns; the audio playback module is used to respond to the beat and pitch parameters in the audio field, calling the built-in speaker to play audio signals with specified beats and pitches; the balance adjustment module is used to respond to the balance field, activating the gyroscope and attitude sensor to work together, adjusting the center of gravity to maintain an upright and stable state; the communication interface is used to communicate with external terminals via Wi-Fi, Bluetooth, or USB, receiving natural language input in the form of text or voice, and outputting execution status information.

[0156] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0157] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0158] The steps in the methods of this application embodiment can be adjusted, merged, or deleted according to actual needs. The units in the apparatus of this application embodiment can be merged, divided, or deleted according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0159] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods provided in the various embodiments of this application.

[0160] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A control method of a robot characterized by, include: In response to the natural language input by the user, the natural language is classified to obtain the user's question category; If the problem category instructs the robot to perform an action task, the natural language is converted into JSON format to obtain a sequence of action instructions. The robot is controlled to perform actions based on the sequence of action instructions.

2. The robot control method according to claim 1, characterized in that, The step of converting the natural language into JSON format to obtain an action instruction sequence includes: Based on a preset set of JSON fields, the natural language is analyzed and decomposed to obtain a set of JSON subfields of the natural language; the set of JSON fields includes at least one of motion fields, expression fields, rotation fields, audio fields, balance fields, and logic fields, and the set of JSON subfields includes at least one of motion subfields, expression subfields, rotation subfields, audio subfields, balance subfields, and logic subfields; The action instruction sequence is generated based on at least one of the motion subfield, the expression subfield, the rotation subfield, the audio subfield, the balance subfield, and the logic subfield.

3. The robot control method according to claim 2, characterized in that, The natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: If the motion field exists in the natural language, extract the motion parameters from the natural language; the motion parameters include at least one of the robot's movement direction, movement distance, and movement time; The target moving distance and target moving direction of the robot are obtained based on at least one of the moving direction, the moving distance, and the moving time. The motion subfield is generated based on the target movement distance and the target movement direction.

4. The robot control method according to claim 3, characterized in that, The step of obtaining the target movement distance and target movement direction of the robot based on at least one of the movement direction, the movement distance, and the movement time includes: If the motion parameters include the direction of movement, the target direction of movement and the target distance of movement are obtained based on the direction of movement and the preset distance of movement, respectively. If the motion parameters include the direction of movement and the distance of movement, the target direction of movement and the target distance of movement are obtained according to the direction of movement and the distance of movement, respectively. If the motion parameters include the direction of movement and the time of movement, the distance of movement is obtained based on the time of movement and the preset speed of movement, and the target direction of movement and the target distance of movement are obtained based on the direction of movement and the distance of movement, respectively.

5. The robot control method according to claim 4, characterized in that, The step of obtaining the target movement direction and the target movement distance based on the movement direction and the movement distance respectively includes: If the moving distance is greater than or equal to a preset distance threshold, the distance threshold is taken as the target moving distance, and the moving direction is taken as the target moving direction; If the moving distance is less than the distance threshold, the moving distance is taken as the target moving distance, and the moving direction is taken as the target moving direction.

6. The robot control method according to claim 2, characterized in that, The natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: If the rotation field exists in the natural language, extract the rotation parameters from the natural language; the rotation parameters include at least one of the robot's rotation direction and rotation angle; The target rotation direction and target rotation angle of the robot are obtained based on at least one of the rotation direction and the rotation angle. The audio subfield is generated based on the target rotation direction and target rotation angle.

7. The robot control method according to claim 6, characterized in that, The step of obtaining the target rotation direction and target rotation angle of the robot based on at least one of the rotation direction and the rotation angle includes: If the rotation parameters include the rotation direction, the rotation direction and the preset rotation angle are respectively taken as the target rotation direction and the target rotation angle; If the rotation parameter includes the rotation angle, the preset rotation direction and the rotation angle are respectively used as the target rotation direction and the target rotation angle; If the rotation parameters include the rotation direction and the rotation angle, the rotation direction and the rotation angle are respectively taken as the target rotation direction and the target rotation angle.

8. The robot control method according to claim 2, characterized in that, The natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: If the audio subfield exists in the natural language, extract the tempo information and pitch information from the natural language; The audio subfield is generated based on the beat information and the pitch information.

9. The robot control method according to claim 2, characterized in that, The logical subfield includes serial instructions or parallel instructions; The natural language is analyzed and decomposed based on a preset set of JSON fields to obtain a set of JSON subfields of the natural language, including: If the logical field exists in the natural language, extract the order information of the robot executing the action instruction sequence from the natural language; The serial instruction or the parallel instruction is generated based on the sequence information.

10. The robot control method according to any one of claims 1-9, characterized in that, After classifying the natural language in response to user input to obtain the user's question category, the method further includes: If the question category instructs the robot to perform voice interaction, it generates chat information in natural language.

11. The robot control method according to any one of claims 1-9, characterized in that, The step of controlling the robot to perform actions based on the sequence of action instructions includes: The action command sequence is verified to obtain the verification information of the action command sequence; If the verification information is the preset first information, the robot is controlled to perform actions based on the action instruction sequence.

12. A robot, characterized in that, The robot performs actions using the control method described in any one of claims 1-11.