Event processing method and apparatus

By selecting the highest priority events and unused computing resources in the autonomous driving system, the system ensures that data processing tasks are completed within a defined timeframe, thus solving the problem that the scheduler cannot guarantee the determinism of processing tasks and achieving determinism in data processing and system security.

CN116670650BActive Publication Date: 2026-03-17HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing autonomous driving systems, the scheduling strategy of the scheduler between events and processing tasks cannot guarantee the determinism and time of processing tasks, resulting in uncertainty and safety hazards in the operation of autonomous driving systems.

Method used

By selecting the highest priority events and unused computing resources, the processing tasks are ensured to complete data processing within a defined time. Event processing methods and devices, including processing units and interfaces, are used to achieve deterministic data processing.

Benefits of technology

It improves the determinism of autonomous driving systems, ensures the determinism of data processing timing and end-to-end latency, reduces the contention and interference of computing resources, and enhances the safety and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116670650B_ABST
    Figure CN116670650B_ABST
Patent Text Reader

Abstract

An event processing method and apparatus are disclosed, relating to the field of autonomous driving. The method includes: selecting a first event from at least one event (S301); selecting a first computing resource from at least one unoccupied computing resource (S302); and processing data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource (S303). This method ensures that a computing resource is occupied by only one processing task corresponding to an event, thereby ensuring that the processing task corresponding to the event can complete the processing of the corresponding data within a defined event. The data that the autonomous driving system needs to process is fixed, and the time required for the processing tasks corresponding to this data to process it is also fixed; therefore, the time from input data to output control commands in the autonomous driving system is also fixed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving, and more particularly to an event processing method and apparatus. Background Technology

[0002] Currently, in existing autonomous driving systems, data is processed through several processing tasks to generate control commands, which in turn control the autonomous driving device to achieve autonomous driving. These processing tasks include one or more of the following: sensor processing tasks, perception processing tasks, fusion processing tasks, and regulatory control processing tasks. Each processing task has a corresponding trigger event. When a processing task is triggered by its corresponding event, it begins processing the data received from upstream sources (hardware resources or the previous processing task). The scheduler in the autonomous driving system schedules multiple events to trigger the corresponding processing tasks to process the data. For example, by scheduling events corresponding to sensor processing tasks, perception processing tasks, fusion processing tasks, and regulatory control processing tasks, the corresponding processing tasks are triggered to process the data and ultimately generate control commands. Since there is a correspondence between events and processing tasks, scheduling multiple events can be considered as scheduling the processing tasks corresponding to multiple events. The data processing by these tasks requires computing resources. Before scheduling an event, the scheduler needs to select computing resources so that the processing task can occupy those resources to process the data and generate subsequent output data.

[0003] Currently, schedulers can schedule tasks using either static orchestration (i.e., manually configured) or the Completely Fair Scheduler (CFS) algorithm, which is based on the time allotted computing resources. However, as the complexity of autonomous driving systems continues to increase, fully static orchestration becomes too laborious, almost impossible for humans to perform, rendering this strategy unusable. Furthermore, while CFS-based scheduling aims to ensure relatively fair runtime allocation of computing resources for each task, it does not guarantee the deterministic completion time of each task. This leads to uncertainty in the overall runtime of the autonomous driving system, posing a safety hazard. Summary of the Invention

[0004] This application provides an event processing method and apparatus to improve the determinism of an autonomous driving system.

[0005] To achieve the above objectives, the embodiments of this application provide the following technical solutions:

[0006] Firstly, an event processing method is provided, comprising: selecting a first event from at least one event; selecting a first computing resource from at least one unoccupied computing resource; and finally processing the data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource. The method provided in the first aspect ensures that a computing resource is occupied by only one processing task corresponding to an event, thereby ensuring that the processing task corresponding to the event can complete the processing of the corresponding data within a defined time. The data that the autonomous driving system needs to process is defined, and the time for the processing tasks corresponding to this data to process this data is also defined. Therefore, the time from input data to output control commands in the autonomous driving system is also defined.

[0007] In one possible implementation, the data corresponding to the processing task is processed according to the processing task corresponding to the first event and the first computing resource. This includes: selecting first data from the data queue corresponding to the processing task, determining a first processing function based on the first data, and then processing the first data according to the first processing function and the first computing resource. This possible implementation can ensure that data processing is performed according to the time when the data enters the data queue, thus guaranteeing the data processing sequence.

[0008] In one possible implementation, processing the data corresponding to the processing task based on the processing task corresponding to the first event and the first computing resources further includes: selecting second data from the data queue corresponding to the processing task, determining a second processing function based on the second data, and then processing the second data based on the second processing function and the first computing resources. In this case, after the first data is processed, other data can be selected from the data queue for processing until all the data to be processed has been processed. This allows the processing task to determine how much data needs to be processed based on scheduling needs, controlling the time spent occupying computing resources.

[0009] In one possible implementation, during the processing of the first data according to the first processing function and the first computing resources, the method further includes: if a new event is generated that requires the execution of the next processing task, adding the new event to the event queue. This possible implementation adds the generated new events to the event queue so that the generated new events are also scheduled, ensuring that all events triggering the start of processing tasks in the autonomous driving system must undergo event scheduling, thus ensuring the determinism of the entire autonomous driving system.

[0010] In one possible implementation, before processing the data corresponding to the processing task based on the processing task corresponding to the first event and the first computing resource, the method further includes: setting the first computing resource to an occupied state. Setting the first computing resource to an occupied state ensures that no other processing task selects the computing resource during the data processing process of the processing task corresponding to the first event, avoiding contention for computing resources between processing tasks. This allows the processing task to complete the processing of the required data within a defined time, and also ensures that the end-to-end latency is deterministic, thereby improving the determinism of the entire autonomous driving system.

[0011] In one possible implementation, computing resources include CPU computing resources.

[0012] In one possible implementation, selecting a first event from at least one event includes selecting the highest priority event from the event queue as the first event. This possible implementation allows high-priority events to be processed first, thereby improving the determinism of the entire autonomous driving system.

[0013] In one possible implementation, after processing the data corresponding to the processing task based on the processing task corresponding to the first event and the first computing resource, the method further includes: setting the first computing resource to an unoccupied state. At this point, setting the first computing resource to an unoccupied state allows subsequent scheduling to select that computing resource again.

[0014] In a second aspect, an event processing apparatus is provided, comprising: a processing unit; the processing unit being configured to: select a first event from at least one event, select a first computing resource from at least one unoccupied computing resource, and process data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource.

[0015] In one possible implementation, the processing unit is specifically used to: select first data from the data queue corresponding to the processing task, determine a first processing function based on the first data, and process the first data based on the first processing function and the first computing resources.

[0016] In one possible implementation, the processing unit is specifically used to: select second data from the data queue corresponding to the processing task, determine a second processing function based on the second data, and process the second data based on the second processing function and the first computing resources.

[0017] In one possible implementation, while the processing unit is processing the first data according to the first processing function and the first computing resources, the processing unit is further configured to: add the new event to the event queue if a new event is generated that requires the next processing task to be executed.

[0018] In one possible implementation, the processing unit is further configured to: set the first computing resource to an occupied state.

[0019] In one possible implementation, computing resources include CPU computing resources.

[0020] In one possible implementation, the processing unit is specifically used to: select the highest priority event from the event queue as the first event.

[0021] In one possible implementation, the processing unit is further configured to: set the first computing resource to an unoccupied state.

[0022] Thirdly, an event processing apparatus is provided, comprising: a processor and an interface, wherein the processor is coupled to a memory via the interface, and when the processor executes a computer program or instructions in the memory, any of the methods provided in the first aspect are executed.

[0023] Fourthly, an event processing apparatus is provided, comprising: a processor coupled to a memory; a memory for storing a computer program; and a processor for executing the computer program stored in the memory, such that the event processing apparatus performs any of the methods provided in the first aspect.

[0024] Fifthly, a computer-readable storage medium is provided, including a computer program that, when run on a computer, causes the computer to perform any of the methods provided in the first aspect.

[0025] In a sixth aspect, a computer program product is provided, comprising a computer program that, when run on a computer, causes the computer to perform any of the methods provided in the first aspect.

[0026] The technical effects of any of the implementation methods in aspects two through six can be found in the technical effects of the corresponding implementation methods in aspect one, and will not be repeated here.

[0027] It should be noted that, provided the solutions do not contradict each other, the solutions in the above aspects can be combined. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the architecture of an autonomous driving system.

[0029] Figure 2 This is a schematic diagram illustrating the execution order of processing tasks;

[0030] Figure 3 A flowchart illustrating an event handling method provided in an embodiment of this application;

[0031] Figure 4 A flowchart illustrating yet another event handling method provided in an embodiment of this application;

[0032] Figure 5 A schematic diagram of the architecture of an autonomous driving system provided in this application embodiment;

[0033] Figure 6 This is a schematic diagram of the architecture of another autonomous driving system provided in an embodiment of this application;

[0034] Figure 7 A flowchart illustrating yet another event handling method provided in an embodiment of this application;

[0035] Figure 8 This is a schematic diagram of the composition of an event processing device provided in an embodiment of this application;

[0036] Figure 9 This is a schematic diagram of the hardware structure of an event processing device provided in an embodiment of this application. Detailed Implementation

[0037] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0038] To make the embodiments of this application clearer, some of the concepts involved in this application will be briefly introduced.

[0039] 1. Processing tasks: It can act as the execution entity to process data in the autonomous driving system.

[0040] For example, it could be a task processing module or a process within a Linux system. Here, Linux refers to the operating system in an autonomous driving system. In actual implementations, the operating system in an autonomous driving system can be other things as well; this is just an example and not a limitation.

[0041] 2. Events: These are used to trigger processing tasks to process data, including information about the processing task that needs to be triggered (e.g., the identifier of the processing task).

[0042] There is a correspondence between events and processing tasks. An event triggers a corresponding processing task to process data, and the information about the processing task to be triggered included in the event indicates the processing task triggered by the event. For example, an IO event includes information about sensor processing tasks, and a message event includes information about perception processing tasks, fusion processing tasks, or regulatory processing tasks.

[0043] In other words, when the scheduler selects an event from the received events for scheduling, it knows which processing task needs to be scheduled to start working based on the information of the processing tasks that need to be triggered included in the event.

[0044] 3. Data: refers to the input information required when processing tasks.

[0045] Since processing tasks require continuous data processing, the data can be organized into data queues and read according to a first-in, first-out (FIFO) rule. Data sent from upstream (hardware resources or processing tasks) to downstream (processing tasks) is stored in memory as data queues, and each data queue has an identifier (indicating which processing task is reading from that queue). The downstream task can retrieve the required data from the corresponding data queue based on the identifier. It's important to note that the essence of data transmission is still upstream to downstream; however, the memory acts as a relay (placing data in memory as data queues, and then the downstream task reads the data from the corresponding data queue). This avoids the communication overhead caused by direct upstream-to-downstream data transmission.

[0046] The above is a brief introduction to some of the concepts involved in the embodiments of this application.

[0047] The method provided in the embodiments of this application can be applied to, for example, Figure 1 The autonomous driving system shown. Figure 1 The autonomous driving system shown includes sensor data, sensor processing tasks, perception processing tasks, fusion processing tasks, traffic control processing tasks, a scheduler, and computing resources.

