Electronic control device, vehicle control system, and task control method
Patent Information
- Application Number
- JP2022153400
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-09-27
AI Technical Summary
Existing vehicle control software scheduling techniques require frequent design and verification when updated, leading to high costs and potential disruptions in data communication and task processing timing.
An electronic control device with a time slot allocation mechanism that predetermines task execution timing, allowing for the addition of new tasks without affecting existing tasks, maintaining data flow and real-time operation by using middleware to manage task scheduling and data communication.
Ensures continuous improvement of vehicle control software without the need for redesign or verification, maintaining data communication integrity and real-time performance.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an electronic control device and a vehicle control system. [Background technology]
[0002] As vehicle control, such as autonomous driving, becomes more advanced and complex, continuous improvements to vehicle control software are required. Vehicle control software is required to operate in real time, and each task must be completed by a certain deadline. However, implementing task scheduling every time the vehicle control software is changed requires costs for design and verification, which is a bottleneck in the continuous improvement of vehicle control software.
[0003] One task scheduling technique is described in JP 2012-181852 A (Patent Document 1). This publication aims to provide a task processing scheduling method that is suitable for use in the field of on-board electronics in particular and can use resources effectively, and describes, as a means for solving this problem, that the task processing includes a step of setting resources required for executing the task and a step of executing the task on the set resources, and that the scheduling includes a step of selecting at least one task level to be processed and a step of sorting tasks based on the task level to be processed according to priority, thereby determining the number of resources required for task processing and the priority of task processing according to the characteristic time of the task.
[0004] Also, according to Japanese Patent Laid-Open No. 2009-80820 (Patent Document 2), the problem is to provide a task switching device that allows for flexibility in program design by facilitating program design for specifying a priority for satisfying the required performance of each task, and as a means for solving this problem, a task switching device that switches execution of tasks assigned to a time slot by switching the time slot in a processor includes a time slot information storage means that stores a pointer that associates a task with a time slot and an assigned time for each of a plurality of first type tasks having an assigned time, a task storage means that stores the priority of each of a plurality of second type tasks having a priority, and a task storage means that stores, for a plurality of time slots within one period, each of the plurality of first type tasks based on the pointer. the plurality of tasks of the second type to one time slot in a multi-task-to-one time slot manner based on the pointer, and assigning the plurality of tasks of the second type to one specific time slot to which no task of the first type is assigned in a multi-task-to-one time slot manner based on the pointer; time slot switching means for switching time slots based on the assigned times specified for each of the plurality of tasks of the first type stored in the time slot information storage means; and task selection means for, when switching to a time slot other than the specific time slot, selecting a task assigned to that time slot, and, when switching to the specific time slot, selecting one task from the plurality of tasks of the second type based on the priority stored in the task storage means. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2012-181852 A [Patent Document 2] JP 2009-80820 A Summary of the Invention [Problem to be solved by the invention]
[0006] According to Patent Document 1, resources can be efficiently used by sorting tasks and allocating resources based on the amount of CPU (Central Processing Unit) resources required to execute each task and characteristic values calculated from the remaining time and priority groups. However, because sorting causes the timing at which each task is processed by the CPU to vary, when the vehicle control software is updated, the processing timing of each task may vary. This may affect data communication between tasks and communication with the outside of the electronic control unit (ECU). Therefore, it is necessary to verify that changing the vehicle control software does not affect communication.
[0007] According to Patent Document 2, time slots are divided into two types, and tasks are assigned to the first time slot on a one-to-one basis, and to the second time slot on a many-to-one basis, which facilitates priority design. However, there is a possibility that the scheduling of the second time slot in particular may change due to changes in the vehicle control software, and so verification is required, as in Patent Document 1.
[0008] In light of the above, the present invention aims to eliminate the need for real-time task scheduling design and verification as much as possible when vehicle control software is changed, and has as its objective the provision of task scheduling that can guarantee that the processing results of existing tasks will not change before and after the vehicle control software is changed. [Means for solving the problem]
[0009] In order to solve the above-mentioned problems, a representative example of the invention disclosed in the present application is as follows: That is, an electronic control device includes a calculation device that performs a predetermined calculation process to periodically execute a task, and a storage device accessible by the calculation device, in which data input and data output timings of the task are predetermined, the electronic control device includes a time slot allocation information storage unit that stores time slot allocation information that specifies the execution timing of the task between the predetermined data input timing and data output timing, a task initiation unit that initiates the task in accordance with the time slot allocation information, and a time slot allocation unit that stores information of a new task in the time slot allocation information storage unit in accordance with the execution timing of a new task, a time slot allocation unit that receives inputs of information about a task that generates data to be input to the new task, data flow request information including information about how many cycles ago, counting from a time slot that starts the new task, the data generated by the task will be used, and time slot request information including information about the number of time slots required to execute the new task, searches for an available time slot for executing the new task based on the time slot allocation information, the data flow request information, and the time slot request information, and updates the time slot allocation information so as to allocate the new task to the available time slot found. Effect of the Invention
[0010] According to one aspect of the present invention, even if a new task is added to an electronic control unit, timing design and verification are not required, and continuous improvement of vehicle control software can be realized. Problems, configurations, and effects other than those described above will become apparent from the following description of the embodiments. [Brief description of the drawings]
[0011] [Figure 1] FIG. 2 is a diagram illustrating a hardware configuration of an electronic control device according to the first embodiment. [Diagram 2]FIG. 2 is a diagram illustrating a software configuration of the electronic control device of the first embodiment. [Diagram 3] FIG. 2 is a diagram illustrating a configuration of middleware according to the first embodiment. [Figure 4] FIG. 11 is a diagram showing time slot allocation information according to the first embodiment; [Diagram 5] 13A and 13B are diagrams illustrating updates of information stored in a time slot allocation information storage unit in the first embodiment. [Figure 6] FIG. 11 is a diagram illustrating data flow request information according to the first embodiment. [Figure 7] 13A and 13B are diagrams illustrating updates of information stored in a data flow request information storage unit according to the first embodiment; [Figure 8] 2 is a diagram illustrating an outline of functions of a communication API providing unit according to the first embodiment; FIG. [Figure 9] FIG. 11 is a diagram illustrating time slot request information according to the first embodiment. [Figure 10] 5 is a flowchart showing a method of searching for a time slot by a time slot allocation unit according to the first embodiment; [Figure 11] FIG. 13 is a diagram showing time slot request information of a new task (fourth task) in the second embodiment. [Figure 12] 13A and 13B are diagrams illustrating updates of time slot allocation information and data flow request information in the second embodiment. [Figure 13] FIG. 13 is a diagram illustrating a hardware configuration of a vehicle control system according to a third embodiment. [Figure 14] FIG. 13 is a diagram illustrating a software configuration of a first electronic control unit and a second electronic control unit according to a third embodiment. [Figure 15] FIG. 13 is a diagram illustrating a configuration of middleware of a first electronic control device and a second electronic control device according to a third embodiment. [Figure 16] FIG. 13 is a diagram showing time slot allocation information (before a new task is added) according to the third embodiment. [Figure 17] FIG. 13 is a diagram illustrating data flow request information (before a new task is added) according to the third embodiment. [Figure 18A]FIG. 13 is a diagram showing data flow request information related to a new task (fourth task) in the third embodiment. [Figure 18B] FIG. 13 is a diagram showing time slot request information for a new task (fourth task) in the third embodiment. [Figure 19] 13 is a flowchart of a time slot search process performed by a time slot allocation unit according to the third embodiment. [Figure 20] FIG. 13 is a diagram showing time slot allocation information (after a new task is added) according to the third embodiment. [Figure 21] FIG. 13 is a diagram illustrating updates of time slot allocation information and data flow request information in the fifth embodiment. [Figure 22] FIG. 23 is a diagram illustrating updates of time slot allocation information and data flow request information in the sixth embodiment. [Figure 23] FIG. 13 is a diagram illustrating a hardware configuration of a vehicle control system according to an eighth embodiment. [Figure 24] FIG. 23 is a diagram illustrating a software configuration of a vehicle control system according to an eighth embodiment. [Diagram 25] FIG. 13 is a diagram illustrating a software configuration of a vehicle control system according to a ninth embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] The present invention relates to an electronic control unit (ECU) and a vehicle control system.
[0013] Preferred embodiments of the present invention will be described below. For simplicity, in the embodiments of the present invention, an example will be described in which the electronic control unit has one CPU and is equipped with a real-time Operating System (OS), but the present invention can also be easily applied to ECUs equipped with multi-core CPUs and non-real-time OSs such as POSIX by multiplexing the time slot allocation information based on the number of installed cores and the number of threads. EXAMPLES
[0014] <Configuration> FIG. 1 is a diagram showing a hardware configuration of an electronic control unit 0 of the first embodiment, and FIG. 2 is a diagram showing a software configuration of the electronic control unit 0 of the present embodiment.
[0015] <Electronic Control Unit 0> The hardware configuration of an electronic control device 0 according to this embodiment will be described with reference to Fig. 1. The electronic control device 0 includes a CPU 1, a memory 2, and a timer 3. The memory 2 stores information such as task codes and parameters. The data stored in the memory 2 is transferred to the CPU 1 for arithmetic processing, and the results of the arithmetic processing are stored in the memory 2. The timer 3 is used to acquire the time inside the electronic control device 0. In this embodiment, the timer 3 has a function of notifying the CPU 1 of the time every 10 milliseconds.
[0016] With reference to FIG. 2, the software configuration of the electronic control device 0 according to the present embodiment will be described. The software is stored in the memory 2 of the electronic control device 0 and executed by the CPU 1. The electronic control device 0 is equipped with an operating system (OS) 100, middleware 101, and a first task 102, a second task 103, and a third task 104 as applications. The OS 100 may be an OS such as a general real-time OS or POSIX. The middleware 101 is started by the OS 100 and starts the first task 102, the second task 103, and the third task 104 as applications. That is, the application is not started directly by the OS 100, but is started by the middleware 101. In addition, data communication between applications is performed via the middleware 101. That is, the application itself is prohibited from arranging a shared memory, and all data communication between applications is performed using an API (Application Programming Interface) provided by the middleware 101.
[0017] <Middleware 101> FIG. 3 is a diagram showing the configuration of the middleware 101 of this embodiment.
[0018] In this embodiment, the middleware 101 includes a communication API providing unit 1011, a time slot allocation unit 1012, a task starting unit 1013, a time slot allocation information storage unit 1015, and a data flow request information storage unit 1016. The function and operation of each unit will be described later.
[0019] <Time slot allocation information 4, task startup section 1013> FIG. 4 is a diagram showing the time slot allocation information 4 of this embodiment.
[0020] The time slot allocation information 4 describes the allocation of tasks and time slots. FIG. 4 shows the time slot allocation information 4 described in a table format, but the time slot allocation information 4 may be shown in other formats. With reference to FIG. 4, the task activation by the task activation unit 1013 using the time slot allocation information 4 will be described. The timer 3 notifies the task activation unit 1013 of the time via the OS 100. When the task activation unit 1013 is notified of the first time from the timer 3, it searches for the first time slot in the time slot allocation information 4 and activates the allocated first task 102. 10 milliseconds later, when the task activation unit 1013 is notified of the second time from the timer 3, it searches for the second time slot in the time slot allocation information 4 and activates the allocated second task 103. 10 milliseconds later, when the task activation unit 1013 is notified of the third time from the timer 3, it searches for the third time slot in the time slot information 4. This time, the second task 103 is assigned, but task 2 has already been started in time slot 2 and continues to be assigned in time slot 3, so the task initiation unit 1013 continues processing the second task 103. If the processing of the second task 103 is completed in time slot 2, the task initiation unit 1013 does not start any task in time slot 3 (i.e., does not newly start the second task 103). After another 10 milliseconds, when the task initiation unit 1013 is notified of the fourth time from timer 3, it searches for time slot 4 in the time slot allocation information 4. Since no task is assigned this time, the task initiation unit 1013 does not start any task. In this way, the task initiation unit 1013 selects which task to start in each time slot. In FIG. 4, eight time slots are shown, which indicates that the task initiation is repeated in a cycle of eight. That is, when the middleware 101 receives the ninth time notification from the timer 3, the task starting unit 1013 searches for the first time slot, just as it did when the first time notification was received. Hereinafter, such a cycle of the time slot allocation information 4 is referred to as a hyper period.In addition, in FIG. 4, the hyper period is 8 as an example, but it may be any non-negative integer.
[0021] <Time slot allocation information storage unit 1015> FIG. 5 is a diagram showing an update of the time slot allocation information 4 stored in the time slot allocation information storage unit 1015 of this embodiment.
[0022] When time slot allocation information storage unit 1015 is instructed by time slot allocation unit 1012 to update time slot allocation information 4, it adds the new task to time slot allocation information 4 in accordance with the input new task number (ID: Identifier) and allocation position and period information (data flow request information 5, time slot request information 6), and updates the time slot allocation information 4 stored in time slot allocation information storage unit 1015.
[0023] <Data flow request information 5> FIG. 6 is a diagram showing the data flow request information 5 of the present embodiment.
[0024] The data flow request information 5 is information transmitted from outside the electronic control device 0 to the middleware 101. As shown in FIG. 5, the data flow request information 5 specifies that the fourth task 105 added to the electronic control device 0 uses the processing results of the first task 102 and the third task 104. In this embodiment, since all tasks are executed periodically, it is necessary to consider at what point in time the processing results generated by the first task 102 and the third task 104 are to be used by the fourth task 105. For this reason, the data flow request information 5 includes time difference information. The time difference is information indicating how many cycles ago, counting from the time slot at which the new task (fourth task 105) is started, the data generated by each input data generating task (first task 102 and third task 104) is to be used as input data for the new task (fourth task 105).
[0025] <Data flow request information storage unit 1016> FIG. 7 is a diagram showing an update of the dataflow request information 5 stored in the dataflow request information storage unit 1016. As shown in FIG.
[0026] When the data flow request information storage unit 1016 is instructed by the time slot allocation unit 1012 to store a new task, the data flow request information storage unit 1016 adds new data flow request information 5 for the fourth task 105 in accordance with the data flow request information 5 for the fourth task 105, which is the input new task, and updates the data flow request information storage unit 1016.
[0027] <Communication API provision section 1011> FIG. 8 is a diagram showing an outline of the functions of the communication API providing unit 1011. As shown in FIG.
[0028] The communication API providing unit 1011 has a role of managing data shared between tasks and providing data in response to a call from a task. At this time, the communication API providing unit 1011 refers to the data flow request information 5 and provides data generated at an appropriate time. The first task 102 calls Write_data, which is an API provided by the communication API providing unit 1011, in order to provide the processing result to other tasks (the second task 103 and the third task 104). It is known from the data flow request information 5 stored in the data flow request information storage unit 1016 that the communication data generated by the first task 102 is used with a delay of 0 cycles in the second task 103 and with a delay of 1 cycle in the third task 104. Therefore, the communication API providing unit 1011 provides a first task generation data storage unit and stores the data generated most recently by the first task 102 and the data generated one cycle before that. For example, in FIG. 8, the latest value is stored in buffer 0, and the value one cycle before is stored in buffer 1. That is, when the first task 102 calls Write_data, the communication API providing unit 1011 copies the data stored in buffer 0 of the first task generation data storage unit to buffer 1, and then writes the data to buffer 0. The second task 103 calls Read_data to use the data generated by the first task 102. At this time, the communication API providing unit 1011 can see by referring to the data flow request information 5 that the second task 103 uses the data generated by the first task 102 with a time difference of 0 cycles, so copies the data stored in buffer 0 of the first task generation data storage unit and passes it to the second task 103. Similarly, the third task 104 calls Read_data to use the data generated by the first task 102. At this time, the communication API providing unit 1011 can see by referring to the data flow request information 5 that the second task 103 uses the data generated by the first task 102 with a time difference of 1 cycle, so copies the data stored in buffer 1 of the first task generation data storage unit and passes it to the third task 104. As can be seen from this, the number of buffers provided in the generated data storage unit for each task is determined by the maximum value of the time difference included in the dataflow request information 5.By executing all data communications between tasks via the communication API provider 1011, each task can obtain and publish data so as to satisfy the data flow request information 5.
[0029] <Time slot request information 6> FIG. 9 is a diagram showing the time slot request information 6 of the present embodiment.
[0030] The time slot request information 6 is information transmitted to the middleware 101 from outside the electronic control device 0. The time slot request information 6 indicates the period of the task and how many time slots are requested to be allocated to the middleware 101 for one processing of the task. In the time slot request information 6 shown in FIG. 5, the fourth task 105 is executed with a period of 8 time slots (i.e., 80 milliseconds) and requests two time slots. This means that 20 milliseconds of processing time is requested from the CPU 1 for one processing of the fourth task 105. Note that if the periods of all tasks are hyper periods, the period information may be omitted from the time slot request information 6.
[0031] <Time slot allocation unit 1012> FIG. 10 is a flow chart showing a method for searching for a time slot by the time slot allocation unit 1012 of this embodiment.
[0032] In this embodiment, a fourth task 105 is newly added to the electronic control device 0 in which a first task 102, a second task 103, and a third task 104 are mounted.
[0033] In step S1, a number (ID) is assigned to the newly added task. In step S2, the time slot allocation information 4 is acquired. That is, according to the time slot allocation information 4 shown in FIG. 4, {1, 2, 2, -1, 1, 3, -1, -1} is sequentially substituted into the array ts_info (the number of elements is 8 because it matches the hyper period) for storing the time slot allocation information 4. Note that -1 indicates an empty time slot to which no task is assigned. Next, in step S3, the data flow request information 5 is stored in the array data_dlow. According to the data flow request information 5 shown in FIG. 6, {1, -1, 0} is sequentially substituted into data_flow. The first element indicates that the time difference of the first task 102 is 1 cycle, and the third element indicates that the time difference of the third task 104 is 0 cycle. Moreover, by substituting -1 into the second element, it is indicated that the second task 103 is not an input data generation task. In step S4, the requested slot number and period included in the time slot request information 6 are stored in the variables ts_num and period, respectively. In step S5, variables for saving search results are initialized. The variable place indicates the time slot number for starting the new task (fourth task 105), and the variable latency is for storing the time from when the input data for the new task (fourth task 105) is generated to when the new task (fourth task 105) completes processing, i.e., the latency due to the new task (fourth task 105).
[0034] In step S6, the time slot number is assigned to the repeat variable i in order from 1 to 8, and the processes of steps S7 to S10 are repeatedly executed. The process of step S6 may be implemented by a For statement. In step S7, the array ts_info is referenced to determine whether or not there are ts_num slots of free time slots in succession from the i-th time slot. Similarly, whether or not there are ts_num slots of free time slots in succession from the i+period time slot is determined for the i+2*period-th, i+3*period-th, ..., i+(n-1)*period-th time slots. Here, n is a number obtained by dividing the hyper period by the period. If the result of the determination is that there is a free time slot, the process proceeds to step S8. On the other hand, if there is no free time slot, a new task (fourth task 105) cannot be added to the i-th time slot, so the process returns to step S6, increments the variable i, and proceeds to step S7 again. In step S8, the latency of the new task (fourth task 105) when the new task is added to the i-th time slot is calculated and stored in a temporary variable tmp. The latency is calculated from the time when the time slot allocated to the new task (fourth task 105) ends to the time when the time slot allocated to the task that generates the input data for the new task (fourth task 105) ends, by referring to the array data_flow in which the data flow request information 5 is stored. When there are multiple input data generation tasks, the latency may be calculated based on the end time of the input data generation task that is farthest from the i-th time slot. For example, in the time slot allocation information 4 shown in FIG. 4, in the case of time slot i=7, the time when the first task 102, which is the input data generation task, ends is data_flow[0]=1, so time slot 1 is referenced instead of time slot 5 when the first task 102 is executed, and the latency is calculated as 7 from the end of the first task 102 to time slot 8, which is the time when the new task (fourth task 105) ends.For the third task 104, since data_flow[2]=0, counting from the sixth time slot in which the third task 104 is executed to the eighth time slot in which the new task (fourth task 105) ends, the latency is calculated as 2. Therefore, since the maximum latency value is 7, tmp=7 is calculated. In step S9, it is confirmed whether the value of tmp is smaller than the value of latency. If the value of tmp is smaller than the value of latency, the process proceeds to step S10, where place and latency are updated with the values of i and tmp. If the value of tmp is not smaller than the value of latency, there is a time slot position that can shorten the latency compared to the i-th time slot, so the process returns to step S6, increments the variable i, and proceeds to step S7 again.
[0035] When the repeated processing of steps S6 to S10 is completed, in step S11, an instruction is given to save data flow request information 5 of the new task (fourth task 105) in data flow request information storage unit 1016. Then, in step S12, the task number (ID) TASK_NUM determined in steps S1 to S10, the additional time slot position place, and information on the period "period" included in time slot request information 6 are passed to time slot allocation information storage unit 1015, and an instruction is given to update time slot allocation information 4.
[0036] According to this embodiment, even if a new task is added to the electronic control device 0, the time slots already allocated for the execution of existing tasks are not affected, so that the data flow between tasks is maintained even after the new task is added, and the real-time nature of the tasks is maintained. Therefore, it is guaranteed that there is no effect on data communication between tasks and communication with the outside of the electronic control device, making it possible to eliminate the need for timing design and verification, which has been a bottleneck, and to realize continuous improvement of the vehicle control software. In addition, the communication API providing unit 1011 and the task starting unit 1013 make it possible to apply Logical Execution Time, which is a scheduling method that limits data exchange between tasks to a predetermined timing, and to achieve the data flow defined in the data flow request information 5 after absorbing fluctuations in the processing time of each task. Furthermore, it is possible to add a new task so as to minimize latency while ensuring that there is no effect on existing tasks. EXAMPLES
[0037] An electronic control device according to a second embodiment of the present invention will be described. The second embodiment differs from the first embodiment in that the number of consecutive free time slots is increased by changing the time slot allocation of existing tasks. In the second embodiment, the differences from the first embodiment will be mainly described, and the same components as those in the first embodiment will be given the same reference numerals and their description will be omitted.
[0038] <Time slot request information> FIG. 11 is a diagram showing the time slot request information 6 of the new task (the fourth task 105) in this embodiment.
[0039] The time slot request information 6 is information transmitted from outside the electronic control device 0 to the middleware 101, similarly to the first embodiment. In the time slot request information 6 shown in Fig. 11, the fourth task 105 is executed in a cycle of eight time slots (i.e., 80 milliseconds) and requests three time slots.
[0040] <Time slot allocation unit 1012, time slot allocation information storage unit 1015, data flow request information storage unit 1016> FIG. 12 is a diagram showing updates of the time slot allocation information 4 and the data flow request information 5 in this embodiment.
[0041] The time slot allocation unit 1012 searches for an available time slot according to the algorithm shown in FIG. 10. In this embodiment, since the requested number of time slots is 3, an available time slot is not found, and the search fails. Therefore, the time slot allocation unit 1012 analyzes the data flow request information 5 and searches for a process that can be brought forward. As a result, it is found that the third task 104 can be brought forward. Before the addition of the new task (fourth task 105), the third task 104 is executed in the sixth time slot, and according to the data flow request information 5, it is found that the process result executed in the first time slot and the process results executed in the second and third time slots are used. Therefore, since the third task 104 can be executed in the fourth or later time slot, the execution timing of the third task 104 is moved from the sixth time slot to the fourth time slot. At this time, in order to not change the data flow, the third task 104 continues to use the execution result of the first task 102 in time slot No. 1, and therefore updates the time difference between the third task 104 and the first task 102 in the data flow request information 5 from 1 period to 0 periods. Then, time slot allocation unit 1012 allocates the execution of the new task (fourth task 105) to time slots No. 6, 7, and 8, updates time slot allocation information 4 and data flow request information 5, and instructs time slot allocation information storage unit 1015 and data flow request information storage unit 1016 to update and store the data.
[0042] According to this embodiment, when a new task is to be added in a situation where sufficient free time cannot be secured due to tasks already being executed by the electronic control device 0, the free time can be increased while maintaining the data flow of the existing tasks, and the new task can be added. EXAMPLES
[0043] An electronic control device and a vehicle control system according to a third embodiment of the present invention will be described. The third embodiment differs from the first embodiment in that a search for an available time slot is performed among a plurality of electronic control devices. In the third embodiment, the differences from the first embodiment will be mainly described, and the same components as those in the first embodiment will be given the same reference numerals and their description will be omitted.
[0044] FIG. 13 is a diagram showing a hardware configuration of the vehicle control system 12 of the present embodiment.
[0045] <Vehicle Control System 12> The vehicle control system 12 has two electronic control devices, a first electronic control device 8 and a second electronic control device 9, which are connected to each other and communicate with each other via a communication bus 11. In this embodiment, two electronic control devices are provided, but three or more electronic control devices may be provided. The communication bus 11 transfers data according to a known communication protocol such as CAN (Controller Area Network) or Ethernet. The first electronic control device 0 and the second electronic control device 9 have a communication peripheral 10, which is hardware for communicating via the communication bus 11. The communication peripheral 10 is hardware that controls communication, and specifically, when the communication bus 11 is CAN, it is known hardware called a CAN transceiver, and when the communication bus 11 is Ethernet, it is known hardware called Ethernet PHY.
[0046] FIG. 14 is a diagram showing the software configuration of the first electronic control unit 8 and the second electronic control unit 9 of this embodiment.
[0047] <Software Configuration of First Electronic Control Unit 8> The first electronic control device 8 has a first task 102, a second task 103, a third task 104, a middleware 101, an OS 100, a communication peripheral driver 110, and a first communication task 108. The communication peripheral driver 110 is software for driving the communication peripheral 10, and is called by the OS 100 or the middleware 101 to access the communication peripheral 10 and provide a function of writing data to be transmitted to a predetermined register of the communication peripheral 10 and a function of reading received data from a predetermined register of the communication peripheral 10. The first communication task 108 is a task for performing data communication in the first electronic control device 8, and will be described in detail later.
[0048] <Software Configuration of Second Electronic Control Unit 9> The second electronic control device 9 has a fifth task 106, a sixth task 107, middleware 101, an OS 100, a communication peripheral driver 110, and a second communication task 109. The second communication task 109 is a task for performing data communication in the second electronic control device 9, and will be described in detail later.
[0049] FIG. 15 is a diagram showing the configuration of the middleware 101 of the first electronic control unit 8 and the second electronic control unit 9 of this embodiment.
[0050] <Middleware 101> The middleware 101 includes a communication API providing unit 1011, a time slot allocation unit 1012, a task starting unit 1013, a time slot allocation information storage unit 1015, a data flow request information storage unit 1016, and an inter-middleware time synchronization unit 1014. The inter-middleware time synchronization unit 1014 is included in the vehicle control system 12 and has a function of synchronizing the time between the middleware 101 mounted on the electronic control devices connected to each other via the communication bus 11. For the time synchronization, a known method such as NTP (Network Time Protocol) can be adopted.
[0051] FIG. 16 is a diagram showing time slot allocation information 4 (before a new task is added) stored in the time slot allocation information storage unit 1015 constituting the middleware 101 of the first electronic control unit 8 and the second electronic control unit 9 in this embodiment.
[0052] <Time slot allocation information 4> As shown in Fig. 16, both the middleware 101 of the first electronic control device 8 and the second electronic control device 9 store time slot allocation information 4 of the tasks mounted in each electronic control device. That is, the time slot allocation information storage unit 1015 of the first electronic control device 8 stores time slot allocation information 4 of not only the first task 102, the second task 103, the third task 104, and the first communication task 108, but also the fifth task 106, the sixth task 107, and the second communication task 109 executed by the second electronic control device 9. Similarly, the second electronic control device 9 stores time slot allocation information 4 of the tasks executed by the first electronic control device 8 and the tasks executed by the second electronic control device 9. The time slot allocation information 4 includes information for identifying the electronic control device to which each task is assigned.
[0053] FIG. 17 is a diagram showing data flow request information 5 (before a new task is added) stored in the data flow request information storage unit 1016 that constitutes the middleware 101 of the first electronic control unit 8 and the second electronic control unit 9 in this embodiment.
[0054] <Data flow request information 5> 17, both the middleware 101 of the first electronic control unit 8 and the second electronic control unit 9 store data flow request information 5 of tasks mounted in each electronic control unit. That is, the data flow request information storage unit 1016 of the first electronic control unit 8 stores data flow request information 5 of not only the first task 102, the second task 103, the third task 104, and the first communication task 108, but also the fifth task 106, the sixth task 107, and the second communication task 109 executed by the second electronic control unit 9. Similarly, the second electronic control unit 9 stores data flow request information 5 of the tasks executed by the first electronic control unit 8 and the tasks executed by the second electronic control unit 9.
[0055] <First communication task 108 and second communication task 109 (before adding new tasks)> The first communication task 108 and the second communication task 109 are tasks for communicating with the outside in the first electronic control unit 8 and the second electronic control unit 9. In this embodiment, before the addition of a new task, according to the assignment of each task to the electronic control unit shown in Fig. 16 and the data communication between each task shown in Fig. 17, there is no data communication between the first electronic control unit 8 and the second electronic control unit 9, so execution of the first communication task 108 and the second communication task 109 is unnecessary and they are not assigned to any time slot.
[0056] FIG. 18A is a diagram showing data flow request information 5 for the fourth task 105, which is a new task in this embodiment, and FIG. 18B is a diagram showing time slot request information 6 for the fourth task 105, which is a new task in this embodiment.
[0057] <New Task (Fourth Task 105)> In this embodiment, a newly added fourth task 105 uses the data generated by the first task 102 and the second task 103, and requests two time slots.
[0058] Fig. 19 is a flowchart of a time slot search process by the time slot allocation unit 1012 of this embodiment. Fig. 20 is a diagram showing time slot allocation information 4 (after a new task is added) stored in the time slot allocation information storage unit 1015 included in the middleware 101 of the first electronic control unit 8 and the second electronic control unit 9 of this embodiment.
[0059] <Time slot allocation unit 1012> The time slot allocation section 1012 mounted on the first electronic control unit 8 searches for an available time slot according to the algorithm of FIG.
[0060] In step S13, the time slot allocation information 4 stored in the time slot allocation information storage unit 1015 and the data flow request information 5 stored in the data flow request information storage unit 1016 are obtained. In step S14, the data flow request information 5 and the time slot request information 6 related to the new task (fourth task 105) are obtained. In this embodiment, it is necessary to select an electronic control device to which the new task (fourth task 105) is assigned. Therefore, in step S15, the data flow request information 5 of the new task (fourth task 105) is analyzed, and an empty slot is searched for in order from the electronic control device to which the most input data generating tasks are assigned. For example, in this embodiment, the input data generating tasks of the fourth task 105 are the first task 102 and the second task 103, and these tasks are assigned to the first electronic control device 8 as shown in FIG. 16. Therefore, by searching from the first electronic control device 8 and then searching the second electronic control device 9, an electronic control device with a small amount of communication between the electronic control devices can be searched for by the search in step S15.
[0061] In step S16, the same algorithm as steps S5 to S10 in FIG. 10 is applied to search for an empty slot. At this time, if an empty slot is found, a new task (the fourth task 105) can be added as in the first embodiment, and the algorithm ends. If all the input data generation tasks are assigned to the same electronic control device, the search ends in step S16. Therefore, if the input data generation tasks are assigned to a plurality of electronic control devices, the search may be started from step S17 without performing the search in step S16. In this embodiment, since all the input data generation tasks are assigned to the same electronic control device, the search in step S16 is not skipped. However, as shown in FIG. 16, there are no two consecutive empty time slots in the first electronic control device 8. Therefore, in step S15, the search target is changed to the second electronic control device 9, and the process proceeds to step S17.
[0062] In step S17, consecutive free slots in the second electronic control device 9 are searched for. Referring to FIG. 16, the 3rd to 4th time slots and the 6th to 8th time slots are consecutive free slots. In step S18, it is determined whether a communication task can be assigned to the electronic control device to which the input data generation task is assigned. That is, it is determined whether the first communication task 108 for transmitting data from the first electronic control device 8 to the second electronic control device 9 can be assigned to the first electronic control device 8. According to the data flow request information 5, it is necessary to transmit data generated by the first task 102 and the second task 103 to the second electronic control device 9. It is found that if a new task (fourth task 105) is assigned to the 3rd to 4th time slots of the second electronic control device 9, it will not be in time for the timing of transmitting data from the first electronic control device 8. Therefore, the 3rd to 4th free slots cannot be used. As for the 6th to 8th time slots, the first communication task 108 can be assigned to the 4th time slot of the first electronic control device 8.
[0063] Therefore, in step S18, the sixth to eighth time slots of the second electronic control unit 9 are selected. In step S19, it is confirmed whether a communication task (second communication task 109) for receiving data can be assigned to the second electronic control unit 9 that is searching for an empty slot to which a new task (fourth task 105) is assigned. In step S18, the first communication task 108 is assigned to the fourth time slot of the first electronic control unit 8, and communication data is transmitted from the first electronic control unit 8 in the fourth time slot, so that an empty time slot after the fourth time slot is suitable for the second communication task 109. Therefore, the second communication task 109 is assigned to the sixth time slot, which is the earliest empty time slot after the fourth time slot in the second electronic control unit 9, and the new task (fourth task 105) is assigned to the remaining seventh to eighth time slots.
[0064] As a result of the above, the time slot allocation information 4 (after adding a new task) is updated as shown in FIG.
[0065] According to this embodiment, it is possible to apply system level Logical Execution Time, which is a scheduling method that synchronizes time between electronic control devices and limits the start and end of communication between tasks of electronic control devices to specified timing by arranging communication tasks, and it is possible to achieve the data flow defined in the data flow request information 5 while absorbing fluctuations in communication time between each electronic control device, and in particular to automatically determine the electronic control device to which a new task should be assigned, and to allocate the new task to an appropriate time slot. EXAMPLES
[0066] An electronic control device and a vehicle control system according to a fourth embodiment of the present invention will be described. The fourth embodiment differs from the first embodiment in that if an available time slot is not found, the data flow request information 5 and the time slot request information 6 of the new task are rejected. Note that in the fourth embodiment, differences from the first embodiment will be mainly described, and the same components as those in the first embodiment will be given the same reference numerals and their description will be omitted.
[0067] <Time slot allocation unit 1012, time slot allocation information storage unit 1015, data flow request information storage unit 1016> If the time slot allocation unit 1012 fails to search for an available time slot using the algorithm of Example 1, it rejects the request to add the new task, does not change the time slot, does not update the time slot allocation information 4 stored in the time slot allocation information storage unit 1015 and the data flow request information 5 stored in the data flow request information storage unit 1016, and does not add a new task (fourth task 105).
[0068] According to this embodiment, it is possible to prevent the addition of a new task from destroying the data flow related to the existing tasks. EXAMPLES
[0069] An electronic control device and a vehicle control system according to a fifth embodiment of the present invention will be described. The fifth embodiment differs from the first embodiment in that the use case is not the addition of a new task, but the expansion or contraction of processing time associated with a processing change related to an existing task. In the fifth embodiment, the differences from the first embodiment will be mainly described, and the same components as those in the first embodiment will be assigned the same reference numerals and their description will be omitted.
[0070] <Time slot allocation unit 1012, time slot allocation information storage unit 1015, data flow request information storage unit 1016> FIG. 21 is a diagram showing updates of the time slot allocation information 4 and the data flow request information 5 in this embodiment.
[0071] In the algorithm of the first embodiment (FIG. 10), when the data flow request information 5 and the time slot request information 6 relate to an existing task (e.g., the third task 104), the time slot allocation unit 1012 updates the allocation information relating to the existing task by referring to the time slot allocation information 4. Note that when the data flow request information 5 is the same as the information stored in the data flow request information storage unit 1016, input of the data flow request information 5 to the time slot allocation unit 1012 may be omitted.
[0072] According to this embodiment, even if the processing time of an existing task increases or decreases due to an over-the-air update, the allocation of the existing task to a time slot can be updated without affecting other existing tasks, and the task that involves expansion or contraction can be updated. EXAMPLES
[0073] An electronic control device and a vehicle control system according to a sixth embodiment of the present invention will be described. The sixth embodiment differs from the first embodiment in that the use case is not the addition of a new task, but the deletion of an existing task by changing the number of required slots to 0. Note that in the sixth embodiment, differences from the first embodiment will be mainly described, and the same components as those in the first embodiment will be given the same reference numerals and their description will be omitted.
[0074] <Time slot allocation unit 1012, time slot allocation information storage unit 1015, data flow request information storage unit 1016> FIG. 22 is a diagram showing updates of the time slot allocation information 4 and the data flow request information 5 in this embodiment.
[0075] When the number of requested slots of a task included in time slot request information 6 is 0, time slot allocation unit 1012 deletes the task whose number of requested slots is 0. When deleting an existing task, data flow request information 5 does not need to be input to time slot allocation unit 1012. Time slot allocation unit 1012 deletes information about the task to be deleted from time slot allocation information storage unit 1015 and data flow request information storage unit 1016.
[0076] According to this embodiment, an existing task can be deleted using the same process as adding or modifying a task. EXAMPLES
[0077] An electronic control device and a vehicle control system according to a seventh embodiment of the present invention will be described. The seventh embodiment differs from the sixth embodiment in that a deletion request for some tasks is rejected. In the seventh embodiment, differences from the first to sixth embodiments will be mainly described, and the same reference numerals will be used to designate the same components as the first to sixth embodiments, and descriptions thereof will be omitted.
[0078] <Time slot allocation unit 1012, time slot allocation information storage unit 1015, data flow request information storage unit 1016> If the number of requested slots included in the time slot request information 6 is 0, the time slot allocation unit 1012 attempts to delete the task. When deleting a task, the data flow request information 5 stored in the data flow request information storage unit 1016 is analyzed, and if the task to be deleted is not an input data generation task for another task, i.e., the task to be deleted is not recorded in the "input data" column of the data flow request information 5, a deletion request is accepted and the task is deleted as in the sixth embodiment. On the other hand, if the task to be deleted is an input data generation task for another task, the request is rejected as in the fourth embodiment, and the stored information is not updated.
[0079] According to this embodiment, it is possible to prevent the destruction of data flows related to other tasks due to the deletion of an existing task. EXAMPLES
[0080] An electronic control device and a vehicle control system according to an eighth embodiment of the present invention will be described. The eighth embodiment differs from the first embodiment in that a server that executes a time slot allocation process is provided, and time slot allocation information 4 is provided to a plurality of electronic control devices. In the eighth embodiment, differences from the first embodiment will be mainly described, and the same components as those in the first embodiment will be given the same reference numerals and their description will be omitted.
[0081] <Hardware configuration of vehicle control system 12> FIG. 23 is a diagram showing a hardware configuration of the vehicle control system 12 of the present embodiment.
[0082] The vehicle control system 12 includes an electronic control device 0 and a server 13. The electronic control device 0 includes a CPU 1, a memory 2, a timer 3, and an OTA communication peripheral 7 for performing OTA communication 15 with the server 13. The server 13 includes a software distribution device 14 for performing OTA communication 15 with the electronic control device 0. The OTA communication 15, the OTA communication peripheral 7, and the software distribution device 14 may be any device that complies with the Over-The-Air publicly known technology that enables wireless software updates.
[0083] <Software configuration of vehicle control system 12> FIG. 24 is a diagram showing the software configuration of the vehicle control system 12 of this embodiment.
[0084] The electronic control device 0 includes an OS 100, middleware 101, a first task 102, a second task 103, and a third task 104. The middleware 101 includes a communication API providing unit 1011, a task starting unit 1013, a time slot allocation information storage unit 1015, and a time slot allocation information receiving unit 1017. The server 13 includes a time slot allocation unit 1012, a time slot allocation information storage unit 1015, a data flow request information storage unit 1016, and a time slot allocation information transmitting unit 1018. The time slot allocation information 4 stored in the time slot allocation information storage unit 1015 included in the middleware 101 of the electronic control device 0 includes information on time slot allocation related to tasks executed by the electronic control device 0 itself. The time slot allocation information 4 stored in the time slot allocation information storage unit 1015 included in the server 13 includes information on time slot allocation related to tasks executed in some or all of the electronic control devices with which the server 13 communicates and which are the targets of OTA distribution. The time slot allocation information receiving unit 1017 has a function of receiving the time slot allocation information 4 from the server 13 using the OTA communication peripheral 7. The time slot allocation information transmitting unit 1018 has a function of transmitting the time slot allocation information 4 to the electronic control device 0 using the software distribution device 14.
[0085] According to this embodiment, by executing the time slot allocation process in the server 13, it is possible to provide the time slot allocation information 4 to a plurality of electronic control devices 0, thereby reducing the processing load of the middleware 101 included in the electronic control devices. EXAMPLES
[0086] An electronic control device and a vehicle control system according to a ninth embodiment of the present invention will be described. The ninth embodiment differs from the eighth embodiment in that the server is provided with a function for providing information for avoiding rejection when rejecting the addition of a new task, the deletion of an existing task, or the change in the number of required time slots of an existing task. In the ninth embodiment, differences from the first to eighth embodiments will be mainly described, and the same reference numerals will be used to designate the same components as the first to eighth embodiments, and their description will be omitted.
[0087] <Software configuration of vehicle control system 12> FIG. 25 is a diagram showing the software configuration of the vehicle control system 12 of this embodiment.
[0088] The server 13 includes a time slot allocation unit 1012 , a time slot allocation information storage unit 1015 , a data flow request information storage unit 1016 , a time slot allocation information transmission unit 1018 , and an improvement information display unit 1019 .
[0089] <Improvement information display section 1019> The improvement information display unit 1019 provides information for avoiding rejection when it is determined that the addition of a new task, the deletion of an existing task, or the change in the number of required time slots of an existing task is rejected. Specifically, when the addition of a new task or the change in the number of required time slots of an existing task is rejected, the improvement information display unit 1019 displays the maximum number of free time slots that can be allocated based on the data flow request information 5, and when the deletion of an existing task is rejected, the improvement information display unit 1019 displays the tasks that need to be deleted simultaneously (or first) from the data flow request information 5.
[0090] According to this embodiment, information regarding timing design can be provided to designers and vehicle users.
[0091] The present invention is not limited to the above-described embodiments, and includes various modified examples and equivalent configurations within the spirit of the appended claims. For example, the above-described embodiments have been described in detail to clearly explain the present invention, and the present invention is not necessarily limited to those including all of the configurations described. Furthermore, a part of the configuration of one embodiment may be replaced with the configuration of another embodiment. Furthermore, the configuration of another embodiment may be added to the configuration of one embodiment. Furthermore, a part of the configuration of each embodiment may be added, deleted, or replaced with another configuration.
[0092] Furthermore, each of the aforementioned configurations, functions, processing units, processing means, etc. may be realized in hardware, for example by designing some or all of them as an integrated circuit, or may be realized in software by a processor interpreting and executing a program that realizes each function.
[0093] Information such as programs, tables, and files that realize each function can be stored in a storage device such as a memory, a hard disk, or an SSD (Solid State Drive), or in a recording medium such as an IC card, an SD card, or a DVD.
[0094] In addition, the control lines and information lines shown are those considered necessary for the explanation, and do not necessarily show all the control lines and information lines necessary for implementation. In reality, it can be considered that almost all components are connected to each other. [Explanation of symbols]
[0095] 0 Electronic Control Unit 1 CPU 2. Memory 3 Timer 4 Time slot allocation information 5. Data Flow Request Information 6 Time slot request information 7 OTA communication peripherals 8 First Electronic Control Unit 9 Second Electronic Control Unit 10 Communication Peripherals 11 Communication Bus 12 Vehicle Control System 13 Server 14 Software distribution equipment 15 OTA communication 100 OS 101 Middleware 102 First Task (Application) 103 Second Task (Application) 104 Third Task (Application) 105 Fourth Task (Application) 106 Fifth Task (Application) 107 Sixth Task (Application) 108 First Communication Task 109 Second Communication Task 110 Communication Peripheral Driver 1011 Communication API provision department 1012 Time slot allocation section 1013 Task Starter 1014 Middleware Time Synchronization Unit 1015 Time slot allocation information storage unit 1016 Data flow request information storage unit 1017 Time slot allocation information receiving unit 1018 Time slot allocation information transmission unit 1019 Improvement information display section
Claims
1. An electronic control device, A computing device that performs a predetermined computation process and periodically executes a task, and a storage device that is accessible by the computing device, The timing of data input and data output of the task is determined in advance; a time slot allocation information storage unit that stores time slot allocation information that specifies the execution timing of the task between the predetermined data input timing and the predetermined data output timing; a task initiation unit that initiates the task in accordance with the time slot allocation information; a time slot allocation unit that stores information of the new task in the time slot allocation information storage unit according to an execution timing of the new task; The time slot allocation unit receiving input of information on a task that generates data to be input to the new task, data flow request information including information on how many cycles ago, counting from a time slot that starts the new task, the task uses data generated by the task, and time slot request information including information on the number of time slots required to execute the new task; searching for an available time slot for executing the new task based on the time slot allocation information, the data flow request information, and the time slot request information; and updating the time slot allocation information so as to allocate the new task to the searched vacant time slot.
2. 2. The electronic control device according to claim 1, The electronic control device according to claim 1, wherein the time slot allocation unit updates the time slot allocation information by allocating the new task to the found vacant time slot so as to shorten the latency of the new task.
3. 2. The electronic control device according to claim 1, The time slot allocation unit if a search for an available time slot that satisfies both the data flow request information and the time slot request information for the new task fails, refer to the data flow request information and the time slot allocation information, and change the time slot allocated to the existing task so as to satisfy the data flow request of the existing task, thereby generating an available time slot; and updating the time slot allocation information so as to allocate the execution of the new task to the created free time slot.
4. 2. The electronic control device according to claim 1, time synchronization with other electronic control devices that execute the tasks; The input and output timing of each task is predetermined based on the synchronized time, An electronic control device characterized in that, when data communication with the other electronic control device is required based on the data flow request information, the time slot allocation information includes a predetermined timing for data communication between the tasks.
5. 2. The electronic control device according to claim 1, The electronic control device is characterized in that, if the time slot allocation unit fails to search for an available time slot that satisfies both the data flow request information and the time slot request information for the new task, it rejects the addition request for the new task and does not update the data flow request information and the time slot allocation information.
6. 2. The electronic control device according to claim 1, The time slot allocation unit When a processing time of the existing task increases or decreases, searching for an available time slot for executing the existing task whose processing time is to be changed based on the time slot allocation information, the data flow request information, and the time slot request information; an electronic control unit that updates the time slot allocation information so as to allocate the existing task to the searched vacant time slot;
7. 2. The electronic control device according to claim 1, The time slot allocation unit 2. An electronic control device comprising: an electronic control unit that, in accordance with a deletion request for an existing task, deletes information of the existing task related to the deletion request from the data flow request information and the time slot allocation information.
8. 8. The electronic control device according to claim 7, The time slot allocation unit Analyzing the data flow requirement information; 2. An electronic control device comprising: an electronic control unit that, when an existing task to be deleted generates input data for another task, rejects the deletion request and does not update the data flow request information and the time slot allocation information.
9. A vehicle control system, comprising: An electronic control device according to any one of claims 1 to 8; A server capable of communicating with the electronic control device, The server, storing time slot allocation information and data flow request information; Searching for an available time slot according to a time slot request based on the time slot allocation information and the data flow request information; updating the time slot allocation information so as to allocate the task related to the request to the found free time slot; transmitting the updated time slot allocation information to the electronic control unit; The vehicle control system according to the present invention is characterized in that the electronic control unit updates the time slot allocation information stored therein with the time slot allocation information received from the server.
10. 10. A vehicle control system according to claim 9, the server has an improvement information display unit that presents information regarding rejection of a request for changing the number of time slots of the task as a result of the search for the time slots; The vehicle control system according to the present invention, wherein the information regarding the rejection includes at least one of a maximum number of available time slots that satisfies the data flow request information and information regarding an existing task that generates input data.
11. A method for controlling a task executed by an electronic control unit, comprising the steps of: The electronic control device includes a calculation device that performs a predetermined calculation process and periodically executes a task, and a storage device that is accessible by the calculation device, The timing of data input and data output of the task is determined in advance; the storage device stores time slot allocation information that specifies the execution timing of the task between the predetermined data input timing and the predetermined data output timing; The method for controlling the tasks includes: a task initiation procedure in which the computing device initiates the task according to the time slot allocation information; a time slot allocation procedure in which the arithmetic device stores information on the new task according to the execution timing of the new task; In the time slot allocation procedure, the arithmetic device receives input of information on a task that generates data to be input to the new task, data flow request information including information on how many cycles ago, counting from a time slot that starts the new task, the task uses data generated by the task, and time slot request information including information on the number of time slots required to execute the new task; the computing device searches for an available time slot for executing the new task based on the time slot allocation information, the data flow request information, and the time slot request information; The method for controlling tasks, characterized in that the computing device updates the time slot allocation information so as to allocate the new task to the found vacant time slot.
12. A method for controlling a task according to claim 11, comprising the steps of: A task control method, characterized in that in the time slot allocation procedure, the computing device allocates the new task to the searched vacant time slot so as to shorten the latency of the new task, and updates the time slot allocation information.