Robot control method and device, electronic equipment and storage medium

By using the mechanism of task queues and task execution semaphores in surgical robots, responding to user instructions to control the start, pause and recovery of tasks, the problem of robot response delay in the prior art is solved, and more efficient and accurate task execution is achieved .

CN119396101APending Publication Date: 2025-02-07GUANGZHOU WEIMOU MEDICAL INSTR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411527786.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

Existing surgical robots fail to respond in time after receiving a pause or stop command, resulting in system delays, surgery interruptions or unstable task execution.

Method used

By responding to user-triggered start, pause and recovery instructions, the task queue and task execution semaphore are used to control the robot to perform tasks, ensuring that the task process is accurately restored under the pause state.

Benefits of technology

It improves the start and stop speed of the robot, reduces task execution delay, and ensures the accuracy of the task process when recovering in a paused state.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396101A_ABST
    Figure CN119396101A_ABST
Patent Text Reader

Abstract

The invention provides a robot control method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a target task corresponding to a starting instruction in response to the starting instruction triggered by a user, and adding the target task to a task queue; in response to a task execution semaphore released when the target task enters the task queue, controlling a robot to execute the target task; in response to a pause instruction triggered by a user, emptying the task queue, and continuously waiting for the task execution semaphore; and in response to a recovery instruction triggered by a user, monitoring the newly released task execution semaphore, and executing the corresponding target task. The starting and stopping speed of the robot can be increased, task execution delay is reduced, and the accuracy of the task process is guaranteed when recovery is conducted in the pause state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of robot technology, and in particular to a robot control method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of automation and AI technology, the requirements for start and pause controllers are getting higher and higher. In industrial production lines, in high-tech fields such as industrial production lines, automation equipment and artificial intelligence robots, how to achieve more efficient and reliable control has become the focus of research. Traditional control methods are stretched in the face of the increasing complexity and high requirements of modern equipment. In recent years, researchers have eliminated a variety of improvement schemes, such as smart switches based on electronic control, embedded controllers, etc. These methods attempt to improve system performance by improving hardware design and optimizing control algorithms.

[0003] Currently, in the field of surgical robots, robot start and stop control often relies on a simple command sending mechanism, which may cause the system to fail to respond in time after receiving a pause or stop command. This delay may cause surgical interruptions, unstable task execution, or poor user experience. For example, after the user clicks the pause button, the system may take a long time to completely stop the motor, and may need to repeatedly read the task status when resuming, which affects the real-time and accuracy of the system. Therefore, how to improve the start and stop speed of the robot, reduce task execution delays, and ensure the accuracy of the task process when resuming from a paused state has become an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present disclosure at least provide a robot control method, device, electronic device and storage medium, which can improve the start and stop speed of the robot, reduce task execution delays and ensure the accuracy of task progress when resuming from a paused state.

[0005] The present disclosure provides a robot control method, including:

[0006] In response to a start instruction triggered by a user, determining a target task corresponding to the start instruction and adding the target task to a task queue;

[0007] In response to a task execution semaphore released when the target task is enqueued in the task queue, controlling the robot to execute the target task;

[0008] In response to a pause instruction triggered by a user, the task queue is cleared, and the task execution semaphore is continuously waited for;

[0009] In response to a recovery instruction triggered by a user, the newly released task execution semaphore is monitored, and the corresponding target task is executed.

[0010] In an optional implementation, after responding to the recovery instruction triggered by the user, monitoring the newly released task execution semaphore, and executing the corresponding target task, the method further includes:

[0011] In response to an exit instruction triggered by the user, ending the target task currently being executed;

[0012] The target task is deleted from the task queue.

[0013] In an optional implementation, in response to a start instruction triggered by a user, determining a target task corresponding to the start instruction and adding the target task to a task queue specifically includes:

[0014] Obtaining the start instruction triggered by the user through the human-computer interaction interface;

[0015] Sending the start instruction to the kernel process through a data pipeline, and determining the target task triggered by the start instruction;

[0016] Pushing the target task to the task queue by the kernel;

[0017] When the target task is enqueued in the task queue, the task execution semaphore is released.

[0018] In an optional implementation, in response to a task execution signal released when the target task is queued in the task queue, controlling the robot to execute the target task specifically includes:

[0019] When the task management thread receives the task execution semaphore, pulling the target task from the task queue;

[0020] Acquire robot status data corresponding to the robot and user control command data;

[0021] Determine the target posture corresponding to the robot according to the robot state data and the control command data;

[0022] Control the machine to move to the target posture.

[0023] In an optional implementation, in response to a pause instruction triggered by a user, pausing the currently executed target task and continuously waiting for the task execution semaphore specifically includes:

[0024] Obtaining the pause instruction triggered by the user through the human-computer interaction interface;

[0025] Mark the target task currently being executed as a paused state;

[0026] Enter the task waiting state until the task execution semaphore is detected.

[0027] The present disclosure also provides a robot control device, including:

[0028] A start trigger module, used for responding to a start instruction triggered by a user, determining a target task corresponding to the start instruction and adding the target task to a task queue;

[0029] A task enqueuing module, configured to control the robot to execute the target task in response to a task execution signal released when the target task is enqueued into the task queue;

[0030] A pause trigger module, used to clear the task queue in response to a pause instruction triggered by a user, and continue to wait for the task execution semaphore;

[0031] The recovery trigger module is used to monitor the newly released task execution semaphore and execute the corresponding target task.

[0032] In an optional implementation manner, the device further includes an exit triggering module, wherein the exit triggering module is configured to:

[0033] In response to an exit instruction triggered by the user, ending the target task currently being executed;

[0034] The target task is deleted from the task queue.

[0035] An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned robot control method or steps in any possible implementation of the above-mentioned robot control method are performed.

[0036] The embodiments of the present disclosure also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program executes the above-mentioned robot control method or the steps in any possible implementation of the above-mentioned robot control method.

[0037] The embodiments of the present disclosure also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the above-mentioned robot control method, or the steps in any possible implementation of the above-mentioned robot control method.

[0038] The disclosed embodiments provide a robot control method, device, electronic device and storage medium, which, in response to a start instruction triggered by a user, determines the target task corresponding to the start instruction and adds the target task to a task queue; in response to a task execution signal released when the target task is enqueued in the task queue, controls the robot to execute the target task; in response to a pause instruction triggered by a user, empties the task queue and continues to wait for the task execution signal; in response to a resume instruction triggered by a user, monitors the newly released task execution signal and executes the corresponding target task. The robot's start and stop speed can be improved, task execution delay can be reduced, and the accuracy of the task process can be ensured when resuming in a paused state.

[0039] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0041] Figure 1 A flow chart of a robot control method provided by an embodiment of the present disclosure is shown;

[0042] Figure 2 A flow chart of another robot control method provided by an embodiment of the present disclosure is shown;

[0043] Figure 3 A schematic diagram of a robot control device provided by an embodiment of the present disclosure is shown;

[0044] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0046] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0047] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0048] Research has found that, currently, in the field of surgical robots, robot start and stop control often relies on a simple command sending mechanism, which may cause the system to fail to respond in time after receiving a pause or stop command. This delay may cause surgical interruptions, unstable task execution, or poor user experience. For example, after the user clicks the pause button, the system may take a long time to completely stop the motor, and may need to repeatedly read the task status when resuming, which affects the real-time and accuracy of the system. Therefore, how to improve the start and stop speed of the robot, reduce task execution delays, and ensure the accuracy of the task process when resuming from a paused state has become an urgent problem to be solved.

[0049] Based on the above research, the present disclosure provides a robot control method, device, electronic device and storage medium, which, in response to a start instruction triggered by a user, determines the target task corresponding to the start instruction and adds the target task to the task queue; in response to the task execution signal released when the target task is enqueued in the task queue, controls the robot to execute the target task; in response to a pause instruction triggered by a user, clears the task queue and continues to wait for the task execution signal; in response to a resume instruction triggered by a user, monitors the newly released task execution signal and executes the corresponding target task. The robot's start and stop speed can be improved, task execution delay can be reduced, and the accuracy of the task process can be guaranteed when resuming in a paused state.

[0050] To facilitate understanding of this embodiment, a robot control method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the robot control method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the robot control method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0051] See also Figure 1 FIG. 1 is a flowchart of a robot control method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S104, wherein:

[0052] S101 . In response to a start instruction triggered by a user, determine a target task corresponding to the start instruction and add the target task to a task queue.

[0053] In the specific implementation, the startup instruction triggered by the user through the human-computer interaction interface is obtained; the startup instruction is sent to the kernel process through the data pipeline, and the target task triggered by the startup instruction is determined; the kernel pushes the target task to the task queue; when the target task is enqueued in the task queue, the task execution semaphore is released.

[0054] Here, the user triggers the start instruction through a human-computer interaction interface (such as a touch screen, a button or other input device). The triggering of the start instruction can be that the user clicks a specific button or selects a corresponding option.

[0055] The system uses an event-driven model to capture user operations. For the QT framework, this is usually implemented through the signal and slot mechanism. When the user clicks the "Start" button, the relevant signal is emitted and connected to the slot function that processes the signal.

[0056] Optionally, the system parses the captured startup instruction to determine the target task it corresponds to. The content of the startup instruction is analyzed to extract necessary information (such as task type, parameters, etc.). The target task matching the instruction is searched in the system's task list or database.

[0057] Furthermore, once the target task is determined, the system adds the task to the task queue, which can adopt a FIFO (first in, first out) structure. The queue's insert function is called to put the target task at the end of the queue. The queue's status information, such as the number of tasks, task priority, etc., is updated.

[0058] In this way, it is ensured that the user's instructions are effectively captured and converted into tasks that the system can understand and execute, and the interaction between the user and the robot is realized by relying on the orderly coordination of event processing, task parsing and queue management.

[0059] S102 . In response to a task execution semaphore released when the target task is enqueued in the task queue, control the robot to execute the target task.

[0060] In the specific implementation, when the task management thread receives the task execution semaphore, it pulls the target task from the task queue; obtains the robot status data corresponding to the robot and the user's control command data; determines the target posture corresponding to the robot based on the robot status data and the control command data; and controls the machine to move to the target posture.

[0061] It should be noted that the execution order of the tasks contained in the task queue is sequential execution. In the embodiment of the present application, the target tasks pulled are sequentially pulled according to the execution order, and the tasks pulled during each task execution process are the target tasks.

[0062] Here, when the target task is successfully added to the task queue, a new task will be added to the queue. At this time, the queue status is updated to record the relevant information of the new task, such as task ID, priority, task parameters, etc.

[0063] At the same time, the system will release a task execution semaphore, usually through a system call or semaphore management function. The release of the task execution semaphore means that a new task is available for execution, notifying the task management thread.

[0064] Here, in a multithreaded environment, semaphores are used to coordinate operations between threads. The task management thread is awakened when it receives the semaphore, so that it is ready to start processing new tasks in the queue. After the task management thread detects the release of the semaphore, it performs corresponding processing.

[0065] The task management thread pulls the target task from the task queue. In the process of executing the target task, the system will obtain the current state data of the robot, which may include: position (coordinates), speed, motor state, sensor readings (such as vision, force feedback, etc.).

[0066] At the same time, the system will also obtain the user's control command data, which contains the specific parameters or target requirements required for task execution, such as: target posture (position and attitude), motion path, operation mode (such as speed, acceleration, etc.), and may also include the posture increment of 3D mouse data in different coordinate directions.

[0067] Exemplarily, based on the acquired robot state data, the end posture is calculated by forward kinematics, the posture increments in different coordinate directions corresponding to the 3D mouse data are read to calculate the target end posture, and then the target position of each click is calculated by inverse kinematics, and then a displacement command is sent to control the motor movement.

[0068] Furthermore, the system generates motion control instructions to instruct the robot how to move to the target position. These motion control instructions may include: motion trajectory planning, motor drive signals, and control strategies (such as PID control) to ensure smooth and precise movement.

[0069] Optionally, during the execution of the task, the system can monitor the status of the robot in real time so as to make necessary adjustments. If it deviates from the predetermined trajectory, the system will dynamically modify the control instructions.

[0070] S103 . In response to a pause instruction triggered by a user, clear the task queue and continue to wait for the task execution semaphore.

[0071] In a specific implementation, a pause instruction triggered by a user through a human-computer interaction interface is obtained; the currently executing target task is marked as a paused state; and a task waiting state is entered until a task execution semaphore is detected.

