WO2023103379A1 - Task execution method and apparatus, and device and storage medium - Google Patents
Task execution method and apparatus, and device and storage medium Download PDFInfo
- Publication number
- WO2023103379A1 WO2023103379A1 PCT/CN2022/105813 CN2022105813W WO2023103379A1 WO 2023103379 A1 WO2023103379 A1 WO 2023103379A1 CN 2022105813 W CN2022105813 W CN 2022105813W WO 2023103379 A1 WO2023103379 A1 WO 2023103379A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target task
- execution
- tasks
- indication information
- task
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000000875 corresponding effect Effects 0.000 description 54
- 230000000249 desinfective effect Effects 0.000 description 24
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 230000005484 gravity Effects 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005507 spraying Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
- G06F9/4818—Priority circuits therefor
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Definitions
- the present invention relates to the technical field of artificial intelligence, in particular to a task execution method, device, equipment and storage medium.
- smart devices can perform different tasks. Generally speaking, assuming that the smart device is currently executing task A and receives task B at this time, then task A will be interrupted due to the arrival of task B. Therefore, when task B is received, the smart device will stop executing task A and immediately switch to executing task B. When task B ends, the smart device will not continue to execute task A, resulting in task A not being completed, and it can be considered that task A and task B conflict. In related technologies, tasks cannot be executed due to conflicts, and there is a lack of effective management of tasks.
- Embodiments of the present invention provide a task execution method, device, device, and storage medium to implement effective management of multiple tasks and avoid the problem that some tasks cannot be executed due to conflicts between tasks.
- an embodiment of the present invention provides a task execution method, the method including:
- the determining first indication information for indicating whether to allow execution of the target task based on the application execution request and the working status of the smart device includes:
- the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed
- the first indication information for indicating whether to allow execution of the target task is determined based on the application execution request and the working status of the smart device, including:
- the smart device If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;
- the determining first indication information for indicating whether execution of the target task is allowed based on the first hardware resource and the second hardware resource includes:
- the application execution request also carries the priority corresponding to the target task
- the method also includes:
- first indication information for indicating whether execution of the target task is allowed is determined.
- the determining first indication information for indicating whether execution of the target task is allowed based on the priority corresponding to the target task and the priorities corresponding to the other tasks includes:
- the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;
- the determining first indication information for indicating whether execution of the target task is allowed based on the priority corresponding to the target task and the priorities corresponding to the other tasks includes:
- the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
- an embodiment of the present invention provides a task execution device, including:
- the receiving module is used to receive the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;
- An acquisition module configured to acquire the working status of the smart device
- a determining module configured to determine first indication information for indicating whether execution of the target task is allowed based on the application execution request and the working status of the smart device;
- a sending module configured to send the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
- the determining module is configured to:
- the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed
- the determination module is configured to:
- the smart device If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;
- the determining module is configured to:
- the application execution request also carries the priority corresponding to the target task
- the determining module is also used for:
- first indication information for indicating whether execution of the target task is allowed is determined.
- the determining module is configured to:
- the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;
- the determining module is configured to:
- the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
- an embodiment of the present invention provides an electronic device, which includes a processor and a memory, wherein executable code is stored in the memory, and when the executable code is executed by the processor, the The processor can at least implement the task execution method in the first aspect.
- an embodiment of the present invention provides a non-transitory machine-readable storage medium, where executable code is stored on the non-transitory machine-readable storage medium, and when the executable code is executed by a processor of an electronic device During execution, the processor can at least implement the task execution method in the first aspect.
- the cloud server when the cloud server needs to control the smart device to execute the target task, it can send an application execution request corresponding to the target task to the arbitration center.
- the arbitration center judges whether to allow the cloud server to control the smart device to execute the target task based on the current working status of the smart device applying for control and the application execution request.
- each cloud server is deployed to control the smart device to perform the task, so that each task can be effectively executed, and the effective management of multi-tasks is realized, which avoids certain conflicts caused by conflicts between tasks. The problem that the task cannot be executed.
- FIG. 1 is a schematic flowchart of a task execution method provided by an embodiment of the present invention
- FIG. 2 is a schematic diagram of concurrent task execution provided by an embodiment of the present invention.
- FIG. 3 is a schematic diagram of an exclusive task execution provided by an embodiment of the present invention.
- Fig. 4 is a schematic structural diagram of a task execution device provided by an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
- the words “if”, “if” as used herein may be interpreted as “at” or “when” or “in response to determining” or “in response to detecting”.
- the phrases “if determined” or “if detected (the stated condition or event)” could be interpreted as “when determined” or “in response to the determination” or “when detected (the stated condition or event) )” or “in response to detection of (a stated condition or event)”.
- FIG. 1 is a flow chart of a task execution method provided by an embodiment of the present invention.
- the method can be applied to an arbitration center, and the arbitration center can be set in a server or in a terminal. As shown in Figure 1, the method includes the following steps:
- the smart device mentioned above may be a robot. It can be understood that the smart device may be provided with various sensors and image acquisition devices, through which data such as images and depths of the physical environment where the smart device is located can be collected.
- the smart device can send the collected image and depth data to the cloud server, and the cloud server performs control operations based on the received image and depth data to obtain control instructions for the smart device.
- the cloud server can send the control command to the smart device, and the smart device performs corresponding actions according to the control command.
- smart devices are responsible for collecting data
- cloud servers are responsible for logical control based on data
- smart devices perform actions based on logical control.
- smart devices can be made to perform tasks, for example, let smart devices perform disinfecting tasks.
- the disinfecting task refers to spraying and disinfecting the physical environment.
- the same smart device can be logically controlled by the same or different cloud servers.
- the cloud server When the cloud server needs to control the smart device to perform the target task, it can send an application execution request corresponding to the target task to the arbitration center, and determine whether the smart device can be controlled to perform the target task according to the feedback result of the arbitration center.
- the arbitration center After receiving the application execution request corresponding to the target task sent by the cloud server, the arbitration center can obtain the current working status of the smart device as the control object, and then determine whether to allow the execution based on the application execution request and the working status of the smart device.
- the first instruction message of the target task Wherein, the first execution information includes execution permission or execution refusal.
- the arbitration center will feed back the first indication information to the cloud server through a callback, so that the cloud server can determine whether the smart device can be controlled to perform the target task based on the first indication information.
- the process of determining the first indication information for indicating whether to allow the execution of the target task may be implemented as: if the smart device is not currently executing other tasks, then determine the first indication The information is to allow the execution of the target task.
- the arbitration center when all cloud servers controlled by the arbitration center need to control the corresponding smart devices to perform tasks, they need to send application execution requests to the arbitration center, and the arbitration center will record the working status of each smart device. If it is determined based on the recorded working status that the smart device that the cloud server applies to control is not currently performing other tasks, then the arbitration center allows the cloud server to control the smart device to perform the target task.
- the application execution request may also carry second indication information for indicating whether concurrent execution of the target task is allowed.
- the process of determining the first indication information indicating whether to allow the execution of the target task can be implemented as follows: if based on the second indication information If it is determined that the target task is allowed to execute concurrently, and other tasks currently executed by the smart device are tasks that allow concurrent execution, then the first hardware resource of the smart device needed to execute the target task and the second hardware resource of the smart device needed to execute other tasks are obtained ; Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
- the task execution manner may include concurrent execution or exclusive execution. If the execution mode of the task is to execute concurrently, then other tasks can be allowed to execute together. If the execution mode of the task is exclusive execution, it needs to be executed separately when other tasks are not executed.
- the second indication information may be used to indicate whether concurrent execution is allowed, and the second indication information is carried in the application execution request and sent to the arbitration center.
- the execution mode of the target task may be set by background personnel during the process of configuring the target task.
- the target task is a task that allows concurrent execution
- whether the target task and the other tasks can be executed concurrently also needs to be determined based on the first hardware resources of the smart device needed to execute the target task and the second hardware resources of the smart device needed to execute other tasks.
- the hardware resources may be hardware such as sensors, mechanical arms, mechanical legs, wheels, etc. set in the smart device.
- the target task can be configured and generated by the background personnel, and the cloud server can obtain the target task after the target task is configured.
- the cloud server can analyze the target task, and through the analysis process, the first hardware resource required for executing the target task in the smart device can be obtained.
- the cloud server sends the application execution request corresponding to the target task to the arbitration center, the first hardware resource can be carried in the application execution request, so that the arbitration center can determine the first hardware resource required to execute the target task based on the application execution request.
- the process of determining the first indication information for indicating whether to allow execution of the target task may be implemented as: if the first hardware resource and the second hardware resource are not the same, then determine The first indication information is permission to execute the target task.
- the target task is to play a piece of broadcast audio
- the first hardware resource required to execute the target task is an audio playback device.
- Other tasks are disinfecting tasks
- the second hardware resources required to perform other tasks are spraying devices and wheels.
- the first hardware resource is different from the second hardware resource, and the arbitration center can allow the target task to execute concurrently with other tasks.
- a smart device needs to be controlled to execute task0, it can apply to the arbitration center to execute task0, and the arbitration center judges that the smart device is not currently executing any tasks, and judges that task0 is allowed to be executed.
- the arbitration center receives a request for executing task1.
- the arbitration center judges that both task0 and task1 are allowed to be executed concurrently, and there is no hardware conflict between them, thus allowing task1 to be executed concurrently while executing task0.
- the life cycle of task1 is short, and task1 finishes execution before task0, and informs the arbitration center of the execution completion. After a period of time after the execution of task1 ends, the execution of task0 also ends, and the arbitration center is notified of the end of execution.
- first hardware resource and the second hardware resource are the same, and the resource attributes of the first hardware resource and the second hardware resource are not allowed to be shared, then based on the priority of the target task and other tasks, determine whether to indicate whether First instruction information allowing execution of the target task.
- the hardware resource that allows sharing is, for example, the gravity sensor in the smart device. Since the gravity reported by the gravity sensor can be shared by multiple tasks, the gravity sensor is a hardware resource that allows sharing.
- mutually exclusive hardware resources are mechanical legs, wheels, etc. Since smart devices move in one direction intelligently, it is necessary to control all mechanical legs and wheels through the same task, and then mechanical legs and wheels are mutually exclusive hardware resources.
- first hardware resource and the second hardware resource may be recorded in the form of a resource list.
- the first hardware resource or the second hardware resource may include multiple pieces of hardware that need to be used.
- the application execution request may also carry the priority corresponding to the target task.
- the priority corresponding to other tasks currently executed by the smart device is obtained; based on the priority corresponding to the target task and the priority corresponding to other tasks, determine The first indication information whether to allow the execution of the target task.
- the target task can be generated by background staff configuration.
- the background staff can set the corresponding priority for the target task.
- tasks may include system tasks, common tasks and applications.
- the system task is an important task, for example, the system task may be a task of upgrading the system of the smart device, a task of charging the smart device when the power of the smart device is low, and the like.
- Ordinary tasks can be disinfecting tasks, for example.
- the function of the application is similar to that of the ordinary task, the difference is that the ordinary task can be a self-developed task, that is, a built-in task, and the application can be a task developed by a third party who purchases the service provided by the cloud server.
- System tasks correspond to system task priority intervals, and common tasks and applications correspond to ordinary task priority intervals. Since system tasks are important tasks, the lowest priority in the priority range of system tasks is set higher than the highest priority in the priority range of ordinary tasks, that is to say, as long as it is a system task, its priority is higher than Any common task or application. When setting the priority of any task, you need to know the task type of the task, and then set it within the priority interval corresponding to the task type.
- the above priority may be determined based on the value of PRIORITY.
- the process of determining the first indication information for indicating whether to allow the execution of the target task may be implemented as follows: if the priority corresponding to the target task is higher than that of other tasks If the corresponding priority is determined, it is instructed to suspend the execution of other tasks, and it is determined that the first indication information is to allow the execution of the target task; when it is determined that the execution of the target task is completed, it is instructed to resume the execution of other tasks.
- a smart device needs to be controlled to execute task0, it can apply to the arbitration center to execute task0, and the arbitration center judges that the smart device is not currently executing any tasks, and judges that task0 is allowed to be executed.
- the arbitration center receives a request for executing task1.
- the arbitration center judges that task1 is an exclusively executed task, and then compares the priorities of task0 and task1. Determine that the priority of task0 is low and the priority of task1 is high, judge to stop executing task0, and execute task1 first. Therefore, task0 is divided into two parts, including part1 and part2. The part that has been executed before is part1, and the part that has been interrupted and not yet executed is part2.
- the arbitration center is notified of the end of the execution. After the arbitration center determines that the execution of task1 is completed, it resumes the execution of part2 of task0. After the execution of part2 ends, the arbitration center is notified of the end of task0 execution.
- the mode of task execution is more flexible.
- the process of determining the first indication information for indicating whether to allow the execution of the target task can also be implemented as follows: if the priority corresponding to the target task is lower than or is equal to the priority corresponding to other tasks, then it is determined that the first indication information is a refusal to execute the target task.
- the fixed-point disinfecting task is a disinfecting task that will be executed immediately if allowed to execute from the moment the task is received, and the disinfecting location of the fixed-point disinfecting task is the area near the coffee machine of a certain department in a certain building.
- the smart device has also set a timed disinfecting task.
- the timing disinfecting task is a disinfecting task that is executed immediately if it is allowed to execute when the specified time point is reached, and the timing disinfecting task is a certain floor in a certain building.
- the specified time of the fixed-point disinfecting task arrives.
- the priority of the fixed-point disinfecting task and the fixed-point disinfecting task can be compared.
- the priority of the scheduled disinfecting task is BASE_PRIORITY+1
- the priority of the fixed-point disinfecting task is BASE_PRIORITY-1.
- the priority of the fixed-point disinfecting task is higher than that of the fixed-point killing task, so the fixed-point disinfecting task cannot interrupt the fixed-point killing task, and it needs to wait until the fixed-point disinfecting task is completed. Then execute the scheduled disinfecting task. This can ensure that each task can be effectively executed, and there will be no situation where the previous task is interrupted by the unimportant task behind and the previous task is discarded and the execution is not completed.
- the cloud server when the cloud server needs to control the smart device to execute the target task, it can send an application execution request corresponding to the target task to the arbitration center.
- the arbitration center judges whether to allow the cloud server to control the smart device to execute the target task based on the current working status of the smart device applying for control and the application execution request.
- each cloud server is deployed to control the smart device to perform the task, so that each task can be effectively executed, and the effective management of multi-tasks is realized, which improves the efficiency of task execution and avoids the gap between tasks. Some tasks cannot be executed due to conflicts.
- Fig. 4 is a schematic structural diagram of a task execution device provided by an embodiment of the present invention. As shown in Fig. 4, the device includes:
- the receiving module 41 is configured to receive the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;
- An acquisition module 42 configured to acquire the working status of the smart device
- a determination module 43 configured to determine, based on the application execution request and the working status of the smart device, first indication information for indicating whether execution of the target task is allowed;
- the sending module 44 is configured to send the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
- the determination module 43 is configured to:
- the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed
- the determining module 43 is configured to:
- the smart device If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;
- the determination module 43 is configured to:
- the application execution request also carries the priority corresponding to the target task
- the determination module 43 is also used for:
- first indication information for indicating whether execution of the target task is allowed is determined.
- the determination module 43 is configured to:
- the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;
- the determination module 43 is configured to:
- the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
- the device shown in FIG. 4 can execute the task execution method provided in the embodiments shown in FIGS. 1 to 3 .
- the device shown in FIG. 4 can execute the task execution method provided in the embodiments shown in FIGS. 1 to 3 .
- the structure of the task execution apparatus shown in FIG. 4 above may be implemented as an electronic device, and the electronic device may specifically be the server or terminal in the above embodiment.
- the electronic device may include: a processor 91 and a memory 92 .
- executable code is stored on the memory 92, when the executable code is executed by the processor 91, the processor 91 can at least implement method of task execution.
- the electronic device may also include a communication interface 93 for communicating with other devices.
- an embodiment of the present invention provides a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by the processor of the electronic device , so that the processor can at least implement the task execution method provided in the embodiment shown in FIG. 1 to FIG. 3 .
- the task execution method provided by the embodiment of the present invention can be executed by a certain program/software, which can be provided by the network side, and the electronic device mentioned in the foregoing embodiments can download the program/software to a local non-volatile In the volatile storage medium, and when it needs to execute the aforementioned task execution method, the program/software is read into the memory by the CPU, and then the program/software is executed by the CPU to realize the task execution method provided in the aforementioned embodiments , the execution process can refer to the schematic diagrams in the aforementioned FIG. 1 to FIG. 3 .
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Provided in the embodiments of the present invention are a task execution method and apparatus, and a device and a storage medium. The method comprises: receiving an application execution request which is sent by a cloud server and which corresponds to a target task, wherein the target task is executed by means of the cloud server controlling an intelligent device; acquiring the working state of the intelligent device; on the basis of the application execution request and the working state of the intelligent device, determining first indication information which is used for indicating whether the target task is allowed to be executed; and sending the first indication information to the cloud server, such that the cloud server determines, on the basis of the first indication information, whether to control the intelligent device to execute the target task. By means of the arbitration performed by an arbitration center regarding whether a task is allowed to be executed, each cloud server is deployed to control an intelligent device to execute the task, such that each task can be effectively executed, thereby realizing effective management of multiple tasks, and avoiding the problem of some tasks being unable to be executed due to conflicts between the tasks.
Description
交叉引用cross reference
本申请要求2021年12月9日递交的、申请号为“2021114989527”、发明名称为“任务执行方法、装置、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number "2021114989527" and the title of the invention "task performance method, device, equipment and storage medium" submitted on December 9, 2021, the entire contents of which are incorporated herein by reference. Applying.
本发明涉及人工智能技术领域,尤其涉及一种任务执行方法、装置、设备和存储介质。The present invention relates to the technical field of artificial intelligence, in particular to a task execution method, device, equipment and storage medium.
相关技术中,智能设备可以执行不同任务。一般来说,假设智能设备当前正在执行任务A,此时又接收到任务B,那么任务A会由于任务B的到来而被打断。因此,当接收到任务B时,智能设备会停止执行任务A,立即转而执行任务B。当任务B结束时,智能设备也不会再继续执行任务A,导致任务A没有完成,可以认为任务A和任务B产生了冲突。相关技术中任务之间会因为冲突导致无法执行,缺乏对任务的有效管理。In related technologies, smart devices can perform different tasks. Generally speaking, assuming that the smart device is currently executing task A and receives task B at this time, then task A will be interrupted due to the arrival of task B. Therefore, when task B is received, the smart device will stop executing task A and immediately switch to executing task B. When task B ends, the smart device will not continue to execute task A, resulting in task A not being completed, and it can be considered that task A and task B conflict. In related technologies, tasks cannot be executed due to conflicts, and there is a lack of effective management of tasks.
发明内容Contents of the invention
本发明实施例提供一种任务执行方法、装置、设备和存储介质,用以实现对多任务的有效管理,避免由于任务之间的冲突导致的某些任务无法执行的问题。Embodiments of the present invention provide a task execution method, device, device, and storage medium to implement effective management of multiple tasks and avoid the problem that some tasks cannot be executed due to conflicts between tasks.
第一方面,本发明实施例提供一种任务执行方法,该方法包括:In a first aspect, an embodiment of the present invention provides a task execution method, the method including:
接收云端服务器发送的目标任务对应的申请执行请求,所述目标任务由所述云端服务器控制智能设备执行;receiving the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;
获取所述智能设备的工作状态;Obtain the working status of the smart device;
基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息;determining first indication information for indicating whether execution of the target task is allowed based on the application execution request and the working status of the smart device;
向所述云端服务器发送所述第一指示信息,以使所述云端服务器基于所述第一指示信息确定是否控制所述智能设备执行所述目标任务。Sending the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
可选地,所述基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:Optionally, the determining first indication information for indicating whether to allow execution of the target task based on the application execution request and the working status of the smart device includes:
若所述智能设备当前未执行其他任务,则确定所述第一指示信息为允许执行所述目标任务。If the smart device is not currently executing other tasks, determine that the first indication information is permission to execute the target task.
可选地,所述申请执行请求中携带有用于指示是否允许并发执行所述目标任务的第二指示信息;Optionally, the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed;
若所述智能设备当前执行有其他任务,所述基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:If the smart device is currently executing other tasks, the first indication information for indicating whether to allow execution of the target task is determined based on the application execution request and the working status of the smart device, including:
若基于所述第二指示信息确定允许并发执行所述目标任务,且所述智能设备当前执行的所述其他任务为允许并发执行的任务,则获取执行所述目标任务需要的所述智能设备的第一硬件资源,以及执行所述其他任务需要的所述智能设备的第二硬件资源;If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;
基于所述第一硬件资源和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
可选地,所述基于所述第一硬件资源和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:Optionally, the determining first indication information for indicating whether execution of the target task is allowed based on the first hardware resource and the second hardware resource includes:
若所述第一硬件资源和所述第二硬件资源不相同,则确定所述第一指示信息为允许执行所述目标任务。If the first hardware resource is different from the second hardware resource, then determine that the first indication information is to allow execution of the target task.
可选地,所述申请执行请求中还携带有所述目标任务对应的优先级;Optionally, the application execution request also carries the priority corresponding to the target task;
所述方法还包括:The method also includes:
若基于所述第二指示信息确定不允许并发执行所述目标任务,则获取所述 智能设备当前执行的所述其他任务对应的优先级;If it is determined based on the second indication information that the target task is not allowed to be executed concurrently, then obtaining the priority corresponding to the other tasks currently executed by the smart device;
基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the priority corresponding to the target task and the priorities corresponding to the other tasks, first indication information for indicating whether execution of the target task is allowed is determined.
可选地,所述基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:Optionally, the determining first indication information for indicating whether execution of the target task is allowed based on the priority corresponding to the target task and the priorities corresponding to the other tasks includes:
若所述目标任务对应的优先级高于所述其他任务对应的优先级,则指示中止执行所述其他任务,并确定所述第一指示信息为允许执行所述目标任务;If the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;
当确定所述目标任务执行结束时,指示恢复执行所述其他任务。When it is determined that the execution of the target task ends, it is instructed to resume execution of the other tasks.
可选地,所述基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:Optionally, the determining first indication information for indicating whether execution of the target task is allowed based on the priority corresponding to the target task and the priorities corresponding to the other tasks includes:
若所述目标任务对应的优先级低于或者等于所述其他任务对应的优先级,则确定所述第一指示信息为拒绝执行所述目标任务。If the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
第二方面,本发明实施例提供一种任务执行装置,包括:In a second aspect, an embodiment of the present invention provides a task execution device, including:
接收模块,用于接收云端服务器发送的目标任务对应的申请执行请求,所述目标任务由所述云端服务器控制智能设备执行;The receiving module is used to receive the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;
获取模块,用于获取所述智能设备的工作状态;An acquisition module, configured to acquire the working status of the smart device;
确定模块,用于基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息;A determining module, configured to determine first indication information for indicating whether execution of the target task is allowed based on the application execution request and the working status of the smart device;
发送模块,用于向所述云端服务器发送所述第一指示信息,以使所述云端服务器基于所述第一指示信息确定是否控制所述智能设备执行所述目标任务。A sending module, configured to send the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
可选地,所述确定模块,用于:Optionally, the determining module is configured to:
若所述智能设备当前未执行其他任务,则确定所述第一指示信息为允许执行所述目标任务。If the smart device is not currently executing other tasks, determine that the first indication information is permission to execute the target task.
可选地,所述申请执行请求中携带有用于指示是否允许并发执行所述目标任务的第二指示信息;Optionally, the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed;
若所述智能设备当前执行有其他任务,所述确定模块,用于:If the smart device currently executes other tasks, the determination module is configured to:
若基于所述第二指示信息确定允许并发执行所述目标任务,且所述智能设 备当前执行的所述其他任务为允许并发执行的任务,则获取执行所述目标任务需要的所述智能设备的第一硬件资源,以及执行所述其他任务需要的所述智能设备的第二硬件资源;If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;
基于所述第一硬件资源和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
可选地,所述确定模块,用于:Optionally, the determining module is configured to:
若所述第一硬件资源和所述第二硬件资源不相同,则确定所述第一指示信息为允许执行所述目标任务。If the first hardware resource is different from the second hardware resource, then determine that the first indication information is to allow execution of the target task.
可选地,所述申请执行请求中还携带有所述目标任务对应的优先级;Optionally, the application execution request also carries the priority corresponding to the target task;
所述确定模块,还用于:The determining module is also used for:
若基于所述第二指示信息确定不允许并发执行所述目标任务,则获取所述智能设备当前执行的所述其他任务对应的优先级;If it is determined based on the second indication information that the target task is not allowed to be executed concurrently, acquiring the priority corresponding to the other tasks currently executed by the smart device;
基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the priority corresponding to the target task and the priorities corresponding to the other tasks, first indication information for indicating whether execution of the target task is allowed is determined.
可选地,所述确定模块,用于:Optionally, the determining module is configured to:
若所述目标任务对应的优先级高于所述其他任务对应的优先级,则指示中止执行所述其他任务,并确定所述第一指示信息为允许执行所述目标任务;If the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;
当确定所述目标任务执行结束时,指示恢复执行所述其他任务。When it is determined that the execution of the target task ends, it is instructed to resume execution of the other tasks.
可选地,所述确定模块,用于:Optionally, the determining module is configured to:
若所述目标任务对应的优先级低于或者等于所述其他任务对应的优先级,则确定所述第一指示信息为拒绝执行所述目标任务。If the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
第三方面,本发明实施例提供一种电子设备,其中包括处理器和存储器,其中,所述存储器上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器至少可以实现第一方面中的任务执行方法。In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, wherein executable code is stored in the memory, and when the executable code is executed by the processor, the The processor can at least implement the task execution method in the first aspect.
第四方面,本发明实施例提供了一种非暂时性机器可读存储介质,所述非暂时性机器可读存储介质上存储有可执行代码,当所述可执行代码被电子设备的处理器执行时,使所述处理器至少可以实现第一方面中的任务执行方法。In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium, where executable code is stored on the non-transitory machine-readable storage medium, and when the executable code is executed by a processor of an electronic device During execution, the processor can at least implement the task execution method in the first aspect.
采用本发明,当云端服务器需要控制智能设备执行目标任务时,可以向仲裁中心发送目标任务对应的申请执行请求。仲裁中心基于申请控制的智能设备当前的工作状态和申请执行请求,判断是否允许云端服务器控制智能设备执行目标任务。通过仲裁中心对是否允许执行任务的仲裁来调配各云端服务器控制智能设备来执行任务,使得各任务可以得到有效执行,实现对多任务的有效管理,避免了由于任务之间的冲突导致的某些任务无法执行的问题。With the present invention, when the cloud server needs to control the smart device to execute the target task, it can send an application execution request corresponding to the target task to the arbitration center. The arbitration center judges whether to allow the cloud server to control the smart device to execute the target task based on the current working status of the smart device applying for control and the application execution request. Through the arbitration of the arbitration center on whether the task is allowed to be executed, each cloud server is deployed to control the smart device to perform the task, so that each task can be effectively executed, and the effective management of multi-tasks is realized, which avoids certain conflicts caused by conflicts between tasks. The problem that the task cannot be executed.
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1为本发明实施例提供的一种任务执行方法的流程示意图;FIG. 1 is a schematic flowchart of a task execution method provided by an embodiment of the present invention;
图2为本发明实施例提供的一种并发任务执行示意图;FIG. 2 is a schematic diagram of concurrent task execution provided by an embodiment of the present invention;
图3为本发明实施例提供的一种独占任务执行示意图;FIG. 3 is a schematic diagram of an exclusive task execution provided by an embodiment of the present invention;
图4为本发明实施例提供的一种任务执行装置的结构示意图;Fig. 4 is a schematic structural diagram of a task execution device provided by an embodiment of the present invention;
图5为本发明实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义, “多种”一般包含至少两种。Terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise, "multiple" Generally contain at least two.
取决于语境,如在此所使用的词语“如果”、“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the words "if", "if" as used herein may be interpreted as "at" or "when" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrases "if determined" or "if detected (the stated condition or event)" could be interpreted as "when determined" or "in response to the determination" or "when detected (the stated condition or event) )" or "in response to detection of (a stated condition or event)".
另外,下述各方法实施例中的步骤时序仅为一种举例,而非严格限定。In addition, the sequence of steps in the following method embodiments is only an example, rather than a strict limitation.
图1为本发明实施例提供的一种任务执行方法的流程图,该方法可以应用于仲裁中心,该仲裁中心可以设置在服务器、也可以设置在终端中。如图1所示,该方法包括如下步骤:FIG. 1 is a flow chart of a task execution method provided by an embodiment of the present invention. The method can be applied to an arbitration center, and the arbitration center can be set in a server or in a terminal. As shown in Figure 1, the method includes the following steps:
101、接收云端服务器发送的目标任务对应的申请执行请求,目标任务由云端服务器控制智能设备执行。101. Receive the application execution request corresponding to the target task sent by the cloud server, and the cloud server controls the smart device to execute the target task.
102、获取智能设备的工作状态。102. Obtain the working status of the smart device.
103、基于申请执行请求以及智能设备的工作状态,确定用于指示是否允许执行目标任务的第一指示信息。103. Based on the application execution request and the working status of the smart device, determine first indication information for indicating whether execution of the target task is allowed.
104、向云端服务器发送第一指示信息,以使云端服务器基于第一指示信息确定是否控制智能设备执行目标任务。104. Send the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
上述智能设备可以是机器人。可以理解的是,智能设备中可以设置有多种传感器、图像采集装置,通过这些传感器、图像采集装置可以采集智能设备所处的物理环境的图像以及深度等数据。智能设备可以将采集到的图像以及深度等数据发送至云端服务器,由云端服务器基于接收到的图像以及深度等数据进行控制运算以得到对智能设备的控制指令。云端服务器可以将控制指令发送至智能设备,智能设备根据控制指令执行相应的动作。The smart device mentioned above may be a robot. It can be understood that the smart device may be provided with various sensors and image acquisition devices, through which data such as images and depths of the physical environment where the smart device is located can be collected. The smart device can send the collected image and depth data to the cloud server, and the cloud server performs control operations based on the received image and depth data to obtain control instructions for the smart device. The cloud server can send the control command to the smart device, and the smart device performs corresponding actions according to the control command.
概括来说,智能设备负责采集数据,云端服务器负责基于数据进行逻辑控制,智能设备根据逻辑控制进行动作。通过对智能设备的逻辑控制,可以让智能设备执行任务,比如说让智能设备执行消杀任务。其中,消杀任务是指对物 理环境进行喷洒消毒。In a nutshell, smart devices are responsible for collecting data, cloud servers are responsible for logical control based on data, and smart devices perform actions based on logical control. Through the logical control of smart devices, smart devices can be made to perform tasks, for example, let smart devices perform disinfecting tasks. Among them, the disinfecting task refers to spraying and disinfecting the physical environment.
另外,值得注意的是,同一智能设备可以由相同或者不同的云端服务器进行逻辑控制。In addition, it is worth noting that the same smart device can be logically controlled by the same or different cloud servers.
当云端服务器需要控制智能设备执行目标任务时,可以向仲裁中心发送目标任务对应的申请执行请求,根据仲裁中心的反馈结果确定是否可以控制智能设备执行目标任务。When the cloud server needs to control the smart device to perform the target task, it can send an application execution request corresponding to the target task to the arbitration center, and determine whether the smart device can be controlled to perform the target task according to the feedback result of the arbitration center.
仲裁中心在接收到云端服务器发送的目标任务对应的申请执行请求之后,可以获取作为控制对象的智能设备当前的工作状态,然后基于申请执行请求以及智能设备的工作状态,确定用于指示是否允许执行目标任务的第一指示信息。其中,第一执行信息包括允许执行或者拒绝执行。最后,仲裁中心会通过回调向云端服务器反馈第一指示信息,这样云端服务器可以基于第一指示信息确定是否可以控制智能设备执行目标任务。After receiving the application execution request corresponding to the target task sent by the cloud server, the arbitration center can obtain the current working status of the smart device as the control object, and then determine whether to allow the execution based on the application execution request and the working status of the smart device. The first instruction message of the target task. Wherein, the first execution information includes execution permission or execution refusal. Finally, the arbitration center will feed back the first indication information to the cloud server through a callback, so that the cloud server can determine whether the smart device can be controlled to perform the target task based on the first indication information.
可选地,上述基于申请执行请求以及智能设备的工作状态,确定用于指示是否允许执行目标任务的第一指示信息的过程可以实现为:若智能设备当前未执行其他任务,则确定第一指示信息为允许执行目标任务。Optionally, based on the application execution request and the working status of the smart device, the process of determining the first indication information for indicating whether to allow the execution of the target task may be implemented as: if the smart device is not currently executing other tasks, then determine the first indication The information is to allow the execution of the target task.
可以理解的是,仲裁中心管控的所有云端服务器在需要控制对应的智能设备执行任务时,都需要向仲裁中心发送申请执行请求,仲裁中心会记录下各智能设备的工作状态。如果基于记录的工作状态确定云端服务器申请控制的智能设备当前未执行其他任务,那么仲裁中心允许该云端服务器控制该智能设备执行目标任务。It is understandable that when all cloud servers controlled by the arbitration center need to control the corresponding smart devices to perform tasks, they need to send application execution requests to the arbitration center, and the arbitration center will record the working status of each smart device. If it is determined based on the recorded working status that the smart device that the cloud server applies to control is not currently performing other tasks, then the arbitration center allows the cloud server to control the smart device to perform the target task.
可选地,申请执行请求中还可以携带有用于指示是否允许并发执行目标任务的第二指示信息。相应地,若智能设备当前执行有其他任务,则基于申请执行请求以及智能设备的工作状态,确定用于指示是否允许执行目标任务的第一指示信息的过程可以实现为:若基于第二指示信息确定允许并发执行目标任务,且智能设备当前执行的其他任务为允许并发执行的任务,则获取执行目标任务需要的智能设备的第一硬件资源,以及执行其他任务需要的智能设备的第二硬件资源;基于第一硬件资源和第二硬件资源,确定用于指示是否允许执行目标 任务的第一指示信息。Optionally, the application execution request may also carry second indication information for indicating whether concurrent execution of the target task is allowed. Correspondingly, if the smart device is currently executing other tasks, based on the application execution request and the working status of the smart device, the process of determining the first indication information indicating whether to allow the execution of the target task can be implemented as follows: if based on the second indication information If it is determined that the target task is allowed to execute concurrently, and other tasks currently executed by the smart device are tasks that allow concurrent execution, then the first hardware resource of the smart device needed to execute the target task and the second hardware resource of the smart device needed to execute other tasks are obtained ; Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
需要说明的是,任务执行的方式可以包括并发执行或者独占执行。如果任务的执行方式是并发执行,那么可以允许其他任务一同执行。如果任务的执行的方式是独占执行,那么需要在其他任务没有执行的情况下单独执行。对于目标任务来说,可以通过第二指示信息来指示是否允许并发执行,并将第二指示信息携带在申请执行请求中发送至仲裁中心。目标任务的执行方式可以是后台人员在配置目标任务的过程中设置的。It should be noted that the task execution manner may include concurrent execution or exclusive execution. If the execution mode of the task is to execute concurrently, then other tasks can be allowed to execute together. If the execution mode of the task is exclusive execution, it needs to be executed separately when other tasks are not executed. For the target task, the second indication information may be used to indicate whether concurrent execution is allowed, and the second indication information is carried in the application execution request and sent to the arbitration center. The execution mode of the target task may be set by background personnel during the process of configuring the target task.
如果申请控制的智能设备当前正在执行其他任务,该其他任务不是独占执行的任务,且目标任务是允许并发执行的任务,那么有可能可以让目标任务和该其他任务并发执行。具体是否可以让目标任务和该其他任务并发执行,还需要基于执行目标任务需要的智能设备的第一硬件资源,以及执行其他任务需要的智能设备的第二硬件资源来确定。If the smart device applying for control is currently executing other tasks, the other tasks are not exclusively executed, and the target task is a task that allows concurrent execution, then it is possible to allow the target task and the other tasks to execute concurrently. Specifically, whether the target task and the other tasks can be executed concurrently also needs to be determined based on the first hardware resources of the smart device needed to execute the target task and the second hardware resources of the smart device needed to execute other tasks.
其中,硬件资源可以是智能设备中设置的各传感器、机械臂、机械腿、轮子等硬件。Wherein, the hardware resources may be hardware such as sensors, mechanical arms, mechanical legs, wheels, etc. set in the smart device.
目标任务可以由后台人员进行配置生成的,在配置目标任务后云端服务器可以获得目标任务。云端服务器可以对目标任务进行解析,通过解析处理可以获得智能设备中的执行目标任务需要的第一硬件资源。在云端服务器向仲裁中心发送目标任务对应的申请执行请求时,可以将第一硬件资源携带在申请执行请求中,这样仲裁中心可以基于申请执行请求确定执行目标任务需要的第一硬件资源。The target task can be configured and generated by the background personnel, and the cloud server can obtain the target task after the target task is configured. The cloud server can analyze the target task, and through the analysis process, the first hardware resource required for executing the target task in the smart device can be obtained. When the cloud server sends the application execution request corresponding to the target task to the arbitration center, the first hardware resource can be carried in the application execution request, so that the arbitration center can determine the first hardware resource required to execute the target task based on the application execution request.
可选地,基于第一硬件资源和第二硬件资源,确定用于指示是否允许执行目标任务的第一指示信息的过程可以实现为:若第一硬件资源和第二硬件资源不相同,则确定第一指示信息为允许执行目标任务。Optionally, based on the first hardware resource and the second hardware resource, the process of determining the first indication information for indicating whether to allow execution of the target task may be implemented as: if the first hardware resource and the second hardware resource are not the same, then determine The first indication information is permission to execute the target task.
比如说,目标任务为播放一段广播音频,执行目标任务需要的第一硬件资源为音频播放装置。其他任务为消杀任务,执行其他任务需要的第二硬件资源为喷洒装置和轮子。这样,第一硬件资源和第二硬件资源不相同,仲裁中心可以允许目标任务与其他任务并发执行。For example, the target task is to play a piece of broadcast audio, and the first hardware resource required to execute the target task is an audio playback device. Other tasks are disinfecting tasks, and the second hardware resources required to perform other tasks are spraying devices and wheels. In this way, the first hardware resource is different from the second hardware resource, and the arbitration center can allow the target task to execute concurrently with other tasks.
如图2所示,假设需要控制某智能设备执行task0,则可以向仲裁中心申请执行task0,仲裁中心判断当前该智能设备没有执行任何任务,判断允许执行task0。在task0执行的过程中,仲裁中心又接收到申请执行task1的请求。仲裁中心判断task0和task1都是允许并发执行的任务,且它们之间不存在硬件冲突,进而允许在执行task0的同时并发执行task1。task1的生命周期短,task1先于task0执行结束,向仲裁中心告知执行结束。在task1执行结束后的一段时间之后,task0也执行结束,向仲裁中心告知执行结束。As shown in Figure 2, assuming that a smart device needs to be controlled to execute task0, it can apply to the arbitration center to execute task0, and the arbitration center judges that the smart device is not currently executing any tasks, and judges that task0 is allowed to be executed. During the execution of task0, the arbitration center receives a request for executing task1. The arbitration center judges that both task0 and task1 are allowed to be executed concurrently, and there is no hardware conflict between them, thus allowing task1 to be executed concurrently while executing task0. The life cycle of task1 is short, and task1 finishes execution before task0, and informs the arbitration center of the execution completion. After a period of time after the execution of task1 ends, the execution of task0 also ends, and the arbitration center is notified of the end of execution.
可选地,若第一硬件资源和第二硬件资源相同,且第一硬件资源和第二硬件资源的资源属性为不允许共享,则基于目标任务和其他任务的优先级,确定用于指示是否允许执行目标任务的第一指示信息。Optionally, if the first hardware resource and the second hardware resource are the same, and the resource attributes of the first hardware resource and the second hardware resource are not allowed to be shared, then based on the priority of the target task and other tasks, determine whether to indicate whether First instruction information allowing execution of the target task.
对于硬件资源来说,某些硬件资源是允许共享的,而某些硬件资源是不允许共享的,或者说是互斥的。允许共享的硬件资源比如说是智能设备中的重力传感器,由于重力传感器上报的重力可以由多个任务共享,因此重力传感器是允许共享的硬件资源。互斥的硬件资源比如说是机械腿、轮子等,由于智能设备智能朝一个方向移动,因此需要通过同一任务控制所有的机械腿、轮子,进而机械腿、轮子是互斥的硬件资源。For hardware resources, some hardware resources are allowed to be shared, while some hardware resources are not allowed to be shared, or are mutually exclusive. The hardware resource that allows sharing is, for example, the gravity sensor in the smart device. Since the gravity reported by the gravity sensor can be shared by multiple tasks, the gravity sensor is a hardware resource that allows sharing. Mutually exclusive hardware resources are mechanical legs, wheels, etc. Since smart devices move in one direction intelligently, it is necessary to control all mechanical legs and wheels through the same task, and then mechanical legs and wheels are mutually exclusive hardware resources.
值得注意的是,第一硬件资源和第二硬件资源可以以资源列表的形式进行记录。第一硬件资源或者第二硬件资源可以包括多个需要使用的硬件。当第一硬件资源和第二硬件资源包括多个需要使用的硬件时,可以确定出第一硬件资源和第二硬件资源中相互重复的硬件,如果这些重复的硬件是不允许共享的,那么可以基于目标任务和其他任务的优先级,确定目标任务能否打断其他任务优先执行。It should be noted that the first hardware resource and the second hardware resource may be recorded in the form of a resource list. The first hardware resource or the second hardware resource may include multiple pieces of hardware that need to be used. When the first hardware resource and the second hardware resource include multiple pieces of hardware that need to be used, it is possible to determine the overlapping hardware in the first hardware resource and the second hardware resource, and if the overlapping hardware is not allowed to be shared, then it can be Based on the priority of the target task and other tasks, it is determined whether the target task can interrupt the priority execution of other tasks.
可选地,申请执行请求中还可以携带有目标任务对应的优先级。相应地,若基于第二指示信息确定不允许并发执行目标任务,则获取智能设备当前执行的其他任务对应的优先级;基于目标任务对应的优先级和其他任务对应的优先级,确定用于指示是否允许执行目标任务的第一指示信息。Optionally, the application execution request may also carry the priority corresponding to the target task. Correspondingly, if it is determined based on the second instruction information that the target task is not allowed to be executed concurrently, the priority corresponding to other tasks currently executed by the smart device is obtained; based on the priority corresponding to the target task and the priority corresponding to other tasks, determine The first indication information whether to allow the execution of the target task.
目标任务可以由后台人员配置生成,在配置目标任务的过程中,后台人员 可以为目标任务设定对应的优先级。The target task can be generated by background staff configuration. During the process of configuring the target task, the background staff can set the corresponding priority for the target task.
在某些可选实施例中,任务可以包括系统任务、普通任务和应用。其中,系统任务是重要的任务,系统任务比如可以是给智能设备的系统进行升级的任务、在智能设备电量低的情况下给智能设备充电的任务等。普通任务比如可以是消杀任务。应用与普通任务的功能类似,区别在于普通任务可以是自主研发的任务,即自带的任务,应用可以是购买云端服务器提供的服务的第三方开发的任务。In some optional embodiments, tasks may include system tasks, common tasks and applications. Among them, the system task is an important task, for example, the system task may be a task of upgrading the system of the smart device, a task of charging the smart device when the power of the smart device is low, and the like. Ordinary tasks can be disinfecting tasks, for example. The function of the application is similar to that of the ordinary task, the difference is that the ordinary task can be a self-developed task, that is, a built-in task, and the application can be a task developed by a third party who purchases the service provided by the cloud server.
系统任务对应有系统任务优先级区间,普通任务和应用对应有普通任务优先级区间。由于系统任务是重要的任务,故设定系统任务优先级区间内的最低优先级高于普通任务优先级区间内的最高优先级,也就是说只要是系统任务,它的优先级就要高于任何普通任务或者应用。在设定任何任务的优先级时,需要了解任务的任务类型,然后在与任务类型对应的优先级区间内进行设置。System tasks correspond to system task priority intervals, and common tasks and applications correspond to ordinary task priority intervals. Since system tasks are important tasks, the lowest priority in the priority range of system tasks is set higher than the highest priority in the priority range of ordinary tasks, that is to say, as long as it is a system task, its priority is higher than Any common task or application. When setting the priority of any task, you need to know the task type of the task, and then set it within the priority interval corresponding to the task type.
在某些可选实施例中,上述优先级可以基于PRIORITY的数值来确定。PRIORITY的数值越小,表示的优先级越大。PRIORITY的数值越大,表示的优先级越小。In some optional embodiments, the above priority may be determined based on the value of PRIORITY. The smaller the value of PRIORITY, the greater the priority. The larger the value of PRIORITY, the lower the priority.
可选地,基于目标任务对应的优先级和其他任务对应的优先级,确定用于指示是否允许执行目标任务的第一指示信息的过程可以实现为:若目标任务对应的优先级高于其他任务对应的优先级,则指示中止执行其他任务,并确定第一指示信息为允许执行目标任务;当确定目标任务执行结束时,指示恢复执行其他任务。Optionally, based on the priority corresponding to the target task and the priority corresponding to other tasks, the process of determining the first indication information for indicating whether to allow the execution of the target task may be implemented as follows: if the priority corresponding to the target task is higher than that of other tasks If the corresponding priority is determined, it is instructed to suspend the execution of other tasks, and it is determined that the first indication information is to allow the execution of the target task; when it is determined that the execution of the target task is completed, it is instructed to resume the execution of other tasks.
如图3所示,假设需要控制某智能设备执行task0,则可以向仲裁中心申请执行task0,仲裁中心判断当前该智能设备没有执行任何任务,判断允许执行task0。在task0执行的过程中,仲裁中心又接收到申请执行task1的请求。仲裁中心判断task1是独占执行的任务,进而比较task0和task1的优先级。确定task0的优先级低、task1的优先级高,判断中止执行task0,优先执行task1。因此,task0被分为两部分,包括part1和part2。前面执行完的部分为part1,被打断还未执行的部分为part2。在task1执行结束之后,向仲裁中心告知执行 结束。仲裁中心确定task1执行结束后,恢复执行task0的part2。在该part2执行结束之后,向仲裁中心告知task0执行结束。As shown in Figure 3, assuming that a smart device needs to be controlled to execute task0, it can apply to the arbitration center to execute task0, and the arbitration center judges that the smart device is not currently executing any tasks, and judges that task0 is allowed to be executed. During the execution of task0, the arbitration center receives a request for executing task1. The arbitration center judges that task1 is an exclusively executed task, and then compares the priorities of task0 and task1. Determine that the priority of task0 is low and the priority of task1 is high, judge to stop executing task0, and execute task1 first. Therefore, task0 is divided into two parts, including part1 and part2. The part that has been executed before is part1, and the part that has been interrupted and not yet executed is part2. After the execution of task1 ends, the arbitration center is notified of the end of the execution. After the arbitration center determines that the execution of task1 is completed, it resumes the execution of part2 of task0. After the execution of part2 ends, the arbitration center is notified of the end of task0 execution.
通过本发明实施例提供的中止以及恢复执行的策略,使得任务执行的方式更加灵活。Through the strategy of suspending and resuming execution provided by the embodiment of the present invention, the mode of task execution is more flexible.
可选地,基于目标任务对应的优先级和其他任务对应的优先级,确定用于指示是否允许执行目标任务的第一指示信息的过程还可以实现为:若目标任务对应的优先级低于或者等于其他任务对应的优先级,则确定第一指示信息为拒绝执行目标任务。Optionally, based on the priority corresponding to the target task and the priorities corresponding to other tasks, the process of determining the first indication information for indicating whether to allow the execution of the target task can also be implemented as follows: if the priority corresponding to the target task is lower than or is equal to the priority corresponding to other tasks, then it is determined that the first indication information is a refusal to execute the target task.
比如说,智能设备当前正在执行定点消杀任务。该定点消杀任务为从接收到任务的即刻起如果被允许执行则立即执行的消杀任务,该定点消杀任务的消杀地点为某楼栋中某部门的咖啡机附近的区域。该智能设备还设定了定时消杀任务。该定时消杀任务为当到达规定时间点时如果被允许执行则立即执行的消杀任务,该定时消杀任务为某楼栋中的某一层。For example, smart devices are currently performing targeted disinfecting tasks. The fixed-point disinfecting task is a disinfecting task that will be executed immediately if allowed to execute from the moment the task is received, and the disinfecting location of the fixed-point disinfecting task is the area near the coffee machine of a certain department in a certain building. The smart device has also set a timed disinfecting task. The timing disinfecting task is a disinfecting task that is executed immediately if it is allowed to execute when the specified time point is reached, and the timing disinfecting task is a certain floor in a certain building.
在智能设备执行定点消杀任务的过程中,定时消杀任务的规定时间到达,此时可以比较定点消杀任务和定时消杀任务的优先级。假设定时消杀任务的优先级为BASE_PRIORITY+1,定点消杀任务的优先级为BASE_PRIORITY-1。根据数值越小优先级越高的原则,定点消杀任务的优先级高于定时消杀任务的优先级,因此定时消杀任务不能打断定点消杀任务,需要等定点消杀任务执行结束之后再执行定时消杀任务。这样可以保证每个任务都能有效执行,不会出现前面的任务被后面不重要的任务打断且丢掉前面的任务不执行完的情况。When the smart device executes the fixed-point disinfecting task, the specified time of the fixed-point disinfecting task arrives. At this time, the priority of the fixed-point disinfecting task and the fixed-point disinfecting task can be compared. Assume that the priority of the scheduled disinfecting task is BASE_PRIORITY+1, and the priority of the fixed-point disinfecting task is BASE_PRIORITY-1. According to the principle that the smaller the value, the higher the priority, the priority of the fixed-point disinfecting task is higher than that of the fixed-point killing task, so the fixed-point disinfecting task cannot interrupt the fixed-point killing task, and it needs to wait until the fixed-point disinfecting task is completed. Then execute the scheduled disinfecting task. This can ensure that each task can be effectively executed, and there will be no situation where the previous task is interrupted by the unimportant task behind and the previous task is discarded and the execution is not completed.
采用本发明,当云端服务器需要控制智能设备执行目标任务时,可以向仲裁中心发送目标任务对应的申请执行请求。仲裁中心基于申请控制的智能设备当前的工作状态和申请执行请求,判断是否允许云端服务器控制智能设备执行目标任务。通过仲裁中心对是否允许执行任务的仲裁来调配各云端服务器控制智能设备来执行任务,使得各任务可以得到有效执行,实现对多任务的有效管理,提高了任务执行效率,避免了由于任务之间的冲突导致的某些任务无法执行的问题。With the present invention, when the cloud server needs to control the smart device to execute the target task, it can send an application execution request corresponding to the target task to the arbitration center. The arbitration center judges whether to allow the cloud server to control the smart device to execute the target task based on the current working status of the smart device applying for control and the application execution request. Through the arbitration of the arbitration center on whether to allow the execution of the task, each cloud server is deployed to control the smart device to perform the task, so that each task can be effectively executed, and the effective management of multi-tasks is realized, which improves the efficiency of task execution and avoids the gap between tasks. Some tasks cannot be executed due to conflicts.
以下将详细描述本发明的一个或多个实施例的任务执行装置。本领域技术人员可以理解,这些任务执行装置均可使用市售的硬件组件通过本方案所教导的步骤进行配置来构成。The task performing apparatus of one or more embodiments of the present invention will be described in detail below. Those skilled in the art can understand that these task execution devices can be configured by using commercially available hardware components through the steps taught in this solution.
图4为本发明实施例提供的一种任务执行装置的结构示意图,如图4所示,该装置包括:Fig. 4 is a schematic structural diagram of a task execution device provided by an embodiment of the present invention. As shown in Fig. 4, the device includes:
接收模块41,用于接收云端服务器发送的目标任务对应的申请执行请求,所述目标任务由所述云端服务器控制智能设备执行;The receiving module 41 is configured to receive the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;
获取模块42,用于获取所述智能设备的工作状态;An acquisition module 42, configured to acquire the working status of the smart device;
确定模块43,用于基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息;A determination module 43, configured to determine, based on the application execution request and the working status of the smart device, first indication information for indicating whether execution of the target task is allowed;
发送模块44,用于向所述云端服务器发送所述第一指示信息,以使所述云端服务器基于所述第一指示信息确定是否控制所述智能设备执行所述目标任务。The sending module 44 is configured to send the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
可选地,所述确定模块43,用于:Optionally, the determination module 43 is configured to:
若所述智能设备当前未执行其他任务,则确定所述第一指示信息为允许执行所述目标任务。If the smart device is not currently executing other tasks, determine that the first indication information is permission to execute the target task.
可选地,所述申请执行请求中携带有用于指示是否允许并发执行所述目标任务的第二指示信息;Optionally, the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed;
若所述智能设备当前执行有其他任务,所述确定模块43,用于:If the smart device currently executes other tasks, the determining module 43 is configured to:
若基于所述第二指示信息确定允许并发执行所述目标任务,且所述智能设备当前执行的所述其他任务为允许并发执行的任务,则获取执行所述目标任务需要的所述智能设备的第一硬件资源,以及执行所述其他任务需要的所述智能设备的第二硬件资源;If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;
基于所述第一硬件资源和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
可选地,所述确定模块43,用于:Optionally, the determination module 43 is configured to:
若所述第一硬件资源和所述第二硬件资源不相同,则确定所述第一指示信息为允许执行所述目标任务。If the first hardware resource is different from the second hardware resource, then determine that the first indication information is to allow execution of the target task.
可选地,所述申请执行请求中还携带有所述目标任务对应的优先级;Optionally, the application execution request also carries the priority corresponding to the target task;
所述确定模块43,还用于:The determination module 43 is also used for:
若基于所述第二指示信息确定不允许并发执行所述目标任务,则获取所述智能设备当前执行的所述其他任务对应的优先级;If it is determined based on the second indication information that the target task is not allowed to be executed concurrently, acquiring the priority corresponding to the other tasks currently executed by the smart device;
基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the priority corresponding to the target task and the priorities corresponding to the other tasks, first indication information for indicating whether execution of the target task is allowed is determined.
可选地,所述确定模块43,用于:Optionally, the determination module 43 is configured to:
若所述目标任务对应的优先级高于所述其他任务对应的优先级,则指示中止执行所述其他任务,并确定所述第一指示信息为允许执行所述目标任务;If the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;
当确定所述目标任务执行结束时,指示恢复执行所述其他任务。When it is determined that the execution of the target task ends, it is instructed to resume execution of the other tasks.
可选地,所述确定模块43,用于:Optionally, the determination module 43 is configured to:
若所述目标任务对应的优先级低于或者等于所述其他任务对应的优先级,则确定所述第一指示信息为拒绝执行所述目标任务。If the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
图4所示装置可以执行前述图1至图3所示实施例中提供的任务执行方法,详细的执行过程和技术效果参见前述实施例中的描述,在此不再赘述。The device shown in FIG. 4 can execute the task execution method provided in the embodiments shown in FIGS. 1 to 3 . For detailed execution process and technical effects, refer to the descriptions in the previous embodiments, which will not be repeated here.
在一个可能的设计中,上述图4所示任务执行装置的结构可实现为一电子设备,该电子设备具体可以是上述实施例中的服务器或者终端。如图5所示,该电子设备可以包括:处理器91、存储器92。其中,所述存储器92上存储有可执行代码,当所述可执行代码被所述处理器91执行时,使所述处理器91至少可以实现如前述图1至图3所示实施例中提供的任务执行方法。In a possible design, the structure of the task execution apparatus shown in FIG. 4 above may be implemented as an electronic device, and the electronic device may specifically be the server or terminal in the above embodiment. As shown in FIG. 5 , the electronic device may include: a processor 91 and a memory 92 . Wherein, executable code is stored on the memory 92, when the executable code is executed by the processor 91, the processor 91 can at least implement method of task execution.
可选地,该电子设备中还可以包括通信接口93,用于与其他设备进行通信。Optionally, the electronic device may also include a communication interface 93 for communicating with other devices.
另外,本发明实施例提供了一种非暂时性机器可读存储介质,所述非暂时性机器可读存储介质上存储有可执行代码,当所述可执行代码被电子设备的处理器执行时,使所述处理器至少可以实现如前述图1至图3所示实施例中提供的任务执行方法。In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by the processor of the electronic device , so that the processor can at least implement the task execution method provided in the embodiment shown in FIG. 1 to FIG. 3 .
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助加必需的通用硬件平台的方式来实现,当然也可以通过硬件和软件结合的方式来实现。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以计算机产品的形式体现出来,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of a general hardware platform plus necessary, and of course, can also be realized by a combination of hardware and software. Based on such an understanding, the above-mentioned technical solution can be embodied in the form of computer products in essence or in other words, the part that contributes to the prior art, and the present invention can adopt computer-usable media (including but not limited to disk storage, CD-ROM, optical storage, etc.) embodied in the form of a computer program product.
本发明实施例提供的任务执行方法可以由某种程序/软件来执行,该程序/软件可以由网络侧提供,前述实施例中提及的电子设备可以将该程序/软件下载到本地的非易失性存储介质中,并在其需要执行前述任务执行方法时,通过CPU将该程序/软件读取到内存中,进而由CPU执行该程序/软件以实现前述实施例中所提供的任务执行方法,执行过程可以参见前述图1至图3中的示意。The task execution method provided by the embodiment of the present invention can be executed by a certain program/software, which can be provided by the network side, and the electronic device mentioned in the foregoing embodiments can download the program/software to a local non-volatile In the volatile storage medium, and when it needs to execute the aforementioned task execution method, the program/software is read into the memory by the CPU, and then the program/software is executed by the CPU to realize the task execution method provided in the aforementioned embodiments , the execution process can refer to the schematic diagrams in the aforementioned FIG. 1 to FIG. 3 .
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims (16)
- 一种任务执行方法,其特征在于,包括:A task execution method, characterized in that, comprising:接收云端服务器发送的目标任务对应的申请执行请求,所述目标任务由所述云端服务器控制智能设备执行;receiving the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;获取所述智能设备的工作状态;Obtain the working status of the smart device;基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息;determining first indication information for indicating whether execution of the target task is allowed based on the application execution request and the working status of the smart device;向所述云端服务器发送所述第一指示信息,以使所述云端服务器基于所述第一指示信息确定是否控制所述智能设备执行所述目标任务。Sending the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
- 根据权利要求1所述的方法,其特征在于,所述基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:The method according to claim 1, wherein, based on the application execution request and the working status of the smart device, determining the first indication information for indicating whether to allow execution of the target task includes:若所述智能设备当前未执行其他任务,则确定所述第一指示信息为允许执行所述目标任务。If the smart device is not currently executing other tasks, determine that the first indication information is permission to execute the target task.
- 根据权利要求1所述的方法,其特征在于,所述申请执行请求中携带有用于指示是否允许并发执行所述目标任务的第二指示信息;The method according to claim 1, wherein the application execution request carries second indication information for indicating whether to allow concurrent execution of the target task;若所述智能设备当前执行有其他任务,所述基于所述申请执行请求以及所述智能设备的工作状态,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:If the smart device is currently executing other tasks, the first indication information for indicating whether to allow execution of the target task is determined based on the application execution request and the working status of the smart device, including:若基于所述第二指示信息确定允许并发执行所述目标任务,且所述智能设备当前执行的所述其他任务为允许并发执行的任务,则获取执行所述目标任务需要的所述智能设备的第一硬件资源,以及执行所述其他任务需要的所述智能设备的第二硬件资源;If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;基于所述第一硬件资源和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
- 根据权利要求3所述的方法,其特征在于,所述基于所述第一硬件资源 和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:The method according to claim 3, wherein, based on the first hardware resource and the second hardware resource, determining the first indication information for indicating whether to allow execution of the target task includes:若所述第一硬件资源和所述第二硬件资源不相同,则确定所述第一指示信息为允许执行所述目标任务。If the first hardware resource is different from the second hardware resource, then determine that the first indication information is to allow execution of the target task.
- 根据权利要求3所述的方法,其特征在于,所述申请执行请求中还携带有所述目标任务对应的优先级;The method according to claim 3, wherein the application execution request also carries the priority corresponding to the target task;所述方法还包括:The method also includes:若基于所述第二指示信息确定不允许并发执行所述目标任务,则获取所述智能设备当前执行的所述其他任务对应的优先级;If it is determined based on the second indication information that the target task is not allowed to be executed concurrently, acquiring the priority corresponding to the other tasks currently executed by the smart device;基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the priority corresponding to the target task and the priorities corresponding to the other tasks, first indication information for indicating whether execution of the target task is allowed is determined.
- 根据权利要求5所述的方法,其特征在于,所述基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:The method according to claim 5, characterized in that, based on the priority corresponding to the target task and the priorities corresponding to the other tasks, determining the first indication information for indicating whether to allow execution of the target task ,include:若所述目标任务对应的优先级高于所述其他任务对应的优先级,则指示中止执行所述其他任务,并确定所述第一指示信息为允许执行所述目标任务;If the priority corresponding to the target task is higher than the priority corresponding to the other tasks, instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;当确定所述目标任务执行结束时,指示恢复执行所述其他任务。When it is determined that the execution of the target task ends, it is instructed to resume execution of the other tasks.
- 根据权利要求5所述的方法,其特征在于,所述基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息,包括:The method according to claim 5, characterized in that, based on the priority corresponding to the target task and the priorities corresponding to the other tasks, determining the first indication information for indicating whether to allow execution of the target task ,include:若所述目标任务对应的优先级低于或者等于所述其他任务对应的优先级,则确定所述第一指示信息为拒绝执行所述目标任务。If the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
- 一种任务执行装置,其特征在于,包括:A task execution device, characterized in that it comprises:接收模块,用于接收云端服务器发送的目标任务对应的申请执行请求,所述目标任务由所述云端服务器控制智能设备执行;The receiving module is used to receive the application execution request corresponding to the target task sent by the cloud server, and the target task is executed by the smart device controlled by the cloud server;获取模块,用于获取所述智能设备的工作状态;An acquisition module, configured to acquire the working status of the smart device;确定模块,用于基于所述申请执行请求以及所述智能设备的工作状态,确 定用于指示是否允许执行所述目标任务的第一指示信息;A determination module, configured to determine, based on the application execution request and the working status of the smart device, the first indication information used to indicate whether execution of the target task is allowed;发送模块,用于向所述云端服务器发送所述第一指示信息,以使所述云端服务器基于所述第一指示信息确定是否控制所述智能设备执行所述目标任务。A sending module, configured to send the first indication information to the cloud server, so that the cloud server determines whether to control the smart device to execute the target task based on the first indication information.
- 根据权利要求8所述的装置,其特征在于,所述确定模块,用于:The device according to claim 8, wherein the determining module is configured to:若所述智能设备当前未执行其他任务,则确定所述第一指示信息为允许执行所述目标任务。If the smart device is not currently executing other tasks, determine that the first indication information is permission to execute the target task.
- 根据权利要求8所述的装置,其特征在于,所述申请执行请求中携带有用于指示是否允许并发执行所述目标任务的第二指示信息;The device according to claim 8, wherein the application execution request carries second indication information for indicating whether concurrent execution of the target task is allowed;若所述智能设备当前执行有其他任务,所述确定模块,用于:If the smart device currently executes other tasks, the determination module is configured to:若基于所述第二指示信息确定允许并发执行所述目标任务,且所述智能设备当前执行的所述其他任务为允许并发执行的任务,则获取执行所述目标任务需要的所述智能设备的第一硬件资源,以及执行所述其他任务需要的所述智能设备的第二硬件资源;If it is determined based on the second indication information that the target task is allowed to be executed concurrently, and the other tasks currently executed by the smart device are tasks that are allowed to be executed concurrently, then acquire the information of the smart device required to execute the target task a first hardware resource, and a second hardware resource of the smart device required to perform the other tasks;基于所述第一硬件资源和所述第二硬件资源,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the first hardware resource and the second hardware resource, determine first indication information for indicating whether execution of the target task is allowed.
- 根据权利要求10所述的装置,其特征在于,所述确定模块,用于:The device according to claim 10, wherein the determining module is configured to:若所述第一硬件资源和所述第二硬件资源不相同,则确定所述第一指示信息为允许执行所述目标任务。If the first hardware resource is different from the second hardware resource, then determine that the first indication information is to allow execution of the target task.
- 根据权利要求10所述的装置,其特征在于,所述申请执行请求中还携带有所述目标任务对应的优先级;The device according to claim 10, wherein the application execution request also carries the priority corresponding to the target task;所述确定模块,还用于:The determining module is also used for:若基于所述第二指示信息确定不允许并发执行所述目标任务,则获取所述智能设备当前执行的所述其他任务对应的优先级;If it is determined based on the second indication information that the target task is not allowed to be executed concurrently, acquiring the priority corresponding to the other tasks currently executed by the smart device;基于所述目标任务对应的优先级和所述其他任务对应的优先级,确定用于指示是否允许执行所述目标任务的第一指示信息。Based on the priority corresponding to the target task and the priorities corresponding to the other tasks, first indication information for indicating whether execution of the target task is allowed is determined.
- 根据权利要求12所述的装置,其特征在于,所述确定模块,用于:The device according to claim 12, wherein the determining module is configured to:若所述目标任务对应的优先级高于所述其他任务对应的优先级,则指示中 止执行所述其他任务,并确定所述第一指示信息为允许执行所述目标任务;If the priority corresponding to the target task is higher than the priority corresponding to the other tasks, then instruct to suspend the execution of the other tasks, and determine that the first instruction information is to allow the execution of the target task;当确定所述目标任务执行结束时,指示恢复执行所述其他任务。When it is determined that the execution of the target task ends, it is instructed to resume execution of the other tasks.
- 根据权利要求12所述的装置,其特征在于,所述确定模块,用于:The device according to claim 12, wherein the determining module is configured to:若所述目标任务对应的优先级低于或者等于所述其他任务对应的优先级,则确定所述第一指示信息为拒绝执行所述目标任务。If the priority corresponding to the target task is lower than or equal to the priority corresponding to the other tasks, it is determined that the first indication information is a refusal to execute the target task.
- 一种电子设备,其特征在于,包括:存储器、处理器;其中,所述存储器上存储有可执行代码,当所述可执行代码被所述处理器执行时,使所述处理器执行如权利要求1-7中任一项所述的任务执行方法。An electronic device, characterized by comprising: a memory and a processor; wherein, executable code is stored on the memory, and when the executable code is executed by the processor, the processor executes the The task execution method described in any one of requirements 1-7.
- 一种非暂时性机器可读存储介质,其特征在于,所述非暂时性机器可读存储介质上存储有可执行代码,当所述可执行代码被电子设备的处理器执行时,使所述处理器执行如权利要求1-7中任一项所述的任务执行方法。A non-transitory machine-readable storage medium, wherein executable code is stored on the non-transitory machine-readable storage medium, and when the executable code is executed by a processor of an electronic device, the The processor executes the task execution method according to any one of claims 1-7.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111498952.7A CN114374681B (en) | 2021-12-09 | 2021-12-09 | Task execution method, device, equipment and storage medium |
CN202111498952.7 | 2021-12-09 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023103379A1 true WO2023103379A1 (en) | 2023-06-15 |
Family
ID=81139540
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/105813 WO2023103379A1 (en) | 2021-12-09 | 2022-07-14 | Task execution method and apparatus, and device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114374681B (en) |
WO (1) | WO2023103379A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114374681B (en) * | 2021-12-09 | 2023-08-22 | 达闼机器人股份有限公司 | Task execution method, device, equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170118693A1 (en) * | 2014-07-03 | 2017-04-27 | Sharp Kabushiki Kaisha | Terminal device, base station apparatus, communication system, control method, and integrated circuit |
CN108091331A (en) * | 2017-12-27 | 2018-05-29 | 北京镁客创新工场科技有限公司 | A kind of intelligent domestic system and its control method based on voice control |
CN109960178A (en) * | 2017-12-26 | 2019-07-02 | 深圳市优必选科技有限公司 | Robot and joint motion control method and device thereof |
CN110493091A (en) * | 2019-08-26 | 2019-11-22 | 珠海格力电器股份有限公司 | A kind of control method and device of smart home device |
CN111309372A (en) * | 2020-01-15 | 2020-06-19 | 中国平安财产保险股份有限公司 | Timed task execution method and device, computer equipment and storage medium |
US20200310752A1 (en) * | 2019-03-25 | 2020-10-01 | Samsung Electronics Co., Ltd. | Electronic device and multitasking supporting method thereof |
CN114374681A (en) * | 2021-12-09 | 2022-04-19 | 达闼机器人有限公司 | Task execution method, device, equipment and storage medium |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009265963A (en) * | 2008-04-25 | 2009-11-12 | Nec Electronics Corp | Information processing system and task execution control method |
CN105068865A (en) * | 2015-07-28 | 2015-11-18 | 新华瑞德(北京)网络科技有限公司 | Task scheduling method and apparatus |
CN108897282B (en) * | 2018-05-03 | 2021-10-29 | 顺丰科技有限公司 | Multitask modular robot, scheduling management method and device and storage medium thereof |
CN112388625B (en) * | 2019-08-15 | 2022-05-24 | 纳恩博(北京)科技有限公司 | Task issuing method and device and task executing method and device |
CN112783616B (en) * | 2019-11-11 | 2023-10-13 | 腾讯科技(深圳)有限公司 | Concurrent conflict processing method and device and computer storage medium |
CN111050199B (en) * | 2019-11-19 | 2022-01-28 | 海信视像科技股份有限公司 | Display device and scheduling method of Bluetooth communication resources of display device |
CN111143077A (en) * | 2019-12-31 | 2020-05-12 | 青岛海尔科技有限公司 | Intelligent household appliance instruction conflict processing method and device, storage medium and electronic device |
CN111190353B (en) * | 2019-12-31 | 2022-09-06 | 青岛海尔科技有限公司 | Intelligent household appliance instruction conflict processing method and device, storage medium and electronic device |
CN113655727A (en) * | 2021-08-24 | 2021-11-16 | 海信家电集团股份有限公司 | Control method and device for household electrical appliance |
-
2021
- 2021-12-09 CN CN202111498952.7A patent/CN114374681B/en active Active
-
2022
- 2022-07-14 WO PCT/CN2022/105813 patent/WO2023103379A1/en unknown
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170118693A1 (en) * | 2014-07-03 | 2017-04-27 | Sharp Kabushiki Kaisha | Terminal device, base station apparatus, communication system, control method, and integrated circuit |
CN109960178A (en) * | 2017-12-26 | 2019-07-02 | 深圳市优必选科技有限公司 | Robot and joint motion control method and device thereof |
CN108091331A (en) * | 2017-12-27 | 2018-05-29 | 北京镁客创新工场科技有限公司 | A kind of intelligent domestic system and its control method based on voice control |
US20200310752A1 (en) * | 2019-03-25 | 2020-10-01 | Samsung Electronics Co., Ltd. | Electronic device and multitasking supporting method thereof |
CN110493091A (en) * | 2019-08-26 | 2019-11-22 | 珠海格力电器股份有限公司 | A kind of control method and device of smart home device |
CN111309372A (en) * | 2020-01-15 | 2020-06-19 | 中国平安财产保险股份有限公司 | Timed task execution method and device, computer equipment and storage medium |
CN114374681A (en) * | 2021-12-09 | 2022-04-19 | 达闼机器人有限公司 | Task execution method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114374681B (en) | 2023-08-22 |
CN114374681A (en) | 2022-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11537435B2 (en) | System and method of providing system jobs within a compute environment | |
CN105100184B (en) | Reliable and deterministic live migration of virtual machines | |
TWI559153B (en) | Distributed computing framework | |
US20150212823A1 (en) | Capturing snapshots of offload applications on many-core coprocessors | |
US8424007B1 (en) | Prioritizing tasks from virtual machines | |
JP5479802B2 (en) | Method, apparatus, and program for data processing in a hybrid computing environment | |
US10318273B2 (en) | Updating software components through online stores | |
JP2001147901A (en) | Method and system for scheduling external job inside distributed processing system having local job control system | |
US20100057865A1 (en) | Transferable Debug Session in a Team Environment | |
JP2001175499A (en) | Distributed debugging device and debugging method and recording medium with control program | |
WO2023103379A1 (en) | Task execution method and apparatus, and device and storage medium | |
CN108173840B (en) | Intelligent logistics terminal integration system based on cloud platform | |
US9407669B1 (en) | Communications pacing | |
US20190253522A1 (en) | De-duplicating remote procedure calls | |
CN113986534A (en) | Task scheduling method and device, computer equipment and computer readable storage medium | |
EP3657329A1 (en) | System, devices and method for execution of tasks in an internet-of-things (iot) environment | |
US20170177419A1 (en) | Maintaining state information in a multi-component, event-driven state machine | |
US7739368B2 (en) | Method for interacting with user and terminal thereof | |
WO2016116013A1 (en) | Software upgrade method and system | |
WO2011144132A1 (en) | Software continuous integration method, equipment and system | |
WO2021057880A1 (en) | Program upgrade method and apparatus for internet of things device, and internet of things device | |
CN110913443B (en) | Intelligent multi-sensor cooperative detection method and device, sensor and storage medium | |
US20170111240A1 (en) | Service Elastic Method and Apparatus in Cloud Computing | |
KR102399291B1 (en) | Control in initiating atomic tasks on a server platform | |
Cheng | Automatic resource scaling for medical cyber-physical systems running in private cloud computing architecture |
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: 22902814 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |