The present invention relates to a vehicle control apparatus.
Currently, various types of vehicle control apparatuses (electronic control units) equipped with multicore microcomputers are being developed. A current multicore ECU is basically designed to fixedly allocate tasks to be executed by each core in advance. For products with low real-time characteristics, such as personal computers, allocation of tasks is dynamically changed during execution of software (after the ECU is fully activated). However, for products with high real-time characteristic, such as vehicle control apparatuses, it is difficult to dynamically allocate tasks from the viewpoint of execution load.
A vehicle control apparatus in PTL 1 below prepares combination patterns of task processing sequence in advance as task tables and dynamically allocates tasks according to the situation by switching the combination patterns.
PTL 1: JP 2013-199180 A
In the method described in PTL 1, task allocation can only be selected from previously designed combination patterns. If both the number of tasks and the number of cores are increased in the future, the number of combinations increases exponentially, causing a difficulty for the designer to evaluate all combinations in advance and design appropriate combination patterns. On the other hand, in a product with high real-time characteristic, such as a vehicle control apparatus, it is difficult to dynamically change the task allocation, because the processing load of the task scheduling function is often unacceptable.
The present invention has been made to solve the above problems, and it is an object of the present invention to provide a vehicle control apparatus including a plurality of arithmetic devices, which changes a task to be allocated to each arithmetic device, while preventing an increase of execution load.
A vehicle control apparatus according to the present invention includes a task table that defines tasks to be executed by each arithmetic device, and updates the task table when the vehicle control apparatus is activated or terminated.
According to the vehicle control apparatus of the present invention, it is possible to optimize allocation of tasks to be executed by each arithmetic device, while preventing an increase of calculation load.
The vehicle control system 2 is a system that controls individual elements of the vehicle 1, and is constituted by, for example, an on-board network (e.g., a controller area network (CAN), a CAN with flexible data-rate (CANFD), or Ethernet (registered trademark)), and a controller such as an electronic control unit (ECU). The vehicle control system 4 is a system configured on an on-board network different from the vehicle control system 2.
The communication device 3 performs wireless communication (e.g., communication using cellular phones, communication using wireless LAN or WAN, or the like) with the outside of the vehicle control system 2, and acquires and transmits information on the outside world (infrastructure or other vehicles) or the own vehicle. The communication device 3 further includes a diagnostic terminal (OBD), an Ethernet terminal, an external recording medium (e.g., a USB memory, an SD card, or the like) terminal, and communicates with the vehicle control system 2 via wired connection.
The drive device 5 is a device such as an actuator that drives machines and electric devices (e.g., an engine, transmission, wheels, brakes, a steering device, and the like) for controlling movement of the vehicle under the control of the vehicle control system 2.
The recognition device 6 is constituted by (a) an external sensor, such as a camera, a radar, an LIDAR, an ultrasonic sensor, or the like, which acquires information input from the outside world to generate external recognition information, and (b) a mechanical sensor (e.g., acceleration, wheel speed, a global positioning system (GPS), or the like) that recognizes the state (e.g., kinetic state, positional information, or the like) of the vehicle 1.
The output device 7 is a device such as a liquid crystal display, an alert lamp, a speaker, or the like, which is connected wired or wirelessly to the vehicle control system 2 to receive data transmitted from the vehicle control system 2, and displays or outputs necessary information such as message information (e.g., video or sound). The input device 8 is a device such as a steering wheel, pedals, buttons, levers, or a touch panel which generates an input signal that is entered by a user as an operational intention or instruction to the vehicle control system 2. The notification device 9 is a device, such as lamps, LEDs, speakers, or the like, with which the vehicle 1 notifies the outside world of the state or the like of the vehicle 1.
The task execution unit 2211 executes a task. The task, as used herein, is referred to as processing in which the control arithmetic operation executed by the control program is divided into certain units. The task execution unit 2211 repeats each task, for example, periodically, or executes the task upon events such as sensor input or user operation. Priority is assigned to each task, and when a plurality of tasks are executable simultaneously in the same processor core, the processor core executes the task with the highest priority.
The processing load measurement unit 2212 measures a processing load when the task execution unit 2211 executes the task and stores the result in the data flash 227 as measured data 2271. The processing load, as used herein, is referred to as, for example, task execution time per unit time. If the execution time of the task in 1 second is 500 mm, the processing load is 50%. The processing load measurement unit 2212 measures the processing load every time the task execution unit 2211 executes a task once.
The task table update unit 2213 acquires the measured data 2271 and updates the task table 2272 so that the processing load is leveled among the processor cores. The task table 2272 is a data table that defines a task to be executed by each processor core. A specific example of the task table 2272 will be described later. The task table update unit 2213 updates the task table 2272 when the ECU 22 is activated or terminated. Details on activation and termination will be described later.
When a difference between the processing loads of the processor cores exceeds a threshold value, the task table update unit 2213 can judge that the task table 2272 needs to be updated. In this case, the task table 2272 may be updated so that the difference between the processing loads of the processor cores does not exceed a threshold (or is desirably minimized). If it does not exceed the threshold value, there is no need to update the task table 2272.
Regardless of whether the task table 2272 has the configuration of
The processor 221 reads the control program from the ROM 224 and develops the control program on the RAM 225 (S701). The processor 221 executes the control program to execute initialization processing (S702). The initialization processing can be implemented as part of the control program.
The processor 221 determines whether the ECU 22 is activated in a normal mode or a maintenance mode. If activated in the maintenance mode, steps S704 to S706 are executed. If activated in the normal mode, steps S707 to S709 are executed. Which activation mode the ECU 22 has been started in is determined in accordance with the fact that, for example, a signal that gives an instruction of activation in the maintenance mode is input from the communication device 3.
The processor 221 initializes the operating system (OS) of the ECU 22 (S704). The processor 221 initializes the application defined by the control program (S705). The processor 221 starts periodic processing defined by the control program (S706).
The processor 221 initializes the operating system (OS) of the ECU 22 (S707). The processor 221 initializes the application defined by the control program (S708). The processor 221 waits until an external input such as a maintenance command is input via the communication device 3 (S709).
The task table update unit 2213 updates the task table 2272 at any point of time between the start of step S701 and the end of step S704 (or S707) (i.e., during activation processing in which the ECU 22 is activated). As a result, task allocation is performed before the control processing of the ECU 22 starts, allowing the tasks to be relocated without affecting the real-time characteristic of the control processing.
The task table update unit 2213 updates the task table 2272 at any point of time between the start of step S801 and the end of step S803 (i.e., during the termination processing in which the ECU 22 is terminated). As a result, task allocation is performed at the point in time after the control processing of the ECU 22 is completed, so that the tasks can be relocated without affecting the real-time characteristic of the control processing. The task table update unit 2213 may update the task table 2272 only when the ECU 22 is activated or terminated, or when the ECU 22 is both activated and terminated.
In a case where the task table 2272 also defines the fixed or relocatable task allocation, the possibility of malfunctioning due to the change of the task allocation can decrease by updating the task allocation according to the definition. Furthermore, when priority is also defined, the task allocation can be updated by considering the priority.
The task table 2272 in the second embodiment defines execution time constraint as a task attribute. The task table update unit 2213 allocates a task to each processor core so that the execution time constraint can be satisfied. Examples of the execution time constraint include the following ones.
The maximum processing time constraint (the first row in
The minimum processing time constraint (the first row in
The activation start time constraint (second line in
The task table update unit 2213 can update the task table 2272 by, for example, the following procedure. The task table update unit 2213 obtains a task allocation by which the processing loads are leveled most among the processor cores, and determines whether the execution time constraint of each task is satisfied with the obtained task allocation. At this time, the processing load relating to the communication between the processor cores may be held in advance and taken into consideration in determining whether the constraint is satisfied. If the execution time constraint is not satisfied, similar determination is repeated for sub-optimal task allocation. Then, the task allocation satisfying all execution time constraints is, when obtained, written to the task table 2272.
Since the ECU 22 according to the second embodiment changes the task allocation so as to satisfy the execution time constraint defined by the task table 2272, it is possible to prevent the control from becoming unstable due to unobserved execution time constraint. In particular, the control devices, such as the engine or the brake, that need to have real-time characteristic can level the processing loads among the processor cores, while satisfying the time constraint.
There is a case where one control function is implemented by executing a plurality of tasks in a predetermined order. Such tasks do not work as a control function if the execution order changes, so that it is necessary to maintain the execution order when changing the task allocation. Therefore, in the third embodiment, the execution order is defined as the constraint condition in the task table 2272 when the task execution order is fixed in advance.
In the example illustrated in
Since the ECU 22 according to the third embodiment changes the task allocation while maintaining the task execution order defined in advance for each control function, it is possible to level the processing loads without searching all the combinations of the task allocations, while keeping the execution order constraint.
The external storage device may be disposed inside the vehicle control system 2, or may be disposed outside the vehicle 1. In any case, it is desirable that a plurality of ECUs 22 can access the external storage device. Using the result of measuring the processing load of each of the plurality of ECUs 22, the task allocation can be optimized.
The task table input unit 2214 receives, for example, a task table described by the user and stores the task table in the data flash 227 as a provisional task table 2273. For example, the user can input the task table via the communication device 3 or by network transmission via the on-vehicle network provided in the vehicle control system 2. Other suitable means may also be used. The user can input and save a plurality of provisional task tables 2273.
The task table designate unit 2215 receives data designating which of the provisional task tables 2273 is adopted as the task table 2272, and reflects the result as the task table 2272. For example, the user can input an instruction to the task table designate unit 2215 via the communication device 3 or by network transmission via the on-vehicle network of the vehicle control system 2.
The ECU 22 according to the fifth embodiment can use the task allocation which is desired by the user, and can flexibly adapt to various needs of the user. Updating the task table 2272 by the task table update unit 2213 may also be performed. For example, the task table 2272 created by the task table update unit 2213 can be used when no task table is input or designated by the user. Alternatively, the user may designate the task table 2272 itself created by the task table update unit 2213.
The present invention is not limited to the embodiments described above, and may also include various modifications. For example, the embodiments described above have been given in detail to facilitate the understanding of the present invention, and are not necessarily limited to those including all constituent components described above. Further, a portion of the structure of a certain embodiment can be partially replaced by a portion of other embodiments, or the portions of other embodiments can be added to the structure of a certain embodiment. Further, some of the constituent components of each embodiment may be added, deleted, or substituted for by other constituent components.
The above embodiments have described leveling of the processing loads among the processor cores, but the present invention can also be applied to the leveling of the processing loads among other arithmetic devices. For example, the leveling may be performed among processors or the ECUs.
In the above embodiments, the bus type network is illustrated and described in
In the above embodiment, measurement of the task execution time as the processing load has been described. More specifically, for example, the worst execution time may be measured as the processing load. The tasks, therefore, can be re-allocated, while guaranteeing that each task is ended within the scheduled execution period.
Number | Date | Country | Kind |
---|---|---|---|
2016-205111 | Oct 2016 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2017/035428 | 9/29/2017 | WO | 00 |