[0072] Here, the user triggers the pause command through the human-computer interaction interface (for example, pressing the "Pause" button). The pause command is captured by the event processing mechanism of the user interface. The system captures the pause command through the signal and slot mechanism (in frameworks such as QT) and executes the slot function associated with the command.

[0073] After that, after receiving the pause command, the task management module will mark the currently executing target task and set its status to "pause". After marking it as paused, the system will stop sending control signals to the robot. The robot will stop the current action and remain in the current position. The motor control module will immediately stop the operation of the motor according to the system's instructions to ensure that the robot's physical state remains safe and stable.

[0074] Among them, the system will enter a waiting state and remain in this state until the condition is met (that is, a continue signal is received), that is, the task execution semaphore indicating that the task can be resumed is continuously detected. At this time, the task management module will be blocked in the waiting state until the semaphore is released.

[0075] Optionally, during the waiting period, the system needs to maintain the status information of the current task, including task progress, parameters, robot status, etc., so that it can continue to execute accurately when it is restored. While the system is waiting, it may still periodically check other status information (such as power supply, system health, etc.) to ensure that the entire system is in normal operation.

[0076] This ensures that the user has flexible control over the robot's operation, allowing the task to be paused when needed while maintaining the system state so that execution can be resumed seamlessly. The pause mechanism is an important part of safety and user control, and can effectively manage the smoothness and stability of task execution.

[0077] S104 . In response to a recovery instruction triggered by a user, monitor the newly released task execution semaphore and execute the corresponding target task.

[0078] In the specific implementation, the user triggers the recovery instruction through the human-computer interaction interface (for example, pressing the "Continue" or "Resume" button). This operation is captured by the system and responded to through the event processing mechanism. The system uses the signal and slot mechanism (in frameworks such as QT) to capture the recovery instruction and execute the slot function related to the instruction to prepare for subsequent operations.

[0079] Here, after receiving the resume instruction, the system will release the task execution semaphore that was previously occupied due to the pause. The purpose of this operation is to notify the task management module that it can continue to execute the paused task. Releasing the semaphore will wake up the task management thread in the waiting state, indicating that the tasks in the queue can be started.

[0080] After receiving the semaphore, the task management thread will recheck the task queue to ensure that the target task is still valid and ready to be executed. Pull the target task from the task queue and prepare for execution.

[0081] It should be noted that the system needs to obtain the status information of the current task to ensure that it continues to execute from the correct pause point. When resuming, it needs to know the steps or progress of the task that have been completed. Obtain the current status data of the robot to ensure that the robot can continue in the appropriate position and posture.

[0082] Furthermore, based on the current state data and the parameters before recovery, the system recalculates the target position that the robot should reach and calculates the robot's joint angles based on the target position. A safe motion path is developed to avoid obstacles and collisions. The system generates new control instructions to instruct the robot to continue the task from the pause point, reactivates motor control, ensures that the robot starts moving according to the new instructions, and adjusts control parameters (such as speed, acceleration, etc.) to ensure a smooth transition.

[0083] Optionally, during task recovery, the system may monitor the robot's status in real time to ensure that the task is proceeding as expected. If an abnormality occurs, the system should be able to respond in a timely manner and take appropriate measures.

[0084] In this way, the user can resume the execution of the robot task at any time, and the system can effectively manage the suspension and resumption of tasks, ensuring the user's control ability and the robot's execution accuracy. The task resumption mechanism is designed to provide flexibility and reliability to enhance the user experience.

[0085] The disclosed embodiment provides a robot control method, which determines the target task corresponding to the start instruction and adds the target task to the task queue in response to the start instruction triggered by the user; controls the robot to execute the target task in response to the task execution signal released when the target task is enqueued in the task queue; clears the task queue in response to the pause instruction triggered by the user, and continues to wait for the task execution signal; monitors the newly released task execution signal in response to the resume instruction triggered by the user, and executes the corresponding target task. The start and stop speed of the robot can be improved, the task execution delay can be reduced, and the accuracy of the task process can be guaranteed when resuming in the paused state.

