Task execution method, apparatus and mobile device for real-time communication network
By using a real-time communication network (TSN network) in the automotive electronic architecture to synchronize the task execution order of each ECU, the problem of large and difficult-to-estimate end-to-end latency is solved, and the integration and efficient execution of the task time chain are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ECARX (HUBEI) TECHCO LTD
- Filing Date
- 2022-03-01
- Publication Date
- 2026-07-10
AI Technical Summary
In automotive electronic architecture, because each ECU independently and periodically performs tasks, the end-to-end delay is large and difficult to estimate and control.
Signals are transmitted through a real-time communication network (TSN network) to determine the task execution order of each control unit, and the control unit is controlled to execute the target task in sequence according to the scheduling information of the target function.
It achieves strict time synchronization of various tasks, shortens the worst-case end-to-end latency, and improves the predictability and efficiency of task execution.
Smart Images

Figure CN116729285B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive control, and more specifically, to a task execution method, apparatus, and mobile device for real-time communication networks. Background Technology
[0002] In the current automotive electronic architecture, each ECU executes tasks independently and periodically without synchronization with each other. Therefore, the end-to-end latency in the vehicle's electronic and electrical architecture is large and difficult to estimate and control.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] The present invention provides a task execution method, apparatus and mobile device for real-time communication networks, to at least solve the technical problem of large end-to-end delay and difficulty in estimation and control in the vehicle electronic and electrical architecture caused by the independent and periodic execution of tasks by each ECU without synchronization between them.
[0005] According to one aspect of the present invention, a task execution method for a real-time communication network is provided, comprising: determining a target task that each control unit among a plurality of control units in a target device needs to execute when the target device performs a target function; wherein the control units transmit signals and execute their respective target tasks through a real-time communication network, and the combination of target tasks is used to complete the target function; determining the task execution order of each control unit when executing the target task according to scheduling information corresponding to the target function, wherein the scheduling information includes the triggering conditions of the target task corresponding to the target function; and controlling each control unit to execute the target task sequentially according to the task execution order to achieve the target function.
[0006] Optionally, determining the task execution order of each control unit when executing the target task based on the scheduling information corresponding to the target function includes: determining the scheduling information corresponding to the target function from the scheduling table, wherein each control unit is configured with global scheduling information corresponding to the target function; the scheduling table includes the target task executed by each control unit and the triggering conditions for each control unit to execute the target task, wherein the triggering conditions include at least one of the following: the start time of the target task and the preceding task of the target task; determining the triggering conditions for each control unit to execute the target task based on the scheduling information corresponding to the target function; and determining the task execution order of each control unit when executing the target task based on the triggering conditions for each control unit to execute the target task.
[0007] Optionally, the control unit that implements the target function includes a first control unit and a second control unit. The global scheduling information includes at least a first target task and a second target task to be executed sequentially. The first target task and the second target task are executed by the first control unit and the second control unit, respectively. Controlling each control unit to execute the target task sequentially according to the task execution order includes: after the first target task is executed, the first control unit obtains the execution result of the first target task, wherein the first target task is the target task executed by each control unit according to the task execution order except for the last target task executed; based on the execution result, it generates and sends instruction information to the second control unit that executes the second target task, wherein the instruction information carries the execution result of the first target task. The second target task is the task executed after the first target task in the task execution order. The instruction information carries the execution result of the first target task to determine the task target. The instruction information is used to execute the second task based on the task target. The task target includes the action performed by the device controlled by the control unit that executes the second task.
[0008] Optionally, a first buffer period is set between the time the instruction information is sent and the time the first target task ends, and a second buffer period is set between the time the instruction information is sent and the time the second target task begins.
[0009] Optionally, controlling each control unit to execute the target task sequentially according to the task execution order includes: according to the task execution order, when it is determined that the target task needs to be executed, controlling the target control unit for executing the target task to establish a first thread and running the target function for executing the target task through the first thread; and controlling the target control unit for executing the target task to wake up a second thread and run the target function through the second thread.
[0010] Optionally, determining the target tasks that each control unit in the target device needs to perform when the target device achieves the target function includes: determining the target actions that each device in the target device needs to perform when the target device achieves the target function, wherein each device corresponds one-to-one with each control unit, and the control unit is used to control the device to perform the target action; and determining the target tasks performed by each control unit based on the target actions performed by the devices corresponding to each control unit in the multiple control units, wherein the target tasks include the target actions performed by the control unit controlling the device, and the execution time of the target actions.
[0011] Optionally, controlling each control unit to execute the target task sequentially according to the task execution order to achieve the target function includes: determining the target task to be executed at the current moment based on the task execution order; determining the target task to be executed at the current moment as a high-priority task, wherein the high-priority task is the task that has priority in acquiring computing resources.
[0012] According to another aspect of the present invention, a task execution method is also provided, comprising: receiving instruction information, wherein the instruction information carries the execution result of a preceding task of a target task, the preceding task being a task that is adjacent to the target task and executed before the target task is executed; and executing the target task according to the instruction information.
[0013] According to another aspect of the present invention, a task execution device for a real-time communication network is also provided, comprising: a processing module, configured to determine the target tasks that each control unit among a plurality of control units in the target device needs to execute when the target device achieves a target function; wherein the control units transmit signals and execute their respective target tasks through a real-time communication network, and the combination of target tasks is used to complete the target function; an arrangement module, configured to determine the task execution order when each control unit executes the target tasks according to scheduling information corresponding to the target function, wherein the scheduling information includes the triggering conditions of the target tasks corresponding to the target function; and a control module, configured to control each control unit to execute the target tasks sequentially according to the task execution order to achieve the target function.
[0014] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, which, when the program is running, controls the device where the non-volatile storage medium is located to execute a task execution method for a real-time communication network.
[0015] According to another aspect of the present invention, a mobile device is also provided, the mobile device including a processor for running a program and executing a task execution method for a real-time communication network during program execution.
[0016] In this embodiment of the invention, the target tasks to be executed by each control unit among multiple control units in the target device are determined when the target device achieves the target function. Each control unit transmits signals and executes its respective target task via a TSN network, and the combination of target tasks is used to complete the target function. Based on the scheduling information corresponding to the target function, the task execution order of each control unit is determined, where the scheduling information includes the triggering conditions of the target task corresponding to the target function. By controlling each control unit to execute the target tasks sequentially according to the task execution order to achieve the target function, the execution order of each task is determined based on the scheduling information corresponding to the target action sequence, achieving the goal of integrating various tasks into a single time chain. This achieves the technical effect that each task is strictly executed only after the upstream task has been completed, thereby solving the problem of large end-to-end delay and difficulty in estimating control technology in the vehicle's electronic and electrical architecture caused by the independent and periodic execution of tasks by each ECU without synchronization. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0018] Figure 1 This is a flowchart illustrating a task execution method according to an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of a task execution flow according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of a mobile device control system according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of a task execution process based on existing technology;
[0022] Figure 5 This is a schematic diagram of a task execution process according to an embodiment of the present invention;
[0023] Figure 6 This is a flowchart illustrating another task execution method according to an embodiment of the present invention;
[0024] Figure 7 This is a schematic diagram of the structure of a task execution device according to an embodiment of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] According to an embodiment of the present invention, a method embodiment for a task execution method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0028] Figure 1 This is a task execution method based on a TSN network according to an embodiment of the present invention. This method is applicable to the control module of a mobile device, such as the central control system of a car. Figure 1 As shown, the method includes the following steps:
[0029] Step S102: Determine the target tasks that each control unit in the target device needs to perform when the target device achieves the target function. The control units transmit signals and execute their respective target tasks through a real-time communication network. The combination of target tasks is used to complete the target function.
[0030] In some embodiments of this application, the target device may be an in-vehicle central computing platform device or system. The target device has at least two control units. When the target device performs a target function, the target task to be performed by each control unit among the multiple control units in the target device includes: determining the target action to be performed by each device in the target device when performing the target function, wherein each device corresponds one-to-one with each control unit, and the control unit is used to control the device to perform the target action; and determining the target task performed by each control unit based on the target action performed by the device corresponding to each control unit among the multiple control units, wherein the target task includes the target action performed by the device controlled by the control unit, and the execution time of the target action.
[0031] Step S104: Determine the task execution order of each control unit when executing the target task based on the scheduling information corresponding to the target function. The scheduling information includes the triggering conditions of the target task corresponding to the target function.
[0032] In some embodiments of this application, determining the task execution order of each control unit when executing the target task based on the scheduling information corresponding to the target function includes: determining the scheduling information corresponding to the target function from the scheduling table, wherein each control unit is configured with global scheduling information corresponding to the target function; the scheduling table includes the target task executed by each control unit and the triggering conditions for each control unit to execute the target task, wherein the triggering conditions include at least one of the following: the start execution time of the target task and the preceding task of the target task; determining the triggering conditions for each control unit to execute the target task based on the scheduling information corresponding to the target function; and determining the task execution order of each control unit when executing the target task based on the triggering conditions for each control unit to execute the target task.
[0033] In some embodiments of this application, the scheduling table information corresponding to each control unit can be obtained by parsing the scheduling table file obtained from each control unit. The scheduling table file can be in any common file format.
[0034] In some embodiments of this application, the target object can also update the task execution order of each control unit when performing tasks. For example, when the target object adds a new target function to the mobile device, it can directly add the tasks that the control units of each component of the mobile device need to perform and the task execution order to achieve the target function to the control module.
[0035] Specifically, in some embodiments of this application, the scheduling information corresponding to the aforementioned target action sequence refers to the actions that each component in the mobile device needs to perform when executing the target action to achieve the preset function. Each component is controlled by a corresponding control unit. For example, if the preset function is "the mobile device can detect road obstacles during movement and decelerate when an obstacle is detected," then the target action that the mobile device needs to perform is to brake when an obstacle appears on the road and not to brake when no obstacle appears on the road. To perform the target action, the image acquisition module in the mobile device periodically acquires images of the road ahead and determines whether an obstacle appears in the road image. The braking module in the mobile device needs to perform the action of braking when the image acquisition module detects an obstacle in front of the road.
[0036] In some embodiments of this application, the scheduling table information also includes the task execution cycle of each control unit and the time required to execute one task. The triggering condition for each control unit includes the execution result of the preceding task. The task executed by the control unit differs depending on the preceding task. Specifically, if the preceding task is to determine whether there is an obstacle on the road, and the result of the preceding task is that there is no obstacle, the control unit controlling the braking device will not control the braking device. If the result of the preceding task is that there is an obstacle, the control unit controlling the braking device will control the braking device to prevent the mobile device from colliding with the obstacle.
[0037] Step S106: Control each control unit to execute the target task sequentially according to the task execution order in order to achieve the target function.
[0038] In some embodiments of this application, the control unit that implements the target function includes a first control unit and a second control unit. The global scheduling information includes at least a first target task and a second target task executed sequentially. The first target task and the second target task are executed by the first control unit and the second control unit, respectively. Controlling each control unit to execute the target task sequentially according to the task execution order includes: after the first target task is executed, the first control unit obtains the execution result of the first target task, wherein the first target task is the target task executed by each control unit according to the task execution order except for the last target task executed; based on the execution result, it generates and sends instruction information to the second control unit that executes the second target task, wherein the instruction information carries the execution result of the first target task. The second target task is the task executed after the first target task in the task execution order. The instruction information carries the execution result of the first target task to determine the task target. The instruction information is used to execute the second task based on the task target. The task target includes the action performed by the device controlled by the control unit that executes the second task.
[0039] In some embodiments of this application, Figure 3 Taking the camera controller and brake controller shown as examples, the following is adopted: Figure 1 After the task execution method shown, the camera controller and the brake controller can communicate via TSN Ethernet, thereby transmitting the task execution result of the camera controller to the brake controller in the form of a message. The brake controller can then execute the corresponding action based on the received message. Figure 3 The TSN Ethernet in the system is used to transmit messages between control units with a defined transmission delay, and to achieve time synchronization between control units, ensuring that each control unit has a precise time base. The scheduling table files of various control units contain global scheduling time information describing when each task (i.e., a C language function in the application) should be triggered. The task scheduler parses the information in the scheduling table files to determine the time when each task should be started. When the time when a task should be started arrives, the task scheduler module starts the corresponding task with two options: starting a new thread to execute the corresponding function, or waking up the thread corresponding to the task.
[0040] In some embodiments of this application, a first buffer period is provided between the time point when the instruction information is sent and the time point when the first target task is completed, and a second buffer period is provided between the time point when the instruction information is sent and the time point when the second target task is started.
[0041] In some embodiments of this application, controlling each control unit to execute a target task sequentially according to the task execution order includes: according to the task execution order, when it is determined that a target task needs to be executed, controlling the target control unit for executing the target task to establish a first thread, and running a target function for executing the target task through the first thread, wherein the target task is any one of the tasks executed by each control unit; and controlling the target control unit for executing the target task to wake up a second thread, and running the target function through the second thread.
[0042] In some embodiments of this application, controlling the various control units to execute the target tasks sequentially according to the task execution order to achieve the target function includes: determining the target task to be executed at the current time according to the task execution order; determining the target task to be executed at the current time as a high-priority task, wherein the high-priority task is a task that prioritizes the acquisition of computing resources.
[0043] Specifically, when not adopting Figure 1 When the task execution method shown is implemented, the mobile device performs the task execution process as follows when it implements the function of "detecting an obstacle on the road and braking". Figure 4 As shown. Consider the camera exposure task in the camera controller, which is responsible for capturing images, processing them, and then sending the corresponding instructions to the braking decision task in the brake controller to proceed with the next action. Let the execution duration of task 1 be d1, the execution duration of task 2 be d2, the message transmission duration be f1 (the message transmission duration refers to the time from the first byte of a message entering a network segment to the last byte leaving the network segment), the execution cycle of the two tasks be di (the execution cycle means, for example, this task is called once every 200ms, and the task execution length means that each execution of this task takes 20ms), and the Ethernet message sending cycle be fi (the message sending cycle means that this message is sent once every 200ms, and the message sending duration means that in a 100Mbps network, a 1500-byte message takes 120us, and in a gigabit network, it takes 12us).
[0044] Since the controllers in the mobile device execute tasks according to a fixed execution cycle, the task execution process of the mobile device is as follows: Figure 4 As shown, in the worst case, an obstacle appears on the road surface after the first execution of the camera controller's exposure control task, so the obstacle will only be captured when the camera controller's exposure control task is executed for the second time.
[0045] After the camera controller completes its exposure control task for the second time, it sends a corresponding message to the brake controller. In the worst case, the message is sent just as the second network message is being sent, so it can only be successfully sent during the third network message transmission. Similarly, in the worst case, the message arrives at the brake controller just as the third execution of the brake decision task has already begun, so the message can only be processed and the braking action triggered during the fourth execution of the brake decision task. Based on the above analysis, the total worst-case delay is: the worst-case delay is di++d1+fi+f1+di+d2.
[0046] And in adopting Figure 1 In the case of the task execution method shown, the task execution process of the mobile device is as follows: Figure 5 As shown. After the camera exposure task is executed, the relevant instructions are sent to the brake controller. Under non-global scheduling technology, the execution order of Task 2 and Task 1 cannot be controlled. Under global scheduling technology, Task 2 only begins execution after the instructions issued by Task 1 reach Controller 2. Under global scheduling technology, the occurrence time of each stage is strictly controlled after the completion of the previous stage. At the same time, to ensure the stability of the timing, a buffer segment is added between each stage, namely buffer1 and buffer2 in the figure. In the worst case, an obstacle appears on the road surface after the first execution of the camera controller's exposure control task. Therefore, the obstacle will only be captured when the camera controller's exposure control task is executed for the second time. After the second execution of the controller's exposure task, according to the design of global scheduling technology, the timing of sending the instructions generated in this execution will not miss the timing of the second message transmission. Therefore, the instruction will be sent through the second transmission, ensuring that it reaches the brake controller before the second execution of the brake decision task. This ensures that the instruction can be processed in the second execution of the brake decision task. In this scenario, the worst-case response time is the time from the start of the first execution of the exposure task to the end of the second execution of the braking decision task. That is, the worst-case delay is di + d1 + f1 + d2 + buffer1 + buffer2.
[0047] It should be noted that di, d1, d2, fi, and f1 are in the range of several milliseconds to tens of milliseconds, while buffer1 / 2 is in the range of tens or hundreds of microseconds. Therefore, it can be seen that the global scheduling technology greatly reduces the worst-case end-to-end latency range.
[0048] In some embodiments of this application, Figure 1 The task execution method shown can be executed by the CPU integrated in a mobile device. Specifically, the CPU executes... Figure 1When executing tasks as shown, tasks that do not need to be started can be temporarily suspended to reduce resource consumption.
[0049] In some embodiments of this application, in order to ensure the accuracy of the triggering time of each task, the CPU mentioned above will also integrate a high-precision timer to trigger the execution of each task.
[0050] By determining the tasks performed by each control unit among multiple control units in the target device when it executes actions in the target action sequence, and by determining the task execution order of each control unit based on the scheduling information corresponding to the target action sequence (where the scheduling information is used to schedule each control unit), and by controlling each control unit to execute tasks sequentially according to the task execution order, the goal of integrating various tasks into a single time chain is achieved. This ensures that each task is executed only after the upstream task has been completed, thereby solving the problem of large end-to-end delays and difficulty in estimating control technology in the vehicle's electronic and electrical architecture caused by the independent and periodic execution of tasks by each ECU without synchronization.
[0051] In some embodiments of this application, the following are employed: Figure 1 Following the task execution method shown, the mobile device requires three control units (i.e., ...) to implement a task. Figure 2 When the ECU (Electronic Control Unit) works together to complete the action, the shortest time required ( Figure 2 "Best case response time" and "longest time" Figure 2 "Worst case time" in the context of Figure 2 As shown.
[0052] According to embodiments of the present invention, another method embodiment for task execution is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be executed in a different order than that shown here.
[0053] Figure 6 This is a task execution method according to an embodiment of the present invention, such as... Figure 6 As shown, the method includes the following steps:
[0054] Step S602: Receive instruction information, wherein the instruction information carries the execution result of the preceding task of the target task, and the preceding task is the task that is adjacent to the target task and executed before the target task is executed;
[0055] Step S604: Execute the target task according to the instructions.
[0056] Figure 7 This is a task execution device based on a TSN network according to an embodiment of the present invention, such as... Figure 7 As shown, the task execution device includes: a processing module 70, used to determine the target tasks that each control unit among multiple control units in the target device needs to execute when the target device achieves the target function; wherein, each control unit transmits signals and executes its respective target task through a TSN network, and the combination of target tasks is used to complete the target function; an arrangement module 72, used to determine the task execution order when each control unit executes the target task according to the scheduling information corresponding to the target function, wherein the scheduling information includes the triggering conditions of the target task corresponding to the target function; and a control module 74, used to control each control unit to execute the target task sequentially according to the task execution order to achieve the target function.
[0057] It should be noted that, Figure 7 The task execution device shown can be used to perform Figure 1 The task execution method shown, therefore, for Figure 1 The explanations and descriptions of the task execution methods shown also apply to Figure 7 The task execution device shown will not be described in detail here.
[0058] According to an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored program. When the program runs, the device where the non-volatile storage medium is located executes the following task execution method based on a TSN network: determining the target tasks that each control unit among multiple control units in the target device needs to execute when the target device achieves a target function; wherein, each control unit transmits signals and executes its respective target task through the TSN network, and the combination of target tasks is used to complete the target function; determining the task execution order when each control unit executes the target task according to the scheduling information corresponding to the target function, wherein the scheduling information includes the triggering conditions of the target task corresponding to the target function; controlling each control unit to execute the target task sequentially according to the task execution order to achieve the target function.
[0059] According to an embodiment of the present invention, a mobile device is provided, comprising a processor for running a program. During program execution, the processor performs the following task execution method based on a TSN network: determining the target tasks that each control unit among multiple control units in the target device needs to execute when the target device achieves a target function; wherein each control unit transmits signals and executes its respective target task via the TSN network, and the combination of target tasks is used to complete the target function; determining the task execution order of each control unit when executing the target task according to scheduling information corresponding to the target function, wherein the scheduling information includes the triggering conditions of the target task corresponding to the target function; and controlling each control unit to execute the target task sequentially according to the task execution order to achieve the target function.
[0060] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0061] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0062] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0063] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0064] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0065] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0066] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A task execution method based on a TSN network, characterized in that, include: When a target device is determined to perform a target function, the target tasks that each of the multiple control units in the target device needs to perform are determined. The control units transmit signals and perform their respective target tasks through a TSN network. The combination of the target tasks is used to complete the target function. Based on the scheduling information corresponding to the target function, the task execution order of each control unit when executing the target task is determined. Each control unit is configured with global scheduling information corresponding to the target function. The global scheduling information includes at least a first target task and a second target task to be executed sequentially, and the task execution time of the first target task. The first target task and the second target task are executed by the first control unit and the second control unit, respectively. After the first target task is executed, the first control unit obtains the execution result of the first target task, generates and sends indication information to the second control unit executing the second target task based on the execution result. The indication information carries the execution result of the first target task. The second control unit determines the second target task based on the execution result. The second target task is the task executed after the first target task in the task execution order. A first buffer period is set between the end time of the first target task execution and the sending time of the indication information, and a second buffer period is set between the end time of receiving the indication information and the start time of the second target task execution. The scheduling information includes the triggering conditions of the target task corresponding to the target function. The control units are controlled to execute the target tasks sequentially according to the task execution order in order to achieve the target function.
2. The task execution method according to claim 1, characterized in that, Determining the task execution order of each control unit when executing the target task based on the scheduling information corresponding to the target function includes: The scheduling information corresponding to the target function is determined from the scheduling table, wherein each control unit is configured with global scheduling information corresponding to the target function; the scheduling table includes the target task executed by each control unit and the triggering conditions for each control unit to execute the target task, wherein the triggering conditions include at least one of the following: the start time of the target task and the preceding task of the target task; Based on the scheduling information corresponding to the target function, determine the triggering conditions for each control unit to execute the target task; Based on the triggering conditions for each control unit to execute the target task, the task execution order of each control unit when executing the target task is determined.
3. The task execution method according to claim 2, characterized in that, The control unit that achieves the target function includes a first control unit and a second control unit. Controlling each control unit to sequentially execute the target task according to the task execution order includes: After the first target task is executed, the first control unit obtains the execution result of the first target task, wherein the first target task is the target task executed by each control unit according to the task execution order, excluding the last target task executed. Based on the execution result, instruction information is generated and sent to a second control unit that executes the second target task. The instruction information is used to execute the second target task based on the task target, which includes actions performed by a device controlled by the control unit that executes the second target task.
4. The task execution method according to claim 1, characterized in that, According to the task execution order, controlling each control unit to execute the target task sequentially includes: Based on the task execution order, when it is determined that the target task needs to be executed, the target control unit for executing the target task establishes a first thread, and the target function for executing the target task is run through the first thread; and, The target control unit, which controls the execution of the target task, wakes up the second thread and runs the target function through the second thread.
5. The task execution method according to claim 1, characterized in that, When determining that a target device is performing a target function, the target tasks that each control unit among the multiple control units in the target device needs to perform include: When the target device achieves the target function, the target actions that each device in the target device needs to perform are determined, wherein each device corresponds one-to-one with each control unit, and the control unit is used to control the device to perform the target action; Based on the target action executed by the device corresponding to each of the plurality of control units, the target task executed by each control unit is determined, wherein the target task includes the target action executed by the device controlled by the control unit, and the execution time of the target action.
6. The task execution method according to claim 1, characterized in that, Controlling each control unit to execute the target task sequentially according to the task execution order to achieve the target function includes: Based on the task execution order, determine the target task to be executed at the current moment; The target task being executed at the current moment is determined to be a high-priority task, wherein the high-priority task is the task that has priority in acquiring computing resources.
7. A task execution method, characterized in that, include: The system receives instruction information, which carries the execution results of the preceding tasks of the target task. The preceding tasks are tasks that are adjacent to the target task and executed before the target task. The tasks are executed by a control unit. The combination of target tasks is used to complete the target function. Each control unit is configured with global scheduling information corresponding to the target function. The global scheduling information includes at least a first target task and a second target task to be executed sequentially, as well as the task execution time of the first target task. The first target task and the second target task are executed by the first control unit and the second control unit, respectively. After the first target task is executed, the first control unit obtains the execution result of the first target task, generates instruction information based on the execution result, and sends it to the second control unit that executes the second target task. The instruction information carries the execution result of the first target task. The second control unit determines the second target task based on the execution result. The second target task is the task executed after the first target task in the task execution sequence. A first buffer period is set between the end time of the first target task execution and the sending time of the instruction information. A second buffer period is set between the end time of the instruction information reception and the start time of the second target task execution. Execute the target task according to the instructions.
8. A task execution device based on a TSN network, characterized in that, include: A processing module is used to determine the target tasks that each control unit among the multiple control units in the target device needs to perform when the target device achieves the target function; wherein, each control unit transmits signals and executes its respective target task through a TSN network, and the combination of the target tasks is used to complete the target function. The scheduling module is used to determine the task execution order of each control unit when executing the target task based on the scheduling information corresponding to the target function. Each control unit is configured with global scheduling information corresponding to the target function. The global scheduling information includes at least a first target task and a second target task to be executed sequentially, as well as the task execution time of the first target task. The first target task and the second target task are executed by the first control unit and the second control unit, respectively. After the first target task is executed, the first control unit obtains the execution result of the first target task, generates and sends indication information to the second control unit executing the second target task based on the execution result. The indication information carries the execution result of the first target task. The second control unit determines the second target task based on the execution result. The second target task is the task executed after the first target task in the task execution order. A first buffer period is set between the end time of the first target task execution and the sending time of the indication information, and a second buffer period is set between the end time of receiving the indication information and the start time of the second target task execution. The scheduling information includes the triggering conditions of the target task corresponding to the target function. The control module is used to control the various control units to execute the target tasks sequentially according to the task execution order, so as to achieve the target function.
9. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, the device containing the non-volatile storage medium is controlled to execute the task execution method based on any one of claims 1 to 6.
10. A mobile device, characterized in that, The mobile device includes a processor for running a program, wherein the program executes the task execution method based on any one of claims 1 to 6 when it runs.
Citation Information
Patent Citations
Thread identification processing method and apparatus, computer device and storage medium
CN108509260A
Task scheduling method, device and equipment and storage medium
CN110543354A
Accelerator management architecture and method and accelerator interface controller
CN111431892A