[0048] Sensor processing tasks convert data received from sensors into formatted data that can be recognized by the autonomous driving system. These sensors can include onboard cameras, LiDAR, and millimeter-wave radar.

[0049] The perception processing task obtains formatted data from the sensor processing task and uses artificial intelligence (AI) algorithms and traditional algorithms to identify participants, obstacles, traffic signs, etc. in the traffic scene from the formatted data. Among them, participants in the traffic scene include, but are not limited to, vehicles and pedestrians.

[0050] Fusion processing tasks can merge data on participants, obstacles, traffic signs, etc. in traffic scenarios to provide a complete driving environment for autonomous driving systems.

[0051] The control processing task can make decisions and output control commands based on the identified driving environment, traffic rules, driver instructions, and its own status information (such as its own speed information, orientation information, etc.).

[0052] A scheduler is used to schedule processing tasks in an autonomous driving system to ensure that the end-to-end latency (the delay from sensor input to control command output) is as predictable as possible. Schedulers can include event-based schedulers (in this case, they can be called event schedulers, first-level schedulers, etc.), data-based schedulers within processing tasks (used to schedule data in data queues, in this case, they can be called second-level schedulers, data schedulers, etc.), and Linux schedulers (referring to the scheduler in a Linux system).

[0053] Computing resources may include a Central Processing Unit (CPU) and / or a Neural Processing Unit (NPU). Computing resources may also include other computing resources (e.g., Digit Video Preprocessing (DVPP)). Processing tasks in autonomous driving systems consume computing resources to process data.

[0054] Figure 1 The data processing process of the autonomous driving system shown includes:

[0055] First, the scheduler selects a computing resource from at least one computing resource, then selects an event from at least one event, and finally determines which processing task to trigger based on the information of the processing task to be triggered in the event. For example, assuming the selected event is an I / O event, the scheduler will trigger the sensor processing task to process the data based on the information of the sensor processing task to be triggered included in the I / O event. During data processing, a processing task generates events and data. The data is passed to the next processing task, and the event is passed to the scheduler. The scheduler then selects another resource and an event, and determines which processing task to trigger based on the information of the processing task to be triggered in the event. The I / O events corresponding to the sensor data are generated by hardware I / O resources, not by other processing tasks. The hardware I / O resources generate the I / O events corresponding to the sensor data and send them to the scheduler. After the sensor data is processed sequentially by the above four processing tasks (the execution order could be sensor processing task → perception processing task → fusion processing task → control processing task), control commands are obtained.

[0056] The data processing process described above for the autonomous driving system is merely an exemplary description. In actual implementation, other tasks may be involved, or fewer processing tasks may be required, or the order of processing tasks may change.

[0057] Furthermore, the autonomous driving system described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the upgrading of autonomous driving systems, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0058] Currently, the following methods 1 or 2 can be used in autonomous driving systems to schedule processing tasks or events.

[0059] Method 1

[0060] Static orchestration refers to the pre-arrangement of triggering conditions, runtime, cycle time, and scheduling priority for processing tasks by engineers. Static orchestration is generally applied to the control systems of microcontroller units (MCUs) in traditional automotive applications. In this system, the MCU provides computing resources for the autonomous driving system, and the autonomous driving system (Autosar Operating System, Autosar OS) acts as the scheduler, scheduling processing tasks according to the static orchestration and monitoring multiple high-priority tasks to ensure the determinism of the entire autonomous driving system's operation as much as possible. In this scenario, the scheduler supports high-priority tasks preempting the computing resources of low-priority tasks. That is, when a high-priority task needs to run urgently, the scheduler will stop the execution of low-priority tasks and prioritize running the high-priority task on that computing resource. Furthermore, when the MCU supports multiple computing resources, a static orchestration strategy needs to be configured for each computing resource. For example, referring to Table 1 for the static orchestration strategy for a single computing resource, assuming it is running on CPU0 and needs to execute processing tasks T1, T2, T3, and T4, the attributes that need to be configured for these four processing tasks are as follows:

[0061] Table 1

[0062] Processing tasks Triggering method Period (ms) / Trigger Source Runtime (ms) T1 cycle 100 10 T2 cycle 100 20 T3 event Event 1 (the event generated by T2) 20 T4 cycle 100 30

[0063] According to the above configuration, within a 100ms cycle, CPU0 processes task T1 during the 0ms-10ms period, task T2 during the 10ms-30ms period, task T3 during the 30ms-50ms period, and task T4 during the 50ms-80ms period. This means it can be processed according to... Figure 2 The sequence shown executes T1, T2, T3, and T4 in a loop. T1, T2, and T4 are triggered at fixed times; for example, T1 is triggered at 0ms within any 100ms period, T2 at 10ms within any 100ms period, and T4 at 50ms within any 100ms period. T3 is triggered by an event generated by T2 after it finishes processing data. That is, after T2 completes data processing, it sends the generated event to the scheduler, which schedules the event so that T3 immediately follows T2, using CPU 0 to process the data.

[0064] Problems with Method 1:

[0065] 11. As can be seen from the above scheduling strategies for static orchestration, the scheduling strategy of waiting for orchestration cannot be applied to higher-level autonomous driving systems. This is because higher-level autonomous driving systems have a large number of tasks to process and a large amount of computation, which in turn requires a large amount of computing resources. Therefore, it is almost impossible to manually orchestrate the triggering events, running time, running cycle and scheduling priority of each processing task on each computing resource.

[0066] 12. In reality, the actual running time and cycle of each processing task can vary and are difficult to predict. Because the scheduler is affected by the overall system scheduling (for example, when a low-priority processing task has not finished running on the computing resource, a high-priority processing task will preempt the computing resource of the low-priority processing task, causing the low-priority processing task to pause), some services cannot be completed normally. If a processing task cannot be completed normally, it will affect the execution time of the next processing task, which in turn will affect the running time and cycle of each processing task on the computing resource, thereby reducing the determinism of the autonomous driving system.

