WO2018077032A1 - Task switching method and related device - Google Patents

Task switching method and related device Download PDF

Info

Publication number
WO2018077032A1
WO2018077032A1 PCT/CN2017/105643 CN2017105643W WO2018077032A1 WO 2018077032 A1 WO2018077032 A1 WO 2018077032A1 CN 2017105643 W CN2017105643 W CN 2017105643W WO 2018077032 A1 WO2018077032 A1 WO 2018077032A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
robot
function
action
time interval
Prior art date
Application number
PCT/CN2017/105643
Other languages
French (fr)
Chinese (zh)
Inventor
刘杰
Original Assignee
菜鸟智能物流控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 菜鸟智能物流控股有限公司 filed Critical 菜鸟智能物流控股有限公司
Publication of WO2018077032A1 publication Critical patent/WO2018077032A1/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems

Definitions

  • the present invention relates to the field of data processing, and in particular, to a task switching method and related apparatus.
  • robots can replace people to complete various tasks and achieve various functions.
  • the functions that the robot can achieve are relatively simple, so the control commands for the robot are solidified in the local storage space of the robot, and the robot realizes a single function through the instruction of the control command. If you want to make the robot function realize new functions, you need to re-develop new control commands for the robot and solidify it into the robot's local storage space to enable the robot to implement new functions.
  • the present invention provides a task switching method and related apparatus, which realizes high-efficiency task switching to a robot.
  • the present invention provides a task switching method, which is applied to a task server, where the task server provides a first task, where the first task includes a type of a first function performed and a first action set, where the An action set is a set of actions for implementing the first function, and the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the method includes:
  • Configuring a second task and an effective time interval of the second task for the robot the second task including a type of the second function performed and a second action set, the second action set being used to implement the second a collection of functional actions;
  • the determining a time interval in which the robot is located includes:
  • the priorities of the first task and the second task are further compared;
  • the method before performing the step of switching the robot to the second task, the method further includes:
  • the setting manner of the priority of the first task includes setting in advance or setting when configuring the first task for the robot;
  • the setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
  • the comparing the priorities of the first task and the second task including:
  • the robot is retained under the first task.
  • the method further includes:
  • the second task is preset in the task server.
  • the second action set includes a plurality of action components and a workflow for indicating an execution order between the action components.
  • the configuring the second task for the robot includes:
  • the second task is configured for the robot according to the second function and the second set of actions.
  • controlling the robot to perform the second work in the second task according to the second action set Yes including:
  • the first task further includes: performing an area of the first function
  • the second task further includes: performing an area of the second function, where the controlling the robot is performed according to the second action set
  • the tasks in the second task include:
  • the present invention provides a task switching apparatus, which is applied to a task server, where the task server provides a first task, the first task includes a type of the first function executed and a first action set, the first An action set is a set of actions for implementing the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot;
  • the device includes a configuration unit, a determining unit, and a switch unit:
  • the configuration unit is configured to configure, for the robot, a second task and an effective time interval of the second task, where the second task includes a type of the executed second function and a second action set, where the second action set is a set of actions for implementing the second function;
  • the determining unit is configured to determine a time interval in which the robot is located; if in an effective time interval of the second task, triggering the switching unit;
  • the switching unit is configured to switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
  • the determining unit is further configured to: if the time interval in which the robot is located is both in an effective time interval of the second task and in an effective time interval of the first task, further comparing the first time The priority of the task and the second task;
  • the switching unit is triggered if the priority of the second task is higher than the priority of the first task.
  • the present invention provides a task server, the task server providing a first task, the first task including a type of a first function performed and a first action set, the first action set being used for Implementing the action set of the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the task server includes a memory and a transmitter, and the memory and the respectively a processor connected to the transmitter, the memory is configured to store a set of program instructions, and the processor is configured to invoke the program instructions stored in the memory to perform the following operations:
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the priorities of the first task and the second task are further compared;
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the setting manner of the priority of the first task includes setting in advance or setting when configuring the first task for the robot;
  • the setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the robot is retained under the first task.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the second task is preset in the task server.
  • the second action set includes a plurality of action components and a workflow for indicating an execution order between the action components.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the task server further includes a receiver, the receiver is connected to the processor, and the processor is further configured to invoke the program instructions stored by the memory to perform the following operations:
  • the first task further includes: performing an area of the first function
  • the second task further includes performing an area of the second function
  • the processor is further configured to invoke the program stored in the memory The instruction performs the following operations:
  • the present invention provides a task switching method, which is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of the first task, and the robot is pre-configured by the server. a second task and an effective time interval of the second task, the first task including a type of the first function executed and a first action set, the second task including a type of the executed second function and a second action set,
  • the second set of actions is a set of actions for implementing the second function; the robot implements the first function by performing a first set of actions, the method comprising:
  • the robot acquires a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
  • the robot switches from the first task to the second task according to the first switching command
  • the robot controls the robot to perform a second function in the second task according to the second action set.
  • the method further includes:
  • the robot acquires a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
  • the robot switches from the second task to the first task according to the second switching command
  • the robot controls the robot to perform a first function in the first task according to the first action set.
  • the present invention provides a task switching apparatus, which is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of a first task, the robot being pre-configured with a second task by the server and An effective time interval of the second task, the first task comprising a type of the first function performed and a first action set, the second task comprising a type of the executed second function and a second action set, the second The action set is a set of actions for implementing the second function; the robot implements the first function by executing a first action set, the device comprising an acquisition unit, a switching unit, and an execution unit:
  • the acquiring unit is configured to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
  • the switching unit is configured to switch from the first task to the second task according to the first switching command
  • the executing unit is configured to control the robot to perform a second function in the second task according to the second action set.
  • the acquiring unit is further configured to acquire a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
  • the switching unit is further configured to switch from the second task to the first task according to the second switching command;
  • the execution unit is further configured to control the robot to perform a first function in the first task according to the first action set.
  • the present invention provides a robot that is pre-configured by a server with a first task and an effective time interval of the first task, the robot being pre-configured by the server with a second task and an effective time of the second task
  • the first task includes a type of the first function executed and a first action set
  • the second task includes a type of the executed second function and a second action set
  • the second action set is used to implement a set of actions of the second function
  • the robot implementing the first function by performing a first set of actions, the robot comprising a memory and a receiver, and a processor coupled to the memory and the receiver, respectively
  • the memory is configured to store a set of program instructions
  • the processor is configured to invoke the program instructions stored in the memory to perform the following operations:
  • Controlling, by the second set of actions, the second function of the second task is performed by the robot.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the task server has a first task set in advance, the first task includes a type of the first function executed and a first action set, and the robot has the first task and the first configured in advance.
  • the second task and the effective time interval of the second task are configured for the robot, and when the robot is determined to be in the effective time interval of the second task, the robot can be switched to the second task.
  • the present invention can configure multiple tasks for the robot, and the time interval in which the robot is located is used as a basis for switching tasks.
  • the robot can be controlled according to the action set corresponding to the switched task, thereby realizing the high-efficiency task switching to the robot. Enable the same robot to perform functions under different tasks
  • FIG. 1 is a schematic diagram of a system for task switching according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for task switching according to an embodiment of the present invention
  • FIG. 3 is a flowchart of another method for task switching according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of a device of a task switching apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a hardware of a task server according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for a task switching method according to an embodiment of the present invention.
  • FIG. 7 is a structural diagram of a device of a task switching apparatus according to an embodiment of the present invention.
  • FIG. 8 is a hardware structural diagram of a robot according to an embodiment of the present invention.
  • robots are usually used instead of manual execution of the corresponding work, but currently the robot's work tasks and workflows are too patterned, and the robot can only work under pre-set tasks.
  • the robot is required to perform a work task under a new task, it is necessary to re-do the corresponding software settings for the robot, and the setting process is cumbersome and time consuming. If the robot can achieve efficient switching under different tasks, the efficiency of the robot will be greatly improved.
  • an embodiment of the present invention provides a task switching method and related apparatus, in which a correspondence relationship between a task and an action set is set in advance in a task server, a task and an effective time interval of the task are configured, and a time interval in which the robot is located is determined. Based on this, the task is switched, and the robot is controlled according to the action set of the task, thereby achieving high-efficiency task switching to the robot, so that the same robot can perform tasks under different tasks.
  • the embodiment of the present invention is mainly implemented by interaction between a task server and a robot.
  • the task server 100 can provide one or more tasks, each of which includes a corresponding function. And a set of actions for implementing the function, wherein the first task may be one of the preset tasks, and the first task includes a type of the first function executed and a first action set.
  • the task server 100 can provide tasks in a variety of ways, such as presetting tasks in the task server 100, or the task server 100 can obtain tasks from other devices or pathways.
  • the task server 100 may be configured with the first task and the effective time interval of the first task for the robot 200 in advance.
  • the first task may be a task set in the task server, and the first action set is a set of actions for implementing the first function specified by the first task. For example, implementing the first function requires multiple steps, and each step needs to pass Implementing an action component is implemented, and a set of multiple action components having an execution order can be understood as a set of actions.
  • the task server can also be configured with a correspondence between other tasks and action sets.
  • the first task is a task associated with the delivery of the item, and the first function can be the delivery of the item.
  • a task has a function of a specified implementation.
  • the robot can implement the function specified by the task within a time interval specified by the task.
  • the action set corresponding to a task can be used to control the robot to implement the function specified by the task.
  • the robot can implement the first function by executing the first action set, so the action set of the one task is equivalent to the task specified by the task.
  • the functions specified by different tasks can be different or the same.
  • the function specified by a task can be a function that the robot can implement, for example, it can include the delivery of articles, the reception of packages, the display of robot functions, and the like.
  • the task can be configured with a corresponding effective time interval for indicating that the robot can complete the function specified by the task within the valid time interval.
  • the robot 200 in advance with the first task and the effective time interval of the first task as an example, it is equivalent to clarifying that the robot 200 can implement the first function specified by the first task in the effective time interval of the first task.
  • the carried items are sequentially delivered to the three positions A, B, and C shown in FIG.
  • the effective time interval configured for a task may include one or more time periods.
  • the robot can perform the work done by the specified function by implementing the functions specified by the task.
  • the function of a task is to deliver goods, then the work under this task can be carried to carry a specific number of items.
  • the number of jobs under one task is not limited.
  • the effective time interval of this task and the time to complete a job are related.
  • the effective time interval of a task configured for a robot is 8 to 12 points.
  • the function specified by the task is The item is delivered, then from 8 o'clock, the robot carries a batch of items to start delivery (equivalent to one of the tasks). After the items are delivered, the robot carries another item again to start delivery (also equivalent to One of the tasks in this task), looping back and forth until 12 o'clock.
  • the The robot configures the second task and the effective time interval of the second task.
  • the second task here is different from the first task, and the robot can implement the function specified by the second task through the second action set under the second task.
  • the second task is a task associated with the robot display, and the second function can be a presentation.
  • the robot can be switched to the second task when the robot is in the effective time interval of the second task, and the robot is instructed to implement the function specified by the second task to complete the work in the second task.
  • FIG. 2 is a flowchart of a method for a task switching method according to an embodiment of the present invention, where the method includes:
  • S201 configuring a second task and a valid time interval of the second task for the robot, where the second task includes a type of the executed second function and a second action set, where the second action set is used to implement the second A collection of functional actions.
  • the task server can add a configured task to the robot according to the requirements of the specific application task. If the robot needs to implement the function under the new task, the new task can be configured for the robot, and the new task can be called differently from the preset first task. Second task.
  • the effective time interval of the second task and the second task is configured for the robot.
  • the effective time interval of the configuration task is to be based on the effective time interval when the task switching needs to be performed in subsequent operations.
  • the task of the robot can be quickly switched so that the robot can implement the functions specified by the second task.
  • the first task configured for the robot in advance may be a default task
  • the second task configured for the robot may be a temporary task.
  • the second task must not be configured for the robot after the first task.
  • the first task and the second task may be pre-configured for the robot at the same time, but the default is only The robot is in the first mission.
  • the task server can determine the action set capable of implementing the second function according to the type of the second function.
  • the set of actions that can implement the second function can be the second set of actions of the corresponding second task.
  • S202 Determine a time interval in which the robot is located. If it is in the effective time interval of the second task, S203 is performed.
  • the robot Before the task server performs the determining step, the robot must have configured at least two tasks and effective time intervals of the tasks for the robot, so that different tasks can be switched.
  • the following will introduce the first task and the second task as an example.
  • the first task and the effective time interval of the first task and the effective time interval of the second task and the second task are stored in the task server.
  • the task server compares the current time with the stored effective time interval and checks which effective time interval the current time belongs to, that is, the time interval in which the robot is located can be determined. For example, the effective time interval of the first task is set from 9:00 am to 11:00 am, and the second task effective time is set from 1 pm to 4 pm. If the current time is 3:00 pm, the task server can determine that the current time belongs to The effective time interval of the second task, that is, the time interval in which the robot is located is the effective time interval of the second task.
  • the task server can determine that the current time belongs to the effective time interval of the first task, that is, it can be determined that the time interval in which the robot is located is the effective time interval of the first task, and the task can be switched. Keep the robot in the first mission. When the time the robot is in the effective time interval of the first task, the robot implements the function of the first task according to the default first task. For the subsequent operations of the first task, no further details are provided here.
  • S203 Switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
  • the task server controls the robot to complete the task switching, and controls the robot to perform the functions in the task according to the action set of the switched task.
  • the S204 needs to perform the switching because before S201, the correspondence between the first task and the first action set has been preset in the task server, and the first task is generally the robot default.
  • the task that is, when the robot does not receive a new instruction, the work in the first task is completed by executing the first action set by default in the effective time interval of the first task. Therefore, when the task server determines that the time the robot is in the effective time interval of the second task, the robot needs to be switched from the original first task to the second task.
  • the switching of tasks can be completed by sending a switching instruction to the robot.
  • the task server sends a switching instruction to the robot (the switching instruction carries the information of the second task), and the robot receives the switching instruction by the default A task mode is switched to the second task.
  • the robot may not be aware of the switching of the task, and the task server completes the task switching to the robot in the background, and then controls the second execution of the second task in the second task by the second action set corresponding to the second task. Can, in order to achieve the effect of the robot to complete different tasks under different tasks.
  • the task server can control the second function of the second task according to the second action set determined by S202.
  • the tasks mentioned above include the type of functionality, and different tasks can be differentiated according to the type of functionality they contain.
  • the first function specified by the first task is a delivery package
  • the type of the first function is a delivery type
  • the second function specified by the second task is a presentation
  • the type of the second function is a presentation type.
  • a task may include, in addition to the type of the specified function, an area in which the function is performed to indicate in which area the robot performs the function.
  • the first task is to deliver the parcel in Hall 9, and the second task is to distribute the parcel in Hall 10.
  • the first task and the second task are two different tasks, but the two tasks include the same type of functions, all of which are delivered. Type, but the areas of Halls 9 and 10 are different areas. Thus, different tasks are distinguished according to the area in which the function is performed.
  • the two tasks can also be tasks with different types of functions and functions. For example, the first task is to distribute parcels in Hall 9, and the second task is to show in Hall 10.
  • the first task may include an area for performing the first function in addition to the type of the first function; the second task may include, in addition to the type of the second function, the second task.
  • the task server controls the robot to perform the function in the task according to the action set, and specifically may control the function of the robot in the area where the function is executed according to the action set.
  • the scope of a task can be more accurately defined, and the task can be distinguished, so that the task server can control the robot to perform work in the designated area according to the area included in the task.
  • a task switching method is provided.
  • the task server has a preset first task, where the first task includes a type of the first function executed and a first action set, where the robot has the pre-configured Under the premise of the first task and the effective time interval of the first task, the second task and the effective time interval of the second task are configured for the robot, and when the robot is determined to be in the effective time interval of the second task, the robot can be Switching to the second task, and controlling the robot to perform the second task according to the second action set corresponding to the second task.
  • the second function can be seen that the present invention can configure a plurality of tasks for the robot, and the time interval in which the robot is located is used as a basis for switching tasks.
  • the task server has a set of actions corresponding to different tasks, after switching the tasks of the robot, The robot can be controlled according to the set of actions corresponding to the switched task, thereby achieving high-efficiency task switching to the robot, so that the same robot can perform functions under different tasks.
  • FIG. 3 is a flowchart of another method for task switching according to an embodiment of the present invention, where the method includes:
  • S301 Configuring a second task and a valid time interval of the second task for the robot, where the second task includes a type of the executed second function and a second action set, where the second action set is used to implement the second A collection of functional actions.
  • S302 Determine a time interval in which the robot is located. If it is in the effective time interval of the second task and also in the effective time interval of the first task, S303 is performed.
  • a task can be configured with one or more valid time intervals, and multiple valid time intervals corresponding to a task do not overlap each other. However, for different tasks, there may be cases where the corresponding effective time intervals overlap. For example, the effective time interval for the first task configuration is from 9:00 am to 11:00 am, and the effective time interval for the second task configuration is from 8:00 am to 10:00 am, and the first task is from 9:00 am to 10:00 am.
  • the task server determines that the time interval of the robot is both the effective time interval of the first task, and It is the effective time interval of the second task, and for a robot, it is impossible to implement the functions specified by two different tasks at the same time, and it is impossible to perform the work of two different tasks at the same time. Therefore, for this case, the determination of the priority may be further performed in S303, thereby determining whether the robot performs the work of the first task or the work of switching to the second task to perform the second task.
  • S303 Determine whether the priority of the second task is higher than the priority of the first task. If the priority of the second task is higher than the priority of the first task, S304 is performed.
  • the priority may be a setting for indicating the importance of the task.
  • the priority may be set to multiple levels according to actual needs, for example, it may be divided into high priority, medium priority, low priority, and the like.
  • the time interval in which the robot is located belongs to the effective time interval in which two or more tasks overlap, you can compare the priorities of each task. Level, determine the specific task of whether the robot needs to switch tasks or need to switch.
  • the first task and the second task are set with different levels of priority, so that when there is overlap in the effective time interval of the first task and the second task, according to the first task and the second task
  • the priority level determines how to perform task switching. For example, when two time-priority tasks exist in the time interval in which the robot is located, the robot can be switched to a high-priority task, or the robot can continue to be in a high-priority task without task switching.
  • the priority level of the task may be determined according to the type of function included in a task.
  • the type of the function of the first task is the delivery type
  • the type of the function of the second task is the presentation type, if the delivery type is more important than the presentation type.
  • the first task can be set to high priority and the second task to low priority.
  • the priority level of the task may also be determined according to the area included in the task. For example, the area where the first function is performed by the first task is the hall No. 9, and the area where the second function performs the second function is the park. In a different area, if Hall 9 is more important than the park, the first task can be set to high priority and the second task to low priority.
  • the priority can be set in advance, that is, the priority of the task is set when the task server sets the task. It is also possible to set the priority of the task as required when the task server configures the task for the robot.
  • the priority of a pre-set task considering the variability of the actual situation, it may be necessary to change the previously set priority.
  • the priority of the task can be set again when the task is configured for the robot.
  • the task server sets the task to a low priority when configuring the task.
  • the task can be configured for the robot. Change its priority to high priority.
  • the priorities of the first task and the second task may be further compared.
  • S304 is performed.
  • the robot remains under the first task and continues to perform the task in the first task.
  • the corresponding task is selected according to the effective time interval.
  • the time interval in which the robot is located belongs to the effective time interval of multiple tasks, the priority of the tasks may be compared, when the robot is not in the high priority task.
  • Task switching allowing the robot to prioritize high-priority tasks and enhance control of the robot Ability to improve the user experience.
  • S304 Determine whether the robot has a first function of the first task that has not been executed; if yes, execute the first function.
  • the robot After the priority judgment of S303, it is determined that the priority of the second task is higher than the priority of the first task, and the robot needs to switch to the second task, and the robot is prepared in consideration of obtaining the priority judgment result.
  • the robot may be in the process of executing the first function in the first task.
  • the robot is directly switched to the second task and the robot is controlled to perform the second function in the second task, The work of the first task being executed cannot be processed. For example, when the first function in the first task being executed by the robot is to deliver the package, if the robot is switched to the second task before proceeding to the delivery position of the package, and then the second function of the second task is performed, then This package may not be delivered in time.
  • the judgment operation of the execution function may be added to determine whether the robot has the first function of the first task that has not been executed.
  • S305 Switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
  • the task server controls the robot to perform the task in the second task according to the second action set.
  • the robot can only be in the second task.
  • the robot can be switched back to the first according to the requirements.
  • a task that enhances the ability to control the robot may also include:
  • S307 Switch the robot to the first task, and control the robot to perform a first function in the first task according to the first action set.
  • the effective time interval of the first task is from 8:00 am to 10:00 am and from 1:00 pm to 3:00 pm
  • the effective time interval of the second task is from 10:00 am to 1:00 pm.
  • the task server will judge the time interval in which the robot is located, and perform the work in the first task from 8:00 am to 10:00 am, and when the time reaches 10:00 am, the robot is switched to the second task, and the work of the second task is performed. When the time reaches 1 pm, the robot is switched to the first task again, and the work of the first task is performed.
  • the action set is determined according to the task. This embodiment is based on the first embodiment and introduces several different determination modes.
  • the action set is determined by the task server according to the task, wherein the task may be a task preset by the task server, or may be a task configured by the task server when the task needs to be configured for the robot.
  • a way to determine a set of actions according to a task may be to determine a set of actions by finding a corresponding relationship by the task.
  • the task is a task preset by the task server
  • the task server sets the task
  • the action set that implements the function is generated according to the function included in the task, and the corresponding relationship between the task and the action set is stored.
  • the task server searches for the corresponding relationship between the pre-stored task and the action set, and determines the action set corresponding to the task.
  • the task server may have a second task set in advance. Then, the corresponding second action set can be searched according to the second task.
  • Another way to determine is to generate the set of actions when the task is configured for the robot. It can be understood that the set of actions is directly determined by the function of the task.
  • the task is a task configured by the task server when it needs to be configured, that is, the task server does not store the action set corresponding to the task. There may be multiple reasons for not saving the action set. One of the reasons may be that the robot needs to perform the corresponding function for the task in a certain emergency situation, and the task is never generated in the task server, so the natural task server There will be no corresponding action set. Another reason may be that the task is generated in the task server, but the action set corresponding to the task is not saved. When the robot needs to perform the function in the task, the task server needs to set the action set again.
  • the action set may be performed by multiple action components and used to indicate execution between the action components.
  • the sequence of workflow components may be performed by multiple action components and used to indicate execution between the action components.
  • An action set is used to implement a function.
  • a action set can include multiple action components.
  • An action component can be understood as a link in the process of implementing the function.
  • An action set also includes a workflow for indicating the execution order between the action components, that is, for explicitly executing the action components in what order, and executing the action components in order to successfully implement a function, the sequence of execution of the action components Need to be coordinated by the workflow. It should be noted that some common workflows can be saved in the task server to be called when generating an action collection.
  • Action components can be stored in a task server, which can be divided into general action components and non-generic action components from the perspective of versatility. If a link may need to be used in the implementation of different functions, then this link can be defined as a general action component. If a link is mainly used in the implementation of certain functions, then this link can be defined as a non-generic action. Component. For example, when the task is to distribute parcels in Hall 9, to achieve the distribution function, it will involve a series of links such as route identification, traffic light recognition, avoiding pedestrians, taking elevators, sheltering from the rain, etc. Among them, route identification, traffic light recognition, avoiding pedestrians, riding The link of the elevator is the link that is frequently used to realize the distribution function. These links are classified into general action components, and the rain-proof link is used for rainy days. The link is classified as a non-general action component.
  • the second action set corresponding to the second task When the second task is configured for the robot, if the second action set corresponding to the second task is not saved, the second action set needs to be generated.
  • the action component required to implement the second function may be determined from the saved action component according to the second function specified by the second task, and the corresponding order is determined according to the execution order of the action component required to implement the second function.
  • Two functional workflows The selected action components are combined according to the execution order of the selected workflows to generate a second action set that can implement the second function.
  • the task server can control the functions of the robot to perform tasks according to the generated action set. Considering that the generated action set contains the action components in a sequential order, the task server can detect the execution of each action component, avoid the out-of-order execution of the action set, or have problems in a certain link. Time can be discovered in time.
  • embodiments of the present invention provide a way to control a function of a robot to perform a task according to a set of actions.
  • the task server generates a first control instruction according to the first action component in the second action set, and sends the first control instruction to the robot.
  • the first action component is one of a plurality of action components included in the second action set.
  • the second action component is an action component that needs to be executed after the first action component is executed in the execution sequence indicated by the workflow of the second action set. That is, after the first action component is executed according to the workflow, the next action component that needs to be executed.
  • the control command sent to the robot is sequentially generated according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set until the robot completes the function in the second task.
  • a function includes five action components, which have a sequential order, numbered 1 through 5, respectively, and are numbered to distinguish the order.
  • the task server controls the robot to execute the action component 1.
  • the robot When receiving the processing information of the feedback of the robot (the feedback information may be that the action component 1 is executed), the robot is controlled to execute the action component 2, and when the feedback information of the feedback of the robot is received ( The feedback information may be after the action component 2 is executed), the control robot executes the action component 3, and so on, until the robot implements the function (ie, completes the work in the task).
  • the execution of the robot can be accurately controlled, the reliability of the execution function of the robot is increased, and when the robot performs the function, if the problem occurs in a certain link, the task server can quickly find out, thereby assisting in solving the problem. A situation occurs when the robot is stuck or unable to continue functioning.
  • the above detection of the execution of the action component is only an alternative.
  • the execution of each action component in the action set may not be monitored.
  • the control instruction set is directly generated according to the action set and sent to the robot, and the robot completes the instruction by executing the instruction in the control instruction set.
  • the functions in the task which reduces the processing pressure of the task server.
  • FIG. 4 is a schematic structural diagram of a device for a task switching apparatus according to an embodiment of the present invention, which is applied to a task server, where the task server provides a first task, where the first task includes a type of the first function performed and a first action. a set, the first action set is a set of actions for implementing the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the device includes a configuration unit 401.
  • the configuration unit 401 is configured to configure, for the robot, a second task and an effective time interval of the second task, where the second task includes a type of the executed second function and a second action set, and the second action set a set of actions for implementing the second function;
  • the determining unit 402 is configured to determine a time interval in which the robot is located; if in an effective time interval of the second task, trigger the switching unit;
  • the switching unit 403 is configured to switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
  • the determining unit is further configured to: if the time interval in which the robot is located is both in an effective time interval of the second task and in an effective time interval of the first task, further comparing the first time The priority of the task and the second task;
  • the switching unit is triggered if the priority of the second task is higher than the priority of the first task.
  • the task server has a first task set in advance, the first task includes a type of the first function executed and a first action set, and the robot has a pre-configured first task and an effective time interval of the first task. If the second task and the effective time interval of the second task are configured for the robot, when the robot is determined to be in the effective time interval of the second task, the robot may be switched to the second task and corresponding to the second task.
  • the second action set controls the robot to perform the second function in the second task.
  • the present invention can configure the robot with multiple tasks, and the time interval in which the robot is located is used as the basis for switching tasks, because the task server has different tasks.
  • the corresponding action set after switching the task of the robot, can control the robot to realize the function under the task according to the action set corresponding to the switched task, thereby realizing the high-efficiency task switching to the robot, so that the same robot can complete Features under different tasks.
  • the task server 500 provides a first task, where the first task includes a type of a first function performed and a first action set, where the first task An action set is a set of actions for implementing the first function, the task server 500 is pre-configured with the first task and an effective time interval of the first task for the robot; the task server 500 includes a memory 501 and transmits And a processor 503 connected to the memory 501 and the transmitter 502, the memory 501 is configured to store a set of program instructions, and the processor 503 is configured to invoke the program instructions stored by the memory 501 Do the following:
  • the second task includes a type of the second function performed and a second action set, where the second action set is An action set for implementing the second function;
  • the processor 503 may be a central processing unit (CPU), and the memory 501 may be an internal memory of a random access memory (RAM) type, and the transmitter 502 may
  • the physical interface may be an Ethernet interface or an Asynchronous Transfer Mode (ATM) interface.
  • the processor 503, the transmitter 502, and the memory 501 may be integrated into one or more independent circuits or hardware, such as an Application Specific Integrated Circuit (ASIC).
  • ASIC Application Specific Integrated Circuit
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the priorities of the first task and the second task are further compared;
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the setting manner of the priority of the first task includes setting in advance or setting when configuring the first task for the robot;
  • the setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the robot is retained under the first task.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the second task is preset in the task server.
  • the second action set includes a plurality of action components and a workflow for indicating an execution order between the action components.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
  • the task server further includes a receiver, the receiver is connected to the processor, and the processor is further configured to invoke the program instructions stored by the memory to perform the following operations:
  • the first task further includes: performing an area of the first function
  • the second task further includes performing an area of the second function
  • the processor is further configured to invoke the program stored in the memory The instruction performs the following operations:
  • the task server has a first task set in advance, the first task includes a type of the first function executed and a first action set, and the robot has a pre-configured first task and an effective time interval of the first task. If the second task and the effective time interval of the second task are configured for the robot, when the robot is determined to be in the effective time interval of the second task, the robot may be switched to the second task and corresponding to the second task.
  • the second action set controls the robot to perform the second function in the second task.
  • the present invention can configure the robot with multiple tasks, and the time interval in which the robot is located is used as the basis for switching tasks, because the task server has different tasks.
  • the corresponding action set can be switched to the task after switching the task of the robot.
  • the corresponding action set controls the robot to realize the functions under the task, thereby achieving high-efficiency task switching to the robot, so that the same robot can perform functions under different tasks.
  • FIG. 6 is a flowchart of a method for a task switching method according to an embodiment of the present invention.
  • the method is applied to a robot, where the robot is pre-configured by a server with a first task and an effective time interval of the first task, where the robot is pre-configured by the server.
  • There is a second task and an effective time interval of the second task the first task comprising a type of the executed first function and a first action set, the second task comprising a type of the executed second function and a second action set
  • the second set of actions is a set of actions for implementing the second function; the robot implements the first function by executing a first set of actions, the method comprising:
  • S601 The robot acquires a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task.
  • S602 The robot switches from the first task to the second task according to the first switching command.
  • S603 The robot controls the robot to perform a second function in the second task according to the second action set.
  • the robot can implement the function specified by the task by executing a set of actions of a task.
  • the robot When the task is switched, the robot only needs to select the action set of the task to be switched to, and can quickly implement the task after switching the task. Switch to the function specified by the task.
  • the method further includes:
  • the robot acquires a second switching command from the server, the second switching command is used to instruct the robot to switch to the first task.
  • the robot switches from the second task to the first task according to the second switching command.
  • the robot controls the robot to perform a first function in the first task according to the first action set.
  • FIG. 7 is a structural diagram of a device of a task switching apparatus according to an embodiment of the present invention, which is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of a first task, and the robot is pre-configured by a server.
  • There is a second task and an effective time interval of the second task the first task comprising a type of the executed first function and a first action set, the second task comprising a type of the executed second function and a second action set
  • the second set of actions is a set of actions for implementing the second function;
  • the robot implements the first function by executing a first set of actions, the apparatus comprising an obtaining unit 701, a switching unit 702, and an executing unit 703 :
  • the obtaining unit 701 is configured to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task.
  • the switching unit 702 is configured to switch from the first task to the second task according to the first switching command
  • the executing unit 703 is configured to control, according to the second action set, the second function of the second task to be performed by the robot.
  • the acquiring unit is further configured to acquire a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
  • the switching unit is further configured to switch from the second task to the first task according to the second switching command;
  • the execution unit is further configured to control the robot to perform a first function in the first task according to the first action set.
  • the robot can implement the function specified by the task by executing a set of actions of a task.
  • the robot When the task is switched, the robot only needs to select the action set of the task to be switched to, and can quickly implement the task after switching the task. Switch to the function specified by the task.
  • FIG. 8 is a hardware structural diagram of a robot according to an embodiment of the present invention.
  • the robot 800 is pre-configured by a server with a first task and an effective time interval of a first task, and the robot 800 is pre-configured with a second task by a server.
  • the second set of actions is a set of actions for implementing the second function;
  • the robot 800 implements the first function by performing a first set of actions, the robot 800 comprising a memory 801 and a receiver 802, and respectively
  • the memory 801 is connected to the processor 802, and the memory 801 is configured to store a set of program instructions.
  • the processor 803 is configured to invoke the program instructions stored by the memory 801 to perform the following operations:
  • the receiver 802 is triggered to acquire a first switching command from the server, the first switching command is used to instruct the robot to switch to the second task.
  • Controlling, by the second set of actions, the second function of the second task is performed by the robot.
  • the processor 803 may be a CPU, and the memory 801 may be a RAM type internal storage.
  • the receiver 802 can include a common physical interface, and the physical interface can be an Ethernet interface or an ATM interface.
  • the processor 803, the receiver 802, and the memory 801 can be integrated into one or more separate circuits or hardware, such as an ASIC.
  • the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:

Abstract

Disclosed are a task switching method and a related device. Under the premise that a first task and an effective time interval for the first task are pre-configured for a robot, a second task and an effective time interval for the second task are configured for the robot; when it is determined that the robot is within the effective time interval for the second task, the robot may be switched to the second task and is controlled according to a second action set corresponding to the second task to execute a second function of the second task. Hence, a robot may be configured with multiple tasks, and the effective time intervals in which the robot is may serve as the basis for implement switching between the tasks; since a task server may have action sets for different tasks, after a robot is switched between tasks, the robot may be controlled to implement the function of the task, to which the robot is switched, according to the action set corresponding to the task, thereby implementing high-efficiency task switching of the robot, to allow a robot to be able to achieve functions of different tasks.

Description

一种任务切换方法和相关装置Task switching method and related device
本申请要求2016年10月24日递交的申请号为201610939702.5、发明名称为“一种任务切换方法和相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. Serial No. No. No. No. No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本发明涉及数据处理领域,特别是涉及一种任务切换方法和相关装置。The present invention relates to the field of data processing, and in particular, to a task switching method and related apparatus.
背景技术Background technique
随着机器人技术的发展,机器人可以代替人完成各种工作,实现各种功能。With the development of robotics, robots can replace people to complete various tasks and achieve various functions.
传统方式中,机器人所能实现的功能较为单一,故对机器人的控制指令被固化在机器人的本地存储空间中,机器人通过该控制指令的指示来实现单一功能。若希望让该机器人功能实现新的功能,则需要重新为该机器人定制开发新的控制指令,并固化到该机器人的本地存储空间中才可以让该机器人实现新功能。In the traditional way, the functions that the robot can achieve are relatively simple, so the control commands for the robot are solidified in the local storage space of the robot, and the robot realizes a single function through the instruction of the control command. If you want to make the robot function realize new functions, you need to re-develop new control commands for the robot and solidify it into the robot's local storage space to enable the robot to implement new functions.
可见,目前若需要改变机器人所实现的功能,改变过程将会耗时繁琐。It can be seen that if the functions implemented by the robot need to be changed at present, the change process will be time consuming and cumbersome.
发明内容Summary of the invention
为了解决上述技术问题,本发明提供了一种任务切换方法和相关装置,实现了对机器人的高效率任务切换。In order to solve the above technical problem, the present invention provides a task switching method and related apparatus, which realizes high-efficiency task switching to a robot.
本发明实施例公开了如下技术方案:The embodiment of the invention discloses the following technical solutions:
第一方面,本发明提供了一种任务切换方法,应用于任务服务器,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述方法包括:In a first aspect, the present invention provides a task switching method, which is applied to a task server, where the task server provides a first task, where the first task includes a type of a first function performed and a first action set, where the An action set is a set of actions for implementing the first function, and the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the method includes:
为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;Configuring a second task and an effective time interval of the second task for the robot, the second task including a type of the second function performed and a second action set, the second action set being used to implement the second a collection of functional actions;
判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
若处于所述第二任务的有效时间区间,将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。 If in the effective time interval of the second task, switching the robot to the second task, and controlling the robot to perform the second function in the second task according to the second action set.
可选的,所述判断所述机器人所处的时间区间,包括:Optionally, the determining a time interval in which the robot is located includes:
若既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,则进一步比较所述第一任务和第二任务的优先级;If the effective time interval of the second task is also in the effective time interval of the first task, the priorities of the first task and the second task are further compared;
若所述第二任务的优先级高于所述第一任务的优先级,执行所述将所述机器人切换至所述第二任务的步骤。If the priority of the second task is higher than the priority of the first task, performing the step of switching the robot to the second task.
可选的,在执行所述将所述机器人切换至所述第二任务的步骤之前,还包括:Optionally, before performing the step of switching the robot to the second task, the method further includes:
判断所述机器人是否具有未执行完的所述第一任务的第一功能;Determining whether the robot has a first function of the first task that has not been performed;
若具有,等待所述机器人将所述未执行完的所述第一任务的任务执行完后,执行所述将所述机器人切换至所述第二任务的步骤。If yes, after the robot waits for the task of the unexecuted first task to be executed, the step of switching the robot to the second task is performed.
可选的,所述第一任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第一任务时设置;Optionally, the setting manner of the priority of the first task includes setting in advance or setting when configuring the first task for the robot;
所述第二任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第二任务时设置。The setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
可选的,所述比较所述第一任务和第二任务的优先级,包括:Optionally, the comparing the priorities of the first task and the second task, including:
若所述第一任务的优先级高于所述第二任务的优先级,则将所述机器人保留在所述第一任务下。If the priority of the first task is higher than the priority of the second task, the robot is retained under the first task.
可选的,在所述将所述机器人切换至所述第二任务之后,还包括:Optionally, after the switching the robot to the second task, the method further includes:
判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
若处于所述第一任务的有效时间区间,将所述机器人切换至所述第一任务,并根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。If in the effective time interval of the first task, switching the robot to the first task, and controlling the robot to perform the first function in the first task according to the first action set.
可选的,所述第二任务是预先设置在所述任务服务器中的。Optionally, the second task is preset in the task server.
可选的,所述第二动作集合包括多个动作组件和用于指示动作组件之间执行顺序的工作流。Optionally, the second action set includes a plurality of action components and a workflow for indicating an execution order between the action components.
可选的,所述为所述机器人配置第二任务,包括:Optionally, the configuring the second task for the robot includes:
确定用于实现所述第二功能所需的多个动作组件,以及用于指示动作组件之间执行顺序的工作流;Determining a plurality of action components required to implement the second function, and a workflow for indicating an order of execution between the action components;
根据所述用于实现所述第二功能所需的多个组件和对应的工作流生成所述第二动作集合;Generating the second set of actions according to the plurality of components and corresponding workflows required to implement the second function;
根据所述第二功能和第二动作集合为所述机器人配置所述第二任务。The second task is configured for the robot according to the second function and the second set of actions.
可选的,所述根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功 能,包括:Optionally, the controlling the robot to perform the second work in the second task according to the second action set Yes, including:
根据所述第二动作集合中的第一动作组件生成第一控制指令,并向所述机器人发送所述第一控制指令;Generating a first control instruction according to the first action component in the second action set, and transmitting the first control instruction to the robot;
获取所述机器人针对所述第一控制指令反馈的处理信息;Obtaining processing information of the robot for feedback of the first control instruction;
根据所述第二动作集合中的第二动作组件生成第二控制指令,并向所述机器人发送所述第二控制指令,所述第二动作组件为在所述第二动作集合的工作流所指示的执行顺序下,执行完所述第一动作组件后所需执行的动作组件;Generating a second control instruction according to the second action component in the second action set, and sending the second control instruction to the robot, where the second action component is in a workflow of the second action set An action component to be executed after the execution of the first action component in the execution order of the indication;
根据所述机器人反馈的处理信息以及所述第二动作集合的工作流所指示的执行顺序依次生成向所述机器人发送的控制指令,直至所述机器人完成所述第二任务中的第二功能。And generating, according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set, a control instruction sent to the robot, until the robot completes the second function in the second task.
可选的,所述第一任务还包括执行所述第一功能的区域,所述第二任务还包括执行所述第二功能的区域,所述根据所述第二动作集合控制所述机器人执行所述第二任务中的任务,包括:Optionally, the first task further includes: performing an area of the first function, where the second task further includes: performing an area of the second function, where the controlling the robot is performed according to the second action set The tasks in the second task include:
根据所述第二动作集合控制所述机器人在所述执行所述第二功能的区域中执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task in an area in which the performing the second function is performed.
第二方面,本发明提供了一种任务切换装置,应用于任务服务器,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述装置包括配置单元、判断单元和切换单元:In a second aspect, the present invention provides a task switching apparatus, which is applied to a task server, where the task server provides a first task, the first task includes a type of the first function executed and a first action set, the first An action set is a set of actions for implementing the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the device includes a configuration unit, a determining unit, and a switch unit:
所述配置单元,用于为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;The configuration unit is configured to configure, for the robot, a second task and an effective time interval of the second task, where the second task includes a type of the executed second function and a second action set, where the second action set is a set of actions for implementing the second function;
所述判断单元,用于判断所述机器人所处的时间区间;若处于所述第二任务的有效时间区间,触发所述切换单元;The determining unit is configured to determine a time interval in which the robot is located; if in an effective time interval of the second task, triggering the switching unit;
所述切换单元,用于将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The switching unit is configured to switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
可选的,所述判断单元还用于若所述机器人所处的时间区间既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,进一步比较所述第一任务和第二任务的优先级;Optionally, the determining unit is further configured to: if the time interval in which the robot is located is both in an effective time interval of the second task and in an effective time interval of the first task, further comparing the first time The priority of the task and the second task;
若所述第二任务的优先级高于所述第一任务的优先级,触发所述切换单元。 The switching unit is triggered if the priority of the second task is higher than the priority of the first task.
第三方面,本发明提供了一种任务服务器,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述任务服务器包括存储器和发送器,以及分别与所述存储器和所述发送器连接的处理器,所述存储器用于存储一组程序指令,所述处理器用于调用所述存储器存储的程序指令执行如下操作:In a third aspect, the present invention provides a task server, the task server providing a first task, the first task including a type of a first function performed and a first action set, the first action set being used for Implementing the action set of the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the task server includes a memory and a transmitter, and the memory and the respectively a processor connected to the transmitter, the memory is configured to store a set of program instructions, and the processor is configured to invoke the program instructions stored in the memory to perform the following operations:
触发所述发送器为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;Triggering the transmitter to configure a second task and an effective time interval of the second task for the robot, the second task including a type of the executed second function and a second action set, the second action set being used for An action set that implements the second function;
判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
若处于所述第二任务的有效时间区间,触发所述发送器将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。If in the effective time interval of the second task, triggering the transmitter to switch the robot to the second task, and controlling the robot to perform the second task according to the second action set Two functions.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
若既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,则进一步比较所述第一任务和第二任务的优先级;If the effective time interval of the second task is also in the effective time interval of the first task, the priorities of the first task and the second task are further compared;
若所述第二任务的优先级高于所述第一任务的优先级,触发所述发送器将所述机器人切换至所述第二任务。If the priority of the second task is higher than the priority of the first task, triggering the transmitter to switch the robot to the second task.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
判断所述机器人是否具有未执行完的所述第一任务的第一功能;Determining whether the robot has a first function of the first task that has not been performed;
若具有,等待所述机器人将所述未执行完的所述第一任务的任务执行完后,触发所述发送器将所述机器人切换至所述第二任务。If yes, after the robot waits for the task of the unexecuted first task to be executed, triggering the transmitter to switch the robot to the second task.
可选的,所述第一任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第一任务时设置;Optionally, the setting manner of the priority of the first task includes setting in advance or setting when configuring the first task for the robot;
所述第二任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第二任务时设置。The setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
若所述第一任务的优先级高于所述第二任务的优先级,则将所述机器人保留在所述第一任务下。If the priority of the first task is higher than the priority of the second task, the robot is retained under the first task.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
判断所述机器人所处的时间区间; Determining a time interval in which the robot is located;
若处于所述第一任务的有效时间区间,触发所述发送器将所述机器人切换至所述第一任务,并根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。If in the effective time interval of the first task, triggering the transmitter to switch the robot to the first task, and controlling the robot to perform the first task in the first task according to the first action set A feature.
可选的,所述第二任务是预先设置在所述任务服务器中的。Optionally, the second task is preset in the task server.
可选的,所述第二动作集合包括多个动作组件和用于指示动作组件之间执行顺序的工作流。Optionally, the second action set includes a plurality of action components and a workflow for indicating an execution order between the action components.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
确定用于实现所述第二功能所需的多个动作组件,以及用于指示动作组件之间执行顺序的工作流;Determining a plurality of action components required to implement the second function, and a workflow for indicating an order of execution between the action components;
根据所述用于实现所述第二功能所需的多个组件和对应的工作流生成所述第二动作集合;Generating the second set of actions according to the plurality of components and corresponding workflows required to implement the second function;
触发所述发送器根据所述第二功能和第二动作集合为所述机器人配置所述第二任务。Triggering the transmitter to configure the second task for the robot according to the second function and the second set of actions.
可选的,所述任务服务器还包括接收器,所述接收器与所述处理器相连,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the task server further includes a receiver, the receiver is connected to the processor, and the processor is further configured to invoke the program instructions stored by the memory to perform the following operations:
根据所述第二动作集合中的第一动作组件生成第一控制指令,并触发所述发送器向所述机器人发送所述第一控制指令;Generating a first control instruction according to the first action component in the second action set, and triggering the transmitter to send the first control instruction to the robot;
触发所述接收器获取所述机器人针对所述第一控制指令反馈的处理信息;Triggering the receiver to acquire processing information that the robot feeds back to the first control instruction;
根据所述第二动作集合中的第二动作组件生成第二控制指令,并触发所述发送器向所述机器人发送所述第二控制指令,所述第二动作组件为在所述第二动作集合的工作流所指示的执行顺序下,执行完所述第一动作组件后所需执行的动作组件;Generating a second control instruction according to the second action component in the second action set, and triggering the transmitter to send the second control instruction to the robot, where the second action component is in the second action An action component to be executed after executing the first action component in an execution order indicated by the set workflow;
根据所述机器人反馈的处理信息以及所述第二动作集合的工作流所指示的执行顺序依次生成向所述机器人发送的控制指令,直至所述机器人完成所述第二任务中的第二功能。And generating, according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set, a control instruction sent to the robot, until the robot completes the second function in the second task.
可选的,所述第一任务还包括执行所述第一功能的区域,所述第二任务还包括执行所述第二功能的区域,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the first task further includes: performing an area of the first function, the second task further includes performing an area of the second function, and the processor is further configured to invoke the program stored in the memory The instruction performs the following operations:
根据所述第二动作集合控制所述机器人在所述执行所述第二功能的区域中执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task in an area in which the performing the second function is performed.
第四方面,本发明提供了一种任务切换方法,应用于机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第 二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述方法包括:In a fourth aspect, the present invention provides a task switching method, which is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of the first task, and the robot is pre-configured by the server. a second task and an effective time interval of the second task, the first task including a type of the first function executed and a first action set, the second task including a type of the executed second function and a second action set, The second set of actions is a set of actions for implementing the second function; the robot implements the first function by performing a first set of actions, the method comprising:
所述机器人从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务;The robot acquires a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
所述机器人根据所述第一切换命令从所述第一任务切换至所述第二任务;The robot switches from the first task to the second task according to the first switching command;
所述机器人根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The robot controls the robot to perform a second function in the second task according to the second action set.
可选的,在所述机器人根据所述切换命令从所述第一任务切换至所述第二任务之后,还包括:Optionally, after the robot switches from the first task to the second task according to the switching command, the method further includes:
所述机器人从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;The robot acquires a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
所述机器人根据所述第二切换命令从所述第二任务切换至所述第一任务;The robot switches from the second task to the first task according to the second switching command;
所述机器人根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。The robot controls the robot to perform a first function in the first task according to the first action set.
第五方面,本发明提供了一种任务切换装置,应用于机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述装置包括获取单元、切换单元和执行单元:In a fifth aspect, the present invention provides a task switching apparatus, which is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of a first task, the robot being pre-configured with a second task by the server and An effective time interval of the second task, the first task comprising a type of the first function performed and a first action set, the second task comprising a type of the executed second function and a second action set, the second The action set is a set of actions for implementing the second function; the robot implements the first function by executing a first action set, the device comprising an acquisition unit, a switching unit, and an execution unit:
所述获取单元,用于从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务;The acquiring unit is configured to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
所述切换单元,用于根据所述第一切换命令从所述第一任务切换至所述第二任务;The switching unit is configured to switch from the first task to the second task according to the first switching command;
所述执行单元,用于根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The executing unit is configured to control the robot to perform a second function in the second task according to the second action set.
可选的,所述获取单元还用于从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;Optionally, the acquiring unit is further configured to acquire a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
所述切换单元还用于根据所述第二切换命令从所述第二任务切换至所述第一任务; The switching unit is further configured to switch from the second task to the first task according to the second switching command;
所述执行单元还用于根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。The execution unit is further configured to control the robot to perform a first function in the first task according to the first action set.
第六方面,本发明提供了一种机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述机器人包括存储器和接收器,以及分别与所述存储器和所述接收器连接的处理器,所述存储器用于存储一组程序指令,所述处理器用于调用所述存储器存储的程序指令执行如下操作:In a sixth aspect, the present invention provides a robot that is pre-configured by a server with a first task and an effective time interval of the first task, the robot being pre-configured by the server with a second task and an effective time of the second task And the first task includes a type of the first function executed and a first action set, the second task includes a type of the executed second function and a second action set, and the second action set is used to implement a set of actions of the second function; the robot implementing the first function by performing a first set of actions, the robot comprising a memory and a receiver, and a processor coupled to the memory and the receiver, respectively The memory is configured to store a set of program instructions, and the processor is configured to invoke the program instructions stored in the memory to perform the following operations:
触发所述接收器从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务;Triggering the receiver to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
根据所述第一切换命令从所述第一任务切换至所述第二任务;Switching from the first task to the second task according to the first switching command;
根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task is performed by the robot.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
触发所述接收器从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;Triggering the receiver to acquire a second switching command from the server, the second switching command is used to instruct the robot to switch to the first task;
根据所述第二切换命令从所述第二任务切换至所述第一任务;Switching from the second task to the first task according to the second switching command;
根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。Controlling the robot to perform a first function in the first task according to the first action set.
由上述技术方案可以看出,任务服务器具有预先设置的第一任务,该第一任务包括所执行第一功能的类型和第一动作集合,在机器人具有预先配置的所述第一任务以及第一任务的有效时间区间的前提下,为该机器人配置第二任务以及第二任务的有效时间区间,在判断该机器人处于第二任务的有效时间区间内时,可以将该机器人切换至第二任务,并根据第二任务对应的第二动作集合控制该机器人执行第二任务中的第二功能,可见本发明可以为机器人配置有多个任务,并通过机器人所处的时间区间作为切换任务的依据,由于任务服务器具有不同任务所对应的动作集合,在切换机器人的任务后,可以根据切换到的任务所对应的动作集合控制机器人实现该任务下的功能,从而实现了对机器人的高效率任务切换,使得同一个机器人可以完成不同任务下的功能。As can be seen from the above technical solution, the task server has a first task set in advance, the first task includes a type of the first function executed and a first action set, and the robot has the first task and the first configured in advance. Under the premise of the effective time interval of the task, the second task and the effective time interval of the second task are configured for the robot, and when the robot is determined to be in the effective time interval of the second task, the robot can be switched to the second task. And controlling, according to the second action set corresponding to the second task, the second function of the second task is performed by the robot, it can be seen that the present invention can configure multiple tasks for the robot, and the time interval in which the robot is located is used as a basis for switching tasks. Since the task server has a set of actions corresponding to different tasks, after switching the tasks of the robot, the robot can be controlled according to the action set corresponding to the switched task, thereby realizing the high-efficiency task switching to the robot. Enable the same robot to perform functions under different tasks
附图说明 DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1为本发明实施例提供的一种任务切换的系统示意图FIG. 1 is a schematic diagram of a system for task switching according to an embodiment of the present invention;
图2为本发明实施例提供的一种任务切换的方法的流程图;2 is a flowchart of a method for task switching according to an embodiment of the present invention;
图3为本发明实施例提供的另一种任务切换的方法的流程图;FIG. 3 is a flowchart of another method for task switching according to an embodiment of the present invention;
图4为本发明实施例提供的一种任务切换装置的装置结构图;4 is a structural diagram of a device of a task switching apparatus according to an embodiment of the present invention;
图5为本发明实施例提供的一种任务服务器的硬件结构图;FIG. 5 is a schematic structural diagram of a hardware of a task server according to an embodiment of the present invention;
图6为本发明实施例提供的一种任务切换方法的方法流程图;FIG. 6 is a flowchart of a method for a task switching method according to an embodiment of the present invention;
图7为本发明实施例提供的一种任务切换装置的装置结构图;FIG. 7 is a structural diagram of a device of a task switching apparatus according to an embodiment of the present invention;
图8为本发明实施例提供的一种机器人的硬件结构图。FIG. 8 is a hardware structural diagram of a robot according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly described in conjunction with the drawings in the embodiments of the present invention. Some embodiments, rather than all of the embodiments, are invented. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
随着信息技术的发展,机器人在日常工作、生活中的应用越来越普遍。在一些任务下通常用机器人代替人工执行相应的工作,但是目前机器人的工作任务和工作流程过于模式化,机器人只能在预先设置好的任务下工作。当需要机器人到新的任务下执行工作任务时,需要重新为机器人做相应的软件设置,设置过程繁琐耗时。如果能够实现机器人在不同任务下的高效切换,将极大程度上提升机器人的工作效率。With the development of information technology, the application of robots in daily work and life is more and more common. In some tasks, robots are usually used instead of manual execution of the corresponding work, but currently the robot's work tasks and workflows are too patterned, and the robot can only work under pre-set tasks. When the robot is required to perform a work task under a new task, it is necessary to re-do the corresponding software settings for the robot, and the setting process is cumbersome and time consuming. If the robot can achieve efficient switching under different tasks, the efficiency of the robot will be greatly improved.
为此,本发明实施例提供了一种任务切换方法和相关装置,在任务服务器中预先设置任务和动作集合的对应关系,配置任务和该任务的有效时间区间,判断机器人所处的时间区间,以此为依据实现任务的切换,并根据任务的动作集合控制机器人完成该任务中的功能,从而实现了对机器人的高效率任务切换,使得同一个机器人可以完成不同任务下的任务。To this end, an embodiment of the present invention provides a task switching method and related apparatus, in which a correspondence relationship between a task and an action set is set in advance in a task server, a task and an effective time interval of the task are configured, and a time interval in which the robot is located is determined. Based on this, the task is switched, and the robot is controlled according to the action set of the task, thereby achieving high-efficiency task switching to the robot, so that the same robot can perform tasks under different tasks.
基于上述基本思想,本发明实施例主要通过任务服务器和机器人的交互来实现。可以参见图1所示,任务服务器100可以提供有一个或多个任务,每个任务包括对应功能 以及实现该功能的动作集合,其中第一任务可以为预设任务中的一个任务,第一任务包括所执行第一功能的类型和第一动作集合。任务服务器100提供任务的方式可以有多种,例如在任务服务器100中预设任务,或者任务服务器100从其他设备或途径获取任务。Based on the above basic idea, the embodiment of the present invention is mainly implemented by interaction between a task server and a robot. Referring to FIG. 1, the task server 100 can provide one or more tasks, each of which includes a corresponding function. And a set of actions for implementing the function, wherein the first task may be one of the preset tasks, and the first task includes a type of the first function executed and a first action set. The task server 100 can provide tasks in a variety of ways, such as presetting tasks in the task server 100, or the task server 100 can obtain tasks from other devices or pathways.
任务服务器100可以为机器人200预先配置有第一任务以及第一任务的有效时间区间。第一任务可以是任务服务器中所设置的一个任务,第一动作集合是用于实现第一任务所指定的第一功能的动作集合,例如实现第一功能需要多个步骤,每个步骤需要通过执行一个动作组件来实现,具有执行顺序的多个动作组件的集合便可以理解为一个动作集合。除了第一任务外,任务服务器中还可以设置有其他任务与动作集合之间的对应关系。在图1所示中,第一任务为与物品配送相关的任务,第一功能可以为物品配送。The task server 100 may be configured with the first task and the effective time interval of the first task for the robot 200 in advance. The first task may be a task set in the task server, and the first action set is a set of actions for implementing the first function specified by the first task. For example, implementing the first function requires multiple steps, and each step needs to pass Implementing an action component is implemented, and a set of multiple action components having an execution order can be understood as a set of actions. In addition to the first task, the task server can also be configured with a correspondence between other tasks and action sets. In Figure 1, the first task is a task associated with the delivery of the item, and the first function can be the delivery of the item.
在本发明实施例中,一个任务中具有指定实现的功能,当为一个机器人配置一个任务,则该机器人可以在该任务所指定的时间区间内实现该任务所指定的功能。而一个任务所对应的动作集合可以用于控制机器人来实现该任务所指定的功能,例如机器人可以通过执行第一动作集合实现第一功能,故该一个任务的动作集合相当于实现这个任务所指定功能的具体方式。不同的任务所指定的功能可以不同,也可以相同。一个任务所指定的功能可以是机器人所能实现的功能,例如可以包括物品的配送,包裹的接收,机器人功能展示等。In the embodiment of the present invention, a task has a function of a specified implementation. When a task is configured for a robot, the robot can implement the function specified by the task within a time interval specified by the task. The action set corresponding to a task can be used to control the robot to implement the function specified by the task. For example, the robot can implement the first function by executing the first action set, so the action set of the one task is equivalent to the task specified by the task. The specific way of function. The functions specified by different tasks can be different or the same. The function specified by a task can be a function that the robot can implement, for example, it can include the delivery of articles, the reception of packages, the display of robot functions, and the like.
在为机器人配置一个任务时,可以为该任务配置对应的有效时间区间,用于指示机器人可以在该有效时间区间内完成该任务所指定的功能。以为机器人200预先配置有第一任务以及第一任务的有效时间区间为例,相当于明确机器人200可以在第一任务的有效时间区间实现第一任务所指定的第一功能。例如将携带物品依次配送到图1所示的A、B和C三个位置。When configuring a task for the robot, the task can be configured with a corresponding effective time interval for indicating that the robot can complete the function specified by the task within the valid time interval. Taking the robot 200 in advance with the first task and the effective time interval of the first task as an example, it is equivalent to clarifying that the robot 200 can implement the first function specified by the first task in the effective time interval of the first task. For example, the carried items are sequentially delivered to the three positions A, B, and C shown in FIG.
针对一个任务所配置的有效时间区间,可以包括一个或多个时间段。当机器人处于一个任务的有效时间区间内时,机器人可以通过实施该任务所指定的功能完成所指定功能所完成的工作。例如一个任务的功能为物品配送,那么这个任务下的工作可以为携带具体数量的物品进行配送。一个任务下的工作数量不限定,以这个任务的有效时间区间以及完成一项工作的时间相关,例如为一个机器人所配置任务的有效时间区间为8点至12点,该任务所指定的功能为物品配送,那么从8点开始,该机器人携带一批物品开始配送(相当于该任务中的一项工作),这批物品配送完后,该机器人再次携带另一批物品开始配送(也相当于该任务中的一项工作),以此循环往复,直至到12点为止。The effective time interval configured for a task may include one or more time periods. When the robot is within the effective time interval of a task, the robot can perform the work done by the specified function by implementing the functions specified by the task. For example, the function of a task is to deliver goods, then the work under this task can be carried to carry a specific number of items. The number of jobs under one task is not limited. The effective time interval of this task and the time to complete a job are related. For example, the effective time interval of a task configured for a robot is 8 to 12 points. The function specified by the task is The item is delivered, then from 8 o'clock, the robot carries a batch of items to start delivery (equivalent to one of the tasks). After the items are delivered, the robot carries another item again to start delivery (also equivalent to One of the tasks in this task), looping back and forth until 12 o'clock.
在为该机器人配置了第一任务以及第一任务的有效时间区间的基础上,还可以为该 机器人配置第二任务以及第二任务的有效时间区间。这里的第二任务不同于第一任务,该机器人在第二任务下,通过第二动作集合可以实现第二任务所指定的功能。在图1所示中,第二任务为与机器人展示相关的任务,第二功能可以为展示。On the basis that the first task and the effective time interval of the first task are configured for the robot, the The robot configures the second task and the effective time interval of the second task. The second task here is different from the first task, and the robot can implement the function specified by the second task through the second action set under the second task. In Figure 1, the second task is a task associated with the robot display, and the second function can be a presentation.
由于第一任务和第二任务都配置有对应的有效时间区间,故可以通过判断该机器人当前所处的时间区间来确定是否切换该机器人所配置的任务。例如可以在该机器人处于第二任务的有效时间区间时将该机器人切换到第二任务,指示机器人实现第二任务所指定的功能,完成第二任务中的工作。Since the first task and the second task are all configured with corresponding effective time intervals, it can be determined whether to switch the task configured by the robot by determining the time interval in which the robot is currently located. For example, the robot can be switched to the second task when the robot is in the effective time interval of the second task, and the robot is instructed to implement the function specified by the second task to complete the work in the second task.
为了能够明确本发明实施例可以实现上述任务切换的功能,接下来结合图2来说明本发明实施例所提供的任务切换方法。In order to be able to clarify the function of the foregoing task switching in the embodiment of the present invention, the task switching method provided by the embodiment of the present invention is described below with reference to FIG. 2 .
如图2所示,为本发明实施例提供的一种任务切换方法的方法流程图,该方法包括:FIG. 2 is a flowchart of a method for a task switching method according to an embodiment of the present invention, where the method includes:
S201:为机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合。S201: configuring a second task and a valid time interval of the second task for the robot, where the second task includes a type of the executed second function and a second action set, where the second action set is used to implement the second A collection of functional actions.
任务服务器可以根据具体应用任务的需求为机器人增加配置的任务,若需要机器人在新任务下实现功能,可以为该机器人配置该新任务,区别于预先设置的第一任务,可以将新任务称为第二任务。The task server can add a configured task to the robot according to the requirements of the specific application task. If the robot needs to implement the function under the new task, the new task can be configured for the robot, and the new task can be called differently from the preset first task. Second task.
在为机器人预先配置有所述第一任务以及第一任务的有效时间区间的前提下,为该机器人配置第二任务以及第二任务的有效时间区间。配置任务的有效时间区间,是为了在后续操作中需要进行任务切换时可以以有效时间区间作为依据。On the premise that the robot is pre-configured with the first task and the effective time interval of the first task, the effective time interval of the second task and the second task is configured for the robot. The effective time interval of the configuration task is to be based on the effective time interval when the task switching needs to be performed in subsequent operations.
在符合条件时,可以快速的切换该机器人的任务,使得该机器人可以实现第二任务所指定的功能。在具体实现上,预先为该机器人配置的第一任务就可以是默认任务,而为机器人配置的第二任务可以为临时任务。When the conditions are met, the task of the robot can be quickly switched so that the robot can implement the functions specified by the second task. In a specific implementation, the first task configured for the robot in advance may be a default task, and the second task configured for the robot may be a temporary task.
需要注意的是,本发明实施例中并不限定第二任务必须在第一任务之后为该机器人配置,在一些情况下,也可以为该机器人同时预先配置第一任务和第二任务,只是默认机器人处于第一任务中。It should be noted that, in the embodiment of the present invention, the second task must not be configured for the robot after the first task. In some cases, the first task and the second task may be pre-configured for the robot at the same time, but the default is only The robot is in the first mission.
由于通过第二任务已经明确了第二任务所指定的第二功能的类型,故任务服务器可以依据该第二功能的类型确定出能够实现该第二功能的动作集合。这个能够实现该第二功能的动作集合即可以为对应的第二任务的第二动作集合。Since the type of the second function specified by the second task has been clarified by the second task, the task server can determine the action set capable of implementing the second function according to the type of the second function. The set of actions that can implement the second function can be the second set of actions of the corresponding second task.
S202:判断所述机器人所处的时间区间。若处于所述第二任务的有效时间区间,执行S203。 S202: Determine a time interval in which the robot is located. If it is in the effective time interval of the second task, S203 is performed.
任务服务器在执行该判断步骤之前,必然已经为机器人配置好了至少两个任务及其任务的有效时间区间,这样才能实现不同任务的切换。下面将以第一任务和第二任务为例展开介绍。Before the task server performs the determining step, the robot must have configured at least two tasks and effective time intervals of the tasks for the robot, so that different tasks can be switched. The following will introduce the first task and the second task as an example.
在任务服务器中存储有第一任务以及第一任务的有效时间区间和第二任务以及第二任务的有效时间区间。任务服务器将当前时间与存储的有效时间区间对比,查看当前时间属于哪个有效时间区间,即可以判断出机器人所处的时间区间。例如,第一任务的有效时间区间设置为上午9点至上午11点,第二任务有效时间设置为下午1点至下午4点,若当前时间为下午3点,任务服务器可以判断出当前时间属于第二任务的有效时间区间,即可以判断出机器人所处的时间区间为第二任务的有效时间区间。若当前时间为上午10点,任务服务器可以判断出当前时间属于第一任务的有效时间区间,即可以判断出机器人所处的时间区间为第一任务的有效时间区间,可以不进行任务的切换,保持该机器人处于第一任务中。当机器人所处的时间为第一任务的有效时间区间时,机器人会根据默认的第一任务,来实现第一任务的功能。对于第一任务的后续操作,在此不再赘述。The first task and the effective time interval of the first task and the effective time interval of the second task and the second task are stored in the task server. The task server compares the current time with the stored effective time interval and checks which effective time interval the current time belongs to, that is, the time interval in which the robot is located can be determined. For example, the effective time interval of the first task is set from 9:00 am to 11:00 am, and the second task effective time is set from 1 pm to 4 pm. If the current time is 3:00 pm, the task server can determine that the current time belongs to The effective time interval of the second task, that is, the time interval in which the robot is located is the effective time interval of the second task. If the current time is 10:00 am, the task server can determine that the current time belongs to the effective time interval of the first task, that is, it can be determined that the time interval in which the robot is located is the effective time interval of the first task, and the task can be switched. Keep the robot in the first mission. When the time the robot is in the effective time interval of the first task, the robot implements the function of the first task according to the default first task. For the subsequent operations of the first task, no further details are provided here.
S203:将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。S203: Switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
当需要进行任务切换时,任务服务器控制机器人完成任务的切换,并依据切换至的任务的动作集合控制机器人执行该任务中的功能。When task switching is required, the task server controls the robot to complete the task switching, and controls the robot to perform the functions in the task according to the action set of the switched task.
以第一任务和第二任务为例,S204需要进行切换是因为在S201之前,任务服务器中已经预先设置有第一任务和第一动作集合之间的对应关系,而第一任务一般是机器人默认的任务,也即机器人在没有接收到新的指令时,默认在第一任务的有效时间区间内通过执行第一动作集合来完成第一任务中的工作。所以在当任务服务器判断出机器人所处的时间属于第二任务的有效时间区间时,需要将机器人由原来的第一任务切换至第二任务。Taking the first task and the second task as an example, the S204 needs to perform the switching because before S201, the correspondence between the first task and the first action set has been preset in the task server, and the first task is generally the robot default. The task, that is, when the robot does not receive a new instruction, the work in the first task is completed by executing the first action set by default in the effective time interval of the first task. Therefore, when the task server determines that the time the robot is in the effective time interval of the second task, the robot needs to be switched from the original first task to the second task.
具体的,任务的切换可以采用向机器人发送切换指令的方式来完成。例如,当机器人所处的时间属于第二任务的有效时间区间时,任务服务器向机器人发送切换指令(该切换指令中携带有第二任务的信息),机器人接收到该切换指令后由默认的第一任务模式切换至第二任务。Specifically, the switching of tasks can be completed by sending a switching instruction to the robot. For example, when the time when the robot is in the effective time interval of the second task, the task server sends a switching instruction to the robot (the switching instruction carries the information of the second task), and the robot receives the switching instruction by the default A task mode is switched to the second task.
或者,机器人可以不必感知任务的切换,由任务服务器在后台完成对机器人的任务切换,之后通过第二任务对应的第二动作集合来控制机器人执行第二任务中的第二功 能,从而实现机器人在不同任务下完成不同工作的效果。Alternatively, the robot may not be aware of the switching of the task, and the task server completes the task switching to the robot in the background, and then controls the second execution of the second task in the second task by the second action set corresponding to the second task. Can, in order to achieve the effect of the robot to complete different tasks under different tasks.
当机器人切换至第二任务后,任务服务器便可以依据S202确定的第二动作集合,控制机器人执行第二任务中的第二功能。After the robot switches to the second task, the task server can control the second function of the second task according to the second action set determined by S202.
上述提到的所有任务均包括功能的类型,不同任务可以依据其包含的功能的类型进行区分。例如,第一任务所指定的第一功能为配送包裹,该第一功能的类型为配送类型;第二任务所指定的第二功能为展示,该第二功能的类型为展示类型。All of the tasks mentioned above include the type of functionality, and different tasks can be differentiated according to the type of functionality they contain. For example, the first function specified by the first task is a delivery package, the type of the first function is a delivery type; the second function specified by the second task is a presentation, and the type of the second function is a presentation type.
为了更为准确的定义一个任务,一个任务除了可以包括所规定的功能的类型外,还可以包括执行该功能的区域,以起到指示机器人在哪一个区域内来执行该功能。例如第一任务为9号馆配送包裹,第二任务为10号馆配送包裹,第一任务和第二任务是两个不同的任务,但是这两个任务所包括功能的类型相同,均为配送类型,但是9号馆和10号馆的区域是不同的区域。从而依据执行功能的区域对不同任务进行了的区分。当然两个任务也可以是功能的类型和功能的区域均不相同的任务。例如,第一任务为9号馆配送包裹,第二任务为10号馆展示。In order to define a task more accurately, a task may include, in addition to the type of the specified function, an area in which the function is performed to indicate in which area the robot performs the function. For example, the first task is to deliver the parcel in Hall 9, and the second task is to distribute the parcel in Hall 10. The first task and the second task are two different tasks, but the two tasks include the same type of functions, all of which are delivered. Type, but the areas of Halls 9 and 10 are different areas. Thus, different tasks are distinguished according to the area in which the function is performed. Of course, the two tasks can also be tasks with different types of functions and functions. For example, the first task is to distribute parcels in Hall 9, and the second task is to show in Hall 10.
以第一任务和第二任务为例,第一任务除了包括第一功能的类型外,还可以包括执行所述第一功能的区域;第二任务除了包括第二功能的类型外,还可以包括执行所述第二功能的区域。当机器人在执行所述第一任务中的工作时,具体为根据第一动作集合控制所述机器人在规定区域中通过执行所述第一功能完成所述第一任务的工作;当机器人在执行所述第二任务中的任务时,具体为根据第二动作集合控制所述机器人在规定区域中通过执行所述第二功能完成所述第二任务的工作。Taking the first task and the second task as an example, the first task may include an area for performing the first function in addition to the type of the first function; the second task may include, in addition to the type of the second function, the second task. The area in which the second function is performed. When the robot performs the work in the first task, specifically, according to the first action set, the robot is controlled to perform the first task by performing the first function in a prescribed area; when the robot is executing When the task in the second task is described, specifically, according to the second action set, the robot is controlled to perform the second task by performing the second function in a predetermined area.
对于任务中还包括执行功能的区域的情况,任务服务器依据动作集合控制机器人执行该任务中的功能,具体可以为依据动作集合控制机器人在执行该功能的区域中执行该任务中的功能。For the case where the task further includes an area for performing the function, the task server controls the robot to perform the function in the task according to the action set, and specifically may control the function of the robot in the area where the function is executed according to the action set.
依据任务中包括的执行功能的区域,可以更为准确的定义一个任务的范围,也可以对任务进行区分,便于任务服务器根据任务中包括的区域控制机器人在指定的区域执行工作。According to the area of the execution function included in the task, the scope of a task can be more accurately defined, and the task can be distinguished, so that the task server can control the robot to perform work in the designated area according to the area included in the task.
可见,本实施例提供的一种任务切换的方法,任务服务器具有预先设置的第一任务,该第一任务包括所执行第一功能的类型和第一动作集合,在机器人具有预先配置的所述第一任务以及第一任务的有效时间区间的前提下,为该机器人配置第二任务以及第二任务的有效时间区间,在判断该机器人处于第二任务的有效时间区间内时,可以将该机器人切换至第二任务,并根据第二任务对应的第二动作集合控制该机器人执行第二任务中 的第二功能,可见本发明可以为机器人配置有多个任务,并通过机器人所处的时间区间作为切换任务的依据,由于任务服务器具有不同任务所对应的动作集合,在切换机器人的任务后,可以根据切换到的任务所对应的动作集合控制机器人实现该任务下的功能,从而实现了对机器人的高效率任务切换,使得同一个机器人可以完成不同任务下的功能。It can be seen that, in this embodiment, a task switching method is provided. The task server has a preset first task, where the first task includes a type of the first function executed and a first action set, where the robot has the pre-configured Under the premise of the first task and the effective time interval of the first task, the second task and the effective time interval of the second task are configured for the robot, and when the robot is determined to be in the effective time interval of the second task, the robot can be Switching to the second task, and controlling the robot to perform the second task according to the second action set corresponding to the second task The second function can be seen that the present invention can configure a plurality of tasks for the robot, and the time interval in which the robot is located is used as a basis for switching tasks. Since the task server has a set of actions corresponding to different tasks, after switching the tasks of the robot, The robot can be controlled according to the set of actions corresponding to the switched task, thereby achieving high-efficiency task switching to the robot, so that the same robot can perform functions under different tasks.
实施例二Embodiment 2
在图2所对应实施例的基础上,本实施例针对于在判断机器人所处的时间区间时可能出现的不同情况展开详细介绍。如图3所示,为本发明实施例提供的另一种任务切换的方法的流程图,该方法包括:Based on the corresponding embodiment of FIG. 2, the present embodiment is directed to a detailed description of different situations that may occur when determining the time interval in which the robot is located. FIG. 3 is a flowchart of another method for task switching according to an embodiment of the present invention, where the method includes:
S301:为机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合。S301: Configuring a second task and a valid time interval of the second task for the robot, where the second task includes a type of the executed second function and a second action set, where the second action set is used to implement the second A collection of functional actions.
S302:判断所述机器人所处的时间区间。若既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,执行S303。S302: Determine a time interval in which the robot is located. If it is in the effective time interval of the second task and also in the effective time interval of the first task, S303 is performed.
一个任务可以配置一个或多个有效时间区间,一任务所对应的多个有效时间区间是互不重叠的。但是针对于不同的任务可能会出现各自对应的有效时间区间发生重叠的情况。例如,对于第一任务配置的有效时间区间为上午9点至上午11点,对于第二任务配置的有效时间区间为上午8点至上午10点,则上午9点至上午10点属于第一任务的有效时间区间和第二任务的有效时间区间所重叠的部分,当机器人所处的时间为上午9点半时,则任务服务器判断机器人所处的时间区间既是第一任务的有效时间区间,又是第二任务的有效时间区间,而对于一个机器人来说无法同时实施两个不同任务所规定的功能,无法同时执行两个不同任务的工作。因此对于这种情况,可以进一步的进行S303关于优先级的判断,从而决定机器人是执行第一任务的工作还是切换到第二任务来执行第二任务的工作。A task can be configured with one or more valid time intervals, and multiple valid time intervals corresponding to a task do not overlap each other. However, for different tasks, there may be cases where the corresponding effective time intervals overlap. For example, the effective time interval for the first task configuration is from 9:00 am to 11:00 am, and the effective time interval for the second task configuration is from 8:00 am to 10:00 am, and the first task is from 9:00 am to 10:00 am. The portion of the effective time interval overlapped with the effective time interval of the second task, when the time of the robot is 9:30 am, the task server determines that the time interval of the robot is both the effective time interval of the first task, and It is the effective time interval of the second task, and for a robot, it is impossible to implement the functions specified by two different tasks at the same time, and it is impossible to perform the work of two different tasks at the same time. Therefore, for this case, the determination of the priority may be further performed in S303, thereby determining whether the robot performs the work of the first task or the work of switching to the second task to perform the second task.
S303:判断所述第二任务的优先级是否高于第一任务的优先级。若所述第二任务的优先级高于所述第一任务的优先级,执行S304。S303: Determine whether the priority of the second task is higher than the priority of the first task. If the priority of the second task is higher than the priority of the first task, S304 is performed.
优先级可以是一种用于表示任务重要程度的设定,依据实际的需求也可以将优先级设定多种等级,例如可以分为高优先级、中优先级、低优先级等。当机器人所处的时间区间属于两个或者两个以上任务重叠的有效时间区间时,可以通过比较各个任务的优先 级,确定出机器人是否需要切换任务或者需要切换的具体任务为何。The priority may be a setting for indicating the importance of the task. The priority may be set to multiple levels according to actual needs, for example, it may be divided into high priority, medium priority, low priority, and the like. When the time interval in which the robot is located belongs to the effective time interval in which two or more tasks overlap, you can compare the priorities of each task. Level, determine the specific task of whether the robot needs to switch tasks or need to switch.
在本发明实施例中,第一任务和第二任务被设置了不同等级的优先级,由此可以在第一任务和第二任务的有效时间区间出现重叠时,根据第一任务和第二任务优先级的高低来确定如何进行任务切换。例如,当机器人所处的时间区间有两个优先级不同的任务同时存在时,可以将机器人切换至高优先级的任务,或者继续让机器人处于高优先级的任务中,不进行任务切换。In the embodiment of the present invention, the first task and the second task are set with different levels of priority, so that when there is overlap in the effective time interval of the first task and the second task, according to the first task and the second task The priority level determines how to perform task switching. For example, when two time-priority tasks exist in the time interval in which the robot is located, the robot can be switched to a high-priority task, or the robot can continue to be in a high-priority task without task switching.
可以依据一个任务包括的功能的类型确定这个任务的优先级等级,例如,第一任务的功能的类型为配送类型,第二任务的功能的类型为展示类型,如果配送类型比展示类型更为重要,则可将第一任务设定为高优先级,将第二任务设定为低优先级。The priority level of the task may be determined according to the type of function included in a task. For example, the type of the function of the first task is the delivery type, and the type of the function of the second task is the presentation type, if the delivery type is more important than the presentation type. , the first task can be set to high priority and the second task to low priority.
也可以依据一个任务所包括的区域确定这个任务的优先级等级,例如,第一任务所执行第一功能的区域为9号馆,第二任务所执行第二功能的区域为园区,比较这两个不同的区域,如果9号馆的重要程度高于园区,则可将第一任务设定为高优先级,将第二任务设定为低优先级。The priority level of the task may also be determined according to the area included in the task. For example, the area where the first function is performed by the first task is the hall No. 9, and the area where the second function performs the second function is the park. In a different area, if Hall 9 is more important than the park, the first task can be set to high priority and the second task to low priority.
设置任务的优先级的时机可以有多种选择,例如可以预先设置优先级,即在任务服务器设置任务时就设置好该任务的优先级。也可以是在任务服务器为机器人配置该任务时,根据需求设置该任务的优先级。There are many options for setting the priority of the task. For example, the priority can be set in advance, that is, the priority of the task is set when the task server sets the task. It is also possible to set the priority of the task as required when the task server configures the task for the robot.
对于预先设置的任务的优先级,考虑到实际情况的多变性,可能会需要更改之前设定好的优先级,此时可以在为机器人配置该任务时再次设置该任务的优先级。例如,任务服务器在配置该任务时将其设定为低优先级,当需要为机器人配置该任务时,若该任务的情况比较紧急需要机器人优先处理,则可在为机器人配置该任务的同时,将其优先级改为高优先级。For the priority of a pre-set task, considering the variability of the actual situation, it may be necessary to change the previously set priority. At this time, the priority of the task can be set again when the task is configured for the robot. For example, the task server sets the task to a low priority when configuring the task. When the task needs to be configured for the robot, if the situation of the task is urgent and requires the robot to be prioritized, the task can be configured for the robot. Change its priority to high priority.
下面将以第一任务和第二任务为例展开介绍。The following will introduce the first task and the second task as an example.
当机器人所处的时间区间属于第一任务和第二任务重叠的时间区间时,可以进一步比较第一任务和第二任务的优先级。当第二任务的优先级高于第一任务的优先级时,执行S304。When the time interval in which the robot is located belongs to a time interval in which the first task and the second task overlap, the priorities of the first task and the second task may be further compared. When the priority of the second task is higher than the priority of the first task, S304 is performed.
需要注意的是,当第一任务的优先级高于第二任务的优先级时,机器人保留在所述第一任务下,继续执行第一任务中的任务。It should be noted that when the priority of the first task is higher than the priority of the second task, the robot remains under the first task and continues to perform the task in the first task.
本发明实施例中依据于有效时间区间选择对应的任务,当机器人所处的时间区间属于多个任务的有效时间区间时,则可通过比较这些任务的优先级,在机器人未处于高优先任务时进行任务切换,让机器人优先为高优先级的任务服务,增强了对机器人的控制 能力,提高了用户体验。In the embodiment of the present invention, the corresponding task is selected according to the effective time interval. When the time interval in which the robot is located belongs to the effective time interval of multiple tasks, the priority of the tasks may be compared, when the robot is not in the high priority task. Task switching, allowing the robot to prioritize high-priority tasks and enhance control of the robot Ability to improve the user experience.
S304:判断所述机器人是否具有未执行完的所述第一任务的第一功能;若具有则将该第一功能执行完。S304: Determine whether the robot has a first function of the first task that has not been executed; if yes, execute the first function.
经过S303的优先级判断,确定出所述第二任务的优先级高于所述第一任务的优先级,此时机器人需要切换到第二任务,考虑到在得到优先级判断结果,准备将机器人切换至第二任务时,该机器人可能正在执行第一任务中第一功能的过程中,此时若直接将该机器人切换为第二任务,并控制该机器人执行第二任务中的第二功能,则会造成正在执行的第一任务的工作无法处理完毕。例如,当机器人正在执行的第一任务中的第一功能为配送包裹,若尚未抵达该包裹的配送位置之前,该机器人被切换到第二任务,转而执行第二任务的第二功能,则可能导致该包裹无法及时送达。After the priority judgment of S303, it is determined that the priority of the second task is higher than the priority of the first task, and the robot needs to switch to the second task, and the robot is prepared in consideration of obtaining the priority judgment result. When switching to the second task, the robot may be in the process of executing the first function in the first task. At this time, if the robot is directly switched to the second task and the robot is controlled to perform the second function in the second task, The work of the first task being executed cannot be processed. For example, when the first function in the first task being executed by the robot is to deliver the package, if the robot is switched to the second task before proceeding to the delivery position of the package, and then the second function of the second task is performed, then This package may not be delivered in time.
因此,为了避免上述情况发生,可以在将机器人切换到第二任务之前,增加对执行功能的判断操作,判断所述机器人是否具有未执行完的所述第一任务的第一功能。Therefore, in order to avoid the above situation, before the robot is switched to the second task, the judgment operation of the execution function may be added to determine whether the robot has the first function of the first task that has not been executed.
在执行S304时,若具有,则等待所述机器人将所述未执行完的所述第一任务的任务执行完后,再执行S305。When S304 is executed, if there is, the robot waits for the robot to execute the task of the unexecuted first task, and then executes S305.
需要注意的是,还有一种可能的情况,若第二任务中的任务是非常紧急的任务,需要机器人立刻执行,则此时可以不执行S305,而直接执行S306,将机器人切换至第二任务,是否执行S305并不影响本实施例的实现。It should be noted that there is a possibility that if the task in the second task is a very urgent task and the robot needs to be executed immediately, then S305 may not be executed at this time, and S306 is directly executed to switch the robot to the second task. Whether or not S305 is executed does not affect the implementation of the embodiment.
可见,任务切换前,可以通过判断机器人是否正在执行对应功能来确定是否立刻将机器人切换至第二任务。并可以在机器人正在执行第一任务中功能时,等待所述机器人将所述未执行完的所述第一任务的第一功能执行完后再进行任务切换,避免了工作未完成可能带来的不良影响。也可以在需要机器人马上执行第二任务中第二功能的情况下,不判断机器人是否正在执行任务而直接将机器人切换至第二任务,提高了对重要任务的反应速度,满足了重要任务的执行需求。It can be seen that before the task is switched, it can be determined whether the robot is switched to the second task immediately by determining whether the robot is performing the corresponding function. And when the robot is performing the function in the first task, waiting for the robot to perform the task switching after the first function of the unexecuted first task is performed, thereby avoiding the possibility that the work is not completed. Bad effects. It is also possible to directly switch the robot to the second task without determining whether the robot is performing the task without directly determining whether the robot is performing the second function in the second task, thereby improving the reaction speed to the important task and satisfying the execution of the important task. demand.
S305:将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。S305: Switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
机器人切换至第二任务后,任务服务器根据第二动作集合控制机器人执行第二任务中的任务。当然在切换至第二任务之后,并不是说机器人就只能一直处于第二任务下,为了起到可以使机器人更加灵活地执行不同任务下的任务,依据需求还可以将该机器人再切换回第一任务,从而起到增强对机器人的控制能力的作用。具体的,还可以包括:After the robot switches to the second task, the task server controls the robot to perform the task in the second task according to the second action set. Of course, after switching to the second task, it is not that the robot can only be in the second task. In order to make the robot more flexible to perform tasks under different tasks, the robot can be switched back to the first according to the requirements. A task that enhances the ability to control the robot. Specifically, it may also include:
S306:判断所述机器人所处的时间区间。若处于所述第一任务的有效时间区间,执 行S307。S306: Determine a time interval in which the robot is located. If in the effective time interval of the first task, Line S307.
S307:将所述机器人切换至所述第一任务,并根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。S307: Switch the robot to the first task, and control the robot to perform a first function in the first task according to the first action set.
例如,第一任务的有效时间区间为上午8点至上午10点和下午1点至下午3点,第二任务的有效时间区间为上午10点至下午1点。任务服务器会判断机器人所处的时间区间,在上午8点至上午10点执行第一任务中的工作,当时间到达上午10点则将机器人切换至第二任务,执行第二任务的工作,当时间到达下午1点则将机器人再切换至第一任务,执行第一任务的工作。For example, the effective time interval of the first task is from 8:00 am to 10:00 am and from 1:00 pm to 3:00 pm, and the effective time interval of the second task is from 10:00 am to 1:00 pm. The task server will judge the time interval in which the robot is located, and perform the work in the first task from 8:00 am to 10:00 am, and when the time reaches 10:00 am, the robot is switched to the second task, and the work of the second task is performed. When the time reaches 1 pm, the robot is switched to the first task again, and the work of the first task is performed.
实施例三Embodiment 3
在实施例一中提到根据任务确定动作集合,本实施例是在实施例一的基础上,对于几种不同的确定方式展开介绍。In the first embodiment, it is mentioned that the action set is determined according to the task. This embodiment is based on the first embodiment and introduces several different determination modes.
动作集合是由任务服务器根据任务确定的,其中,任务可以是由任务服务器预先设置好的任务,也可以是在需要为机器人配置任务时由任务服务器配置的任务。The action set is determined by the task server according to the task, wherein the task may be a task preset by the task server, or may be a task configured by the task server when the task needs to be configured for the robot.
一种根据任务确定动作集合的方式可以是通过任务查找对应关系来确定出动作集合。当任务是由任务服务器预先设置好的任务时,任务服务器在设置该任务时,会依据该任务中包含的功能生成实现该功能的动作集合,并存储任务与动作集合的对应关系。当机器人需要执行该任务中的任务时,任务服务器会查找预先存储的任务与动作集合的对应关系,确定出该任务对应的动作集合。例如任务服务器可以具有预先设置的第二任务。那么可以根据所述第二任务查找对应的第二动作集合。A way to determine a set of actions according to a task may be to determine a set of actions by finding a corresponding relationship by the task. When the task is a task preset by the task server, when the task server sets the task, the action set that implements the function is generated according to the function included in the task, and the corresponding relationship between the task and the action set is stored. When the robot needs to perform the task in the task, the task server searches for the corresponding relationship between the pre-stored task and the action set, and determines the action set corresponding to the task. For example, the task server may have a second task set in advance. Then, the corresponding second action set can be searched according to the second task.
另一种确定方式是在为机器人配置任务时生成该动作集合,可以理解为由该任务的功能直接确定出动作集合。该任务是在需要配置的时候由任务服务器配置的任务,也即表示任务服务器中没有存储该任务对应的动作集合。没有保存动作集合的原因可能有多种,其中一种原因可能是针对某一突发情况需要机器人去该任务执行对应功能,而该任务是任务服务器中从未生成过该任务,故自然任务服务器不会具有对应的动作集合。另一种原因可能是,在任务服务器中生成过该任务,但并未保存该任务所对应的动作集合,当机器人需要执行该任务中的功能时,任务服务器需要再次设置该动作集合。Another way to determine is to generate the set of actions when the task is configured for the robot. It can be understood that the set of actions is directly determined by the function of the task. The task is a task configured by the task server when it needs to be configured, that is, the task server does not store the action set corresponding to the task. There may be multiple reasons for not saving the action set. One of the reasons may be that the robot needs to perform the corresponding function for the task in a certain emergency situation, and the task is never generated in the task server, so the natural task server There will be no corresponding action set. Another reason may be that the task is generated in the task server, but the action set corresponding to the task is not saved. When the robot needs to perform the function in the task, the task server needs to set the action set again.
对于任务是在需要配置的时候由任务服务器配置的任务的情况,由于任务服务器中没有存储该任务的动作集合,因此需要配置该任务的动作集合。In the case of a task that is configured by the task server when the task needs to be configured, since the task server does not store the action set of the task, it is necessary to configure the action set of the task.
在本发明实施例中,动作集合可以由多个动作组件和用于指示动作组件之间执行顺 序的工作流组成。In the embodiment of the present invention, the action set may be performed by multiple action components and used to indicate execution between the action components. The sequence of workflow components.
动作集合是用于实现一个功能的,一个动作集合中可以包括多个动作组件,一个动作组件可以理解为实现该功能的过程中的一个环节。一个动作集合中还包括用于指示动作组件之间执行顺序的工作流,即用于明确以什么顺序来执行这些动作组件,依照先后顺序执行动作组件才能顺利实现一个功能,动作组件执行的先后顺序需要由工作流的协调。需要注意的是,一些常见的工作流可以保存在任务服务器中以便生成动作集合时调用。An action set is used to implement a function. A action set can include multiple action components. An action component can be understood as a link in the process of implementing the function. An action set also includes a workflow for indicating the execution order between the action components, that is, for explicitly executing the action components in what order, and executing the action components in order to successfully implement a function, the sequence of execution of the action components Need to be coordinated by the workflow. It should be noted that some common workflows can be saved in the task server to be called when generating an action collection.
动作组件可以保存在任务服务器中,动作组件从通用性的程度上可以分为通用动作组件和非通用动作组件。若一个环节在不同功能的实现过程中可能都需要用到,那么这个环节可以定义为通用动作组件,若一个环节主要用于某些特定功能的实现过程中,那么这个环节可以定义为非通用动作组件。例如,当任务为9号馆配送包裹,要实现配送功能,会涉及到路线识别、红绿灯识别、避让行人、乘坐电梯、避雨等一系列环节,其中,路线识别、红绿灯识别、避让行人、乘坐电梯的环节是实现配送功能经常使用的环节,这些环节归类为通用动作组件,而避雨环节是针对雨天才会使用的环节,将该环节归类为非通用动作组件。Action components can be stored in a task server, which can be divided into general action components and non-generic action components from the perspective of versatility. If a link may need to be used in the implementation of different functions, then this link can be defined as a general action component. If a link is mainly used in the implementation of certain functions, then this link can be defined as a non-generic action. Component. For example, when the task is to distribute parcels in Hall 9, to achieve the distribution function, it will involve a series of links such as route identification, traffic light recognition, avoiding pedestrians, taking elevators, sheltering from the rain, etc. Among them, route identification, traffic light recognition, avoiding pedestrians, riding The link of the elevator is the link that is frequently used to realize the distribution function. These links are classified into general action components, and the rain-proof link is used for rainy days. The link is classified as a non-general action component.
在为机器人配置第二任务时,若没有保存第二任务所对应的第二动作集合,则需要生成第二动作集合。可以根据第二任务所指定的第二功能,从所保存的动作组件中确定出实现第二功能所需的动作组件,并根据为了实现第二功能所需执行动作组件的执行顺序确定出对应第二功能的工作流。将选取出的动作组件依据选取的工作流的执行顺序进行组合生成可以实现第二功能的第二动作集合。When the second task is configured for the robot, if the second action set corresponding to the second task is not saved, the second action set needs to be generated. The action component required to implement the second function may be determined from the saved action component according to the second function specified by the second task, and the corresponding order is determined according to the execution order of the action component required to implement the second function. Two functional workflows. The selected action components are combined according to the execution order of the selected workflows to generate a second action set that can implement the second function.
任务服务器可以依据生成的动作集合控制机器人执行任务中的功能。考虑到生成的动作集合包含的动作组件是有先后顺序的,因此任务服务器可以对每一个动作组件的执行情况进行检测,避免动作集合的执行过程出现乱序的情况,或者在某个环节出现问题时能够及时发现。The task server can control the functions of the robot to perform tasks according to the generated action set. Considering that the generated action set contains the action components in a sequential order, the task server can detect the execution of each action component, avoid the out-of-order execution of the action set, or have problems in a certain link. Time can be discovered in time.
为此,本发明实施例提供了一种根据动作集合控制机器人执行任务中功能的方式。To this end, embodiments of the present invention provide a way to control a function of a robot to perform a task according to a set of actions.
接下来以第二动作集合为例进行说明,任务服务器根据所述第二动作集合中的第一动作组件生成第一控制指令,并向所述机器人发送所述第一控制指令。其中所述第一动作组件为所述第二动作集合包括的多个动作组件中的一个动作组件。Next, taking the second action set as an example, the task server generates a first control instruction according to the first action component in the second action set, and sends the first control instruction to the robot. The first action component is one of a plurality of action components included in the second action set.
当获取到所述机器人针对所述第一控制指令反馈的处理信息后,根据所述动作集合中的第二动作组件生成第二控制指令,并向所述机器人发送所述第二控制指令,所述第 二动作组件为在所述第二动作集合的工作流所指示的执行顺序下,执行完所述第一动作组件后所需执行的动作组件。也就是在根据工作流执行完第一动作组件后,下一个需要被执行的动作组件。After acquiring the processing information fed back by the robot for the first control instruction, generating a second control instruction according to the second action component in the action set, and sending the second control instruction to the robot, Narrative The second action component is an action component that needs to be executed after the first action component is executed in the execution sequence indicated by the workflow of the second action set. That is, after the first action component is executed according to the workflow, the next action component that needs to be executed.
根据所述机器人反馈的处理信息以及所述第二动作集合的工作流所指示的执行顺序依次生成向所述机器人发送的控制指令,直至所述机器人完成所述第二任务中的功能。The control command sent to the robot is sequentially generated according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set until the robot completes the function in the second task.
例如,一个功能包括五个动作组件,这五个动作组件具有先后顺序,分别标号1至5,以标号来区分先后顺序。任务服务器控制机器人执行动作组件1,当收到机器人的反馈的处理信息(该反馈信息可以是动作组件1执行完毕)后,再控制机器人执行动作组件2,当收到机器人的反馈的处理信息(该反馈信息可以是动作组件2执行完毕)后,在控制机器人执行动作组件3,以此类推,直到机器人实现该功能(即完成该任务中的工作)。For example, a function includes five action components, which have a sequential order, numbered 1 through 5, respectively, and are numbered to distinguish the order. The task server controls the robot to execute the action component 1. When receiving the processing information of the feedback of the robot (the feedback information may be that the action component 1 is executed), the robot is controlled to execute the action component 2, and when the feedback information of the feedback of the robot is received ( The feedback information may be after the action component 2 is executed), the control robot executes the action component 3, and so on, until the robot implements the function (ie, completes the work in the task).
通过该方法可以精确的控制机器人的执行情况,增加了机器人执行功能的可靠性,并可以在机器人执行功能时,若执行到某一环节出现问题,任务服务器可以快速发现,从而可以协助解决以避免机器人卡死或无法继续执行功能的情况发生。Through this method, the execution of the robot can be accurately controlled, the reliability of the execution function of the robot is increased, and when the robot performs the function, if the problem occurs in a certain link, the task server can quickly find out, thereby assisting in solving the problem. A situation occurs when the robot is stuck or unable to continue functioning.
当然上述对动作组件的执行情况进行检测,只是一种可选的方式。也可以不监测动作集合中的每一个动作组件的执行情况,在生成任务的动作集合后,直接依据该动作集合生成控制指令集合发给机器人,由机器人通过执行控制指令集合中的指令来完成该任务中的功能,从而降低了任务服务器的处理压力。Of course, the above detection of the execution of the action component is only an alternative. The execution of each action component in the action set may not be monitored. After the action set of the task is generated, the control instruction set is directly generated according to the action set and sent to the robot, and the robot completes the instruction by executing the instruction in the control instruction set. The functions in the task, which reduces the processing pressure of the task server.
图4为本发明实施例提供的一种任务切换装置的装置结构图,应用于任务服务器,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述装置包括配置单元401、判断单元402和切换单元403:FIG. 4 is a schematic structural diagram of a device for a task switching apparatus according to an embodiment of the present invention, which is applied to a task server, where the task server provides a first task, where the first task includes a type of the first function performed and a first action. a set, the first action set is a set of actions for implementing the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the device includes a configuration unit 401. The determining unit 402 and the switching unit 403:
所述配置单元401,用于为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;The configuration unit 401 is configured to configure, for the robot, a second task and an effective time interval of the second task, where the second task includes a type of the executed second function and a second action set, and the second action set a set of actions for implementing the second function;
所述判断单元402,用于判断所述机器人所处的时间区间;若处于所述第二任务的有效时间区间,触发所述切换单元; The determining unit 402 is configured to determine a time interval in which the robot is located; if in an effective time interval of the second task, trigger the switching unit;
所述切换单元403,用于将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The switching unit 403 is configured to switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
以上单元的说明请参见图2所对应实施例的相关描述,这里不再赘述。For the description of the above units, refer to the related description of the corresponding embodiment in FIG. 2, and details are not described herein again.
可选的,所述判断单元还用于若所述机器人所处的时间区间既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,进一步比较所述第一任务和第二任务的优先级;Optionally, the determining unit is further configured to: if the time interval in which the robot is located is both in an effective time interval of the second task and in an effective time interval of the first task, further comparing the first time The priority of the task and the second task;
若所述第二任务的优先级高于所述第一任务的优先级,触发所述切换单元。The switching unit is triggered if the priority of the second task is higher than the priority of the first task.
可见,任务服务器具有预先设置的第一任务,该第一任务包括所执行第一功能的类型和第一动作集合,在机器人具有预先配置的所述第一任务以及第一任务的有效时间区间的前提下,为该机器人配置第二任务以及第二任务的有效时间区间,在判断该机器人处于第二任务的有效时间区间内时,可以将该机器人切换至第二任务,并根据第二任务对应的第二动作集合控制该机器人执行第二任务中的第二功能,可见本发明可以为机器人配置有多个任务,并通过机器人所处的时间区间作为切换任务的依据,由于任务服务器具有不同任务所对应的动作集合,在切换机器人的任务后,可以根据切换到的任务所对应的动作集合控制机器人实现该任务下的功能,从而实现了对机器人的高效率任务切换,使得同一个机器人可以完成不同任务下的功能。It can be seen that the task server has a first task set in advance, the first task includes a type of the first function executed and a first action set, and the robot has a pre-configured first task and an effective time interval of the first task. If the second task and the effective time interval of the second task are configured for the robot, when the robot is determined to be in the effective time interval of the second task, the robot may be switched to the second task and corresponding to the second task. The second action set controls the robot to perform the second function in the second task. It can be seen that the present invention can configure the robot with multiple tasks, and the time interval in which the robot is located is used as the basis for switching tasks, because the task server has different tasks. The corresponding action set, after switching the task of the robot, can control the robot to realize the function under the task according to the action set corresponding to the switched task, thereby realizing the high-efficiency task switching to the robot, so that the same robot can complete Features under different tasks.
图5为本发明实施例提供的一种任务服务器的硬件结构图,所述任务服务器500提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器500为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述任务服务器500包括存储器501和发送器502,以及分别与所述存储器501和所述发送器502连接的处理器503,所述存储器501用于存储一组程序指令,所述处理器503用于调用所述存储器501存储的程序指令执行如下操作:5 is a hardware structure diagram of a task server according to an embodiment of the present invention. The task server 500 provides a first task, where the first task includes a type of a first function performed and a first action set, where the first task An action set is a set of actions for implementing the first function, the task server 500 is pre-configured with the first task and an effective time interval of the first task for the robot; the task server 500 includes a memory 501 and transmits And a processor 503 connected to the memory 501 and the transmitter 502, the memory 501 is configured to store a set of program instructions, and the processor 503 is configured to invoke the program instructions stored by the memory 501 Do the following:
触发所述发送器502为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;Triggering the transmitter 502 to configure the second task and the effective time interval of the second task for the robot, the second task includes a type of the second function performed and a second action set, where the second action set is An action set for implementing the second function;
判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
若处于所述第二任务的有效时间区间,触发所述发送器将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。 If in the effective time interval of the second task, triggering the transmitter to switch the robot to the second task, and controlling the robot to perform the second task according to the second action set Two functions.
可选地,所述处理器503可以为中央处理器(Central Processing Unit,CPU),所述存储器501可以为随机存取存储器(Random Access Memory,RAM)类型的内部存储器,所述发送器502可以包含普通物理接口,所述物理接口可以为以太(Ethernet)接口或异步传输模式(Asynchronous Transfer Mode,ATM)接口。所述处理器503、发送器502和存储器501可以集成为一个或多个独立的电路或硬件,如:专用集成电路(Application Specific Integrated Circuit,ASIC)。Optionally, the processor 503 may be a central processing unit (CPU), and the memory 501 may be an internal memory of a random access memory (RAM) type, and the transmitter 502 may The physical interface may be an Ethernet interface or an Asynchronous Transfer Mode (ATM) interface. The processor 503, the transmitter 502, and the memory 501 may be integrated into one or more independent circuits or hardware, such as an Application Specific Integrated Circuit (ASIC).
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
若既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,则进一步比较所述第一任务和第二任务的优先级;If the effective time interval of the second task is also in the effective time interval of the first task, the priorities of the first task and the second task are further compared;
若所述第二任务的优先级高于所述第一任务的优先级,触发所述发送器将所述机器人切换至所述第二任务。If the priority of the second task is higher than the priority of the first task, triggering the transmitter to switch the robot to the second task.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
判断所述机器人是否具有未执行完的所述第一任务的第一功能;Determining whether the robot has a first function of the first task that has not been performed;
若具有,等待所述机器人将所述未执行完的所述第一任务的任务执行完后,触发所述发送器将所述机器人切换至所述第二任务。If yes, after the robot waits for the task of the unexecuted first task to be executed, triggering the transmitter to switch the robot to the second task.
可选的,所述第一任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第一任务时设置;Optionally, the setting manner of the priority of the first task includes setting in advance or setting when configuring the first task for the robot;
所述第二任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第二任务时设置。The setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
若所述第一任务的优先级高于所述第二任务的优先级,则将所述机器人保留在所述第一任务下。If the priority of the first task is higher than the priority of the second task, the robot is retained under the first task.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
若处于所述第一任务的有效时间区间,触发所述发送器将所述机器人切换至所述第一任务,并根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。If in the effective time interval of the first task, triggering the transmitter to switch the robot to the first task, and controlling the robot to perform the first task in the first task according to the first action set A feature.
可选的,所述第二任务是预先设置在所述任务服务器中的。Optionally, the second task is preset in the task server.
可选的,所述第二动作集合包括多个动作组件和用于指示动作组件之间执行顺序的工作流。 Optionally, the second action set includes a plurality of action components and a workflow for indicating an execution order between the action components.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
确定用于实现所述第二功能所需的多个动作组件,以及用于指示动作组件之间执行顺序的工作流;Determining a plurality of action components required to implement the second function, and a workflow for indicating an order of execution between the action components;
根据所述用于实现所述第二功能所需的多个组件和对应的工作流生成所述第二动作集合;Generating the second set of actions according to the plurality of components and corresponding workflows required to implement the second function;
触发所述发送器根据所述第二功能和第二动作集合为所述机器人配置所述第二任务。Triggering the transmitter to configure the second task for the robot according to the second function and the second set of actions.
可选的,所述任务服务器还包括接收器,所述接收器与所述处理器相连,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the task server further includes a receiver, the receiver is connected to the processor, and the processor is further configured to invoke the program instructions stored by the memory to perform the following operations:
根据所述第二动作集合中的第一动作组件生成第一控制指令,并触发所述发送器向所述机器人发送所述第一控制指令;Generating a first control instruction according to the first action component in the second action set, and triggering the transmitter to send the first control instruction to the robot;
触发所述接收器获取所述机器人针对所述第一控制指令反馈的处理信息;Triggering the receiver to acquire processing information that the robot feeds back to the first control instruction;
根据所述第二动作集合中的第二动作组件生成第二控制指令,并触发所述发送器向所述机器人发送所述第二控制指令,所述第二动作组件为在所述第二动作集合的工作流所指示的执行顺序下,执行完所述第一动作组件后所需执行的动作组件;Generating a second control instruction according to the second action component in the second action set, and triggering the transmitter to send the second control instruction to the robot, where the second action component is in the second action An action component to be executed after executing the first action component in an execution order indicated by the set workflow;
根据所述机器人反馈的处理信息以及所述第二动作集合的工作流所指示的执行顺序依次生成向所述机器人发送的控制指令,直至所述机器人完成所述第二任务中的第二功能。And generating, according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set, a control instruction sent to the robot, until the robot completes the second function in the second task.
可选的,所述第一任务还包括执行所述第一功能的区域,所述第二任务还包括执行所述第二功能的区域,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the first task further includes: performing an area of the first function, the second task further includes performing an area of the second function, and the processor is further configured to invoke the program stored in the memory The instruction performs the following operations:
根据所述第二动作集合控制所述机器人在所述执行所述第二功能的区域中执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task in an area in which the performing the second function is performed.
可见,任务服务器具有预先设置的第一任务,该第一任务包括所执行第一功能的类型和第一动作集合,在机器人具有预先配置的所述第一任务以及第一任务的有效时间区间的前提下,为该机器人配置第二任务以及第二任务的有效时间区间,在判断该机器人处于第二任务的有效时间区间内时,可以将该机器人切换至第二任务,并根据第二任务对应的第二动作集合控制该机器人执行第二任务中的第二功能,可见本发明可以为机器人配置有多个任务,并通过机器人所处的时间区间作为切换任务的依据,由于任务服务器具有不同任务所对应的动作集合,在切换机器人的任务后,可以根据切换到的任务所 对应的动作集合控制机器人实现该任务下的功能,从而实现了对机器人的高效率任务切换,使得同一个机器人可以完成不同任务下的功能。It can be seen that the task server has a first task set in advance, the first task includes a type of the first function executed and a first action set, and the robot has a pre-configured first task and an effective time interval of the first task. If the second task and the effective time interval of the second task are configured for the robot, when the robot is determined to be in the effective time interval of the second task, the robot may be switched to the second task and corresponding to the second task. The second action set controls the robot to perform the second function in the second task. It can be seen that the present invention can configure the robot with multiple tasks, and the time interval in which the robot is located is used as the basis for switching tasks, because the task server has different tasks. The corresponding action set can be switched to the task after switching the task of the robot. The corresponding action set controls the robot to realize the functions under the task, thereby achieving high-efficiency task switching to the robot, so that the same robot can perform functions under different tasks.
接下来从机器人的角度描述本发明所提供的技术方案。图6为本发明实施例提供的一种任务切换方法的方法流程图,应用于机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述方法包括:Next, the technical solution provided by the present invention will be described from the perspective of a robot. FIG. 6 is a flowchart of a method for a task switching method according to an embodiment of the present invention. The method is applied to a robot, where the robot is pre-configured by a server with a first task and an effective time interval of the first task, where the robot is pre-configured by the server. There is a second task and an effective time interval of the second task, the first task comprising a type of the executed first function and a first action set, the second task comprising a type of the executed second function and a second action set The second set of actions is a set of actions for implementing the second function; the robot implements the first function by executing a first set of actions, the method comprising:
S601:所述机器人从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务。S601: The robot acquires a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task.
S602:所述机器人根据所述第一切换命令从所述第一任务切换至所述第二任务。S602: The robot switches from the first task to the second task according to the first switching command.
S603:所述机器人根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。S603: The robot controls the robot to perform a second function in the second task according to the second action set.
可见,机器人可以通过执行一个任务的动作集合来实现这个任务所指定的功能,当任务发生切换时,机器人只需选择执行所切换到的任务的动作集合,即可在切换任务后快速的实现所切换到的任务所指定的功能。It can be seen that the robot can implement the function specified by the task by executing a set of actions of a task. When the task is switched, the robot only needs to select the action set of the task to be switched to, and can quickly implement the task after switching the task. Switch to the function specified by the task.
可选的,在所述机器人根据所述切换命令从所述第一任务切换至所述第二任务之后,还包括:Optionally, after the robot switches from the first task to the second task according to the switching command, the method further includes:
所述机器人从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务。The robot acquires a second switching command from the server, the second switching command is used to instruct the robot to switch to the first task.
所述机器人根据所述第二切换命令从所述第二任务切换至所述第一任务。The robot switches from the second task to the first task according to the second switching command.
所述机器人根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。The robot controls the robot to perform a first function in the first task according to the first action set.
图7为本发明实施例提供的一种任务切换装置的装置结构图,应用于机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合, 所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述装置包括获取单元701、切换单元702和执行单元703:FIG. 7 is a structural diagram of a device of a task switching apparatus according to an embodiment of the present invention, which is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of a first task, and the robot is pre-configured by a server. There is a second task and an effective time interval of the second task, the first task comprising a type of the executed first function and a first action set, the second task comprising a type of the executed second function and a second action set , The second set of actions is a set of actions for implementing the second function; the robot implements the first function by executing a first set of actions, the apparatus comprising an obtaining unit 701, a switching unit 702, and an executing unit 703 :
所述获取单元701,用于从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务;The obtaining unit 701 is configured to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task.
所述切换单元702,用于根据所述第一切换命令从所述第一任务切换至所述第二任务;The switching unit 702 is configured to switch from the first task to the second task according to the first switching command;
所述执行单元703,用于根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The executing unit 703 is configured to control, according to the second action set, the second function of the second task to be performed by the robot.
可选的,所述获取单元还用于从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;Optionally, the acquiring unit is further configured to acquire a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
所述切换单元还用于根据所述第二切换命令从所述第二任务切换至所述第一任务;The switching unit is further configured to switch from the second task to the first task according to the second switching command;
所述执行单元还用于根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。The execution unit is further configured to control the robot to perform a first function in the first task according to the first action set.
可见,机器人可以通过执行一个任务的动作集合来实现这个任务所指定的功能,当任务发生切换时,机器人只需选择执行所切换到的任务的动作集合,即可在切换任务后快速的实现所切换到的任务所指定的功能。It can be seen that the robot can implement the function specified by the task by executing a set of actions of a task. When the task is switched, the robot only needs to select the action set of the task to be switched to, and can quickly implement the task after switching the task. Switch to the function specified by the task.
图8为本发明实施例提供的一种机器人的硬件结构图,所述机器人800被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人800被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人800通过执行第一动作集合实现所述第一功能,所述机器人800包括存储器801和接收器802,以及分别与所述存储器801和所述接收器802连接的处理器803,所述存储器801用于存储一组程序指令,所述处理器803用于调用所述存储器801存储的程序指令执行如下操作:FIG. 8 is a hardware structural diagram of a robot according to an embodiment of the present invention. The robot 800 is pre-configured by a server with a first task and an effective time interval of a first task, and the robot 800 is pre-configured with a second task by a server. And an effective time interval of the second task, the first task including a type of the first function performed and a first action set, the second task including a type of the executed second function and a second action set, the The second set of actions is a set of actions for implementing the second function; the robot 800 implements the first function by performing a first set of actions, the robot 800 comprising a memory 801 and a receiver 802, and respectively The memory 801 is connected to the processor 802, and the memory 801 is configured to store a set of program instructions. The processor 803 is configured to invoke the program instructions stored by the memory 801 to perform the following operations:
触发所述接收器802从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务。The receiver 802 is triggered to acquire a first switching command from the server, the first switching command is used to instruct the robot to switch to the second task.
根据所述第一切换命令从所述第一任务切换至所述第二任务。Switching from the first task to the second task according to the first switching command.
根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task is performed by the robot.
可选地,所述处理器803可以为CPU,所述存储器801可以为RAM类型的内部存储 器,所述接收器802可以包含普通物理接口,所述物理接口可以为Ethernet接口或ATM接口。所述处理器803、接收器802和存储器801可以集成为一个或多个独立的电路或硬件,如:ASIC。Optionally, the processor 803 may be a CPU, and the memory 801 may be a RAM type internal storage. The receiver 802 can include a common physical interface, and the physical interface can be an Ethernet interface or an ATM interface. The processor 803, the receiver 802, and the memory 801 can be integrated into one or more separate circuits or hardware, such as an ASIC.
可选的,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:Optionally, the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
触发所述接收器从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;Triggering the receiver to acquire a second switching command from the server, the second switching command is used to instruct the robot to switch to the first task;
根据所述第二切换命令从所述第二任务切换至所述第一任务;Switching from the second task to the first task according to the second switching command;
根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。Controlling the robot to perform a first function in the first task according to the first action set.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:只读存储器(英文:read-only memory,缩写:ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。It can be understood by those skilled in the art that all or part of the steps of implementing the foregoing method embodiments may be performed by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium may be at least one of the following: a read-only memory (English: read-only memory, abbreviation: ROM), a RAM, a magnetic disk, or an optical disk, etc., may be stored. The medium of the program code.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It is to be noted that the various embodiments in the present specification are described in a progressive manner, and the same similar parts between the various embodiments may be referred to each other, and each embodiment focuses on different embodiments from other embodiments. At the office. In particular, for the device and the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment. The apparatus and system embodiments described above are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。 The above is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or within the technical scope disclosed by the present invention. Alternatives are intended to be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims (30)

  1. 一种任务切换方法,其特征在于,应用于任务服务器,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述方法包括:A task switching method is characterized in that it is applied to a task server, the task server provides a first task, and the first task includes a type of the first function executed and a first action set, and the first action set is a set of actions for implementing the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the method includes:
    为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;Configuring a second task and an effective time interval of the second task for the robot, the second task including a type of the second function performed and a second action set, the second action set being used to implement the second a collection of functional actions;
    判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
    若处于所述第二任务的有效时间区间,将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。If in the effective time interval of the second task, switching the robot to the second task, and controlling the robot to perform the second function in the second task according to the second action set.
  2. 根据权利要求1所述的方法,其特征在于,所述判断所述机器人所处的时间区间,包括:The method according to claim 1, wherein said determining a time interval in which said robot is located comprises:
    若既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,则进一步比较所述第一任务和第二任务的优先级;If the effective time interval of the second task is also in the effective time interval of the first task, the priorities of the first task and the second task are further compared;
    若所述第二任务的优先级高于所述第一任务的优先级,执行所述将所述机器人切换至所述第二任务的步骤。If the priority of the second task is higher than the priority of the first task, performing the step of switching the robot to the second task.
  3. 根据权利要求2所述的方法,其特征在于,在执行所述将所述机器人切换至所述第二任务的步骤之前,还包括:The method according to claim 2, further comprising: before performing the step of switching the robot to the second task, further comprising:
    判断所述机器人是否具有未执行完的所述第一任务的第一功能;Determining whether the robot has a first function of the first task that has not been performed;
    若具有,等待所述机器人将所述未执行完的所述第一任务的任务执行完后,执行所述将所述机器人切换至所述第二任务的步骤。If yes, after the robot waits for the task of the unexecuted first task to be executed, the step of switching the robot to the second task is performed.
  4. 根据权利要求2所述的方法,其特征在于,所述第一任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第一任务时设置;The method according to claim 2, wherein the setting manner of the priority of the first task comprises setting in advance or setting when configuring the first task for the robot;
    所述第二任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第二任务时设置。The setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
  5. 根据权利要求2所述的方法,其特征在于,所述比较所述第一任务和第二任务的优先级,包括:The method according to claim 2, wherein said comparing priorities of said first task and said second task comprises:
    若所述第一任务的优先级高于所述第二任务的优先级,则将所述机器人保留在所述第一任务下。 If the priority of the first task is higher than the priority of the second task, the robot is retained under the first task.
  6. 根据权利要求1或2所述的方法,其特征在于,在所述将所述机器人切换至所述第二任务之后,还包括:The method according to claim 1 or 2, further comprising: after the switching the robot to the second task, further comprising:
    判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
    若处于所述第一任务的有效时间区间,将所述机器人切换至所述第一任务,并根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。If in the effective time interval of the first task, switching the robot to the first task, and controlling the robot to perform the first function in the first task according to the first action set.
  7. 根据权利要求1所述的方法,其特征在于,所述第二任务是预先设置在所述任务服务器中的。The method of claim 1 wherein said second task is pre-set in said task server.
  8. 根据权利要求1所述的方法,其特征在于,所述第二动作集合包括多个动作组件和用于指示动作组件之间执行顺序的工作流。The method of claim 1 wherein the second set of actions comprises a plurality of action components and a workflow for indicating an order of execution between the action components.
  9. 根据权利要求8所述的方法,其特征在于,所述为所述机器人配置第二任务,包括:The method of claim 8 wherein said configuring said robot with a second task comprises:
    确定用于实现所述第二功能所需的多个动作组件,以及用于指示动作组件之间执行顺序的工作流;Determining a plurality of action components required to implement the second function, and a workflow for indicating an order of execution between the action components;
    根据所述用于实现所述第二功能所需的多个组件和对应的工作流生成所述第二动作集合;Generating the second set of actions according to the plurality of components and corresponding workflows required to implement the second function;
    根据所述第二功能和第二动作集合为所述机器人配置所述第二任务。The second task is configured for the robot according to the second function and the second set of actions.
  10. 根据权利要求8所述的方法,其特征在于,所述根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能,包括:The method according to claim 8, wherein the controlling the second function of the second task according to the second action set comprises:
    根据所述第二动作集合中的第一动作组件生成第一控制指令,并向所述机器人发送所述第一控制指令;Generating a first control instruction according to the first action component in the second action set, and transmitting the first control instruction to the robot;
    获取所述机器人针对所述第一控制指令反馈的处理信息;Obtaining processing information of the robot for feedback of the first control instruction;
    根据所述第二动作集合中的第二动作组件生成第二控制指令,并向所述机器人发送所述第二控制指令,所述第二动作组件为在所述第二动作集合的工作流所指示的执行顺序下,执行完所述第一动作组件后所需执行的动作组件;Generating a second control instruction according to the second action component in the second action set, and sending the second control instruction to the robot, where the second action component is in a workflow of the second action set An action component to be executed after the execution of the first action component in the execution order of the indication;
    根据所述机器人反馈的处理信息以及所述第二动作集合的工作流所指示的执行顺序依次生成向所述机器人发送的控制指令,直至所述机器人完成所述第二任务中的第二功能。And generating, according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set, a control instruction sent to the robot, until the robot completes the second function in the second task.
  11. 根据权利要求1所述的方法,其特征在于,所述第一任务还包括执行所述第一功能的区域,所述第二任务还包括执行所述第二功能的区域,所述根据所述第二动作集合控制所述机器人执行所述第二任务中的任务,包括: The method of claim 1 wherein said first task further comprises an area for performing said first function, said second task further comprising an area for performing said second function, said The second set of actions controls the robot to perform tasks in the second task, including:
    根据所述第二动作集合控制所述机器人在所述执行所述第二功能的区域中执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task in an area in which the performing the second function is performed.
  12. 一种任务切换装置,其特征在于,应用于任务服务器,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述装置包括配置单元、判断单元和切换单元:A task switching apparatus, configured to be applied to a task server, where the task server provides a first task, the first task includes a type of the first function executed and a first action set, and the first action set is a set of actions for implementing the first function, the task server is pre-configured with the first task and an effective time interval of the first task for the robot; the device includes a configuration unit, a determining unit, and a switching unit:
    所述配置单元,用于为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;The configuration unit is configured to configure, for the robot, a second task and an effective time interval of the second task, where the second task includes a type of the executed second function and a second action set, where the second action set is a set of actions for implementing the second function;
    所述判断单元,用于判断所述机器人所处的时间区间;若处于所述第二任务的有效时间区间,触发所述切换单元;The determining unit is configured to determine a time interval in which the robot is located; if in an effective time interval of the second task, triggering the switching unit;
    所述切换单元,用于将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The switching unit is configured to switch the robot to the second task, and control the robot to perform a second function in the second task according to the second action set.
  13. 根据权利要求12所述的装置,其特征在于,所述判断单元还用于若所述机器人所处的时间区间既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,进一步比较所述第一任务和第二任务的优先级;The device according to claim 12, wherein the determining unit is further configured to: if the time interval in which the robot is located is in the effective time interval of the second task, and is also valid in the first task a time interval for further comparing priorities of the first task and the second task;
    若所述第二任务的优先级高于所述第一任务的优先级,触发所述切换单元。The switching unit is triggered if the priority of the second task is higher than the priority of the first task.
  14. 一种任务服务器,其特征在于,所述任务服务器提供第一任务,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第一动作集合为用于实现所述第一功能的动作集合,所述任务服务器为机器人预先配置有所述第一任务以及第一任务的有效时间区间;所述任务服务器包括存储器和发送器,以及分别与所述存储器和所述发送器连接的处理器,所述存储器用于存储一组程序指令,所述处理器用于调用所述存储器存储的程序指令执行如下操作:A task server, wherein the task server provides a first task, the first task includes a type of a first function performed and a first action set, and the first action set is used to implement the first a functional set of actions, the task server being pre-configured with the first task and an effective time interval of the first task for the robot; the task server including a memory and a transmitter, and the memory and the transmitter, respectively a connected processor for storing a set of program instructions, the processor for invoking the program instructions stored by the memory to perform the following operations:
    触发所述发送器为所述机器人配置第二任务以及第二任务的有效时间区间,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;Triggering the transmitter to configure a second task and an effective time interval of the second task for the robot, the second task including a type of the executed second function and a second action set, the second action set being used for An action set that implements the second function;
    判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
    若处于所述第二任务的有效时间区间,触发所述发送器将所述机器人切换至所述第二任务,并根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。If in the effective time interval of the second task, triggering the transmitter to switch the robot to the second task, and controlling the robot to perform the second task according to the second action set Two functions.
  15. 根据权利要求14所述的任务服务器,其特征在于,所述处理器还用于调用所 述存储器存储的程序指令执行如下操作:The task server according to claim 14, wherein said processor is further configured to call the location The program instructions stored in the memory perform the following operations:
    若既处于所述第二任务的有效时间区间,也处于所述第一任务的有效时间区间,则进一步比较所述第一任务和第二任务的优先级;If the effective time interval of the second task is also in the effective time interval of the first task, the priorities of the first task and the second task are further compared;
    若所述第二任务的优先级高于所述第一任务的优先级,触发所述发送器将所述机器人切换至所述第二任务。If the priority of the second task is higher than the priority of the first task, triggering the transmitter to switch the robot to the second task.
  16. 根据权利要求15所述的任务服务器,其特征在于,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The task server according to claim 15, wherein the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
    判断所述机器人是否具有未执行完的所述第一任务的第一功能;Determining whether the robot has a first function of the first task that has not been performed;
    若具有,等待所述机器人将所述未执行完的所述第一任务的任务执行完后,触发所述发送器将所述机器人切换至所述第二任务。If yes, after the robot waits for the task of the unexecuted first task to be executed, triggering the transmitter to switch the robot to the second task.
  17. 根据权利要求15所述的任务服务器,其特征在于,所述第一任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第一任务时设置;The task server according to claim 15, wherein the setting manner of the priority of the first task comprises setting in advance or setting when configuring the first task for the robot;
    所述第二任务的优先级的设置方式包括预先设置或者在为所述机器人配置所述第二任务时设置。The setting manner of the priority of the second task includes setting in advance or setting when the second task is configured for the robot.
  18. 根据权利要求15所述的任务服务器,其特征在于,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The task server according to claim 15, wherein the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
    若所述第一任务的优先级高于所述第二任务的优先级,则将所述机器人保留在所述第一任务下。If the priority of the first task is higher than the priority of the second task, the robot is retained under the first task.
  19. 根据权利要求14或15所述的任务服务器,其特征在于,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The task server according to claim 14 or 15, wherein the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
    判断所述机器人所处的时间区间;Determining a time interval in which the robot is located;
    若处于所述第一任务的有效时间区间,触发所述发送器将所述机器人切换至所述第一任务,并根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。If in the effective time interval of the first task, triggering the transmitter to switch the robot to the first task, and controlling the robot to perform the first task in the first task according to the first action set A feature.
  20. 根据权利要求14所述的任务服务器,其特征在于,所述第二任务是预先设置在所述任务服务器中的。The task server according to claim 14, wherein said second task is preset in said task server.
  21. 根据权利要求14所述的任务服务器,其特征在于,所述第二动作集合包括多个动作组件和用于指示动作组件之间执行顺序的工作流。The task server of claim 14, wherein the second set of actions comprises a plurality of action components and a workflow for indicating an order of execution between the action components.
  22. 根据权利要求21所述的任务服务器,其特征在于,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The task server according to claim 21, wherein the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
    确定用于实现所述第二功能所需的多个动作组件,以及用于指示动作组件之间执行 顺序的工作流;Determining a plurality of action components required to implement the second function, and for indicating execution between the action components Sequential workflow
    根据所述用于实现所述第二功能所需的多个组件和对应的工作流生成所述第二动作集合;Generating the second set of actions according to the plurality of components and corresponding workflows required to implement the second function;
    触发所述发送器根据所述第二功能和第二动作集合为所述机器人配置所述第二任务。Triggering the transmitter to configure the second task for the robot according to the second function and the second set of actions.
  23. 根据权利要求21所述的任务服务器,其特征在于,所述任务服务器还包括接收器,所述接收器与所述处理器相连,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The task server according to claim 21, wherein the task server further comprises a receiver, the receiver is connected to the processor, and the processor is further configured to invoke the program instruction stored in the memory to execute Do the following:
    根据所述第二动作集合中的第一动作组件生成第一控制指令,并触发所述发送器向所述机器人发送所述第一控制指令;Generating a first control instruction according to the first action component in the second action set, and triggering the transmitter to send the first control instruction to the robot;
    触发所述接收器获取所述机器人针对所述第一控制指令反馈的处理信息;Triggering the receiver to acquire processing information that the robot feeds back to the first control instruction;
    根据所述第二动作集合中的第二动作组件生成第二控制指令,并触发所述发送器向所述机器人发送所述第二控制指令,所述第二动作组件为在所述第二动作集合的工作流所指示的执行顺序下,执行完所述第一动作组件后所需执行的动作组件;Generating a second control instruction according to the second action component in the second action set, and triggering the transmitter to send the second control instruction to the robot, where the second action component is in the second action An action component to be executed after executing the first action component in an execution order indicated by the set workflow;
    根据所述机器人反馈的处理信息以及所述第二动作集合的工作流所指示的执行顺序依次生成向所述机器人发送的控制指令,直至所述机器人完成所述第二任务中的第二功能。And generating, according to the processing information fed back by the robot and the execution sequence indicated by the workflow of the second action set, a control instruction sent to the robot, until the robot completes the second function in the second task.
  24. 根据权利要求14所述的任务服务器,其特征在于,所述第一任务还包括执行所述第一功能的区域,所述第二任务还包括执行所述第二功能的区域,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The task server according to claim 14, wherein said first task further comprises an area for performing said first function, said second task further comprising an area for performing said second function, said processor The program instructions that are also used to call the memory store perform the following operations:
    根据所述第二动作集合控制所述机器人在所述执行所述第二功能的区域中执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task in an area in which the performing the second function is performed.
  25. 一种任务切换方法,其特征在于,应用于机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述方法包括:A task switching method is characterized in that it is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of the first task, the robot being pre-configured by the server with the second task and the second task An effective time interval, the first task comprising a type of the first function executed and a first action set, the second task comprising a type of the executed second function and a second action set, the second action set being a set of actions for implementing the second function; the robot implementing the first function by executing a first set of actions, the method comprising:
    所述机器人从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务; The robot acquires a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
    所述机器人根据所述第一切换命令从所述第一任务切换至所述第二任务;The robot switches from the first task to the second task according to the first switching command;
    所述机器人根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The robot controls the robot to perform a second function in the second task according to the second action set.
  26. 根据权利要求25所述的方法,其特征在于,在所述机器人根据所述切换命令从所述第一任务切换至所述第二任务之后,还包括:The method according to claim 25, further comprising: after the robot switches from the first task to the second task according to the switching command, further comprising:
    所述机器人从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;The robot acquires a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
    所述机器人根据所述第二切换命令从所述第二任务切换至所述第一任务;The robot switches from the second task to the first task according to the second switching command;
    所述机器人根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。The robot controls the robot to perform a first function in the first task according to the first action set.
  27. 一种任务切换装置,其特征在于,应用于机器人,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述装置包括获取单元、切换单元和执行单元:A task switching device is characterized in that it is applied to a robot, which is pre-configured by a server with a first task and an effective time interval of the first task, the robot being pre-configured by the server with the second task and the second task An effective time interval, the first task comprising a type of the first function executed and a first action set, the second task comprising a type of the executed second function and a second action set, the second action set being a set of actions for implementing the second function; the robot implementing the first function by performing a first action set, the device comprising an acquisition unit, a switching unit, and an execution unit:
    所述获取单元,用于从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务;The acquiring unit is configured to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
    所述切换单元,用于根据所述第一切换命令从所述第一任务切换至所述第二任务;The switching unit is configured to switch from the first task to the second task according to the first switching command;
    所述执行单元,用于根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。The executing unit is configured to control the robot to perform a second function in the second task according to the second action set.
  28. 根据权利要求27所述装置,其特征在于,所述获取单元还用于从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;The device according to claim 27, wherein the obtaining unit is further configured to acquire a second switching command from the server, where the second switching command is used to instruct the robot to switch to the first task;
    所述切换单元还用于根据所述第二切换命令从所述第二任务切换至所述第一任务;The switching unit is further configured to switch from the second task to the first task according to the second switching command;
    所述执行单元还用于根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。The execution unit is further configured to control the robot to perform a first function in the first task according to the first action set.
  29. 一种机器人,其特征在于,所述机器人被服务器预先配置有第一任务以及第一任务的有效时间区间,所述机器人被服务器预先配置有第二任务以及第二任务的有效时间区间,所述第一任务包括所执行第一功能的类型和第一动作集合,所述第二任务包括所执行第二功能的类型和第二动作集合,所述第二动作集合为用于实现所述第二功能的 动作集合;所述机器人通过执行第一动作集合实现所述第一功能,所述机器人包括存储器和接收器,以及分别与所述存储器和所述接收器连接的处理器,所述存储器用于存储一组程序指令,所述处理器用于调用所述存储器存储的程序指令执行如下操作:A robot, wherein the robot is pre-configured by a server with a first task and an effective time interval of the first task, the robot being pre-configured by the server with a second task and an effective time interval of the second task, The first task includes a type of the first function performed and a first set of actions, the second task including a type of the executed second function and a second set of actions, the second set of actions being for implementing the second functional a set of actions; the robot implements the first function by performing a first set of actions, the robot comprising a memory and a receiver, and a processor coupled to the memory and the receiver, respectively, the memory for storing A set of program instructions, the processor is configured to invoke the program instructions stored in the memory to perform the following operations:
    触发所述接收器从所述服务器获取第一切换命令,所述第一切换命令用于指示所述机器人切换至所述第二任务;Triggering the receiver to acquire a first switching command from the server, where the first switching command is used to instruct the robot to switch to the second task;
    根据所述第一切换命令从所述第一任务切换至所述第二任务;Switching from the first task to the second task according to the first switching command;
    根据所述第二动作集合控制所述机器人执行所述第二任务中的第二功能。Controlling, by the second set of actions, the second function of the second task is performed by the robot.
  30. 根据权利要求29所述的机器人,其特征在于,所述处理器还用于调用所述存储器存储的程序指令执行如下操作:The robot according to claim 29, wherein the processor is further configured to invoke the program instructions stored in the memory to perform the following operations:
    触发所述接收器从所述服务器获取第二切换命令,所述第二切换命令用于指示所述机器人切换至所述第一任务;Triggering the receiver to acquire a second switching command from the server, the second switching command is used to instruct the robot to switch to the first task;
    根据所述第二切换命令从所述第二任务切换至所述第一任务;Switching from the second task to the first task according to the second switching command;
    根据所述第一动作集合控制所述机器人执行所述第一任务中的第一功能。 Controlling the robot to perform a first function in the first task according to the first action set.
PCT/CN2017/105643 2016-10-24 2017-10-11 Task switching method and related device WO2018077032A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610939702.5 2016-10-24
CN201610939702.5A CN107976918B (en) 2016-10-24 2016-10-24 Task switching method and related device

Publications (1)

Publication Number Publication Date
WO2018077032A1 true WO2018077032A1 (en) 2018-05-03

Family

ID=62004107

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105643 WO2018077032A1 (en) 2016-10-24 2017-10-11 Task switching method and related device

Country Status (3)

Country Link
CN (1) CN107976918B (en)
TW (1) TW201816598A (en)
WO (1) WO2018077032A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113329455A (en) * 2020-02-12 2021-08-31 丰田自动车株式会社 Task execution system, radio connection method, and program

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209485B (en) * 2019-06-05 2020-06-02 青岛海通胜行智能科技有限公司 Dynamic avoidance method for multiple robots during cooperative operation
CN110239868B (en) * 2019-06-29 2021-05-11 深圳市海柔创新科技有限公司 Goods taking task allocation method and goods sorting system thereof
CN111880877B (en) * 2020-07-24 2023-10-31 上海米哈游天命科技有限公司 Animation switching method, device, equipment and storage medium
CN112356030B (en) * 2020-11-05 2022-04-22 苏州工业园区卡鲁生产技术研究院 Robot control method, device, computer equipment and storage medium
CN115145233B (en) * 2022-07-25 2023-08-01 西安热工研究院有限公司 Multi-stage small-granularity movement scheduling control method, device and equipment for robot
CN115946126B (en) * 2023-02-22 2023-06-13 深圳市欧拉智造科技有限公司 Task execution control method and robot

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060276934A1 (en) * 2005-06-07 2006-12-07 Fanuc Ltd Device and method for controlling robot
CN101884585A (en) * 2010-07-30 2010-11-17 山东建筑大学 Control system of traditional Chinese medical massage robot
CN102914967A (en) * 2012-09-21 2013-02-06 浙江工业大学 Autonomous navigation and man-machine coordination picking operating system of picking robot

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8311905B1 (en) * 2008-09-29 2012-11-13 Honda Motor Co., Ltd. Computerized system and method for automated demand-based parts delivery
EP2224384A1 (en) * 2009-02-25 2010-09-01 Siemens Aktiengesellschaft Method and system for scheduling a manufacturing process
US8756606B2 (en) * 2011-01-31 2014-06-17 Toyota Jidosha Kabushiki Kaisha Safety controller and safety control method in which time partitions are scheduled according to a scheduling pattern
US10802876B2 (en) * 2013-05-22 2020-10-13 Massachusetts Institute Of Technology Multiprocessor scheduling policy with deadline constraint for determining multi-agent schedule for a plurality of agents
CN104657835B (en) * 2013-11-20 2018-01-16 沈阳工业大学 A kind of engineering shop's scheduling and monitoring system and method
US20150324229A1 (en) * 2014-05-09 2015-11-12 International Business Machines Corporation Propagation of task progress through the use of coalesced time intervals
JP2016066124A (en) * 2014-09-22 2016-04-28 富士通株式会社 Scheduling method and information processor
CN105700941B (en) * 2015-12-18 2019-04-05 西安工业大学 The dispatching method of three-dimensional scheduler model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060276934A1 (en) * 2005-06-07 2006-12-07 Fanuc Ltd Device and method for controlling robot
CN101884585A (en) * 2010-07-30 2010-11-17 山东建筑大学 Control system of traditional Chinese medical massage robot
CN102914967A (en) * 2012-09-21 2013-02-06 浙江工业大学 Autonomous navigation and man-machine coordination picking operating system of picking robot

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113329455A (en) * 2020-02-12 2021-08-31 丰田自动车株式会社 Task execution system, radio connection method, and program
CN113329455B (en) * 2020-02-12 2024-02-23 丰田自动车株式会社 Task execution system, radio connection method, and computer-readable medium

Also Published As

Publication number Publication date
CN107976918B (en) 2020-10-13
TW201816598A (en) 2018-05-01
CN107976918A (en) 2018-05-01

Similar Documents

Publication Publication Date Title
WO2018077032A1 (en) Task switching method and related device
CN107291547B (en) Task scheduling processing method, device and system
US11144340B2 (en) Placement of container workloads triggered by network traffic for efficient computing at network edge devices
CN109116847A (en) Path dispatching method, device, background server and storage medium
CN106293919A (en) The built-in tasks dispatching device of a kind of Time Triggered and method
JPH10228385A (en) Real time os and its task management system
CN105589748A (en) Service request processing method and apparatus
US7237005B2 (en) Job network setup method, job network execution method, job management system, management terminal and program
JPWO2005013130A1 (en) Real-time control system
JP2004015717A (en) Cellular phone with priority control function
WO2004061663A3 (en) System and method for providing hardware-assisted task scheduling
JP2000272205A (en) Printer determining printing execution order and network system including the printer
CN115946126B (en) Task execution control method and robot
JPH1165623A (en) Programmable controller
US20160364260A1 (en) Event router and routing method for symmetric multiprocessor virtual machine using queue
JP2005128952A (en) Supervisory control device and program
JPH0789323B2 (en) Multiple interrupt control method
JPH07114518A (en) Task scheduling system of multiprocessor system
KR100653741B1 (en) flow scheduling system and method for home network
JP2001265610A (en) Device control method
JP2007110270A (en) Communications device for executing specified interval communication
JP2848172B2 (en) I / O controller
JP2003179661A (en) Data transmission unit
JPH05233525A (en) Input/otuput processor
JP3362673B2 (en) Channel control device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17864258

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17864258

Country of ref document: EP

Kind code of ref document: A1