An event-driven task scheduling method and device, a vehicle, and a storage medium

By segmenting the periodic time and constructing scheduling windows, and integrating static and event-triggered scheduling, the uncertainty problem of event-driven task execution in autonomous driving systems is solved, achieving deterministic and real-time response task scheduling, and improving the system's safety and analyzability.

CN122240280APending Publication Date: 2026-06-19CHONGQING CHANGAN AUTOMOBILE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING CHANGAN AUTOMOBILE CO LTD
Filing Date
2026-05-22
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing scheduling frameworks struggle to simultaneously balance the determinism of task scheduling with the real-time responsiveness of event-driven operations. In particular, in autonomous driving systems, the uncertainty of the execution timing of event-driven tasks leads to excessive system load or timing race conditions, failing to meet automotive-grade safety requirements.

Method used

By dividing the periodic time segment, static scheduling windows and dynamic scheduling windows are constructed, and static time period scheduling and event-triggered scheduling are integrated to ensure the deterministic execution of periodic tasks. Event-driven tasks are executed within the dynamic scheduling window to generate task trigger sequences in response to external or internal events.

Benefits of technology

It achieves deterministic execution control for event-driven tasks, suppresses task interference, improves timing analyzability and formal verification capabilities, and meets the safety requirements of autonomous driving systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240280A_ABST
    Figure CN122240280A_ABST
Patent Text Reader

Abstract

This invention relates to the field of intelligent driving control technology and discloses a scheduling method, device, vehicle, and storage medium for event-driven tasks. The invention divides a periodic time period into several duration units, matches corresponding duration units to each periodic task, and constructs a static scheduling window for each periodic task. The remaining duration unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window. When the system enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution. Simultaneously, in response to receiving at least one event-driven task, the event-driven tasks are sorted to generate a task trigger sequence. When the system clock enters the dynamic scheduling window, the event-driven task is retrieved and executed. By integrating static time-period scheduling and event-triggered scheduling through window constraints, event-driven tasks are intelligently executed within the dynamic scheduling window, achieving deterministic execution control of event-driven tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent driving control technology, specifically to a scheduling method, device, vehicle, and storage medium for event-driven tasks. Background Technology

[0002] As the complexity of autonomous driving systems increases, the vehicle's electronic and electrical architecture is gradually evolving from a distributed electronic control unit (ECU) to a centralized or domain-centralized architecture. A large number of functional modules such as perception, localization, planning, and control run in parallel in the system. These functional modules have strict requirements on execution timing and must meet deterministic execution characteristics in order to pass the ISO 26262 functional safety certification requirements. However, existing scheduling frameworks mainly use a fixed-cycle driven approach to achieve task scheduling, that is, to generate a task execution table through a static time-triggered architecture to ensure the determinism and verifiability of the execution order. This method is suitable for periodic tasks, but it is difficult to support the large number of event-driven tasks in autonomous driving systems.

[0003] Event-driven tasks are typically triggered by external events, such as changes in perception results triggering trajectory replanning, changes in obstacles triggering dynamic obstacle avoidance path updates, or map updates triggering relocalization. These tasks are triggered randomly and suddenly, making their execution sequence uncertain. If the existing static time-triggered scheduling method is still used, the task cycle will be significantly reduced to cover the worst-case trigger frequency, resulting in excessive system load. On the other hand, using event-triggered scheduling may lead to time jitter and timing races, failing to meet the requirements of deterministic execution. Therefore, the relevant technologies cannot simultaneously take into account the determinism of task scheduling and the real-time responsiveness of event-driven operation, which seriously restricts the realization of autonomous driving systems under automotive-grade safety requirements. Summary of the Invention

[0004] This invention provides a scheduling method, apparatus, vehicle, and storage medium for event-driven tasks, in order to solve the problem that related technologies cannot simultaneously achieve both the determinism of task scheduling and the real-time responsiveness of event-driven operation.

[0005] In a first aspect, the present invention provides a scheduling method for event-driven tasks. The method includes: obtaining a periodic time interval for executing all periodic tasks, and dividing the periodic time interval into several duration units, wherein the periodic time interval is configured to be able to completely execute all periodic tasks; based on the scheduling information of each periodic task, matching corresponding duration units for each periodic task, and constructing a static scheduling window corresponding to each periodic task. The scheduling information includes at least the execution time and task period of each periodic task, and the static scheduling window includes at least a start and end time. The start and end times are represented by the start and end unit positions of the continuous duration units occupied by the task instance of the corresponding periodic task, and the static scheduling window corresponding to the task instance of each periodic task is configured according to... The periodic task cycle is set at equal intervals, and the duration unit occupied by each static scheduling window is continuous in time. The remaining duration unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window, which includes at least a start and end time and available duration. When the system clock enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution. In response to receiving at least one event-driven task, the event-driven tasks are sorted based on the scheduling information of the at least one event-driven task to generate a task trigger sequence. The event-driven tasks are used to represent tasks triggered by external or internal system events. When the system clock enters a dynamic scheduling window, the event-driven task is retrieved from the task trigger sequence and executed.

[0006] The event-driven task scheduling method provided by this invention divides a periodic time period into several duration units. Based on the scheduling information of each periodic task, a corresponding duration unit is matched for each periodic task, and a static scheduling window corresponding to each periodic task is constructed. The remaining duration unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window. When the system enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution. Simultaneously, in response to receiving at least one event-driven task, the event-driven tasks are sorted to generate a task trigger sequence. When the system clock enters the dynamic scheduling window, the event-driven task is retrieved from the task trigger sequence and executed. By using window constraints, static time periodic scheduling and event-triggered scheduling are integrated, enabling event-driven tasks to be executed intelligently within the dynamic scheduling window. This achieves deterministic execution control of event-driven tasks and effectively suppresses task interference caused by sudden changes in event task input, ensuring that the execution of event-driven tasks does not exceed the limits and interfere with periodic tasks, thereby improving the analyzability of timing and formal verification capabilities.

[0007] In one optional implementation, the step of obtaining the periodic time period corresponding to all periodic tasks and dividing the periodic time period into several duration units includes: calculating the least common multiple of the task periods of all periodic tasks and determining the least common multiple as the periodic time period; and dividing the periodic time period into several duration units based on a preset duration.

[0008] This invention calculates the least common multiple of all periodic tasks as the periodic time period, ensuring that each periodic task can complete an integer number of executions within the periodic time period. This solves the problem of misalignment and conflict in the execution of different periodic tasks, improves the determinism and stability of periodic task execution, and is especially suitable for real-time scheduling scenarios where multiple periodic tasks coexist.

[0009] In one optional implementation, the step of matching corresponding duration units for each periodic task based on the scheduling information of each periodic task and constructing a static scheduling window corresponding to each periodic task includes: calculating the number of task instance triggers for each periodic task within the periodic time period according to the task cycle of each periodic task; determining the number of duration units corresponding to a single task instance of each periodic task based on the execution time of each periodic task; and arranging each periodic task within the periodic time period based on the number of task instance triggers and the number of duration units corresponding to a single task instance of each periodic task to construct a static scheduling window corresponding to each periodic task, wherein the duration units occupied by each static scheduling window are continuous in time.

[0010] This invention determines the number of duration units corresponding to a single instance based on the execution time of periodic tasks, decomposes the task execution time into the smallest scheduling unit, ensures that the task execution time and duration units correspond precisely, improves the utilization accuracy of scheduling resources, and by arranging each periodic task as a continuous duration unit, the constructed static scheduling window occupies continuous time resources, avoiding task execution interruption and scheduling chaos caused by window fragmentation, and ensuring that periodic task instances can be executed continuously and completely. It is especially suitable for safety-critical tasks with high requirements for execution continuity, such as trajectory planning.

[0011] In an optional implementation, the scheduling information further includes: the scheduling priority and execution order dependency of each periodic task, and the method further includes: when arranging each periodic task within a periodic time period, the arrangement order of each periodic task is arranged in descending order of the scheduling priority, and the arrangement order conforms to the execution order dependency.

[0012] In an optional implementation, before sorting the event-driven tasks based on the scheduling information of the at least one event-driven task, the method further includes: in response to receiving at least one event-driven task, performing an event preprocessing operation, the event preprocessing operation including at least one of the following: if the interval between the currently received first event-driven task and the last time the first event-driven task was received is less than a preset task triggering interval, discarding the first event-driven task; when at least two identical event-driven tasks are detected to be received at the same time, merging the at least two identical event-driven tasks; and converting the at least one event-driven task into a standard event triggering description.

[0013] In one optional implementation, the scheduling information of the event-driven task includes at least a scheduling priority, a criticality level, and a timestamp. The criticality level is used to characterize the impact level of the event-driven task on vehicle driving safety. The step of sorting the event-driven tasks based on the scheduling information of the at least one event-driven task to generate a task trigger sequence includes: sorting the at least one event-driven task according to a hierarchical comparison rule of scheduling priority, criticality level, and timestamp to generate a task trigger sequence; and sequentially marking each event-driven task in the task trigger sequence with an executable window, so that when the system clock enters the dynamic scheduling window, an executable event-driven task is retrieved from the task trigger sequence based on the executable window mark corresponding to the dynamic scheduling window. The executable window mark is used to indicate the dynamic scheduling window that allows the execution of the event-driven task.