[0067] 13. In order to ensure that all processing tasks can be completed normally within a cycle, engineers usually refer to the maximum running time of each processing task within that cycle to plan for unforeseen circumstances. This results in a longer running cycle, increases end-to-end latency, and also wastes computing resources to some extent.

[0068] Method 2

[0069] The Completely Fair Scheduler (CFS) algorithm records the CPU resource usage time of all processing tasks. During scheduling, CPU resources are allocated based on the CPU resource usage time of each task, ensuring fairness in CPU resource usage across all tasks. Comparing the CPU resource usage time of each task is achieved by introducing virtual runtime (vruntime), as follows:

[0070] vruntime = actual running time * 1024 / weight of the task being processed.

[0071] In essence, vruntime is the standardization of actual runtime based on weights. After standardization, the time each processing task occupies computing resources can be directly compared by vruntime. The processing task weights can be configured by engineers according to the importance of the processing tasks. For example, if processing task 'a' is the most important, then the processing task weight of processing task 'a' will be configured to be the highest, so that the vruntime of processing task 'a' is minimized, and more runtime can be obtained.

[0072] Problems with Method 2

[0073] 21. As can be seen from the above description of the scheduling strategy for the Completely Fair Scheduling Algorithm, the Completely Fair Scheduling Algorithm ensures that the time each processing task occupies computing resources is fair. In this case, when there are more tasks in the autonomous driving system, the determinism of the completion time of each task cannot be guaranteed. Therefore, the determinism of the end-to-end delay between the input data and the output control command of the entire autonomous driving system cannot be guaranteed.

[0074] 22. The Completely Fair Scheduler (CFS) algorithm is based on independent scheduling for each computing resource. It requires periodic load balancing among the computing resources. In this case, the load of each computing resource cannot be kept balanced in real time, and the inability to schedule in a timely manner exacerbates the uncertainty.

[0075] 23. Preemption can also occur between processing tasks. Unexpected interference from other processing tasks can affect the normal processing of the preempted task and increase uncertainty.

[0076] 24. There are dependencies between the processing tasks (for example, there is a dependency between processing task a and processing task b, that is, processing task a must be completed before processing task b can be run). If the fair scheduling is based solely on the time occupied by computing resources, the dependencies between processing tasks will be ignored. For example, if processing task b is scheduled before processing task a has been completed, it will cause processing task b to be unable to run normally, resulting in invalid scheduling.

[0077] To address the problems encountered in methods 1 and 2, this application proposes an event handling method that can not only run on higher-level autonomous driving systems but also improve the determinism of autonomous driving system scheduling. For example... Figure 3 As shown, the method includes:

[0078] S301. Select the first event from at least one event.

[0079] It should be noted that, Figure 3 The entities performing the steps shown can be autonomous driving devices, such as cars, subways, and high-speed trains.

[0080] The first event can be any one of the at least one events, or it can be the event with the highest priority. The at least one event can be all the events generated by the autonomous driving system, or it can be a subset of all the events generated by the autonomous driving system (e.g., events sent by various processing tasks to the event scheduler).

[0081] At least one event can form an event queue, and the events in the event queue can be sorted according to priority from high to low or from low to high. The priority refers to the processing task priority and / or event priority. There are two ways to select an event.

[0082] Method 1: When selecting events based on task priority, choose the event with the highest task priority. If only one event is selected, that event is designated as the first event. If multiple events are selected, choose the event with the highest priority from among them. If only one event is selected based on event priority, that event is designated as the first event. If multiple events are selected based on event priority, choose the event that occurred earliest as the first event. For example, first, three events with the highest task priority are selected (e.g., event 1, event 2, and event 3). Then, the event with the highest event priority is selected based on event priority. If only two events can be selected from these three (e.g., event 1 and event 2), then the earlier event (e.g., event 1) is selected as the first event based on the time of its occurrence.

[0083] Method 2: When selecting based on event priority, choose the event with the highest priority. If only one event is selected, that event is designated as the first event. If multiple events are selected, choose the event with the highest task priority from among them. If only one event is selected based on task priority, that event is designated as the first event. If multiple events are selected based on task priority, choose the event that occurred earliest as the first event. For example, first, three events with the highest priority are selected based on event priority (e.g., event 1, event 2, and event 3). Then, the event with the highest task priority is selected based on task priority. If only two events can be selected from these three (e.g., event 1 and event 2), then the earlier event (e.g., event 1) is selected as the first event.

[0084] It should be noted that Method 1 and Method 2 above are merely examples of methods for selecting events. The specific order in which task priority, event priority, and time are selected can be set by the engineer according to the actual situation, and this application does not impose any restrictions.

[0085] The event queue can be stored in memory. Figure 1 The scheduler in the architecture shown can read the event queue from memory.

[0086] It should be noted that S301 can be... Figure 1 The scheduler executes in the architecture shown.

[0087] S302. Select the first computing resource from at least one unoccupied computing resource.

[0088] The first computing resource can only be selected from unoccupied computing resources. If it were selected from occupied computing resources, high-priority events might preempt the computing resources of low-priority events. When an occupied computing resource is processing a low-priority event, a high-priority event could then preempt that resource, preventing the low-priority event from completing within the defined time, thus increasing the uncertainty of the autonomous driving system. Therefore, selecting the first resource from unoccupied computing resources avoids interference from other events, ensuring that each event can be processed within the defined time.

