Electronic Control Unit
The electronic control device addresses delays in interrupt processing by reallocating time from running virtual machines to non-running machines, ensuring timely execution and preventing communication message loss.
Patent Information
- Application Number
- JP2021156100
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2025-01-22
- Estimated Expiration
- 2041-09-24
AI Technical Summary
Existing virtual machine control technologies cause delays in interrupt processing due to waiting for non-running virtual machines to start according to a processing schedule, potentially leading to communication message loss.
An electronic control device with an execution switching section, interrupt acquisition section, and time allocation section that allocates time to running virtual machines to execute interrupt processing for non-running machines, ensuring prompt execution.
Interrupt processing is executed promptly without delay, even for non-running virtual machines, by reallocating time from running machines, thus preventing communication message loss.
Smart Images

Figure 0007619222000001 
Figure 0007619222000002 
Figure 0007619222000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a technique for controlling the execution of a virtual machine. [Background technology]
[0002] There is known a technique for controlling the execution of a virtual machine based on a preset processing schedule. For example, in the technique described in Patent Document 1 below, an assigned time is set for each of a plurality of virtual machines, and when the assigned time of a running virtual machine has elapsed, another virtual machine is started to execute a process.
[0003] In the technology described in Patent Document 1, when the processing time of a high-priority virtual machine exceeds the allocated time, the free time of a low-priority virtual machine is added to the allocated time of the high-priority virtual machine to extend it. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Patent Publication No. 2021-060923 Summary of the Invention [Problem to be solved by the invention]
[0005] However, after detailed consideration by the inventors, it was found that the technology described in Patent Document 1 has the problem that interrupt processing is delayed, as it has to wait until a virtual machine that is not currently running and for which an interrupt request has occurred is started according to a processing schedule.
[0006] For example, if an interrupt process for an interrupt request caused by receiving a communication message is delayed, the next communication message may be received before the interrupt process is executed, causing the communication message to be overwritten and lost.
[0007] One aspect of the present disclosure is to provide a technique for quickly executing an interrupt process of a virtual machine that is not currently running. [Means for solving the problem]
[0008] An electronic control device according to one aspect of the present disclosure includes an execution switching unit (42), an interrupt acquisition unit (44), and a time allocation unit (46, S400 to S410). The execution switching unit switches the virtual machine to be executed based on the allocated time set for each of the multiple virtual machines to execute a process. The interrupt acquisition unit acquires an interrupt request from the virtual machine. When the interrupt acquisition unit acquires an interrupt request from a virtual machine that is not currently running, the time allocation unit provides the virtual machine that has generated the interrupt request with a part of the allocated time of the currently running virtual machine as interrupt processing time.
[0009] With this configuration, even if the virtual machine on which the interrupt request occurred is not running, the virtual machine on which the interrupt request occurred can execute the interrupt process by using part of the allocated time of the running virtual machine. This allows the interrupt process that needs to be executed within a certain time period to be executed promptly without delay. [Brief description of the drawings]
[0010] [Figure 1] FIG. 2 is a block diagram showing a hardware configuration of an electronic control device. [Diagram 2] Schematic diagram showing the integration of electronic control units. [Diagram 3] FIG. 2 is a block diagram showing a software configuration of an electronic control unit. [Figure 4] 13 is a flowchart showing a scheduling process. [Diagram 5] 4 is a time chart showing a scheduling process. [Figure 6] 11 is a time chart showing another scheduling process. [Figure 7] 11 is a time chart showing another scheduling process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. [1. First embodiment] [1-1. Configuration] An electronic control device 10 according to a first embodiment shown in Fig. 1 is mounted on, for example, a vehicle. The electronic control device is also called an ECU. The ECU 10 includes, as hardware, a CPU 12, a ROM 14, a RAM 16, and a peripheral device 20. The peripheral device 20 includes communication units such as a CAN communication unit 22, an Ethernet communication unit 24, and a LIN communication unit 26.
[0012] CAN is an abbreviation for Controller Area Network, and LIN is an abbreviation for Local Interconnect Network. CAN and Ethernet are registered trademarks. The CPU 12 of the ECU 10 executes a program stored in the ROM 14 or the like, thereby implementing the functions of the ECU 10 corresponding to the program. The ECU 10 may include one microcomputer or may include multiple microcomputers.
[0013] As shown in Figure 2, when the number of ECUs in a vehicle increases, there is a demand to integrate multiple ECUs that can be integrated functionally or that are installed in close proximity into one ECU. As shown in Figure 2, there are also ECUs that are not integrated with other ECUs. ECU 10 in Figure 1 is an integration of multiple ECUs.
[0014] When multiple ECUs are integrated into a single ECU, the processing power of the integrated ECU must be equal to or greater than the combined processing power of the multiple ECUs before integration. Processing power is determined by the number of CPUs the ECU has and the performance of those CPUs.
[0015] For example, consider the case where each of ECUs A, B, C, and D before integration in Fig. 2 has one CPU with a processing capacity of 10, and ECU A' after integration has four CPUs with a processing capacity of 10. In this case, it is sufficient to assign the virtual machines corresponding to ECUs A, B, C, and D to each of the four CPUs of ECU A'.
[0016] Also, consider a case where each of ECUs A, B, C, and D before integration in Fig. 2 has one CPU with a processing capacity of 10, and ECU A' after integration has two CPUs with a processing capacity of 20. In this case, virtual machines corresponding to two ECUs among ECUs A, B, C, and D can be assigned to each of the two CPUs of ECU A'.
[0017] 3, the CPU 12 executes a program, whereby a plurality of virtual machines 30 in the ECU 10 realize the functions of the pre-integration ECUs. In addition, the CPU 12 executes a program, whereby the virtual machine manager 40 controls the execution of the virtual machines 30. A virtual machine is also called a VM, and a virtual machine manager is also called a VMM.
[0018] The VMM 40 includes an execution switching unit 42, an interrupt acquisition unit 44, and a time allocation unit 46. The execution switching unit 42 allocates a predetermined allocation time set for each VM 30 to execute a process, to each VM 30. When the allocation time for a currently running VM 30 has elapsed, the execution switching unit 42 starts up another VM 30 based on a processing schedule to execute the process.
[0019] The interrupt acquisition unit 44 acquires an interrupt request from the VM 30 regardless of whether the VM 30 is running or not. When the interrupt request acquired by the interrupt acquisition unit 44 is an interrupt request from the VM 30 that is running, the time allocation unit 46 causes the running VM 30 to execute an interrupt process.
[0020] In contrast, when the interrupt request acquired by the interrupt acquisition unit 44 is an interrupt request from a VM 30 that is not currently running, the time allocation unit 46 provides a portion of the time of the currently running VM 30 in which the interrupt request has occurred as interrupt processing time required to execute the interrupt processing for the VM 30 that is not currently running.
[0021] An interrupt request occurs, for example, in the following cases (1) to (3). (1) When a gateway ECU relays communication between CAN and Ethernet, when the gateway ECU receives a message from CAN or Ethernet.
[0022] (2) When the body ECU detects that the doors are locked or unlocked. (3) When the multimedia ECU detects that audio execution has been switched via panel operation.
[0023] [1-2. Processing] Next, the scheduling process executed by the VMM 40 will be described with reference to the flowchart of Fig. 4. The flowchart of Fig. 4 is executed when the interrupt acquisition unit 44 acquires an interrupt request from any of the VMs 30, regardless of whether the VM 30 is running or not.
[0024] In S400, the time allocation unit 46 determines whether or not the interrupt request acquired by the interrupt acquisition unit 44 is from the running VM 30. If the determination in S400 is Yes, that is, the interrupt request is from the running VM 30, the process proceeds to S410. If the determination in S400 is No, that is, the interrupt request is not from the running VM 30, the time allocation unit 46 acquires the free time of the running VM 30 in S402. The free time of the running VM 30 is acquired, for example, by subtracting the processing times shown in (1) to (4) below from the allocation time allocated to the running VM 30.
[0025] (1) The maximum processing time actually used (2) Average processing time actually used to date (3) Processing time corresponding to the amount of input data The time allocation unit 46 records the processing time corresponding to the amount of input data, and calculates the processing time corresponding to the current amount of input data. For example, if five CAN messages are input, the processing time for five messages is set, and if ten CAN messages are input, the processing time for ten messages is set.
[0026] (4) Processing time corresponding to the environmental conditions in which the ECU 10 operates For example, in the case of an in-vehicle ECU 10, the processing time corresponds to the environmental conditions in which the ECU 10 operates, such as whether the vehicle is running or stopped, the position of the ignition switch, whether the in-vehicle audio is playing or not, or whether the ECU 10 program is being rewritten or not.
[0027] In Fig. 5, VM#1 corresponds to a running VM 30, and VM#2 in which an interrupt request has occurred corresponds to a non-running VM 30. For ease of explanation, two VMs, VM#1 and VM#2, are shown in Fig. 5. In Fig. 5, the shaded areas represent the free times of VM#1 and VM#2.
[0028] In S404, the time allocation unit 46 acquires the interrupt processing time of the interrupt request acquired by the interrupt acquisition unit 44. Since the interrupt processing time differs depending on the type of interrupt request, the time allocation unit 46 records the interrupt processing time for each type of interrupt request and acquires the interrupt processing time corresponding to the type of interrupt request acquired this time.
[0029] For example, in the occurrence of the above-mentioned interrupt requests (1) to (3), the interrupt processing time corresponding to the type of the interrupt request is recorded, and the interrupt processing time corresponding to the current type of interrupt request is acquired. In S406, the time allocating unit 46 determines whether or not the free time of the running VM 30 is longer than the interrupt processing time. If the determination in S406 is Yes, that is, if the free time of the running VM 30 is longer than the interrupt processing time, the process proceeds to S410.
[0030] If the determination in S406 is No, that is, if the free time of the running VM 30 is less than or equal to the interrupt processing time, in S408 the time allocation unit 46 continues the processing of the running VM 30 without providing the free time of the running VM 30 for the interrupt processing of the interrupt request, and terminates this process.
[0031] In this case, the interrupt process of the VM 30 that could not be executed is executed when the normal allocation time is allocated to the VM 30 based on the processing schedule, or when the allocation time of the VM 30 that is being executed ends, and a VM 30 other than the VM 30 in which the interrupt request occurred is started and the free time is longer than the interrupt processing time.
[0032] In S410, if the interrupt request is from the VM 30 that is currently running, the time allocating unit 46 causes the VM 30 that is currently running to execute the allocation process, and ends this process. Also, in S410, if the interrupt request is not from the running VM 30, the time allocation unit 46 provides the free time of the running VM #1 to the VM #2 for which the interrupt request occurred, as shown in FIG. 5, to execute the interrupt processing, and terminates this process.
[0033] In the first embodiment described above, steps S400 to S410 in FIG. [1-3. Effects] According to the first embodiment described above, the following effects can be obtained.
[0034] (1a) Even if the VM 30 in which an interrupt request has occurred is not currently running, the VM 30 in which the interrupt request has occurred can execute the interrupt process by using part of the allocated time of the currently running VM 30. This allows the interrupt process that needs to be executed within a certain period of time to be executed promptly without delay.
[0035] [2. Second embodiment] [2-1. Differences from the first embodiment] The second embodiment has a basic configuration similar to that of the first embodiment, and therefore differences will be described below. Note that the same reference numerals as those in the first embodiment indicate the same configuration, and the preceding description will be referred to.
[0036] In the above-described first embodiment, when the free time of the running VM 30 is equal to or less than the interrupt processing time of another VM 30, the free time of the running VM 30 is not allocated to the interrupt processing of the interrupt request, and the processing of the running VM 30 is continued. In contrast, the second embodiment differs from the first embodiment in that even when the free time of the running VM 30 is equal to or less than the interrupt processing time of the other VM 30, the allocated time of the running VM 30 is allocated to the interrupt processing of the other VM 30.
[0037] [2-2. Processing] As shown in the upper part of Figure 6, when the free time of the running VM#1 is less than or equal to the interrupt processing time of another VM#2, the time allocation unit 46 extends the allocated time of the running VM#1, as shown in the lower part of Figure 6, to ensure the free time required for the interrupt processing of VM#2.
[0038] As a result, the time required for processing the running VM#1 exceeds the allocated time for VM#1. In this case, the time allocating unit 46 allocates the excess time to VM#1 at any point in the allocated time for VM#2 where the interrupt request occurred, for example, from the beginning of the normal allocated time for VM#2 in FIG. 6. The upper limit of the allocated time for VM#2 that can be allocated to VM#1 is the interrupt processing time for VM#2 secured for VM#1.
[0039] [2-3. Effects] According to the second embodiment described above, in addition to the effects of the first embodiment described above, the following effects can be obtained.
[0040] (2a) Even if the free time of a running VM 30 is equal to or less than the interrupt processing time of another VM 30, the VM 30 in which the interrupt request has occurred can execute the interrupt processing. [3. Third embodiment] [3-1. Differences from the first embodiment] The third embodiment has a basic configuration similar to that of the first embodiment, and therefore differences will be described below. Note that the same reference numerals as those in the first embodiment indicate the same configurations, and the preceding description will be referred to.
[0041] In the first embodiment described above, when an interrupt request occurs to another VM 30 that is not currently running, the free time of the currently running VM 30 is provided to the interrupt process of the other VM 30. In contrast, the third embodiment differs from the first embodiment in that a time for interrupt processing is set in advance in the allocated time of a running VM 30 in preparation for an interrupt request occurring in another VM 30.
[0042] [3-2. Processing] 7, the allocated time for VM#1 includes time reserved for interrupt processing for VM#2 when an interrupt request occurs in another VM#2 that is not currently running. Therefore, the allocated time for VM#1 is longer than the allocated time required for VM#1, including free time, by the time for interrupt processing.
[0043] When an interrupt request occurs in another VM#2 that is not currently running, the time allocating unit 46 provides the interrupt processing time secured for the currently running VM#1 for the interrupt processing of the VM#2. If no interrupt request occurs in another VM#2 that is not currently running, the free time of VM#1 becomes longer by the time for interrupt processing, as shown by the second allocation time of VM#1 in FIG.
[0044] Alternatively, if no interrupt request occurs in the other VM#2 that is not running, the time reserved for interrupt processing in the running VM#1 may be allocated to the processing time of the VM#2 that is not running.
[0045] [3-3. Effects] According to the third embodiment described above, in addition to the effects of the first embodiment described above, the following effects can be obtained.
[0046] (3a) Because time for interrupt processing of other VMs 30 that are not currently running is reserved in the allocated time of the currently running VM 30, the VM 30 that has generated an interrupt request can execute the interrupt processing of the VM 30 that has generated an interrupt request even if the VM 30 is not currently running. This allows interrupt processing that needs to be executed within a certain time period to be executed promptly without delay.
[0047] [4. Other embodiments] Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments and can be implemented in various modified forms.
[0048] (4a) In the above embodiment, the ECU 10 is mounted on a vehicle, but the present invention is not limited to this. The ECU 10 of the above embodiment may be applied to any field as long as the ECU controls the execution of a VM including interrupt processing.
[0049] (4b) In the above embodiment, when an interrupt request occurs to a running VM 30, the running VM 30 notifies the VMM 40 that an interrupt request has occurred, and the VMM 40, upon receiving the interrupt request from the running VM 30, permits the running VM 30 to execute the interrupt processing.
[0050] On the other hand, when an interrupt request occurs to the VM 30 that is being executed, the VM 30 that is being executed may execute the interrupt process without notifying the VMM 40 that the interrupt request has occurred. (4c) The ECU 10 and the method described in the present disclosure may be realized by a dedicated computer provided by configuring a processor and a memory programmed to execute one or more functions embodied in a computer program. Alternatively, the ECU 10 and the method described in the present disclosure may be realized by a dedicated computer provided by configuring a processor with one or more dedicated hardware logic circuits. Alternatively, the ECU 10 and the method described in the present disclosure may be realized by one or more dedicated computers configured by a combination of a processor and a memory programmed to execute one or more functions and a processor configured with one or more hardware logic circuits. In addition, the computer program may be stored in a computer-readable non-transitory tangible recording medium as instructions executed by a computer. The method for realizing the functions of each unit included in the ECU 10 does not necessarily need to include software, and all of the functions may be realized using one or more hardware.
[0051] (4d) Multiple functions possessed by one component in the above embodiments may be realized by multiple components, or one function possessed by one component may be realized by multiple components. Also, multiple functions possessed by multiple components may be realized by one component, or one function realized by multiple components may be realized by one component. Also, part of the configuration of the above embodiments may be omitted. Also, at least part of the configuration of the above embodiments may be added to or substituted for the configuration of another of the above embodiments.
[0052] (4e) In addition to the ECU 10 described above, the present disclosure can be realized in various forms, such as a system including the ECU 10 as a component, a program for causing a computer to function as the ECU 10, a non-transient physical recording medium such as a semiconductor memory on which the program is recorded, and an electronic control method. [Explanation of symbols]
[0053] 10: ECU (electronic control unit), 30: VM (virtual machine), 42: execution switching unit, 44: interrupt acquisition unit, 46: time allocation unit
Claims
1. an execution switching unit (42) configured to switch a virtual machine to be executed based on an allocated time set for each of a plurality of virtual machines (30) to execute a process; an interrupt acquisition unit (44) configured to acquire an interrupt request from the virtual machine; a time allocation unit (46, S400 to S410) configured to provide a part of the allocated time of the running virtual machine as an interrupt processing time to the virtual machine not currently running in which the interrupt request has occurred, when the interrupt request acquired by the interrupt acquisition unit is from the virtual machine not currently running; Equipped with the time allocating unit is configured to acquire free time of the virtual machine that is currently running, and provide the acquired free time to the virtual machine that is not currently running and in which the interrupt request has occurred, as the interrupt processing time. Electronic control unit.
2. 2. The electronic control device according to claim 1, the time allocating unit is configured to acquire the free time based on a value obtained by subtracting a maximum processing time actually used up to that point from the allocated time allocated to the virtual machine. Electronic control unit.
3. 2. The electronic control device according to claim 1, the time allocating unit is configured to acquire the free time based on a value obtained by subtracting an average of processing times actually used up to that point from the allocated time allocated to the virtual machine. Electronic control unit.
4. 2. The electronic control device according to claim 1, the time allocation unit is configured to record processing time actually used by the virtual machine according to the amount of input data up to now, and to acquire the free time based on a value obtained by subtracting the processing time according to the current amount of input data from the recorded free time. Electronic control unit.
5. 2. The electronic control device according to claim 1, the time allocation unit is configured to record processing time actually used by the virtual machine so far in accordance with an environmental state in which the electronic control device operates, and to acquire the free time based on a value obtained by subtracting the processing time corresponding to the current environmental state from the allocated time allocated to the virtual machine. Electronic control unit.
Citation Information
Patent Citations
Information processor and scheduling method
JP1998301793A
Task management device
JP2000322277A
Virtual computer control device
JP2008234116A
Semiconductor device
JP2019114097A
Vehicle control device
JP2021060923A