[0086] See also Figure 2 FIG. 2 is a flowchart of another robot control method provided by an embodiment of the present disclosure, wherein the method includes steps S201 to S205, wherein:

[0087] S201 . In response to a start instruction triggered by a user, determine a target task corresponding to the start instruction and add the target task to a task queue.

[0088] S202: In response to a task execution semaphore released when the target task is enqueued in the task queue, control the robot to execute the target task.

[0089] S203 . In response to a pause instruction triggered by the user, clear the task queue and continue to wait for the task execution semaphore.

[0090] S204 . In response to a recovery instruction triggered by a user, monitor the newly released task execution semaphore and execute the corresponding target task.

[0091] It should be noted that steps S201 to S204 are substantially the same as steps S101 to S104, have the same implementation methods and can achieve the same technical effects, and will not be described in detail.

[0092] S205 . In response to an exit instruction triggered by the user, the target task currently being executed is terminated; and the target task is deleted from the task queue.

[0093] In the specific implementation, the user triggers the exit command through the human-computer interaction interface (such as pressing the "Exit" or "Stop" button). The operation is captured by the system and prepared for subsequent processing. The system captures the exit command through the signal and slot mechanism (in frameworks such as QT) and executes the corresponding slot function to perform the exit processing.

[0094] Here, after receiving the exit command, the task management module will immediately stop the currently executing target task. Send a stop signal to the motor control module to ensure that the robot stops all movements immediately. Release the resources related to the current task, such as interrupting the collection of sensor data, stopping the motion control loop, etc., to ensure safety and stability.

[0095] Furthermore, the system updates the status of the current task to "end" or "cancel" and records the final status of the task (such as successful completion or termination by the user). After ensuring that the task is terminated, the system deletes the target task from the task queue.

[0096] Among them, the corresponding task entry is found in the task queue. The delete or remove function of the queue is called to remove the task from the queue to ensure that subsequent processing will not continue to execute the task.

[0097] It should be noted that after a task is deleted, the system needs to perform necessary resource cleanup, reclaim dynamically allocated memory associated with the task, exit the current task loop, and then delete the task node to free up space.

[0098] Optionally, after exiting the task, the system will enter a standby state, ready to accept new user instructions. At this time, the task management module can recheck the task queue to confirm whether there are other tasks to be executed.

[0099] This ensures that users can stop robot tasks in a timely manner, and the system can effectively handle task termination and cleanup, maintaining system stability and security. The exit mechanism is designed to enhance user control while ensuring efficient management of system resources.

[0100] A robot control method provided by an embodiment of the present disclosure determines the target task corresponding to the start instruction and adds the target task to the task queue in response to a start instruction triggered by a user; controls the robot to execute the target task in response to a task execution semaphore released when the target task is queued in the task queue; clears the task queue in response to a pause instruction triggered by the user, and continues to wait for the task execution semaphore; monitors the newly released task execution semaphore in response to a resume instruction triggered by the user, and executes the corresponding target task. In response to an exit instruction triggered by the user, the target task currently being executed is terminated; and the target task is deleted from the task queue. The start and stop speed of the robot can be improved, the task execution delay can be reduced, and the accuracy of the task process can be ensured when resuming in a paused state.

[0101] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0102] Based on the same inventive concept, a robot control device corresponding to the robot control method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned robot control method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0103] See also Figure 3 , Figure 3 Schematic diagram of a robot control device provided by an embodiment of the present disclosure. Figure 3 As shown in , the robot control device 300 provided in the embodiment of the present disclosure includes:

[0104] The start trigger module 310 is used to respond to a start instruction triggered by a user, determine a target task corresponding to the start instruction and add the target task to a task queue.

[0105] The task enqueuing module 320 is used to control the robot to execute the target task in response to the task execution signal released when the target task is enqueued into the task queue.

[0106] The pause triggering module 330 is used to clear the task queue in response to a pause instruction triggered by a user, and continue to wait for the task execution semaphore.

[0107] The recovery trigger module 340 is used to monitor the newly released task execution semaphore and execute the corresponding target task in response to the recovery instruction triggered by the user.

[0108] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0109] The robot control device provided by the embodiment of the present disclosure determines the target task corresponding to the start instruction and adds the target task to the task queue in response to the start instruction triggered by the user; controls the robot to execute the target task in response to the task execution signal released when the target task is enqueued in the task queue; clears the task queue in response to the pause instruction triggered by the user, and continues to wait for the task execution signal; monitors the newly released task execution signal in response to the resume instruction triggered by the user, and executes the corresponding target task. The start and stop speed of the robot can be improved, the task execution delay can be reduced, and the accuracy of the task process can be guaranteed when resuming in the paused state.

[0110] Corresponds to Figure 1 and Figure 2 The robot control method in the present disclosure also provides an electronic device 400, such as Figure 4 FIG. 4 is a schematic diagram of the structure of an electronic device 400 provided in an embodiment of the present disclosure, including:

[0111] Processor 41, memory 42, and bus 43; memory 42 is used to store execution instructions, including memory 421 and external memory 422; memory 421 here is also called internal memory, which is used to temporarily store operation data in processor 41 and data exchanged with external memory 422 such as hard disk. Processor 41 exchanges data with external memory 422 through memory 421. When the electronic device 400 is running, the processor 41 communicates with the memory 42 through bus 43, so that the processor 41 executes Figure 1 and Figure 2 Steps of the robot control method.

[0112] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the robot control method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0113] The embodiments of the present disclosure also provide a computer program product, which includes computer instructions. When the computer instructions are executed by a processor, the steps of the robot control method described in the above method embodiment can be executed. For details, please refer to the above method embodiment, which will not be repeated here.

[0114] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0115] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0119] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A robot control method, characterized in that: include: In response to a start instruction triggered by a user, determining a target task corresponding to the start instruction and adding the target task to a task queue; In response to a task execution semaphore released when the target task is enqueued in the task queue, controlling the robot to execute the target task; In response to a pause instruction triggered by a user, the task queue is cleared, and the task execution semaphore is continuously waited for; In response to a recovery instruction triggered by a user, the newly released task execution semaphore is monitored, and the corresponding target task is executed.

2. The method according to claim 1, characterized in that In response to the recovery instruction triggered by the user, monitoring the newly released task execution semaphore and executing the corresponding target task, the method further includes: In response to an exit instruction triggered by the user, ending the target task currently being executed; The target task is deleted from the task queue.

3. The method according to claim 1, characterized in that In response to a start instruction triggered by a user, determining a target task corresponding to the start instruction and adding the target task to a task queue specifically includes: Obtaining the start instruction triggered by the user through the human-computer interaction interface; Sending the start instruction to the kernel process through a data pipeline, and determining the target task triggered by the start instruction; Pushing the target task to the task queue by the kernel; When the target task is enqueued in the task queue, the task execution semaphore is released.

4. The method according to claim 1, characterized in that: In response to a task execution semaphore released when the target task is enqueued into the task queue, controlling the robot to execute the target task specifically includes: When the task management thread receives the task execution semaphore, pulling the target task from the task queue; Acquire robot status data corresponding to the robot and user control command data; Determine the target posture corresponding to the robot according to the robot state data and the control command data; Control the machine to move to the target posture.

5. The method according to claim 1, characterized in that In response to a pause instruction triggered by a user, the task queue is cleared, and the task execution signal is continuously waited for, specifically including: Obtaining the pause instruction triggered by the user through the human-computer interaction interface; Mark the target task currently being executed as a paused state; Enter the task waiting state until the task execution semaphore is detected.

6. A robot control device, characterized in that: include: A start trigger module, used for responding to a start instruction triggered by a user, determining a target task corresponding to the start instruction and adding the target task to a task queue; A task enqueuing module, configured to control the robot to execute the target task in response to a task execution signal released when the target task is enqueued into the task queue; A pause trigger module, used to clear the task queue in response to a pause instruction triggered by a user, and continue to wait for the task execution semaphore; The recovery trigger module is used to monitor the newly released task execution semaphore and execute the corresponding target task.

7. The device according to claim 6, characterized in that The device further includes an exit triggering module, wherein the exit triggering module is configured to: In response to an exit instruction triggered by the user, ending the target task currently being executed; The target task is deleted from the task queue.

8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the robot control method as described in any one of claims 1 to 5 are performed.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the robot control method according to any one of claims 1 to 5 are executed.

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