[0089] In its specific implementation, S302 allows the event scheduler to uniformly schedule events generated by different hardware resources (e.g., hardware I / O resources, NPU resources, etc.) and / or events generated by processing tasks on different types of computing resources (e.g., events generated by processing tasks on NPU computing resources, events generated by processing tasks on CPU computing resources). As can be seen from the above, this embodiment supports unified scheduling of events generated by processing tasks on different types of computing resources, eliminating the need for separate scheduling of events generated by processing tasks on different types of computing resources, thereby reducing communication and scheduling overhead between different types of computing resources. The event scheduler also achieves this beneficial effect when uniformly scheduling events generated by different hardware resources; this can be understood by reference and will not be elaborated further.

[0090] Optionally, before processing the data corresponding to the processing task based on the processing task and the first computing resource corresponding to the first event, the method further includes: setting the first computing resource to an occupied state to avoid the problem of preemption when selecting the first computing resource again when scheduling other events.

[0091] It should be noted that engineers can reserve computing resources required for processing tasks, so that these reserved computing resources are used only for running events or processing tasks related to autonomous driving, thereby avoiding interference from other events or processing tasks unrelated to the autonomous driving system, and thus improving the determinism of the autonomous driving system.

[0092] It should be noted that S302 can be... Figure 1 The scheduler in the architecture shown performs the execution.

[0093] S303. Process the data corresponding to the processing task based on the processing task corresponding to the first event and the first computing resource. Specifically, the processing task corresponding to the first event can occupy the first computing resource to process the data.

[0094] Optionally, in its specific implementation, S303 includes: a secondary scheduler selecting first data from the data queue corresponding to the processing task of the first event, determining a first processing function based on the first data, and finally processing the first data according to the first processing function and the first computing resources. Specifically, the processing task corresponding to the first event selects first data from its corresponding data queue, determines a first processing function based on the first data, occupies the first computing resources, and processes the first data using the first processing function. In subsequent processes, the method further includes: a secondary scheduler selecting second data from the data queue corresponding to the processing task of the first event, determining a second processing function based on the second data, and finally processing the second data according to the second processing function and the first computing resources. In this case, after processing the second data, a third data can be selected for processing. The number of data in the processing data queue is set by a certain algorithm, which is not limited in this application. Processing of the data queue corresponding to the processing task of the first event is only completed after all the required data has been processed. It should be noted that if the processing task requires processing only one piece of data, it is not necessary to select the second data for processing after processing the first data. The first processing function and the second processing function can be the same or different. It should be noted that a data queue can correspond to one processing function or multiple processing functions, which can be set by the engineer according to the actual situation. This application does not impose any restrictions.

[0095] Since events require triggering processing tasks, there is a correspondence between events and processing tasks. Since a processing task can be a process, events and processes also have the same correspondence. A processing task (also called a process) includes one or more threads. In this case, a thread within the process can process data. The thread for processing data can be selected within the process using methods A, B, or C. The selected thread then performs the actions required by the aforementioned processing task.

[0096] Method A: If the number of threads created in a process is the same as the number of reserved computing resources, and there is a one-to-one correspondence between threads and computing resources, as shown in Table 2 below, then the thread in the process corresponding to the computing resource is determined to be the thread processing data. Table 2 is only an example of the correspondence between events, processing tasks (also known as processes), and computing resources. The correspondence between events, processing tasks, and computing resources can be set by engineers according to actual conditions, and this application does not impose any restrictions.

[0097] Table 2

[0098]

[0099] Method B: If the number of threads created in a process is less than the number of reserved computing resources, and one thread corresponds to multiple computing resources, then the thread in the process corresponding to the computing resources is determined to be the thread that processes the data.

[0100] Method C: If the relationship between threads and computing resources changes dynamically, then one unoccupied thread in the process will be identified as the thread that processes data.

[0101] For example, based on the selected thread, the implementation process of S301-S303 can be as follows: The event scheduler selects an event (i.e., the first event) from the event queue and selects an unoccupied computing resource (i.e., the first computing resource). Since the first event has been selected, the processing task corresponding to the first event can be determined according to the correspondence between events and processing tasks. The event scheduler determines a thread (denoted as the first thread) from the unoccupied threads in the process and notifies the Linux scheduler to wake up the first thread. The secondary scheduler can select a piece of data (i.e., the first data) from the data queue, and then determine the processing function corresponding to the first data (i.e., the first processing function) according to the correspondence between data and processing functions, and process the first data on the first computing resource according to the first processing function.

[0102] Other methods can be used to select the thread for data processing within a process, and this application does not impose any restrictions. The method for selecting the thread for data processing within a process can be set by the engineer according to the actual situation, and this application does not impose any restrictions.

[0103] It should be noted that there is also a correspondence between data queues and processing functions. When a data queue corresponds to one processing function (for example, data queue A1 in Table 3 corresponds only to processing function F1), all data in that data queue corresponds to that processing function (for example, data B1 and data B2 in data queue A1 in Table 3 both correspond to processing function F1). When a data queue corresponds to multiple processing functions (for example, data queue A2 in Table 3 corresponds to processing functions F1 and F2), then each piece of data in that data queue may correspond to different processing functions (for example, data B3 in data queue A2 in Table 3 corresponds to processing function F1, and data B4 and data B5 correspond to processing function F2). Table 3 below is only an example of the correspondence between data queues, data, and processing functions. The correspondence between data queues, data, and processing functions shall be set by the engineer according to the actual situation, and this application does not impose any restrictions.

[0104] Table 3

[0105]

[0106] Optionally, prior to S303, the method further includes: when the processing task corresponding to the first event runs in an operating system (e.g., a Linux system), the processing task corresponding to the first event should avoid being directly or indirectly called by the Linux system. Otherwise, the processing related to the autonomous driving system in the processing task may be interrupted by the Linux system, causing the processing task corresponding to the first event to fail to complete within a certain time. Therefore, in order to prevent the processing task from being interrupted by the operating system during data processing, thereby causing interference, the engineer can remove the factors that may be interrupted by the operating system in the processing task corresponding to the first event in advance.

