CPC G06F 9/4881 (2013.01) | 17 Claims |
1. A task scheduling method, comprising:
obtaining, by an embedded device using AUTomotive Open System ARchitecture (AUTOSAR) and an interface function, registration information of a to-be-deployed algorithm, wherein the algorithm comprises a plurality of tasks, and wherein the registration information comprises configuration information of each task and relational data used to describe a dependency between the plurality of tasks;
generating, by the embedded device via the interface function, a dependency graph of the plurality of tasks based on the relational data, wherein the dependency graph comprises a plurality of nodes; and each node is used to indicate one task;
recording, by the embedded device via the interface function, a mapping relationship between each node in the dependency graph and configuration information of a task indicated by the node to obtain an execution flow graph of the algorithm;
creating, by the embedded device via a first software component, an algorithm instance based on the execution flow graph;
scheduling, by the embedded device via the first software component based on the algorithm instance, a target task that meets a scheduling condition in the plurality of tasks comprised in the algorithm to a second software component;
executing, by the embedded device via the second software component, the target task;
sending, by the embedded device via the second software component, a notification message to the first software component after the second software component executes the target task, wherein the notification message is used to indicate that the target task is executed; and
updating, by the embedded device via the first software component, a status of the target task to a finish state in response to the notification message.
|