[0014] In one optional implementation, the step of sequentially marking the executable window for each event-driven task in the task triggering sequence includes: obtaining the event trigger time of the current event-driven task itself; filtering out each first dynamic scheduling window that is not currently occupied by an event-driven task; selecting a second dynamic scheduling window from each of the first dynamic scheduling windows whose start time is later than the event trigger time and whose start time is closest to the event trigger time; and marking the executable window of the current event-driven task as the second dynamic scheduling window.

[0015] In an optional implementation, the method further includes: if the first dynamic scheduling window is not selected, or if the second dynamic scheduling window is not selected, marking the current event-driven task as an executable window in the next period.

[0016] In one optional implementation, when the system clock enters the dynamic scheduling window, an event-driven task is retrieved from the task trigger sequence and executed, including: when the system clock enters the current dynamic scheduling window, retrieving the current event-driven task from the task trigger sequence for execution, and comparing the system clock with the end time of the current dynamic scheduling window during execution; if the current event-driven task is completed and the current system clock is less than the end time, retrieving the next event-driven task from the task trigger sequence for execution, and returning to the step of comparing the system clock with the end time of the current dynamic scheduling window during execution.

[0017] In an optional implementation, the method further includes: if the current system clock reaches the end time during the execution of the current event-driven task, interrupting the execution of the current event-driven task to execute the periodic task corresponding to the next static scheduling window; and recording the execution progress of the current event-driven task so that the current event-driven task can continue to be executed when the system clock enters the next dynamic scheduling window.

[0018] In an optional implementation, the scheduling information of the event-driven task further includes a standard execution duration. During the process of retrieving and executing the event-driven task from the task trigger sequence, the method further includes: recording the actual execution duration of the current event-driven task; when the actual execution duration exceeds the standard execution duration of the current event-driven task, marking the current event-driven task and increasing the number of consecutive exceptions for the current event-driven task; when the number of consecutive exceptions exceeds a preset threshold, performing scheduling degradation processing on the current event-driven task, the scheduling degradation processing including at least one of reducing scheduling priority and increasing the task trigger interval duration.

[0019] In an optional implementation, the method further includes: monitoring the execution status of event-driven tasks in the task triggering sequence; if it is detected that the current event-driven task in the task triggering sequence has not been invoked to the dynamic scheduling window for execution within a consecutive preset number of periodic time periods, an exception handling mechanism is triggered, the exception handling mechanism including at least one of the following: suspending the execution of event-driven tasks with scheduling priority lower than a preset level; reducing the available time of each dynamic scheduling window in the next periodic time period; and migrating event-driven tasks whose actual execution time exceeds the corresponding standard execution time to other processors for orchestration and execution.

[0020] Secondly, the present invention provides a scheduling device for event-driven tasks. The device includes: a time period segmentation module, used to acquire the periodic time periods for executing all periodic tasks and segment the periodic time periods to obtain several duration units, wherein the periodic time periods are configured to be able to completely execute all periodic tasks; and a static scheduling window construction module, used to match corresponding duration units for each periodic task based on the scheduling information of each periodic task, and construct a static scheduling window corresponding to each periodic task. The scheduling information includes at least the execution time and task period of each periodic task, and the static scheduling window includes at least a start and end time, wherein the start and end time are represented by the start and end unit positions of the continuous duration units occupied by the task instance of the corresponding periodic task, and the static scheduling window corresponding to the task instance of each periodic task is equally spaced according to the task period of that periodic task. The system is configured such that the duration units occupied by each static scheduling window are continuous in time; a dynamic scheduling window determination module is used to determine the remaining duration units between any two adjacent static scheduling windows as dynamic scheduling windows, wherein the dynamic scheduling window includes at least start and end times and available duration; a periodic task execution module is used to trigger the execution of the periodic task corresponding to any static scheduling window when the system clock enters any static scheduling window; a task trigger sequence generation module is used to, in response to receiving at least one event-driven task, sort the event-driven tasks based on the scheduling information of the at least one event-driven task to generate a task trigger sequence, wherein the event-driven task is used to characterize a task triggered by an external or internal system event; and an event-driven task execution module is used to retrieve and execute the event-driven task from the task trigger sequence when the system clock enters the dynamic scheduling window.

[0021] Thirdly, the present invention provides a vehicle including an autonomous driving domain controller, the autonomous driving domain controller including a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the event-driven task scheduling method of the first aspect or any corresponding embodiment described above.

[0022] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the event-driven task scheduling method of the first aspect or any corresponding embodiment thereof.

[0023] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute a scheduling method for an event-driven task according to the first aspect or any corresponding embodiment thereof.

[0024] The present invention has the following technical effects: The event-driven task scheduling method provided by this invention divides a periodic time period into several duration units. Based on the scheduling information of each periodic task, a corresponding duration unit is matched for each periodic task, and a static scheduling window corresponding to each periodic task is constructed. The remaining duration unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window. When the system enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution. Simultaneously, in response to receiving at least one event-driven task, the event-driven tasks are sorted to generate a task trigger sequence. When the system clock enters the dynamic scheduling window, the event-driven task is retrieved from the task trigger sequence and executed. By using window constraints, static time periodic scheduling and event-triggered scheduling are integrated, enabling event-driven tasks to be executed intelligently within the dynamic scheduling window. This achieves deterministic execution control of event-driven tasks and effectively suppresses task interference caused by sudden changes in event task input, ensuring that the execution of event-driven tasks does not exceed the limits and interfere with periodic tasks, thereby improving the analyzability of timing and formal verification capabilities. Attached Figure Description

[0025] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0026] Figure 1 This is a schematic diagram of the first type of event-driven task scheduling method according to an embodiment of the present invention; Figure 2 This is an example diagram of the sequential execution axis of the scheduling window according to an embodiment of the present invention; Figure 3 This is a second flowchart illustrating the event-driven task scheduling method according to an embodiment of the present invention; Figure 4 This is an example architecture diagram of an event-driven task scheduling system according to an embodiment of the present invention; Figure 5 This is an example diagram of the scheduling process architecture for event-driven tasks according to an embodiment of the present invention; Figure 6 This is a structural example diagram of a vehicle according to an embodiment of the present invention; Figure 7 This is a structural block diagram of an event-driven task scheduling device according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the hardware structure of the autonomous driving domain controller according to an embodiment of the present invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0029] According to an embodiment of the present invention, an embodiment of a scheduling method for event-driven tasks 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.

[0030] This embodiment provides a scheduling method for event-driven tasks, which can be used in autonomous driving domain controllers in vehicles. It is suitable for multi-core processors (Central Processing Units, CPUs) and heterogeneous computing platforms. The system's underlying hardware timer enables task time synchronization, ensuring consistency and deterministic timing of task execution order. Figure 1 This is a flowchart of an event-driven task scheduling method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the periodic time intervals for executing all periodic tasks, and divide the periodic time intervals into several duration units.

[0031] The periodic time period is configured to allow all periodic tasks to be executed completely.

[0032] In this embodiment of the invention, all tasks declare their priority, execution time limit, resource requirements, and criticality level, such as the Automotive Safety Integrity Level (ASIL), during registration and store them in the configuration file or scheduling description table of the scheduling manager. During system initialization, the scheduling manager can read the task list from the configuration file or scheduling description table and divide the tasks into periodic tasks and event-driven tasks through the task classification module. Periodic tasks are triggered periodically by the framework timer and have a fixed period and deadline, such as sensor sampling and state fusion. Event-driven tasks are triggered by external events or internal signals, have no fixed period but have real-time response requirements, such as changes in perception results, obstacle detection, and map updates.

[0033] This invention provides an embodiment for obtaining the periodic time intervals for executing all periodic tasks. The method for obtaining these intervals is not limited. The longest-running task among all periodic tasks can be directly taken as the periodic time interval, ensuring that by the time the longest task finishes, the remaining shorter-running tasks have already been executed multiple times, thus covering all tasks. Alternatively, a fixed periodic time interval can be set directly in conjunction with natural time, such as using 1 second as the periodic time interval. A basic minimum scheduling beat (e.g., 5ms) can also be set, and all task cycles can be aligned to integer multiples of the basic beat. In this case, the periodic time interval is the product of the least common multiple of all task cycles and the basic minimum scheduling beat. This is just an example. To achieve fine-grained scheduling, each periodic time interval can be evenly divided into several duration units. For example, the smallest time unit, 1ms, can be directly determined as the time interval, and each 20ms periodic time interval can be evenly divided into several duration units of 1ms length, resulting in duration unit 0, duration unit 1, duration unit 2... duration unit 19. The execution duration of each duration unit is 1ms, and each duration unit serves as the smallest unit for allocating scheduling resources. This is just an example.