[0107] Optionally, prior to S303, the method further includes: waking up the processing task corresponding to the first event. Waking up means selecting a thread in the processing task (also known as a process) to wake up, that is, transferring the right to occupy the first computing resource from the Linux scheduler to that thread.

[0108] Optionally, during the processing of the first data according to the first processing function and the first computing resources, the method further includes: if a new event is generated that requires the execution of the next processing task, adding the new event to the event queue. That is, if a new event is generated that does not require the execution of the next processing task (for example, the new event is still generated by the current processing task), then the new event is not added to the event queue, and the current processing task can directly process the new event.

[0109] Optionally, after processing the data corresponding to the processing task based on the processing task corresponding to the first event and the first computing resource, the method further includes: setting the first computing resource to an unoccupied state so that the subsequent event scheduler can schedule the computing resource.

[0110] It should be noted that S303 can be... Figure 1 The processing tasks (e.g., sensor processing tasks, perception processing tasks, fusion processing tasks, and control processing tasks) in the architecture shown are executed.

[0111] It should be noted that the execution order of S301 and S302 is not limited in this embodiment.

[0112] To make the above process clearer, the following will be explained... Figure 4 The above process is illustrated by example; see [link to example]. Figure 4 The process includes:

[0113] S401. Select an event from the event queue as the first event (e.g., event 1).

[0114] S401 can be understood by referring to S301 above, and will not be repeated here.

[0115] S402. Select a computing resource from the unoccupied computing resources as the first computing resource (e.g., computing resource 1).

[0116] S402 can be understood by referring to S302 above, and will not be repeated here.

[0117] S403. Find the corresponding processing task for an event in the correspondence between events and processing tasks (for example, event 1 corresponds to processing task 1).

[0118] Since the task being processed is a process, the process corresponding to the first event has also been determined.

[0119] In the specific implementation of S403, if the processing task (also known as a process) includes multiple threads, the event scheduler needs to determine one thread from among the multiple threads and notify the Linux scheduler to wake up that thread.

[0120] Before the thread in the processing task corresponding to the first event has completed processing the required data, the event scheduler will not notify the Linux scheduler to wake up other threads during the scheduling process, thus eliminating the influence of the Linux scheduler.

[0121] Although the Linux scheduler uses the CFS scheduling strategy, in this application, the Linux scheduler can only select one thread each time it schedules, thus making the Linux scheduler act as an executor of transitional computing resources. In this case, the internal scheduling strategy of the Linux scheduler does not need to be changed, thereby simplifying the implementation of the technical effect of this application.

[0122] S404. Select a data from the received data queue from the upstream as the first data (e.g., data 1).

[0123] In the specific implementation of S404, the method includes: reading a data queue organized by data sent from upstream from the memory, and then selecting a data from the data queue as the first data.

[0124] S405. Find the processing function (e.g., processing function 1) corresponding to the first data in the correspondence between data and processing functions.

[0125] The correspondence between data and processing functions can be found in the corresponding descriptions above, and will not be repeated here.

[0126] S406. Process the first data on the first computing resource according to the processing function corresponding to the first data.

[0127] In the S406 process, if a new event is generated that requires the next processing task to be executed, the new event is added to the event queue.

[0128] S407. Select one data point from the data queue as the second data point (e.g., data 2).

[0129] Please refer to S404 above for further understanding; it will not be repeated here. It should be noted that if the task requires processing only one piece of data, then after processing the first piece of data, there is no need to select a second piece of data for processing.

[0130] S408. Find the processing function (e.g., processing function 2) corresponding to the second data in the correspondence between data and processing functions.

[0131] Please refer to S405 above for further understanding; it will not be repeated here.

[0132] S409. Process the second data on the first computing resource according to the processing function corresponding to the second data.

[0133] In the S409 process, if a new event is generated that requires the next processing task to be executed, the new event is added to the event queue.

[0134] Subsequently, other data can be selected from the data queue for processing until all the required data has been processed. Then, the event scheduler is notified to set the first computing resource to an unoccupied state.

[0135] In this scenario, subsequent event scheduling can select the first computing resource, promoting a virtuous cycle of resource utilization.

[0136] It should be noted that S401-S402 can be executed by the event scheduler, S403 can be executed by both the event scheduler and the Linux scheduler, and S404, S405, S407 and S408 can be executed by the secondary scheduler.

[0137] In the method provided in this application embodiment, before scheduling an event, the event scheduler selects a computing resource from unoccupied computing resources. This ensures that a processing task occupies a computing resource not occupied by other processing tasks, avoiding multiple processing tasks competing for the same computing resource and thus preventing mutual interference between events. This allows the processing task corresponding to the event to complete the processing of the required data within a defined time, and also ensures that the end-to-end latency is deterministic, thereby improving the determinism of the entire autonomous driving system. Furthermore, it eliminates the need for static orchestration of processing tasks, significantly improving the development efficiency of operators.

[0138] It should be noted that the execution order of S401 and S402 is not limited in this embodiment.

[0139] To make the embodiments of this application clearer, a specific process is described below (see details). Figure 7 The method provided in the above embodiments is illustrated by way of example. This method can be applied to... Figure 5 and Figure 6 In the architecture shown. Figure 5 and Figure 6 The difference lies in the location of the event scheduler. Figure 5 The architecture shown places the event scheduler within the software operating system. Figure 6 The architecture shown places the event scheduler within hardware resources. When the event scheduler is a hardware resource, the time to schedule events can be shortened, and it can directly receive events generated by other hardware resources without going through the software operating system, further reducing the scheduling time. It also avoids interference from the software operating system on processing tasks and improves the determinism of event scheduling.

[0140] Figure 5 and Figure 6 The architecture shown includes hardware resources, event queues, event schedulers, Linux schedulers, and processing tasks (i.e., processes, which include threads).

