The present invention relates to a vehicle control apparatus.
Built-in control devices, which control an object to be controlled by a built-in software, are used in technical fields such as automobiles, elevators and construction machines. The built-in software is advantageous in terms that it is possible to implement flexible and advanced control as compared to the conventional control method employing a mechanical mechanism and an electric circuit.
Recently, such built-in control devices, for example, vehicle control apparatuses have rapidly progressed to have higher performances, and accordingly, an increase in computation amount of a central processing unit (CPU) has been a problem. In order to solve this, there has been an effort to improve the computation amount per unit time by achieving a multi-core configuration or a multi-CPU configuration in which the number of CPU cores is increased.
However, there are a lot of problems in efficient execution of existing software, developed on the premise of a single-core processor, on a multi-core processor. In particular, it is a big problem to establish a task allocation method of parallelizing vehicle control software having a strict constraint on an execution order of a program and allocating the software to a plurality of cores.
PTL 1, which will be described later, describes a technique of efficiently allocating existing vehicle control software that have been developed for a single-core processor to a plurality of cores. In the same literature, an execution order of an existing program is secured by allocating a task to a core in a standby state for processing based on a dependency of the software and a progress status.
PTL 2, which will be described later, describes a technique of improving a real-time performance than the related art by securing a possibility that a task can be executed even when the task which requires a high CPU utilization rate occurs. In the same literature, a CPU utilization rate, which is required for allowing a task to satisfy a time constraint, is calculated based on the time constraint imposed on the task and a required amount of calculation of a real-time task, and the task is allocated such that the calculated CPU utilization, rate is maximized.
PTL 1: Japanese Patent Application Laid-Open No. 2012-108576
PTL 2: Japanese Patent Application Laid-Open No. 2010-277171
There is no consideration relating to handling the software having a plurality of control cycles in the above-described technique of PTL 1. For example, programs having a plurality of control cycles coexist (that is, there are a plurality of the programs to be executed. in each different execution cycle) in the software that controls a single system in many cases in the case of the vehicle control software. Since the technique described in PTL 1 does not consider a difference depending on the control cycle, there is a possibility that execution of software having a short control cycle, which is planned to be processed with priority, is delayed over a deadline.
There is no consideration on a dependency of a program in the above-described technique of PTL 2. For example, it is necessary to allocate the task in consideration of the dependency between the programs such as a request for strict satisfaction of a program execution order constraint from acquisition of sensor value information to calculation of a control amount of an actuator in a vehicle control software. Since the technique described in PTL 2 assumes the task having no execution order constraint, it is difficult to properly allocate the software, which has the execution order constraint such as the vehicle control software, to multi-cores.
The present invention has been made in view of the above-described problems, and an object thereof is to provide a vehicle control apparatus that is capable of allocating a program to multi-cores so as to meet a deadline even when two or more control cycles coexist in software.
A vehicle control apparatus according to the present invention allocates each task to processor cores in consideration of an execution order of the task, an execution cycle of the task, and a communication cost between the processor cores.
According to a vehicle control apparatus of the present invention, it is possible to allocate the tasks to the processor cores While meeting each deadline of the tasks even in the case of using a control software in which a plurality of control cycles coexist and the dependency between the tasks is present.
<Task Allocation in Multi-Cores>
Hereinafter, a description will be given regarding a problem at the time of allocating a task to each processor core in a multi-core processor, first, in order to facilitate understanding of the present invention, and then, an embodiment of the present invention will be described.
<Embodiment of Present Invention>
The execution control parameter 101 describes information relating to hardware and software which are required for control of a vehicle. To be specific, the execution control parameter 101 describes a multi-core configuration, a bus wiring, a sensor value, a control cycle parameter 1011 of a control software (task), an order of priorities, a deadline, an execution order parameter 1012 of the task, a communication cost parameter 1013 between the cores, and the like.
The control cycle parameter 1011 describes a control cycle of a program (task) to be executed by the processor. The execution order parameter 1012 describes an execution order of the program to be executed by the processor. The execution order described herein includes the dependency between the tasks that has been described in
The execution log 201 is a log that describes a partial or whole result of computation performed by the cores 102 to 104, and includes a control cycle log 202, an execution order log 203, and a communication cost log 204. The control cycle log 202, the execution order log 203, and the communication cost log 204 correspond to the control cycle parameter 1011, the execution order parameter 1012, and the communication cost parameter 1013, respectively, and describe each log relating to the control cycle, the execution order, and a communication cost when each of the processor cores actually executes the task.
(
The weighting unit 1051 starts this flowchart when acquiring the execution control parameter 101 (S10511). The weighting unit 1051 acquires the dependency (the execution control parameter 101) between the tasks to be used for weighting (S10512).
(
The weighting unit 1051 determines a weight with respect to the communication cost based on each control cycle of a previous task and a subsequent task having the dependency therebetween which is acquired in Step S10512 (S10513). A method of considering the weighting will be described later. The weighting unit 1051 performs weighting on the communication cost using the weight, which is determined in Step S10513 based on the dependency acquired in Step 510512, and calculates the weighted communication cost 1052.
(
The weighting unit 1051 confirms whether the weighting has been completed with respect to the entire dependency among the tasks described in the execution control parameter 101. In the case of not being completed, the same process is repeated by retuning to Step S10512. In the case of being completed, this flowchart is ended.
In the example illustrated in
(
The task assignment unit 1053 starts this flowchart when the weighting unit 1051 ends the calculation of the weighted communication cost 1052 (S10531). The task assignment unit 1053 lists all allocable tasks (S10532). The allocable task indicates a task that can be subsequently allocated to the processor core in accordance with the dependency between the tasks described in the execution order parameter 1012.
(
The task assignment unit 1053 allocates a task, which has a highest weighted communication cost among all the allocable tasks, to the processor core. When a task whose communication cost is zero and a task whose communication cost is not zero coexist among the allocable tasks, these tasks are allocated to different processor cores. It is because the task whose communication cost is zero is allocated to the same processor core as that of the immediately previous task, and the task whose communication cost is not zero is allocated to a different processor core from the immediately previous task. In this case, a task having a highest weighted communication cost among the tasks each of which communication cost is not zero may be preferentially allocated while allocating the task whose communication cost is zero to the different processor core in parallel. When there are a plurality of the tasks each of which communication cost is zero, a task having a greatest weight among them may be preferentially allocated.
(
The task assignment unit 1053 conforms whether the entire allocable task has been allocated to the processor core. When there remains an allocated task, the same process is repeated by returning to Step S10532. When the entire task has been allocated, this flowchart is ended.
(
The task assignment unit 1053 may execute the task assignment, described in this flowchart, for example, only from the start of the vehicle control apparatus 1 until the processor starts execution of the task, may acquiring the execution control parameter 101 at a suitable time (for example, when a processor load is relatively small) after the processor starts the execution of the task and reallocate the tasks, or may execute the both in a combined manner.
When a record to a predetermined time from a specific time (for example, time at which the error occurs) needs to be stored, the processor of the vehicle control apparatus 1 repetitively records the execution log 201 in a specific storage area of the storage device 2. That is, when there is no free space of the storage area, the processor overwrites the oldest log in the storage area sequentially with a new log. Alternatively, when a record for a certain time from a specific time needs to be stored, the execution log 201 is recorded in the specific storage area of the storage device 2, and output of the log is stopped at a point in time when reaching a maximum limit of the free space of the storage area. When the free space of the storage device 2 is sufficient, the entire execution log 201 may be simply recorded without using the above-described methods.
<Conclusion of Present Invention>
As above, the vehicle control apparatus 1 according to the present invention allocates each of the tasks to the processor core while satisfying the constraints relating to the dependencies among the tasks and the execution cycles of each of the tasks in accordance with each description of the control cycle parameter 1011 and the execution order parameter 1012. Accordingly, it is possible to efficiently execute the task while satisfying the constraints even in the vehicle control software with the execution order constraint and the deadline constraint.
In addition, when the subsequent task having the dependency between the tasks is the short-cyclic task, the vehicle control apparatus 1 according to the present invention preferentially allocates this task to the processor core. Accordingly, the task having the Short control cycle can be reliably completed by the deadline.
The present invention is not limited to the above-described embodiment, and may include various modification examples. The above-described embodiment has been described in detail in order to facilitate the understanding of the present invention, and is not necessarily limited to one including the entire configuration described above. For example, it is also possible to use a method according to the present invention in a built-in system that performs electronic control of other household equipment, industrial equipment, medical equipment, and the like although the configuration example of the vehicle control apparatus has been described in the above-described embodiment.
Although the example in which there are the two control cycles including 5 ms and 10 ms has been given in the above-described embodiment, these numeric values are illustrative, and the present invention is not limited thereto. In addition, it is also possible to use the present invention When three or more types of control cycles coexist. For example, although the combination of the previous and subsequent tasks has been illustrated in
Although it is assumed that the control cycle designated by the control cycle parameter 1011 is satisfied in the above-described embodiment, there is a task, among the tasks having a low priority, which does not have any trouble upon operation even when the control cycle thereof is not satisfied a certain number of times. It is not necessarily desirable to allocate such a task based only on the control cycle. Thus, each priority of the tasks may be described along with the control cycle parameter 1011, and the task allocation unit 105 may set the number of times, which is acceptable even if the control cycle is not satisfied (not counted as an error), to be larger in a task having a lower priority.
The configurations, the functions, the processing units, the processing means, and the like may be realized by hardware such as by designing a part of the components with an integrated circuit. A processor may interpret and execute programs for realizing the functions to realize the configurations, the functions, and the like, by software. Information, such as programs, tables, and files, for realizing the respective functions can be stored in a recording device, such as a memory, a hard disk, and a solid state drive (SSD), or in a recording medium, such as an IC card, an SD card, and a DVD.
1 vehicle control apparatus
101 execution control parameter
1011 control cycle parameter
1012 execution order parameter
1013 communication cost parameter
102 to 104 processor core
105 task allocation unit
1051 weighting unit
1052 weighted communication cost
1053 task assignment unit
2 storage device
201 execution log
202 control cycle log
202 execution order log
203 communication cost log
Number | Date | Country | Kind |
---|---|---|---|
2014-108387 | May 2014 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2015/062169 | 4/22/2015 | WO | 00 |