[0034] Step S102: Based on the scheduling information of each periodic task, match the corresponding duration unit for each periodic task and construct the static scheduling window corresponding to each periodic task.

[0035] The scheduling information includes at least the execution time and task cycle of each period task. The static scheduling window includes at least the start and end times. The start and end times are represented by the start and end unit positions of the continuous duration units occupied by the task instance of the corresponding period task. The static scheduling window corresponding to the task instance of each period task is set at equal intervals according to the task cycle of that period task, and the duration units occupied by each static scheduling window are continuous in time.

[0036] This invention is based on the logic of first compactly scheduling periodic tasks, collecting all remaining time units, and forming several dynamic scheduling windows. It can obtain scheduling information for each periodic task, including but not limited to the execution time and task period of each task. For example, periodic task A has an execution time of 1ms and an execution period of 2ms, while periodic task B has an execution time of 1ms and an execution period of 4ms. Following the principle of prioritizing high-priority tasks and avoiding time conflicts, corresponding time units are matched to each periodic task. For instance, task A has the highest priority, and task B has a lower priority. Since task A has an execution period of 1ms, it can be pre-assigned to time unit 0, occupying only one time unit. Time unit 0 then becomes the static scheduling window corresponding to task A. The start and end times of this static scheduling window are determined by the start and end times of time unit 0. The process is as follows: Since task B has an execution cycle of 4ms, it is not assigned initially. After one execution cycle of A (2ms) has passed, task A is reassigned to duration unit 2. Duration unit 2 is the static scheduling window corresponding to task A. Based on the execution cycle and duration of task B, task B is assigned to duration unit 3, occupying only one duration unit. Duration unit 3 is the static scheduling window corresponding to task B. Then, task A is reassigned to duration unit 4, which is the static scheduling window corresponding to task A. Then, task A is assigned to duration unit 6, and task B is assigned to duration unit 7, and so on, to construct the static scheduling window corresponding to each periodic task. The static scheduling window includes at least the start and end times. The start and end times and duration of the static scheduling window are fixed and cannot be changed during runtime, ensuring that the execution time of the periodic task is completely determined.

[0037] Step S103: Determine the remaining time unit between any two adjacent static scheduling windows as a dynamic scheduling window.

[0038] The dynamic scheduling window in this embodiment of the invention is composed of the remaining time unit between any two adjacent static scheduling windows, resulting in the following: Figure 2 The execution order axis of the scheduling windows shown is for illustrative purposes only. The order of each static and dynamic scheduling window and its position on the time axis can be determined based on scheduling information such as the actual execution cycle and execution duration. Figure 2 In this context, static A, static B, and static C refer to static scheduling windows A, B, and C, respectively. These windows are constructed using scheduling information such as the execution cycle and duration of each periodic task, and are used to execute the corresponding periodic tasks. Within the entire periodic timeframe, time is divided into several continuous regions, such as... ,in, Indicates a periodic time period; This represents the nth static scheduling window, where n represents the number of static scheduling windows. Let j represent the j-th dynamic scheduling window, where j represents the number of dynamic scheduling windows. Then, based on the remaining time units between each adjacent static scheduling window, the parameters of the dynamic scheduling window can be determined, including but not limited to the start and end times, available time, and trigger strategy identifier. The start and end times are determined by the end time of the previous static scheduling window and the start time of the next static scheduling window. The available time is the time difference between the two static scheduling windows. The trigger strategy identifier is used to indicate that the current dynamic scheduling window is the window for executing event-driven tasks, so that the response range of event-driven tasks is limited and predictable, and the time boundary stability of the overall scheduling cycle is guaranteed.

[0039] This invention achieves global predictability of task scheduling by combining static and dynamic scheduling windows on the timeline.

[0040] Step S104: When the system clock enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution.

[0041] The fusion scheduling execution engine of this invention executes the following process cyclically according to the current system clock value during system operation. When the current system clock enters any static scheduling window, it strictly triggers the execution of the periodic task corresponding to that static scheduling window to ensure the timely execution of the periodic task.

[0042] Step S105: In response to receiving at least one event-driven task, sort the event-driven tasks based on the scheduling information of at least one event-driven task to generate a task trigger sequence.

[0043] Event-driven tasks are used to characterize tasks triggered by external or internal system events.

[0044] In this embodiment of the invention, when the peripheral input interface module receives at least one event-driven task (such as sensor frame completion, Controller Area Network (CAN) message arrival, target detection completion, etc.), it can sort the event-driven tasks based on the scheduling information of at least one event-driven task to generate a task trigger sequence. If there is only one event-driven task, the event-driven task is directly output. If multiple event-driven tasks arrive at the same time, the scheduling information of each event-driven task (including execution duration, timestamp, and priority, etc.) can be obtained. Based on the scheduling information, at least one event-driven task can be sorted according to the priority principle to generate a task trigger sequence.

[0045] Step S106: When the system clock enters the dynamic scheduling window, retrieve the event-driven task from the task trigger sequence and execute it.

[0046] In this embodiment of the invention, when the current system clock enters the dynamic scheduling window, it can determine whether there are any event-driven tasks to be executed in the task triggering sequence. If so, the event-driven tasks can be retrieved and executed sequentially from the task triggering sequence according to the sorting order. At the same time, the execution time of the event-driven tasks is monitored to ensure that it does not exceed the available time of the dynamic scheduling window, so as to avoid affecting the normal execution of periodic tasks. If there are no event-driven tasks to be executed, the system can remain idle or execute low-priority background tasks, such as other tasks that do not perform deterministic execution. When the current system clock enters the static scheduling window, the periodic task corresponding to the static scheduling window is executed immediately. Through the above method, the event-driven tasks can only be executed within the dynamic scheduling window, thereby achieving deterministic event response without disrupting the static scheduling window (i.e., ensuring the real-time execution of periodic tasks).

[0047] The event-driven task scheduling method provided by this invention divides a periodic time period into several duration units. Based on the scheduling information of each periodic task, a corresponding duration unit is matched for each periodic task, and a static scheduling window corresponding to each periodic task is constructed. The remaining duration unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window. When the system enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution. Simultaneously, in response to receiving at least one event-driven task, the event-driven tasks are sorted to generate a task trigger sequence. When the system clock enters the dynamic scheduling window, the event-driven task is retrieved from the task trigger sequence and executed. By using window constraints, static time periodic scheduling and event-triggered scheduling are integrated, enabling event-driven tasks to be executed intelligently within the dynamic scheduling window. This achieves deterministic execution control of event-driven tasks and effectively suppresses task interference caused by sudden changes in event task input, ensuring that the execution of event-driven tasks does not exceed the limits and interfere with periodic tasks, thereby improving the analyzability of timing and formal verification capabilities.

[0048] This embodiment provides a scheduling method for event-driven tasks, which can be used in the driving domain controller of a vehicle. Figure 3 This is a flowchart of an event-driven task scheduling method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Obtain the periodic time intervals for executing all periodic tasks, and divide the periodic time intervals into several duration units.

[0049] The periodic time period is configured to allow all periodic tasks to be executed completely.

[0050] Specifically, step S301 above includes: Step S3011: Calculate the least common multiple of the task cycles of all periodic tasks, and determine the least common multiple as the periodic time period.

[0051] Step S3012: Based on the preset duration, the periodic time period is divided into several duration units.

[0052] This invention can calculate the least common multiple of the task cycles of all periodic tasks and determine the least common multiple as the periodic time period. For example, if the periodic task cycles are different, such as task A having an execution cycle of 2ms and task B having an execution cycle of 4ms, then the least common multiple is 4ms. This ensures that all periodic tasks can complete an integer number of loop executions within the periodic time period, avoiding task execution conflicts. Furthermore, in order to achieve fine-grained scheduling and ensure the accuracy and flexibility of task scheduling, the determined periodic time period is divided into several duration units based on a preset standard duration. This enables precise control of task execution time and facilitates the subsequent construction of static scheduling windows and the allocation of resources for dynamic scheduling windows.

[0053] This invention calculates the least common multiple of all periodic tasks as the periodic time period, ensuring that each periodic task can complete an integer number of executions within the periodic time period. This solves the problem of misalignment and conflict in the execution of different periodic tasks, improves the determinism and stability of periodic task execution, and is especially suitable for real-time scheduling scenarios where multiple periodic tasks coexist.

[0054] Step S302: Based on the scheduling information of each periodic task, match the corresponding duration unit for each periodic task and construct the static scheduling window corresponding to each periodic task.

[0055] The scheduling information includes at least the execution time and task cycle of each periodic task, and the static scheduling window includes at least the start and end times. The start and end times are represented by the start and end positions of the continuous duration units occupied by the task instance of the corresponding periodic task. The static scheduling window corresponding to the task instance of each periodic task is set at equal intervals according to the task cycle of that periodic task, and the duration units occupied by each static scheduling window are continuous in time.