[0141] Hardware resources include hardware I / O resources and computing resources. Hardware I / O resources are used to communicate with devices outside the autonomous driving system, such as with Ethernet interfaces (ETH) or Controller Area Networks (CAN), and generate I / O events upon receiving external data. Computing resources include CPU and NPU resources, which are used to process events and the data contained in the corresponding processing tasks, generating new events during or after data processing. Furthermore, the computing resources used by the autonomous driving system can be pre-reserved by engineers. To improve the determinism of the autonomous driving system, these pre-reserved computing resources can be used exclusively by the autonomous driving system.

[0142] The event queue contains all or some events sorted by priority from low to high or high to low. Because the event queue has limited memory, it may not be able to hold all events. Therefore, a strategy can be used to place some events in the event queue. This strategy can be configured by engineers; for example, placing events according to priority, with higher-priority events placed first in the event queue.

[0143] The event scheduler is used to select unused computing resources, as well as to view events in the event queue and select events from the event queue.

[0144] A task (also called a process) consists of one or more threads. Each thread executes the functions of the secondary scheduler and the processing functions. In other words, a thread can perform two parts of the functionality: one part executes the functions of the secondary scheduler, and the other part executes the functions of the processing functions.

[0145] The Linux scheduler is used to wake up threads that are processing tasks.

[0146] See Figure 7 ,include:

[0147] S701, the event scheduler places events generated by hardware resources and events generated by processing tasks into the event queue according to priority.

[0148] S702, The event scheduler checks if there are any events in the event queue.

[0149] If present, execute S703. If not, terminate the process.

[0150] S703, the event scheduler checks for any unused CPU computing resources.

[0151] If present, execute S704. If not, terminate the process.

[0152] S704, the event scheduler selects the first computing resource from the computing resources of the unoccupied CPUs and sets the first computing resource to an occupied state.

[0153] Please refer to S302 above for further understanding; it will not be repeated here.

[0154] S705. The event scheduler selects the highest priority event from the event queue as the first event and determines the processing task corresponding to the first event.

[0155] Please refer to S301 above for further understanding; it will not be repeated here.

[0156] S706 The event scheduler determines one of the threads in one or more threads of the processing task (also known as the process) corresponding to the first event as the first thread, and notifies the Linux scheduler to wake up the first thread.

[0157] Please refer to S403 above for further understanding; it will not be repeated here.

[0158] S707, the secondary scheduler selects a piece of data from the data queue corresponding to the processing task of the first event as the first piece of data.

[0159] Please refer to S404 above for further understanding; it will not be repeated here.

[0160] S708, the secondary scheduler determines the processing function corresponding to the first data based on the first data.

[0161] Please refer to S405 above for further understanding; it will not be repeated here.

[0162] S709. The first thread processes the first data on the first computing resource according to the processing function corresponding to the first data.

[0163] In the process of processing the first data, if a new event is generated that requires the next processing task to be executed, the generated new event will be placed in the event queue.

[0164] S710, the secondary scheduler selects one piece of data from the data queue corresponding to the processing task of the first event as the second piece of data.

[0165] Please refer to S407 above for further understanding; it will not be repeated here.

[0166] S711, the secondary scheduler determines the processing function corresponding to the first data based on the second data.

[0167] Please refer to S408 above for further understanding; it will not be repeated here.

[0168] S712, The first thread processes the second data on the first computing resource according to the processing function corresponding to the second data.

[0169] During the processing of the second data, if a new event is generated that requires the next processing task to execute, the new event is placed in the event queue. Subsequent processing can continue by selecting other data from the data queue until all required data has been processed. However, if the processing task only requires processing one piece of data, after processing the first piece of data, there is no need to select the second piece of data for processing.

[0170] S713, the secondary scheduler sends a message indicating that the processing task corresponding to the first event has been completed to the event scheduler. Correspondingly, the event scheduler receives the message indicating that the processing task corresponding to the first event has been completed.

[0171] The message indicating that the processing task corresponding to the first event has been completed is used to transfer the right to occupy the first computing resource from the first thread back to the event scheduler.

[0172] S714, The event scheduler sets the first computing resource to an unoccupied state.

[0173] The foregoing primarily describes the solutions of the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the event processing apparatus includes at least one of the hardware structures and software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0174] This application embodiment can divide the event processing device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0175] For example, Figure 8 The event processing apparatus (denoted as event processing apparatus 80) involved in the above embodiments is shown.

[0176] A possible structural diagram shows that the event processing device 80 includes a processing unit 801 and a storage unit 802.

[0177] The processing unit 801 is used to control and manage the actions of the event processing device. For example, the processing unit 801 is used to execute... Figure 3 301-303 in the middle, Figure 4 401-409 in the middle, Figure 7 The events performed by the event processing device in processes 701-714 and / or other processes described in the embodiments of this application. Storage unit 802 is used to store the program code and data of the event processing device.

[0178] Optionally, the event processing apparatus 80 further includes a communication unit 803. The processing unit 801 can communicate with other network entities through the communication unit 803. For example, the communication unit 803 can be a hardware I / O resource that can communicate with devices outside the event processing apparatus, such as with ETH or CAN.

[0179] For example, the event processing device 80 can be a device, a chip, or a chip system.

[0180] When the event processing device 80 is a single device, the processing unit 801 can be a processor; the communication unit 802 can be a communication interface, a transceiver, or an input interface and / or an output interface. Optionally, the transceiver can be a transceiver circuit. Optionally, the input interface can be an input circuit, and the output interface can be an output circuit.

[0181] When the event processing device 80 is a chip or chip system, the communication unit 802 may be a communication interface, input interface and / or output interface, interface circuit, output circuit, input circuit, pin, or related circuit on the chip or chip system. The processing unit 801 may be a processor, processing circuit, or logic circuit.

