Electronic control device
The electronic control device maintains real-time processing speed by using dedicated buses for CPUs connected to active memories, addressing slowdowns during memory switching during program updates.
Patent Information
- Application Number
- JP2023025205
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-09-02
- Estimated Expiration
- 2043-02-21
AI Technical Summary
Switching the active memory during program updates via OTA in electronic control units can lead to decreased processing speed and affect real-time functionality due to the connection relationship with CPUs and memories.
The electronic control device employs multiple CPUs connected to memories via dedicated and shared buses, with a selection unit that assigns schedulers based on active memory, ensuring that CPUs execute processing that requires real-time performance via dedicated buses, while others execute non-real-time tasks.
This configuration maintains the execution speed of real-time processing by ensuring that critical tasks are executed via dedicated buses, even when inactive memory is switched to active, thereby preventing slowdowns.
Smart Images

Figure 2024118749000001
Abstract
Description
[Technical field]
[0001] The present invention relates to an electronic control device having a configuration in which each of a plurality of CPUs and each of a plurality of memories are connected by a dedicated bus. [Background technology]
[0002] Programs of electronic control devices mounted on vehicles such as automobiles may be updated to add functions, repair defects, etc. Conventionally, the programs of electronic control devices were updated by taking the vehicle to a dealer, etc. However, since this is inconvenient for the vehicle user, a technology has been proposed that updates programs at the user's location using wireless communication, so-called OTA (On The Air).
[0003] When updating a program via OTA, it is desirable to be able to update it even while the vehicle is running, etc. To achieve this, two storage areas secured in the non-volatile memory of the electronic control device are used alternately, and the program in the inactive area is updated while the program is running, and the active area is switched at the timing of restart, for example, when the ignition switch is turned ON / OFF, making it possible to update the program even while the vehicle is running. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Patent Publication No. 2021-60747 Summary of the Invention [Problem to be solved by the invention]
[0005] In this case, depending on the connection relationship with devices such as the CPU and memory, the switching of the active surface may cause a decrease in processing speed, which may affect functionality.
[0006] For example, if the surface to be activated to execute an updated program, i.e., the memory device, is switched and processing via a dedicated bus can no longer be performed, the speed of processing that requires real-time performance will decrease.
[0007] The present invention has been made in consideration of the above-mentioned circumstances, and its object is to provide an electronic control device that can prevent a decrease in the execution speed of processing that requires real-time performance, even when the memory device that executes an updated program is switched. [Means for solving the problem]
[0008] According to the electronic control device of claim 1, each scheduler assigns each process in the update program acquired via the communication unit (3) that performs wireless communication with the outside to a plurality of CPUs (6(0), 6(1)) for execution. Each of the plurality of CPUs is connected to one of a plurality of memories (8(0), 8(1)) via a dedicated bus (11) and is connected to the other memories via a shared bus (5), and accesses one of the plurality of memories as an active memory. A selection unit (13) selects a scheduler according to the selection of the active memory.
[0009] When multiple memories are provided, the memory that multiple CPUs are accessing to execute programs becomes the active memory, and the other memories become the inactive memories. An updated new program is written to one of the inactive memories. When execution of the updated program is to be started, the inactive memory is switched to the active memory. The scheduler selected by the selection unit causes the CPU connected to the active memory via a dedicated bus to execute processing that requires real-time performance, and causes the other CPUs to execute processing that does not require real-time performance.
[0010] With this configuration, even if a program is updated and the inactive memory is switched to the active memory, the CPU connected to the active memory via a dedicated bus always executes the processing that requires real-time performance, thereby preventing a decrease in the execution speed of the processing that requires real-time performance. [Brief description of the drawings]
[0011] [Figure 1] FIG. 1 is a functional block diagram showing a configuration of an electronic control device according to an embodiment of the present invention; [Diagram 2] Flowchart showing execution from program update by OTA to scheduler decision processing [Diagram 3] Flowchart showing the OTA update process [Figure 4] A diagram showing an example of a scheduler. [Diagram 5] Flowchart showing program rewrite processing [Figure 6] Flowchart showing normal processing [Figure 7] Flowchart showing initialization process [Figure 8] Flowchart showing scheduler determination processing DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] An embodiment will be described below. As shown in Fig. 1, an electronic control device 1 of this embodiment includes an OTA controller 2, and the OTA controller 2 acquires update programs and the like by wirelessly communicating with an external device 4, such as an OTA center, via a communication interface (I / F) 3, which is a communication unit. The OTA controller 2 and the communication I / F 3 are connected via a shared bus 5. CPUs 6(0) and 6(1), RAM 7, ROMs 8(0) and 8(1), a data flash 9, a timer 10, and the like are connected to the shared bus 5. The ROM 8 and the data flash 9 are ROMs that are rewritable, and are so-called flash memories.
[0013] The ROM 8 is a dual-port memory, and the CPU 6(0) and ROM 8(0), and the CPU 6(1) and ROM 8(1) are directly connected via dedicated buses 11(0) and 11(1), respectively. That is, the electronic control unit 1 is supplied with operating power from the power supply circuit 12. The OTA controller 2 has a control device 13 as a selection unit and a storage device 14 inside. Note that update programs and the like may be referred to as "rewrite data".
[0014] Next, the operation of this embodiment will be described. As shown in FIG. 2, the electronic control unit 1 sequentially executes an OTA update process (S1), a normal process (S2), and a scheduler determination process (S3). Each of these processes will be described hereinafter.
[0015] <OTA Update Process> As shown in FIG. 3, the control device 13 of the OTA controller 2 receives rewrite data from the external device 4 via the communication I / F 3 and stores it in the storage device 14 (S11). Note that the rewrite data includes a scheduler which is a program for allocating each process in the update program to be executed by the CPUs 6(0) and 6(1). More specifically, the scheduler determines which of the CPUs 6(0) and 6(1) will execute the time-period process and interrupt process of each function. Specifically, it calls in the order designed for the periodic execution process, or is the configuration setting of the real-time OS regarding the interrupt process (OK?).
[0016] In this embodiment, as shown in FIG. 4, the update program has two types of schedulers for different CPUs 6 to be executed, and can select a scheduler according to the ROM 8 on the active side, and change the CPU 6 that executes the scheduler function of each function. The "active side" is either one of the ROMs 8(0) or 8(1) accessed by the CPUs 6(0) and 6(1). The non-accessed side is referred to as the "non-active side". The active side corresponds to the active memory, and the non-active side corresponds to the inactive memory.
[0017] Scheduler No. 1 is selected when the active side is ROM8(0), and causes CPU6(0) to execute processing that requires real-time performance, and causes CPU6(1) to execute processing that does not require real-time performance. "Processing that requires real-time performance" would be, for example, engine fuel injection control in a vehicle control application, and "processing that does not require real-time performance" would be, for example, car air conditioner control. At this time, CPU6(0) accesses ROM8(0) via dedicated bus 11(0), and CPU6(1) accesses ROM8(0) via shared bus 5.
[0018] On the other hand, scheduler No. 2 is the opposite of the above, being selected when the active side is ROM8(1), causing CPU6(1) to execute processing that requires real-time performance, and CPU6(0) to execute processing that does not require real-time performance. At this time, CPU6(1) accesses ROM8(1) via dedicated bus 11(1), and CPU6(0) accesses ROM8(1) via shared bus 5.
[0019] Next, it is determined whether the CPU 6 is executing a program, i.e., in operation (S12). For example, the control device 13 monitors the state of the CPU 6, and determines that the program is being executed when the state of the bus accessing the ROM 8 or the interface is being called. In the electronic control device 1, when the CPU 6 stops operation, for example, when the application is assumed to an ECU (Electronic Control Unit) mounted on a vehicle, the ignition switch is turned off when the vehicle is parked or stopped.
[0020] If the CPU 6 is not operating (No), a program rewrite process is performed (S14). Details of this rewrite process will be described later. On the other hand, if the CPU 6 is operating (Yes), the functions of the CPU 6 and RAM 7 that are not used for rewriting the program are stopped (S13), and then the process proceeds to step S14. "Stopping the functions of the CPU 6" means, for example, switching to a HALT mode. Also, "stopping the functions of the RAM 7" means, for example, stopping the supply of backup power in the case of SRAM, or stopping the refresh operation in the case of DRAM. Then, the same judgment as in step S12 is made (S15), and if the CPU 6 is operating (Yes), the process waits until the operation stops, and when it stops (No), the active surface is switched (S16).
[0021] <Program rewrite process> As shown in Fig. 5, when the control device 13 judges the active side (S21), it stores a part of the rewrite data acquired via the communication I / F 3 in the storage device 14 (S22). Next, the control device 13 checks the congestion level of the shared bus 5 (S23). For example, when an arbiter is used to arbitrate requests for bus use rights by multiple bus masters, the congestion level of the bus 5 is judged from the number of bus requests output to the arbiter. If the congestion level of the shared bus 5 is below the expected value and is not congested (Yes), writing of the data stored in the storage device 14 to the ROM 8 is started (S24), and if it exceeds the expected value (No), it waits until the congestion is alleviated.
[0022] In step S24, the control device 13 writes the rewrite data stored in the storage device 14 to the ROM 8 of the inactive side. At this time, the scheduler is included in the rewrite data and can be used on either active side. Finally, it is confirmed whether the writing is complete (S25), and if the writing is unsuccessful, the process returns to step S22 and performs the data writing process again.
[0023] <Normal processing> As shown in Fig. 6, normal processing is started (S32) after initialization processing is performed (S31). The initialization processing is performed by one of the CPUs 6, and the other waits until the initialization is completed. Each CPU 6 starts normal processing based on the scheduler determined in the initialization processing. The normal processing is the execution of a program by the CPU 6 to realize the functions provided to the electronic control unit 1.
[0024] <Initialization process> As shown in Fig. 7, in the initialization process, the active side of the ROM 8 is judged (S41). However, since the active side is also judged in the program rewrite process shown in Fig. 5, the judgment result at that time may be stored in the storage device 14 and the judgment result may be referred to. Next, a scheduler abnormality judgment is made (S42). The CPU 6 refers to the scheduler judgment result stored in the data flash 9 and judges whether or not there is an abnormality in the scheduler. If there is no abnormality in the scheduler (No), a scheduler based on the active side is selected (S44).
[0025] On the other hand, if there is an abnormality in the scheduler (Yes), a scheduler is selected again (S43). That is, a different scheduler is selected without setting the scheduler based on the active surface. For example, if scheduler No. 1 shown in FIG. 3 is set and an abnormality occurs, scheduler No. 2 is selected.
[0026] <Scheduler abnormality judgment process> As shown in Fig. 8, if the processing speed of the normal processing exceeds the expected value (S51; No), the scheduler is judged to be normal and the judgment result is OK (S52). On the other hand, if the processing speed of the normal processing is slower than the expected value or if the processing speed is abnormally fast and significantly exceeds the expected value (S51; Yes), the scheduler is judged to be abnormal and the judgment result is NG (S54). Here, the processing speed is measured using a timer 10 for each CPU 6 that performs normal processing. If the expected value is set as a lower limit expected value when the speed is abnormally fast and significantly exceeds the expected value, an upper limit expected value that is greater than the lower limit expected value is set, and the processing speed is compared and judged.
[0027] Finally, the determination result is written to the data flash 9 (S53) and the determination process is terminated. This scheduler determination process is assumed to be performed after the normal process is completed and before the power is cut off and the electronic control unit 1 is shut down. As shown in Fig. 7, this determination result is referred to the next time the electronic control unit 1 is started and normal process is started.
[0028] As described above, according to this embodiment, in electronic control device 1, each scheduler assigns each process in the update program acquired via the communication unit to CPU 6(0), 6(1) for execution. CPU 6(0), 6(1) are connected to ROM 8(0), 8(1) via dedicated buses 11(0), 11(1), respectively, and are also connected to ROM 8(1), 8(0) via shared bus 5. CPU 6(0), 6(1) accesses one of ROM 8(0), 8(1) as an active memory.
[0029] The control device 13 of the OTA controller 2 selects a scheduler according to the selection of the active memory, ROM 8, accessed by the CPUs 6(0) and 6(1). The selected scheduler causes the CPU 6 connected to the ROM 8, which is the active memory, via a dedicated bus 11 to execute processing that requires real-time performance, and causes the other CPUs 6 to execute processing that does not require real-time performance.
[0030] With this configuration, even if a program is updated and the inactive memory is switched to the active memory, the processing requiring real-time performance is always executed by the CPU 6 connected to the active memory via the dedicated bus 11. Therefore, it is possible to prevent a decrease in the execution speed of the processing requiring real-time performance.
[0031] The control device 13 also measures the speed at which the process executed by the selected scheduler is completed, and if the measured speed is slower than a lower limit expected value, it judges the scheduler to be abnormal and stores the judgment result in the data flash 9. It also judges the scheduler to be abnormal if the measured speed is faster than an upper limit expected value that is set to a value faster than the lower limit expected value. This makes it possible to take measures such as avoiding the use of a scheduler that has been judged to be abnormal.
[0032] (Other embodiments) There may be three or more pairs of CPU and ROM. The present invention may be applied to controls other than vehicle control. Although the present disclosure has been described based on the embodiment, it is understood that the present disclosure is not limited to the embodiment or structure. The present disclosure also includes various modifications and modifications within the equivalent range. In addition, various combinations and forms, and other combinations and forms including only one element, more than one element, or less than one element, are also within the scope and concept of the present disclosure. [Explanation of symbols]
[0033] In the drawing, 1 indicates an electronic control unit, 3 indicates a communication interface, 5 indicates a shared bus, 6 indicates a CPU, 8 indicates a ROM, 11 indicates a dedicated bus, and 13 indicates a control unit.
Claims
1. A plurality of CPUs (6(0), 6(1)), A plurality of memories (8(0), 8(1)); a plurality of schedulers that assign each process in an update program acquired via a communication unit (3) that wirelessly communicates with an external device to the plurality of CPUs; A selection unit (13) that selects one of the plurality of schedulers; Each of the plurality of CPUs is connected to one of the plurality of memories via a dedicated bus (11) and is connected to the other memories via a shared bus (5), and accesses one of the plurality of memories as an active memory and accesses memories that are not accessed by the plurality of CPUs as inactive memories, the selection unit selects the scheduler in response to the selection of the active memory; When the inactive memory is switched to an active memory and execution of the update program is started, the scheduler selected by the selection unit causes a CPU connected to the active memory via a dedicated bus to execute processing that requires real-time performance, and causes other CPUs to execute processing that does not require real-time performance.
2. 2. The electronic control device according to claim 1, wherein the selection unit measures a speed at which a process executed by the selected scheduler is completed, and when the measured speed is slower than a lower limit expected value, determines that the scheduler is abnormal, and stores the determination result.
3. 3. The electronic control device according to claim 2, wherein the selection unit also determines that the scheduler is abnormal when the measured speed is faster than an upper limit expected value that is set to a value faster than the lower limit expected value.
Citation Information
Patent Citations
Method and apparatus for processor task migration in multiprocessor system
JP2005235229A
Method and device for securing real time property of soft real-time operating system
JP2013125549A
microcomputer
JP2021060747A
Cited By
Power supply management device
CN122957158A
Power supply management device
CN122957159A
Power supply management device
JP2026173952A
Power supply management device
JP2026173953A