[0056] Specifically, the following steps can be used to match corresponding duration units for each periodic task: Calculate the number of task instance triggers for each periodic task within the periodic time frame based on the task cycle of each periodic task; determine the number of duration units corresponding to a single task instance for each periodic task based on the execution time of each periodic task; arrange each periodic task within the periodic time frame based on the number of task instance triggers and the number of duration units corresponding to a single task instance for each periodic task to construct a static scheduling window corresponding to each periodic task, wherein the duration units occupied by each static scheduling window are continuous in time.

[0057] In this embodiment of the invention, after determining the periodic time period, the number of task instance triggers for each periodic task within the periodic time period can be calculated based on the task cycle of each periodic task. The calculation rule for the number of task instance triggers can be the duration of the periodic time period divided by the task cycle of that periodic task. Since the periodic time period is the least common multiple of the task cycles of all periodic tasks, it ensures that each periodic task completes an integer number of instance triggers within the periodic time period. For example, if the periodic time period is 4ms, the number of instance triggers for task A is 2, and the number of instance triggers for task B is 1. Then, based on the execution time of each periodic task, the number of duration units corresponding to a single task instance of each periodic task is determined. For example, if the execution time of task A is 1ms, the number of duration units corresponding to a single task instance is... Each task instance requires one consecutive time unit. Task B's execution time is 2ms, and its individual task instance requires two consecutive time units. This ensures that the execution time of a single task instance precisely matches the time unit, avoiding task execution timeouts or resource waste caused by time fragmentation. Subsequently, based on the number of triggers of task instances in each period and the number of time units corresponding to a single task instance, each periodic task can be arranged within the periodic time period to construct a static scheduling window corresponding to each periodic task. Each static scheduling window occupies consecutive time units, does not overlap, and is distributed in an orderly manner within the periodic time period, satisfying both the time requirements for task execution and ensuring the determinism of periodic task instance triggering.

[0058] This invention determines the number of duration units corresponding to a single instance based on the execution time of periodic tasks, decomposes the task execution time into the smallest scheduling unit, ensures that the task execution time and duration units correspond precisely, improves the utilization accuracy of scheduling resources, and by arranging each periodic task as a continuous duration unit, the constructed static scheduling window occupies continuous time resources, avoiding task execution interruption and scheduling chaos caused by window fragmentation, and ensuring that periodic task instances can be executed continuously and completely. It is especially suitable for safety-critical tasks with high requirements for execution continuity, such as trajectory planning.

[0059] Furthermore, the scheduling information also includes the scheduling priority and execution order dependency of each periodic task. When arranging each periodic task within the periodic time period, the arrangement order of each periodic task is arranged in descending order of scheduling priority, and the arrangement order conforms to the execution order dependency.

[0060] The embodiments of the present invention can follow the principle of scheduling priority from high to low and the arrangement order conforming to the execution order dependency relationship, arrange each periodic task within the periodic time period, ensure that the higher priority is executed first, and dependent tasks must be executed after the dependent task is completed. Each task instance corresponds to a static scheduling window, and the window occupies a continuous time unit and does not overlap with each other.

[0061] This invention reduces the risk of delays and interference in the execution of core tasks by arranging periodic tasks from high to low scheduling priority. It is suitable for scenarios with high requirements for scheduling security, such as autonomous driving. In addition, the arrangement process strictly follows the execution order dependency relationship, ensuring that dependent tasks are only executed after the dependent tasks are completed, eliminating data loss and logical errors caused by the reversal of task execution order, and ensuring the continuity and rationality of periodic task execution.

[0062] Step S303: The remaining time unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window. The dynamic scheduling window includes at least the start and end times and the available time. For details, please refer to [link to relevant documentation]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.

[0063] Step S304: When the system clock enters any static scheduling window, trigger the execution of the periodic task corresponding to that static scheduling window. For details, please refer to [link to relevant documentation]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.

[0064] Step S305: In response to receiving at least one event-driven task, the event-driven tasks are sorted based on the scheduling information of the at least one event-driven task to generate a task triggering sequence. Here, the event-driven task is used to characterize a task triggered by an external or internal system event.

[0065] Before sorting the event-driven tasks, an event preprocessing operation can be performed on at least one received event-driven task. The event preprocessing operation includes at least one of the following: in response to receiving at least one event-driven task, the event preprocessing operation includes at least one of the following: if the interval between the currently received first event-driven task and the last time the first event-driven task was received is less than a preset task triggering interval, the first event-driven task is discarded; when at least two identical event-driven tasks are detected to be received at the same time, the at least two identical event-driven tasks are merged; at least one event-driven task is converted into a standard event triggering description.

[0066] When the peripheral input interface module of this embodiment receives an event-driven task (such as sensor frame completion, CAN message arrival, target detection completion, etc.), the event shaper can perform event preprocessing operations on the event-driven task. The current limiting and merging mechanism of the event shaper ensures that the input trigger frequency is bounded, guaranteeing that the event trigger frequency is less than the preset trigger frequency, that is, the interval duration is greater than the preset task trigger interval duration.

[0067] in, Based on this formula, the input jitter is limited to a preset task trigger interval duration after shaping. That is, the frequency of receiving the first event-driven task is greater than When the interval between the first received event-driven task and the last received event-driven task is less than the preset task trigger interval, the first event-driven task can be discarded. Alternatively, when at least two identical event-driven tasks are detected at the same time, they can be merged, retaining only one event-driven task instance. The execution duration, priority, and criticality level of the merged task remain consistent with the single task, avoiding resource waste and scheduling delays caused by repeated execution. Event-driven tasks can also be uniformly converted into standard event trigger descriptions, including event ID, timestamp, and task mapping ID, ensuring that the scheduler can uniformly identify, parse, and schedule them.

[0068] This invention discards event-driven tasks with excessively short trigger intervals, effectively filtering high-frequency, repetitive, and invalid triggering event tasks, thus avoiding excessive resource consumption caused by a large influx of events. It also merges multiple identical event-driven tasks received at the same time, reducing the number of redundant tasks and lowering task scheduling and execution costs. Furthermore, it standardizes the expression of various event-driven tasks by converting them into standard event trigger descriptions, facilitating subsequent unified sorting, scheduling, and execution, and improving the versatility and standardization of task processing.

[0069] Specifically, the scheduling information for event-driven tasks includes at least scheduling priority, criticality level, and timestamp. The criticality level is used to characterize the impact level of the event-driven task on vehicle driving safety. Step S305 includes: Step S3051: Sort at least one event-driven task according to the hierarchical comparison rules of scheduling priority, criticality level and timestamp, and generate a task trigger sequence.

[0070] Step S3052: Each event-driven task in the task triggering sequence is marked with an executable window so that when the system clock enters the dynamic scheduling window, an executable event-driven task is retrieved from the task triggering sequence based on the executable window mark corresponding to the dynamic scheduling window. The executable window mark indicates the dynamic scheduling window that allows the execution of the event-driven task.

[0071] In response to the simultaneous arrival of multiple event-driven tasks, this embodiment of the invention can acquire the scheduling information of each event-driven task, including but not limited to scheduling priority, criticality level, and event stamp. Following a hierarchical comparison rule of scheduling priority → criticality level → timestamp, at least one event-driven task is sorted to generate a deterministic task triggering sequence. This ensures that high-priority and high-criticality tasks are processed first, while also guaranteeing temporal fairness for tasks of the same level through timestamps. Then, each event-driven task in the task triggering sequence can be marked with an executable window to indicate the dynamic scheduling window that allows execution of the event-driven task, forming a marked task triggering sequence. The method for handling each event-driven task... The method and reference factors for marking executable windows are not limited and can be set according to the actual design scenario. For example, the priority, real-time requirements and execution duration of each event-driven task can be read. For high-priority task A, it can be allowed to execute in a consecutive number of dynamic scheduling windows to increase the execution opportunity. Therefore, a number of dynamic scheduling windows can be marked for task A. For ordinary event task A, it can only be allowed to execute in an even number of windows to avoid preempting key times. An even number of dynamic scheduling window identifiers can be marked for task B. This is just an example. Subsequently, when the system clock enters the current dynamic scheduling window, the task trigger sequence is traversed and the event-driven task with the current dynamic scheduling window identifier is called for execution.

[0072] This invention employs a sequential rule that compares scheduling priority, criticality level, and timestamp level step by step. This allows for refined and multi-dimensional orderly arrangement of event-driven tasks, avoiding task contention and execution chaos, significantly improving scheduling rationality and real-time performance. Furthermore, based on the sorted task trigger sequence, each task is marked with an executable window, achieving precise binding between task execution timing and dynamic scheduling windows. This effectively controls the task execution sequence, prevents window contention or queue jumping, and directly and quickly filters executable tasks based on the markings when the system clock enters the corresponding scheduling window, improving task scheduling efficiency and system response speed.

[0073] Furthermore, the executable window for each event-driven task in the task triggering sequence can be marked sequentially by the following steps: obtaining the event triggering time of the current event-driven task itself; filtering out each first dynamic scheduling window that is not currently occupied by an event-driven task; selecting a second dynamic scheduling window from each first dynamic scheduling window whose start time is later than the event triggering time and whose start time is closest to the event triggering time; and marking the executable window of the current event-driven task as the second dynamic scheduling window.

[0074] In this embodiment of the invention, the event-driven task to be marked is retrieved sequentially from the task trigger sequence, the event trigger time corresponding to the event-driven task itself is read and recorded, and then all dynamic scheduling windows are traversed. Windows that are occupied by other event-driven tasks or are currently being executed and cannot be allocated are removed to obtain a first set of currently available dynamic scheduling windows. In the first set of dynamic scheduling windows, windows that meet the conditions of having a start time later than the event trigger time and having the smallest time interval between the start time and the event trigger time (i.e., the closest distance) are selected as the second dynamic scheduling windows. The selected second dynamic scheduling windows are then marked as the executable windows of the current event-driven task, i.e., satisfying the following conditions: ,in,

[0075] in, This represents the i-th event-driven task; Indicates an event The dynamically scheduled window to which it is mapped; This represents the j-th dynamic scheduling window; Indicates the start time of the dynamic scheduling window; Indicates the time when the event was triggered.

[0076] Following the steps above, the same operation is performed on the next event-driven task in the task triggering sequence until all tasks in the sequence have completed the executable window marking. When the system clock enters the current dynamic scheduling window, the corresponding event-driven task can be retrieved from the task triggering sequence and executed according to the executable window marking.

[0077] This invention uses the event triggering time of the task itself as the basis for window matching, and selects a dynamic scheduling window that has not yet started and whose start time is no earlier than the event triggering time for allocation. This ensures that the event task is executed within a legal and reasonable time range, conforms to the basic timing constraint of first occurrence and then execution, improves the system timing standardization, and allocates the earliest available compliant window to minimize task waiting delay and significantly improve the real-time execution of event-driven tasks.

[0078] In one alternative implementation, if the first dynamic scheduling window is not selected, or the second dynamic scheduling window is not selected, the current event-driven task can be marked as an executable window in the next cycle time period.

[0079] If, in an embodiment of the present invention, it is determined that all running windows within the current period are occupied or running, and no first dynamic scheduling window is selected, or no dynamic scheduling window with a start time later than the event trigger time is selected from the first dynamic scheduling window set, the delay processing logic can be executed because there are no available free windows in the current period. The current event-driven task is postponed to the next period, and the window marking process is re-executed in the next period.

[0080] When it is determined that there is no available window in the current period, this invention postpones the marking to the next period. This not only continues the timing rules but also avoids breaking the timing order in order to allocate windows, ensuring the rationality of execution. Furthermore, the postponement mechanism reserves buffer space, reducing problems such as task blocking caused by abnormal window allocation, and enhancing the fault tolerance and operational stability of the system.

[0081] Step S306: When the system clock enters the dynamic scheduling window, retrieve the event-driven task from the task trigger sequence and execute it.

[0082] Specifically, when the system clock enters the current dynamic scheduling window, the current event-driven task is retrieved from the task triggering sequence for execution, and during execution, the system clock is compared with the end time of the current dynamic scheduling window. If the current event-driven task is completed and the current system clock is less than the end time, the next event-driven task is retrieved from the task triggering sequence for execution, and the process of comparing the system clock with the end time of the current dynamic scheduling window during execution is returned.

[0083] In this embodiment of the invention, when the system clock enters the current dynamic scheduling window, the currently executable event-driven task can be retrieved from the task trigger sequence and started. During the execution, the system clock can be compared with the end time of the current dynamic scheduling window in real time to monitor the execution duration. If the current system clock is less than the end time of the current dynamic scheduling window when the current event-driven task is completed, the next executable event-driven task can be retrieved from the task trigger sequence and executed. During the task execution, the system clock and the end time can be compared in real time.

[0084] This invention allows multiple event-driven tasks to be executed continuously within a single dynamic scheduling window, avoiding time segment limitations within the window, improving processor event utilization and task throughput, and ensuring timing determinism by comparing the system clock with the window end time in real time during execution, thus constraining task execution to not exceed the current dynamic scheduling window.

[0085] In one optional implementation, if the current system clock reaches its end time during the execution of the current event-driven task, the execution of the current event-driven task is interrupted to execute the periodic task corresponding to the next static scheduling window; the execution progress of the current event-driven task is recorded so that the current event-driven task can continue to be executed when the system clock enters the next dynamic scheduling window.

[0086] In this embodiment of the invention, if the system clock reaches the end time of the current dynamic scheduling window during the execution of the current event-driven task, the execution of the current event-driven task must be interrupted immediately, and the system should switch to the next static scheduling window to execute the periodic task corresponding to that window, ensuring that the periodic task is not delayed. While interrupting the execution of the current event-driven task, the current execution progress of the current event-driven task can be recorded and cached. The system clock continues to advance, and when entering the next dynamic scheduling window, the execution progress of the event-driven task is retrieved, and execution continues from the interrupted position until the task is completed.

[0087] This invention interrupts event-driven tasks when the dynamic scheduling window ends and prioritizes the execution of periodic tasks in the next static scheduling window. This ensures that periodic tasks are not delayed or preempted, meeting the core requirement of deterministic execution of periodic tasks. Furthermore, by recording and caching the execution progress of event-driven tasks, it ensures both the high priority and timing safety of static scheduling and periodic tasks, without discarding low-priority event-driven tasks, thus achieving orderly coexistence of the two types of tasks under a unified scheduling architecture.

[0088] In one optional implementation, the scheduling information of the event-driven task also includes a standard execution duration. During the process of retrieving and executing the event-driven task from the task trigger sequence, the actual execution duration of the current event-driven task can also be recorded. When the actual execution duration is longer than the standard execution duration of the current event-driven task, the current event-driven task is marked and the number of consecutive exceptions for the current event-driven task is increased. When the number of consecutive exceptions is greater than a preset threshold, the current event-driven task is downgraded in scheduling. The downgraded scheduling process includes at least one of reducing the scheduling priority and increasing the task trigger interval.

[0089] During operation, the system can periodically evaluate task execution (including execution time distribution, window utilization, and event frequency). If long-term offsets or resource waste are detected, the scheduler can dynamically adjust window allocation parameters to achieve adaptive optimization.

[0090] In this embodiment of the invention, when the system clock enters the current dynamic scheduling window, an executable event-driven task is retrieved from the task trigger sequence, and task execution is initiated. Simultaneously, a timer is started to record the actual execution duration of the event-driven task in real time. Alternatively, the start and end times of the event-driven task can be recorded, and the actual execution duration is obtained based on the difference between these two time periods. ,in, Indicates the actual execution time; Indicates the end time of the event-driven task; This indicates the start time of the event-driven task. The actual execution time is then compared to the standard execution time. If the actual execution time exceeds the standard execution time, the event-driven task is deemed to be abnormal, marked as "out of bounds execution," and the consecutive abnormality count is incremented by 1. This consecutive abnormality count is then compared to a preset threshold. If the consecutive abnormality count exceeds the preset threshold, the event-driven task can be downgraded. The preset threshold is the maximum tolerable consecutive number of times the same event-driven task is deemed to be out of bounds execution. It can be set hierarchically based on task security level, task priority, etc. For example, for high-priority tasks, a threshold of 2-3 times can be set for rapid downgrading to prevent loss of control; for low-priority tasks, a threshold of 5-8 times can be set. The threshold can also be adjusted in real-time based on system load and window utilization. For example, when the system is under low load and the window utilization is low, the number of times threshold can be appropriately increased; when the system is under high load and the window utilization is high, the number of times threshold can be appropriately decreased. In other cases, the number of times threshold can be kept unchanged. This is just an example. Scheduling degradation can include, but is not limited to, reducing the scheduling priority: ensuring that the scheduling priority of the event-driven task is increased so that tasks with higher priority and more stable execution can obtain system resources first. It can also increase the task trigger interval: extending the trigger cycle of the event-driven task, reducing its frequent triggering and its occupation of system resources, and reducing the probability of subsequent timeout exceptions. If the actual execution time of the current event-driven task does not exceed the standard execution time, the task is judged to be executing normally. The number of consecutive exceptions of the event-driven task can be reset to 0. Subsequently, the original dynamic scheduling logic will still be followed, and the next event-driven task will be called when there is sufficient remaining time in the window. This is just an example.

[0091] This invention achieves synchronization through a hardware timer and a high-precision system clock, ensuring that the timing boundary accuracy reaches the microsecond level, thus meeting the deterministic requirements of automotive-grade systems.

[0092] This invention can quickly identify timed-out event-driven tasks by comparing the actual execution time with the standard execution time, promptly discover potential problems with the task itself or system resources, and degrade timed-out tasks by reducing their priority and increasing the trigger interval, thereby reducing the system resource consumption of the abnormal task and allocating limited resources to stable, higher-priority tasks, thus improving the overall scheduling efficiency and stability of the system.

[0093] In one optional implementation, the execution status of event-driven tasks in the task triggering sequence can also be monitored. If it is detected that the current event-driven task in the task triggering sequence has not been invoked to the dynamic scheduling window for execution within a consecutive preset number of periodic time periods, an exception handling mechanism is triggered. The exception handling mechanism includes at least one of the following: suspending the execution of event-driven tasks with scheduling priority lower than a preset level; reducing the available time of each dynamic scheduling window in the next periodic time period; and migrating event-driven tasks whose actual execution time exceeds the corresponding standard execution time to other processors for orchestration and execution.