[0182] Figure 8 If the integrated units in the process are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0183] This application also provides a hardware structure diagram of an event processing device, see [link]. Figure 9 The event handling device includes a processor 901, and optionally, a memory 902 connected to the processor 901.

[0184] Processor 901 can be a CPU, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program according to the present application. Processor 901 may also include multiple CPUs, and processor 901 can be a single-core processor or a multi-core processor. Here, processor can refer to one or more devices, circuits, or processing cores used to process data (e.g., computer program instructions).

[0185] The memory 902 can be a ROM or other type of static storage device capable of storing static information and instructions, RAM or other type of dynamic storage device capable of storing information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer. This application embodiment does not impose any limitations on this. The memory 902 can exist independently (in this case, the memory 902 can be located outside or inside the event processing device) or can be integrated with the processor 901. The memory 902 may contain computer program code. The processor 901 is used to execute the computer program code stored in the memory 902 to implement the method provided in this application embodiment.

[0186] The processor 901 is used to control and manage the actions of the event processing device; for example, the processor 901 is used to execute... Figure 3 301-303 in the middle, Figure 4 401-409 in the middle, Figure 7 The events performed by the event processing device in processes 701-714 and / or other processes described in the embodiments of this application. The memory 902 is used to store the program code and data of the event processing device.

[0187] Optionally, the event processing apparatus may also include a transceiver, or the processor 901 may include logic circuitry and input and / or output interfaces. The processor 901 may communicate with other network entities via the transceiver, or via the input and / or output interfaces. For example, the transceiver, or the input and / or output interfaces, may be hardware I / O resources that can communicate with devices outside the event processing apparatus, such as with ETH or CAN.

[0188] In implementation, each step of the method provided in this embodiment can be completed by integrated logic circuits in the processor or by instructions in software form. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.

[0189] This application also provides a computer-readable storage medium including computer-executable instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0190] This application also provides a computer program product containing computer-executable instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0191] This application also provides an event processing apparatus, including a processor and an interface. The processor is coupled to a memory through the interface. When the processor executes a computer program or computer-executable instructions in the memory, any of the methods provided in the above embodiments are executed.

[0192] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs).

[0193] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0194] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the scope of protection of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the scope of protection of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and modifications.

Claims

1. An event processing method, characterized by, The method comprises: selecting a first event from at least one event; selecting a first computing resource from at least one computing resource that is not occupied; setting the first computing resource to an occupied state; determining a thread as a first thread in one or more threads in a processing task corresponding to the first event, and notifying a Linux scheduler to wake up the first thread; processing data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource; setting the first computing resource to an unoccupied state; before the first thread completes processing of the data corresponding to the processing task, the Linux scheduler is not notified to wake up other threads in the scheduling process; wherein the processing of the data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource comprises: selecting first data from a data queue corresponding to the processing task; determining a first processing function according to the first data; the first thread processes the first data according to the first processing function and the first computing resource.

2. The method of claim 1, wherein, The processing of the data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource further comprises: selecting second data from the data queue corresponding to the processing task; determining a second processing function according to the second data; processing the second data according to the second processing function and the first computing resource.

3. The method of claim 2, wherein, During the processing of the first data according to the first processing function and the first computing resource, the method further comprises: if a new event needs to be executed by a next processing task, adding the new event to an event queue.

4. The method according to any one of claims 1 to 3, characterized in that, The computing resource comprises a computing resource of a central processing unit (CPU).

5. The method according to any one of claims 1 to 4, characterized in that, The selecting of the first event from at least one event comprises: selecting an event with the highest priority from an event queue as the first event.

6. An event processing apparatus characterized by comprising: The method comprises: a processing unit; the processing unit is configured to: select a first event from at least one event; select a first computing resource from at least one computing resource that is not occupied; set the first computing resource to an occupied state; determine a thread as a first thread in one or more threads in a processing task corresponding to the first event, and notify a Linux scheduler to wake up the first thread; process data corresponding to the processing task according to the processing task corresponding to the first event and the first computing resource; set the first computing resource to an unoccupied state; before the first thread completes processing of the data corresponding to the processing task, the Linux scheduler is not notified to wake up other threads in the scheduling process; wherein the processing unit is specifically configured to: select first data from a data queue corresponding to the processing task; determine a first processing function according to the first data; the first thread processes the first data according to the first processing function and the first computing resource.

7. The apparatus of claim 6, wherein, The processing unit is specifically configured to: selecting a second data from a data queue corresponding to the processing task; determining a second processing function according to the second data; processing the second data according to the second processing function and the first computing resource.

8. The apparatus of claim 7, wherein, In the process that the processing unit processes the first data according to the first processing function and the first computing resource, the processing unit is further configured to: if a new event needs to be executed by a next processing task, adding the new event to the event queue.

9. The device according to any of claims 6-8, characterized in that The computing resource includes a computing resource of a central processing unit (CPU).

10. The device according to any of claims 6-9, characterized in that The processing unit is specifically configured to: select an event with a highest priority from the event queue as the first event.

11. An event processing apparatus, characterized by comprising: comprising: a processor coupled with a memory; the memory is configured to store a computer program; the processor is configured to execute the computer program stored in the memory, so that the event processing device executes the method in any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, comprising a computer program, when the computer program runs on a computer, so that the computer executes the method in any one of claims 1-5.

13. A computer program product, characterised in that, comprising a computer program, when the computer program runs on a computer, so that the computer executes the method in any one of claims 1-5.

Citation Information

Patent Citations

  • CPU resource distribution method and device under simultaneous running of multiple program examples

    CN107479976A

  • Centralized scheduling system using event loop for operating autonomous driving vehicles

    CN109213143A