[0094] This invention, by fixing the scheduling boundaries of the dynamic execution window, strictly constrains the overall system jitter, achieving a fixed upper limit for the triggering latency of event-driven tasks, interference-free scheduling of periodic tasks, and global verifiability of the entire scheduling table in the time dimension. That is, since all time boundaries, window positions, and trigger response paths are clearly defined, the system scheduling behavior can be verified through formal verification tools, such as response time analysis, timing consistency checks, and static scheduling reachability analysis. This structure overcomes the problem of "unpredictable timing of event-triggered tasks" in autonomous driving systems, realizing a time-deterministic closed loop for hybrid triggering systems. During system operation, the execution status of event-driven tasks within the task trigger sequence is continuously monitored, with a focus on tracking whether each event-driven task is successfully invoked into the dynamic scheduling window for execution, and recording the number of consecutive cycles in which it is not invoked. If it is detected that the current event-driven task in the task trigger sequence has not been invoked into the dynamic scheduling window for execution within a consecutive preset number of cycle time periods, it is determined that the event-driven task has a scheduling anomaly, and an anomaly handling mechanism can be triggered immediately. The anomaly handling mechanism may include at least one of the following: suspending the execution of event-driven tasks with a scheduling priority lower than the preset top priority, releasing scheduling resources, or reducing the available duration of each dynamic scheduling window in the next cycle time period, for example, reducing the dynamic scheduling window duration to 6ms to ensure that the trajectory planning task can still be executed within the static scheduling window, or migrating event-driven tasks whose actual execution time exceeds the standard execution time to other processors for orchestration and execution (if multi-core orchestration is used). This is only an example and is not a limitation.

[0095] In one alternative implementation, the system can be triggered in stages based on the type and severity of the anomaly. For example, for minor anomalies, some low-priority tasks will be suspended to free up more computing resources and ensure the safety of key personnel. For moderate anomalies, the triggering frequency of some tasks will be reduced to decrease event load. For severe anomalies, a system warning will be triggered or a safe shutdown mode will be entered. This is just an example.

[0096] This invention monitors and intervenes in the abnormal state of tasks that are continuously not scheduled, thus preventing important event-driven tasks from being unable to be executed for a long time and ensuring the schedulability of critical event-driven tasks. It adopts lightweight processing methods such as pausing low-priority tasks and reducing the duration of dynamic scheduling windows to quickly alleviate scheduling resource contention and overload, optimize multi-processor load balancing, and improve system throughput.

[0097] This invention provides an event-driven task scheduling system. For the specific architecture of the event-driven task scheduling system, please refer to [link / reference needed]. Figure 4As shown, the system includes an input layer module, a scheduling core module, an output execution module, and a monitoring and management module. The input layer module includes a peripheral input interface module and an event shaper. The scheduling core module includes a trigger arbitrator, a fusion scheduling execution engine, a task classification module, and a static scheduling orchestration module. The monitoring and management module includes a timing monitor and a scheduling manager. The output execution module consists of two types of task execution units: receiving scheduling instructions from the fusion scheduling execution engine and executing periodic tasks in the static scheduling window, or executing event-driven tasks in the dynamic scheduling window. This is just an example. The peripheral input interface module receives event trigger signals from sensors, communication buses, or sensing systems. This module supports multi-source inputs, including CAN bus events, Ethernet frames, and camera / radar data frame completion signals. The peripheral input interface module converts these asynchronous inputs into a unified format of "data trigger events" and reports them to the event shaper. The event shaper performs trigger shaping, debouncing, and current limiting control on events from the peripheral input interface module, based on a set minimum trigger interval. The system uses a sliding window with intervals and time to merge, suppress, or delay triggers of events, ensuring that the frequency of input events is bounded and avoiding the impact of momentary jitter or abnormally high-frequency events on the scheduling system. When multiple data-triggered events arrive simultaneously, the arbitrator is triggered to arbitrate based on task priority, task criticality level (such as ASIL level), and task dependencies, outputting a deterministic task trigger sequence (arbitration sequence) to avoid timing jitter caused by resource contention. The fusion scheduling execution engine is used to schedule periodic tasks according to the static scheduling table and to schedule event-driven tasks determined by the arbitrator within the dynamic execution window. The fusion scheduling execution engine supports interruptible execution mode to ensure that the execution of data-triggered tasks does not exceed the boundaries and interfere with static tasks. The timing monitor is used to detect whether the start time, execution duration, and end time of each task are within the predefined range. When an out-of-bounds or timeout event is detected, the timing monitor can trigger a safety degradation or task reset operation. The scheduling manager is used to manage scheduling parameters (such as reducing the priority of an event-driven task or reducing the dynamic scheduling window) and policy configuration. When the system load exceeds limits or resources are limited, the scheduler manager ensures the continuous operation of automotive-grade safety tasks by adjusting task priorities or shutting down non-critical tasks. The task classification module divides tasks into periodic tasks and event-driven tasks based on their triggering characteristics. Periodic tasks are triggered by fixed time periods, such as sensor sampling and state fusion. Event-driven tasks are triggered by external events, such as changes in perception results, obstacle detection, and map updates. The static scheduling and orchestration module generates a static scheduling table for periodic tasks based on a time-triggered architecture. This module calculates the execution time slot allocation based on the task cycle, priority, and dependencies, and reserves several dynamic execution windows in each main scheduling cycle for use by event-driven tasks. This system runs in the autonomous driving domain controller and is suitable for multi-core CPUs and heterogeneous computing platforms.The system uses a hardware timer at the underlying level to synchronize task time, ensuring the consistency of task execution order and the determinism of timing. For details, please refer to the above embodiment, which will not be repeated here.

[0098] In specific embodiments, such as Figure 5 As shown, the core mechanism of this invention includes the following steps or system modules: 1. Task classification and scheduling base table generation mechanism The system divides tasks into periodic tasks and event-triggered tasks, constructs a base table for periodic task execution through a static scheduler, and reserves multi-level dynamic insertion windows for event-driven tasks.

[0099] 2. Event Shaping Mechanism An event shaper is introduced to shape the trigger frequency and suppress sudden changes in data trigger sources such as external sensor events and changes in sensing results, ensuring that the input of data trigger events is bounded and avoiding the spread of scheduling jitter.

[0100] 3. Triggering the arbitration mechanism Arbitrate multiple data triggers that arrive simultaneously, and determine the trigger order based on task priority, task importance level (such as security level ASIL), and time constraints to avoid timing uncertainty caused by resource contention.

[0101] Deterministic insertion scheduling mechanism Data-triggered tasks can only be started within the dynamic execution window preset in the static schedule table, and a bounded execution time control strategy is adopted to prevent over-boundary occupation and ensure that static tasks are not disturbed.

[0102] Taking the perception fusion and trajectory planning scenario as an example, its task flow is as follows: (1) System initialization stage: After the vehicle is powered on, the scheduling manager reads the scheduling configuration file and completes task registration and classification, such as: periodic tasks: vehicle speed sampling task (10ms cycle, low priority, low integrity level (Automotive Safety Integrity Level, ASIL), execution time is 1ms); vehicle body state fusion task (20ms cycle, higher priority, higher ASIL, execution time is 1ms); control signal sending task (10ms cycle, highest priority, high ASIL, execution time is 1ms), only as an example; event-driven tasks: radar target fusion task (signal triggering completed by radar frame) perception result update task (event triggering completed by neural network inference) trajectory replanning task (triggered by path deviation or obstacle change event). The static scheduling generation module generates the main scheduling table based on these tasks, with the main cycle set to 50ms, which includes: a 40ms static scheduling window; and a 10ms dynamic scheduling window (divided into 3 sub-windows).

[0103] (2) Event Triggering and Arbitration Example: In the third main scheduling cycle, the radar module completes the data frame update, and the peripheral input interface module generates event signals: Event: Radar_Frame_Ready (t = 135.6ms) and perception update signal Event: Perception_Update (t = 135.8ms). The event shaper will first filter invalid and jittery events, generate a standard triggering mode, and the event shaper has a preset event generation frequency, such as 50Hz. If the radar module frequently sends abnormal events due to faults (frequency exceeding the preset value of 50Hz), the event shaper will trigger rate limiting, and some events will be merged or discarded to avoid repeated execution leading to resource waste and scheduling delay.

[0104] The arbitrator determines the execution order based on the task level (radar fusion is ASIL C, with lower priority; perception update is ASIL B, with higher priority): ,

[0105] It is then mapped to the nearest dynamic execution window. (Start time 136.0ms), at this time it is necessary to ensure that the start time of the dynamic execution window is later than the timestamp t of each event-driven task.

[0106] Fusion scheduling execution engine in The two tasks mentioned above are executed sequentially within the 50ms main cycle, ensuring that: all tasks are completed within the 50ms main cycle; the execution timing conforms to the deterministic window allocation; when the clock reaches the static scheduling window, the execution of the dynamic scheduling window is directly interrupted, and the periodic tasks within the static scheduling window are executed immediately.

[0107] (3) Timing Guarantee and Boundary Verification During the execution of the dynamic scheduling window, the timing monitor records the following data: Table 1. Table 1 shows the execution status of each event-driven task recorded by the timing monitor.

[0108] The results show that all tasks are completed within the dynamic window range without any out-of-bounds issues, and the system timing is stable.

[0109] (4) Security downgrade example If a dynamic window overflow is detected within two consecutive cycles, the scheduler triggers a second-level degradation: suspending non-critical perception update tasks; reducing the dynamic window duration to 6ms; ensuring that trajectory planning tasks can still be executed within a fixed window; migrating timed-out tasks (if multi-core orchestration is used). The system automatically issues a function degradation alarm and maintains vehicle operation safety. This is just an example; for detailed explanations, please refer to the above embodiments, which will not be repeated here.

[0110] This embodiment also provides a vehicle, such as Figure 6 As shown, the vehicle includes an autonomous driving domain controller 61, which includes a memory and a processor. The memory and the processor are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform the event-driven task scheduling method described above.

[0111] This embodiment also provides an event-driven task scheduling device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0112] This embodiment provides a scheduling device for event-driven tasks, such as... Figure 7 As shown, it includes: a time period segmentation module 701, used to obtain the periodic time period for executing all periodic tasks, and segment the periodic time period to obtain several duration units, wherein the periodic time period is configured to be able to completely execute all periodic tasks; and a static scheduling window construction module 702, used to match the corresponding duration units for each periodic task based on the scheduling information of each periodic task, and construct the static scheduling window corresponding to each periodic task. The scheduling information includes at least the execution time and task period of each periodic task, and the static scheduling window includes at least the start and end times. The start and end times are represented by the start and end unit positions of the continuous duration units occupied by the task instance of the corresponding periodic task, and the static scheduling window corresponding to the task instance of each periodic task is set at equal intervals according to the task period of that periodic task, and the duration unit occupied by each static scheduling window is... The long units are continuous in time; the dynamic scheduling window determination module 703 is used to determine the remaining time unit between any two adjacent static scheduling windows as a dynamic scheduling window, and the dynamic scheduling window includes at least the start and end time and the available time; the periodic task execution module 704 is used to trigger the execution of the periodic task corresponding to the static scheduling window when the system clock enters any static scheduling window; the task trigger sequence generation module 705 is used to sort the event-driven tasks based on the scheduling information of at least one event-driven task in response to receiving at least one event-driven task, and generate a task trigger sequence, where the event-driven task is used to characterize the task triggered by external or internal system events; the event-driven task execution module 706 is used to retrieve the event-driven task from the task trigger sequence and execute it when the system clock enters the dynamic scheduling window.

[0113] In some optional implementations, the time period segmentation module 701 includes: a common multiple calculation unit, used to calculate the least common multiple of the task cycles of all periodic tasks and determine the least common multiple as the periodic time period; and a unit segmentation unit, used to divide the periodic time period into several duration units based on a preset duration.

[0114] In some optional implementations, the static scheduling window construction module 702 includes: a trigger count calculation unit, used to calculate the number of task instances triggered by each periodic task within a periodic time period based on the task period of each periodic task; a unit count calculation unit, used to determine the number of duration units corresponding to a single task instance of each periodic task based on the execution time of each periodic task; and a window construction unit, used to arrange each periodic task within a periodic time period based on the number of task instance triggers and the number of duration units corresponding to a single task instance of each periodic task, to construct a static scheduling window corresponding to each periodic task, wherein the duration units occupied by each static scheduling window are continuous in time.

[0115] In some optional implementations, the scheduling information further includes: the scheduling priority and execution order dependency of each periodic task. The event-driven task scheduling device further includes: a sequence arrangement module, which is used to arrange each periodic task in the order of scheduling priority from high to low when arranging each periodic task within the periodic time period, and the arrangement order conforms to the execution order dependency.

[0116] In some optional implementations, before sorting the event-driven tasks based on the scheduling information of at least one event-driven task, the event-driven task scheduling device further includes: an event preprocessing module, configured to perform an event preprocessing operation in response to receiving at least one event-driven task, the event preprocessing operation including at least one of the following: a task discarding module, configured to discard the first event-driven task if the interval between the currently received first event-driven task and the last time the first event-driven task was received is less than a preset task triggering interval; a task merging module, configured to merge at least two identical event-driven tasks when at least two identical event-driven tasks are detected to be received at the same time; and a description conversion module, configured to convert at least one event-driven task into a standard event triggering description.

[0117] In some optional implementations, the scheduling information of the event-driven task includes at least scheduling priority, criticality level, and timestamp. The criticality level is used to characterize the impact level of the event-driven task on vehicle driving safety. The task trigger sequence generation module 705 includes: a task sorting unit, used to sort at least one event-driven task according to the hierarchical comparison rules of scheduling priority, criticality level, and timestamp to generate a task trigger sequence; and a task marking unit, used to sequentially mark each event-driven task in the task trigger sequence with an executable window, so that when the system clock enters the dynamic scheduling window, an executable event-driven task can be retrieved from the task trigger sequence based on the executable window mark corresponding to the dynamic scheduling window. The executable window mark is used to indicate the dynamic scheduling window that allows the execution of the event-driven task.

[0118] In some optional implementations, the task marking unit includes: a trigger time acquisition subunit, used to acquire the event trigger time of the current event-driven task itself; a first window filtering subunit, used to filter out each first dynamic scheduling window that is not currently occupied by the event-driven task; a second window filtering subunit, used to select from each first dynamic scheduling window a second dynamic scheduling window whose start time is later than the event trigger time and whose start time is closest to the event trigger time; and a task marking subunit, used to mark the executable window of the current event-driven task as the second dynamic scheduling window.

[0119] In some optional implementations, the event-driven task scheduling device further includes a task marking module, used to mark the current event-driven task as an executable window in the next period if no first dynamic scheduling window is selected or no second dynamic scheduling window is selected.

[0120] In some optional implementations, the event-driven task execution module 706 includes: a time comparison unit, configured to retrieve the current event-driven task from the task trigger sequence for execution when the system clock enters the current dynamic scheduling window, and compare the system clock with the end time of the current dynamic scheduling window during execution; and a task retrieval unit, configured to retrieve the next event-driven task from the task trigger sequence for execution if the current event-driven task has been completed and the current system clock is less than the end time, and return to the step of comparing the system clock with the end time of the current dynamic scheduling window during execution.

[0121] In some optional implementations, the event-driven task scheduling device further includes: a task interruption module, used to interrupt the execution of the current event-driven task if the current system clock reaches the end time during the execution of the current event-driven task, so as to execute the periodic task corresponding to the next static scheduling window; and a progress recording module, used to record the execution progress of the current event-driven task so as to continue the execution of the current event-driven task when the system clock enters the next dynamic scheduling window.

[0122] In some optional implementations, the scheduling information of the event-driven task also includes a standard execution duration. During the process of retrieving and executing the event-driven task from the task trigger sequence, the event-driven task scheduling device further includes: a duration recording module for recording the actual execution duration of the current event-driven task; an exception count increment module for marking the current event-driven task and increasing the consecutive exception count of the current event-driven task when the actual execution duration exceeds the standard execution duration of the current event-driven task; and a scheduling degradation module for performing scheduling degradation processing on the current event-driven task when the consecutive exception count exceeds a preset threshold, wherein the scheduling degradation processing includes at least one of reducing the scheduling priority and increasing the task trigger interval duration.

[0123] In some optional implementations, the event-driven task scheduling device further includes: a status monitoring module for monitoring the execution status of event-driven tasks in the task triggering sequence; and an exception handling module for triggering an exception handling mechanism if it is detected that the current event-driven task in the task triggering sequence has not been invoked to the dynamic scheduling window for execution within a consecutive preset number of periodic time periods. The exception handling mechanism includes at least one of the following: suspending the execution of event-driven tasks with a scheduling priority lower than a preset level; reducing the available time of each dynamic scheduling window in the next periodic time period; and migrating event-driven tasks whose actual execution time exceeds the corresponding standard execution time to other processors for orchestration and execution.

[0124] The event-driven task scheduling apparatus provided in this embodiment of the invention can execute the event-driven task scheduling method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0125] Figure 8 This is a schematic diagram of the structure of an autonomous driving domain controller provided in an embodiment of the present invention.

[0126] The following is a detailed reference. Figure 8This diagram illustrates a suitable structural design for implementing an autonomous driving domain controller according to an embodiment of the present invention. The autonomous driving domain controller may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 802 or a program loaded from memory 808 into random access memory (RAM) 803. RAM 803 also stores various programs and data required for the operation of the autonomous driving domain controller. The processor 801, ROM 802, and RAM 803 are interconnected via bus 804. An input / output (I / O) interface 805 is also connected to bus 804.

[0127] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; memory 808 including, for example, magnetic tape, hard disk, etc.; and communication devices 809. Communication device 809 allows the autonomous driving domain controller to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An autonomous driving domain controller with various devices is shown; however, it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0128] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a memory 808, or installed from a ROM 802. When the computer program is executed by the processor 801, it performs the functions defined in the event-driven task scheduling method of the embodiments of the present invention.

[0129] Figure 8 The autonomous driving domain controller shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0130] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the event-driven task scheduling method shown in the above embodiments is implemented.

[0131] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0132] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the defined scope.

Claims

1. A scheduling method for event-driven tasks, characterized in that, The method includes: Obtain the periodic time interval for executing all periodic tasks, and divide the periodic time interval into several duration units. The periodic time interval is configured to be able to execute all periodic tasks completely. Based on the scheduling information of each periodic task, a corresponding duration unit is matched for each periodic task to construct a static scheduling window for each periodic task. The scheduling information includes at least the execution time and task cycle of each periodic task, and the static scheduling window includes at least the start and end times. The start and end times are represented by the start and end unit positions of the continuous duration units occupied by the task instance of the corresponding periodic task. The static scheduling window corresponding to the task instance of each periodic task is set at equal intervals according to the task cycle of that periodic task, and the duration units occupied by each static scheduling window are continuous in time. The remaining time unit between any two adjacent static scheduling windows is determined as a dynamic scheduling window, and the dynamic scheduling window includes at least the start and end time and the available time. When the system clock enters any static scheduling window, the periodic task corresponding to that static scheduling window is triggered for execution; In response to receiving at least one event-driven task, the event-driven tasks are sorted based on the scheduling information of the at least one event-driven task to generate a task triggering sequence, wherein the event-driven task is used to characterize a task triggered by an external or internal system event; When the system clock enters the dynamic scheduling window, an event-driven task is retrieved from the task trigger sequence and executed.

2. The method according to claim 1, characterized in that, The step involves obtaining the periodic time segments corresponding to all periodic tasks and dividing these periodic time segments into several duration units, including: Calculate the least common multiple of the task cycles of all periodic tasks, and determine the least common multiple as the periodic time period; Based on a preset duration, the periodic time period is divided into several duration units.

3. The method according to claim 2, characterized in that, The process of matching corresponding duration units to each periodic task based on the scheduling information of each periodic task, and constructing a static scheduling window for each periodic task, includes: Based on the task cycle of each periodic task, calculate the number of task instance triggers for each periodic task within the stated periodic time. Based on the execution time of each periodic task, determine the number of duration units corresponding to a single task instance in each periodic task. Based on the number of task instance triggers for each periodic task and the number of duration units corresponding to a single task instance, each periodic task is arranged within the periodic time period to construct a static scheduling window corresponding to each periodic task. The duration units occupied by each static scheduling window are continuous in time.

4. The method according to claim 3, characterized in that, The scheduling information also includes: the scheduling priority and execution order dependencies of each periodic task; the method further includes: When arranging the periodic tasks within the periodic time period, the arrangement order of the periodic tasks is arranged in descending order of the scheduling priority, and the arrangement order conforms to the execution order dependency relationship.

5. The method according to claim 1, characterized in that, Before sorting the event-driven tasks based on the scheduling information of the at least one event-driven task, the method further includes: In response to receiving at least one event-driven task, an event preprocessing operation is performed, the event preprocessing operation including at least one of the following: If the interval between the current first event-driven task and the last time the first event-driven task was received is less than the preset task trigger interval, the first event-driven task is discarded. When at least two identical event-driven tasks are detected to be received at the same time, the at least two identical event-driven tasks are merged. Convert the at least one event-driven task into a standard event-triggered description.

6. The method according to claim 1, characterized in that, The scheduling information of the event-driven task includes at least scheduling priority, criticality level, and timestamp. The criticality level is used to characterize the impact level of the event-driven task on vehicle driving safety. The step of sorting the event-driven tasks based on the scheduling information of the at least one event-driven task to generate a task trigger sequence includes: Based on the hierarchical comparison rules of scheduling priority, criticality level, and timestamp, at least one event-driven task is sorted to generate a task trigger sequence; Each event-driven task in the task triggering sequence is marked with an executable window in turn, so that when the system clock enters the dynamic scheduling window, an executable event-driven task is retrieved from the task triggering sequence based on the executable window mark corresponding to the dynamic scheduling window. The executable window mark is used to indicate the dynamic scheduling window that allows the execution of the event-driven task.

7. The method according to claim 6, characterized in that, The step of sequentially marking each event-driven task in the task triggering sequence as an executable window includes: Get the event trigger time of the current event-driven task itself; Filter out the first dynamic scheduling windows that are not currently occupied by event-driven tasks; The second dynamic scheduling window selected from each of the first dynamic scheduling windows has a start time later than the event trigger time and the start time is closest to the event trigger time; The executable window of the current event-driven task is marked as the second dynamic scheduling window.

8. The method according to claim 7, characterized in that, The method further includes: If the first dynamic scheduling window is not selected, or if the second dynamic scheduling window is not selected, the current event-driven task will be marked as an executable window in the next cycle time period.

9. The method according to claim 1, characterized in that, When the system clock enters the dynamic scheduling window, an event-driven task is retrieved from the task triggering sequence and executed, including: When the system clock enters the current dynamic scheduling window, the current event-driven task is retrieved from the task trigger sequence for execution, and during execution, the system clock is compared with the end time of the current dynamic scheduling window. If the current event-driven task is completed and the current system clock is less than the end time, the next event-driven task is retrieved from the task triggering sequence and executed. The process of comparing the system clock with the end time of the current dynamic scheduling window during execution is then returned.

10. The method according to claim 9, characterized in that, The method further includes: If the current system clock reaches the end time during the execution of the current event-driven task, the execution of the current event-driven task is interrupted, and the periodic task corresponding to the next static scheduling window is executed. Record the execution progress of the current event-driven task so that it can continue to execute when the system clock enters the next dynamic scheduling window.

11. The method according to claim 1 or 6, characterized in that, The scheduling information for the event-driven task also includes a standard execution duration. During the process of retrieving and executing the event-driven task from the task trigger sequence, the method further includes: Record the actual execution time of the current event-driven task; When the actual execution time exceeds the standard execution time of the current event-driven task, the current event-driven task is marked and the number of consecutive exceptions for the current event-driven task is increased. When the number of consecutive anomalies exceeds a preset threshold, the current event-driven task is downgraded in scheduling. The downgraded scheduling process includes at least one of reducing the scheduling priority and increasing the task trigger interval.

12. The method according to claim 5, characterized in that, The method further includes: Monitor the execution status of event-driven tasks in the task triggering sequence; If it is detected that the current event-driven task in the task triggering sequence has not been invoked to the dynamic scheduling window for execution within a consecutive preset number of periodic time periods, an exception handling mechanism is triggered, and the exception handling mechanism includes at least one of the following: Suspend the execution of event-driven tasks with a scheduling priority lower than the preset level; Reduce the available duration of each dynamic scheduling window within the next cycle period; Event-driven tasks whose actual execution time exceeds the corresponding standard execution time will be migrated to other processors for orchestration and execution.

13. A scheduling device for event-driven tasks, characterized in that, The device includes: The time period segmentation module is used to obtain the periodic time period for executing all periodic tasks, and to segment the periodic time period into several duration units. The periodic time period is configured to be able to execute all periodic tasks completely. A static scheduling window construction module is used to match corresponding duration units for each periodic task based on the scheduling information of each periodic task, and construct a static scheduling window corresponding to each periodic task. The scheduling information includes at least the execution time and task cycle of each periodic task, and the static scheduling window includes at least the start and end times. The start and end times are represented by the start and end unit positions of the continuous duration units occupied by the task instance of the corresponding periodic task. The static scheduling window corresponding to the task instance of each periodic task is set at equal intervals according to the task cycle of that periodic task, and the duration units occupied by each static scheduling window are continuous in time. The dynamic scheduling window determination module is used to determine the remaining time unit between any two adjacent static scheduling windows as a dynamic scheduling window, wherein the dynamic scheduling window includes at least the start and end time and the available time. The periodic task execution module is used to trigger the execution of the periodic task corresponding to any static scheduling window when the system clock enters that static scheduling window. A task trigger sequence generation module is used to respond to receiving at least one event-driven task, sort the event-driven tasks based on the scheduling information of the at least one event-driven task, and generate a task trigger sequence, wherein the event-driven task is used to characterize a task triggered by an external or internal system event. The event-driven task execution module is used to retrieve and execute event-driven tasks from the task trigger sequence when the system clock enters the dynamic scheduling window.

14. A vehicle, characterized in that, The vehicle includes an autonomous driving domain controller, which includes a memory and a processor. The memory and the processor are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the event-driven task scheduling method of any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the event-driven task scheduling method according to any one of claims 1 to 12.

16. A computer program product, characterized in that, It includes computer instructions for causing a computer to execute the scheduling method for event-driven tasks according to any one of claims 1 to 12.