Control device and program arrangement method
By implementing a control device with a write count storage and rearrangement mechanism to balance data writing in ECUs, the storage device degradation is slowed down, ensuring prolonged durability.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- NISSAN MOTOR CO LTD
- Filing Date
- 2024-11-29
- Publication Date
- 2026-06-04
AI Technical Summary
The frequent program updates in ECUs via OTA lead to increased write operations in storage devices, causing deterioration and eventual failure due to uneven data writing patterns.
A control device with a write count storage unit, placement determination unit, and rearrangement unit that monitors and balances data writing across the program storage area to even out the write counts, thereby slowing down the degradation of the storage device.
The solution effectively distributes write operations evenly, reducing the wear and tear on storage devices, thus prolonging their lifespan and maintaining functionality.
Smart Images

Figure JP2024042278_04062026_PF_FP_ABST
Abstract
Description
Control Device and Program Arrangement Method
[0001] The present invention relates to a control device and a program arrangement method.
[0002] A vehicle is equipped with an ECU (Electronic Control Unit) which is a control device. Each function of the ECU is realized by a processor included in the ECU executing a software program (hereinafter referred to as a program) stored in a program storage area of a storage device such as a flash memory. Patent Document 1 discloses a technique of downloading an update program from a server and updating the program of the ECU mounted on a vehicle.
[0003] Japanese Patent Application Laid-Open No. 2017-149323
[0004] Since the technology of obtaining an update program by OTA (Over The Air) via wireless communication has become widespread and relatively frequent program updates are required for software using cloud or machine learning, it is assumed that the program stored in the program storage area of the ECU will be frequently updated in the future. And when such program updates are repeated, the number of write operations of the data in the storage device having the program storage area increases, so the storage device gradually deteriorates and finally fails and becomes unusable.
[0005] The present invention has been made in view of the above circumstances, and an object thereof is to provide a control device and a program arrangement method capable of delaying the deterioration of a storage device having a program storage area.
[0006] To achieve the above objective, the control device according to the present invention is a control device that realizes corresponding functions by executing each program stored in the program storage area of a storage device, and comprises a write count storage unit, a placement determination unit, and a rearrangement unit. The write count storage unit stores the number of times data has been written to each area into which the program storage area has been divided into predetermined sizes. The placement determination unit refers to the write count storage unit and determines the placement of each program so that data writing is as even as possible within the program storage area. The rearrangement unit moves each program within the program storage area so that it is placed in the arrangement determined by the placement determination unit.
[0007] According to the present invention, the degradation of a storage device having a program storage area can be slowed down.
[0008] This is a block diagram of a system equipped with an ECU according to an embodiment of the present invention. This is a hardware configuration diagram of an ECU according to an embodiment of the present invention. This is a diagram showing an example of the configuration of a write count table. This is a diagram showing a flowchart of the write monitoring process according to an embodiment of the present invention. This is a diagram showing a flowchart of the leveling process according to an embodiment of the present invention. This is a diagram showing an example of the configuration of the program storage area before leveling processing. This is a diagram showing an example of the configuration of the program storage area after leveling processing. This is a diagram showing an example of the configuration of the program storage area according to an example of change. This is a diagram showing an example of the configuration of a table referenced to estimate the load of the free space from the size of the free space. This is a diagram showing an example of the configuration of a table referenced to estimate the load of the free space from the execution frequency of reallocation processing. This is a diagram showing an example of the configuration of a table referenced to determine the allocation rule to the free space in reallocation processing from the load of the free space.
[0009] Hereinafter, an ECU 100 according to an embodiment of the present invention will be described with reference to the drawings. In each drawing, the same or equivalent parts are denoted by the same reference numerals.
[0010] As shown in Figure 1, the ECU 100 according to an embodiment of the present invention is mounted on a vehicle 10. The ECU 100 is a vehicle control device for driver assistance that has multiple functions to assist in driving the vehicle 10. For example, the ECU 100 has functions to assist in driving, such as emergency braking (FEB), rear emergency braking (RAEB), lane departure prevention (LDP), rear side collision prevention (BSI), autonomous driving (AD), parking assistance (APA), preceding vehicle departure notification (LCDN), and exit safety assistance (OSE). These functions of the ECU 100 are independent of each other, and a program for realizing each function is stored in the program storage area 141. The ECU 100 controls in-vehicle components such as the engine, brakes, steering, and car navigation system by executing each program stored in the program storage area 141. In this way, the ECU 100 realizes each of the driver assistance functions.
[0011] Furthermore, the ECU 100 is connected to the data center 30 wirelessly via the communication device 20, enabling communication. This allows the ECU 100 to obtain update programs from the data center 30 via OTA (Over The Air) and update each program stored in the program storage area 141 to the latest version. The ECU 100 can also obtain new programs from the data center 30 via OTA (Over The Air) and store (install) them in the program storage area 141.
[0012] Next, the hardware configuration of the ECU 100 will be described. The ECU 100 is, for example, a microcomputer. As shown in Figure 2, the ECU 100 comprises a processor 11, RAM (Random Access Memory) 12, ROM (Read Only Memory) 13, flash memory 14, a communication interface (indicated as communication I / F in the figure) 15, and EEPROM (Electrically Erasable Programmable Read-Only Memory) 16, all connected to each other via a bus 17.
[0013] The processor 11 comprises, for example, one or more CPUs (Central Processing Units) and their peripheral circuits, and performs various arithmetic operations. The processor 11 executes the control program 131 stored in the ROM 13 to perform write monitoring and leveling operations, which will be described later. The processor 11 also implements various functions to support the operation of the vehicle 10 by executing each program stored in the program storage area 141. The processor 11 may further include arithmetic circuits such as a logic unit and a numerical unit.
[0014] RAM 12 functions as the work memory of processor 11. ROM 13 stores the control program 131 described above. The control program 131 may also be stored in flash memory 14 or EEPROM 16.
[0015] The flash memory 14 is a non-volatile semiconductor memory. The flash memory 14 is a storage device having a program storage area 141. The program storage area 141 stores programs corresponding to various driving assistance functions of the vehicle 10, which are executed by the processor 11. In addition, the flash memory 14 stores various data used for processing by the processor 11 in areas other than the program storage area 141. Alternatively, storage such as an HDD (Hard Disk Drive) or SSD (Solid State Drive) may be provided in or outside the ECU 100, and this storage may be used as the program storage area 141.
[0016] Returning to Figure 2, the communication interface 15 includes an interface circuit for connecting the ECU 100 to an in-vehicle network compliant with standards such as CAN (Controller Area Network). The communication interface 15 receives signals from in-vehicle components such as brakes and engines, and the navigation system, and passes them to the processor 11. The communication interface 15 also receives update programs and newly added programs from the data center 30 via the communication device 20 and passes them to the processor 11.
[0017] Furthermore, the communication interface 15 transmits control signals generated by the processor 11 to the in-vehicle components. The control signals received from the communication interface 15 control in-vehicle components such as the engine and brakes, thereby realizing the various driver assistance functions of the ECU 100.
[0018] The EEPROM 16 is a non-volatile semiconductor memory provided separately from the flash memory 14. The EEPROM 16 stores a write count table 161 that stores the number of times data has been written to each area into which the program storage area 141 has been divided into predetermined sizes. Figure 3 shows an example of the write count table 161. This write count table 161 stores the number of times data has been written to each of the 500 areas into which the 1GB program storage area 141 has been divided into 2MB sections. In this figure, the area ID is identification information that uniquely identifies each area into which the program storage area 141 has been divided, and area IDs R1 to R500 are assigned to each area in the address order within the program storage area 141. The write count table 161 is an example of the write count storage unit of the present invention. Alternatively, instead of the write count table 161, the number of times data has been written to each area of the program storage area 141 may be stored as array-formatted data.
[0019] For example, the ECU 100 implements the functions shown in Figure 1 by the processor 11 executing the control program 131 stored in the ROM 13. Specifically, the ECU 100 implements the functions of the program update unit 110, the write monitoring unit 120, the placement determination unit 130, and the re-placement unit 140. These units are functional configurations related to the management of each program stored in the program storage area 141. The configurations related to the driver assistance functions, which are the original functions of the ECU 100, and other functional configurations are omitted in Figure 1.
[0020] The program update unit 110 obtains an update program from the data center 30 via the communication device 20 and updates the program stored in the program storage area 141.
[0021] When data is written to the program storage area 141, such as when the program stored in the program storage area 141 is updated by the program update unit 110, the write monitoring unit 120 increases the write count of the area that has been written to, which is stored in the write count table 161. Details of the processing performed by the write monitoring unit 120 will be described later.
[0022] The placement determination unit 130 refers to the write count table 161 and determines the placement of programs so that data writing is as even as possible within the program storage area 141. The rearrangement unit 140 performs a rearrangement process to move each program stored in the program storage area 141 within the program storage area 141 so that it matches the placement determined by the placement determination unit 130. Details of the processes performed by the placement determination unit 130 and the rearrangement unit 140 will be described later.
[0023] Next, we will explain the operation of the ECU 100 configured as described above. First, we will explain the operation of the write monitoring process performed by the ECU 100, following the flowchart in Figure 4. While the ECU 100 is running, the write monitoring unit 120 of the ECU 100 constantly performs the write monitoring process. The write monitoring process is executed in parallel even while other processes, such as the relocation process described later, are being performed.
[0024] First, the write monitoring unit 120 of the ECU 100 determines whether or not data has been written to the program storage area 141 (step S101). If no data has been written (step S101; No), the process waits without proceeding to the next step. On the other hand, if data has been written (step S101; Yes), the write monitoring unit 120 identifies the range within the program storage area 141 where the data was written (the write range) (step S102). Then, the write monitoring unit 120 increments the write count of the area belonging to the write range, which is stored in the write count table 161, by 1 (step S103). The process then returns to step S101.
[0025] By executing the write monitoring process, it becomes possible to accurately store the number of times data has been written to each area within the program storage area 141.
[0026] Next, the leveling process will be explained using the flowchart in Figure 5. The ECU 100 performs the leveling process every predetermined number of days (for example, 10 days).
[0027] First, the placement determination unit 130 of the ECU 100 determines whether or not there is a bias in data writing within the program storage area 141 by comparing the number of writes to each area stored in the write count table 161 with a predetermined standard (step S201). For example, the placement determination unit 130 can determine that there is a bias if the difference between the maximum and minimum values of the write counts for each area stored in the write count table 161 is greater than or equal to a threshold. For example, the placement determination unit 130 can calculate the standard deviation of the write counts for each area stored in the write count table 161 and determine that there is a bias if the standard deviation is greater than or equal to a threshold.
[0028] If it is determined that there is no bias in the writes (step S201; No), the writes within the program storage area 141 are already fairly even, and there is no need to perform the following steps, so the process ends. On the other hand, if it is determined that there is a bias in the writes (step S201; Yes), the placement determination unit 130 refers to the write count table 161 and selects one program from among the unselected programs stored in the program storage area 141 that is stored in the area with the largest number of writes (step S202). Hereinafter, the program selected in step S202 will also be referred to as the selected program.
[0029] Next, the placement determination unit 130 determines the storage location for the selected program to be the area within the program storage area 141 that has not yet been determined as a storage location, which has the minimum number of write operations (step S203).
[0030] Next, the placement determination unit 130 determines whether all programs stored in the program storage area 141 were selected in step S202 (step S204). If not all programs were selected (step S204; No), the process returns to step S202. On the other hand, if all programs were selected (step S204; Yes), the storage locations for all programs stored in the program storage area 141 have been determined in step S203. Therefore, the relocation unit 140 executes a relocation process to move the programs stored in the program storage area 141 so that they are placed in the determined storage locations (step S205). This completes the leveling process.
[0031] Next, we will explain the leveling process described above with a specific example. For example, let's assume a program storage area 141 before leveling processing, where programs A to C are stored, as shown in Figure 6A. Furthermore, let's assume that this program storage area 141 has a biased writing pattern, where the number of data writes increases as you move to the right in the figure. Let's then assume that leveling processing is performed on this program storage area 141.
[0032] In this case, first, because the program storage area 141 has a bias in writes (step S201; Yes), the placement determination unit 130 selects program A, which is stored in the leftmost area with the highest number of writes among programs A to C (step S202). Then, the placement determination unit 130 determines the storage location of program A to be the rightmost area in the program storage area 141 with the lowest number of writes (step S203). Similarly, the storage locations of programs B and C are determined sequentially. Then, the relocation unit 140 executes the relocation process based on these decisions (step S204). As a result, the program storage area 141 is in the state shown in Figure 6B. That is, compared to the state in Figure 6A, the storage positions of programs A to C are almost reversed, so when programs A to C are updated in the future, the writes to the program storage area 141 will be leveled out.
[0033] As described above, in the ECU 100 control device according to this embodiment, the placement determination unit 130 refers to a write count table 161 that stores the number of times data has been written to each area into which the program storage area 141 has been divided into predetermined sizes, and determines the placement of each program so that data writing is as even as possible within the program storage area 141. Then, the rearrangement unit 140 executes a rearrangement process to move each program within the program storage area 141 to the determined placement. As a result, data writing within the program storage area 141 can be made even, and thus the deterioration of the flash memory 14, which is a storage device having the program storage area 141, can be slowed down.
[0034] (Variations) This invention is not limited to the above embodiments, and various modifications and applications are possible. For example, parts of the above embodiments can be omitted or replaced, or arbitrary configurations can be added. Also, the hardware configuration, functional configuration, flowchart, etc. shown in the above embodiments are examples and can be changed as appropriate.
[0035] For example, it is desirable that programs stored in the program storage area 141 subject to leveling processing be pre-arranged within the program storage area 141, with similar update frequencies grouped together, as shown in Figure 7. In this example, programs D and E with high update frequencies, programs F and G with medium update frequencies, and programs H and I with low update frequencies are grouped together next to each other within the program storage area 141. The update frequency of a program can be determined by referring to the type of function of the program or the update log file. By making such a program storage area 141 subject to leveling processing, the effect of leveling writes during relocation can be further enhanced, and the occurrence of so-called gaps that cause fragmentation during relocation can also be suppressed.
[0036] For example, when moving programs stored in the program storage area 141 by the rearrangement process in step S105 of the leveling process, the free space within the program storage area 141 is used as a temporary working area. This places a load on the free space due to the rearrangement process, increasing the number of writes to the free space. Therefore, the placement of each program may be determined so that the writes to the program storage area 141 are as even as possible, taking into account the load on the free space during such rearrangement processes.
[0037] The following describes in more detail the leveling process method that also takes into account the load on the free space during the relocation process. For example, it is known that the smaller the size of the free space in the program storage area 141, the more often the free space is used as a working area, and the greater the load on the free space during the relocation process. Therefore, during the leveling process, the placement determination unit 130 refers to a table like the one shown in Figure 8A and estimates the load on the free space during the relocation process according to the proportion of the free space in the program storage area 141. Alternatively, since a higher frequency of relocation processing results in more relocation processing and a greater load on the free space, the placement determination unit 130 refers to a table like the one shown in Figure 8B and estimates the load on the free space during the relocation process according to the frequency of relocation processing performed so far. The frequency of relocation processing can be calculated by referring to log data, etc.
[0038] The placement determination unit 130 may then determine the placement of the program by referring to the table shown in Figure 8C, for example, to obtain the allocation rules for the free area in the relocation process, in accordance with the load on the free area estimated in this way, and by taking the obtained rules into consideration.
[0039] For example, in the leveling process, the placement determination unit 130 may decide to place programs for specific functions, such as safety-related functions, in the area of the program storage area 141 with the fewest data write cycles. By doing so, it is possible to improve the availability of critical functions such as safety-related functions.
[0040] In the above embodiment, the ECU 100 is not limited to a driver assistance system ECU, but may also be a multimedia system ECU, a power supply system ECU, etc. A multimedia system ECU is a general term for an ECU that controls the multimedia system of the vehicle 10. Examples of multimedia system ECUs include a navigation control ECU that controls the navigation system of the vehicle 10, and an audio control ECU that controls the audio equipment of the vehicle 10. A power supply system ECU is a general term for an ECU that controls the power supply system of the vehicle 10. Examples of power supply system ECUs include a power supply control ECU that controls the ACC (accessory) power and IG (ignition) power installed in the vehicle 10. Furthermore, the present invention is also applicable in a configuration in which the vehicle 10 is equipped with multiple types of such ECUs and each of these ECUs shares the program storage area 141.
[0041] Furthermore, the present invention is applicable to control devices other than the ECU 100, which is a control device for the vehicle 10. For example, the present invention is applicable to control devices for industrial robots and machine tools that operate by executing programs corresponding to each function. In addition, the program storage method of the present invention can be applied when storing the programs for each function in the program storage area 141 of the flash memory 14 during the manufacturing stage of the ECU 100.
[0042] Furthermore, in the above embodiment, an example was described in which the processor 11 of the ECU 100 executes the control program 131 to realize the functions of the program update unit 110, the write monitoring unit 120, the placement determination unit 130, and the re-placement unit 140. However, the processor 11 may also be configured with dedicated hardware to realize each function.
[0043] In addition, a control program 131 for executing the operations of the above-described embodiment may be stored and distributed on a recording medium such as a computer-readable CD-ROM (Compact Disc Read-Only Memory), DVD (Digital Versatile Disc), MO (Magneto Optical Disc), memory card, etc., and by installing the program in a computer, a program update unit 110, a write monitoring unit 120, an arrangement determination unit 130, and a rearrangement unit 140 of the ECU 100 that can realize each function may be configured. And when each function of the program update unit 110, the write monitoring unit 120, the arrangement determination unit 130, and the rearrangement unit 140 is realized by sharing between the OS (Operating System) and the application or by cooperation between the OS and the application, only the part other than the OS may be stored on the recording medium.
[0044] The present invention can be variously embodied and modified without departing from the broad spirit and scope of the present invention. Also, the above-described embodiment is for explaining the present invention and does not limit the scope of the present invention. That is, the scope of the present invention is indicated not by the embodiment but by the claims. And various modifications made within the scope of the claims and within the scope of the meaning of the disclosure equivalent thereto are regarded as being within the scope of the present invention.
[0045] 10 Vehicle, 20 Communication device, 30 Data center, 100 ECU, 11 Processor, 12 RAM, 13 ROM, 131 Control program, 14 Flash memory, 141 Program storage area, 15 Communication interface, 16 EEPROM, 161 Write count table, 17 Bus, 110 Program update unit, 120 Write monitoring unit, 130 Arrangement determination unit 140 Rearrangement unit.
Claims
1. A control device that realizes corresponding functions by executing each program stored in the program storage area of a storage device, comprising: a write count storage unit that stores the number of times data has been written to each area into which the program storage area has been divided into predetermined sizes; an arrangement determination unit that refers to the write count storage unit and determines the arrangement of each program in the program storage area so that data writing is as even as possible; and a rearrangement unit that performs a rearrangement process to move each program in the program storage area so that it is arranged as determined by the arrangement determination unit.
2. The control device according to claim 1, wherein programs with similar update frequencies are grouped together in the vicinity and pre-arranged within the program storage area.
3. The control device according to claim 1, wherein the placement determination unit estimates the load on the free area when executing the relocation process based on at least the size of the free area in the program storage area or the frequency of execution of the relocation process executed so far, and determines the placement of each program taking into consideration the estimated load.
4. The control device according to claim 1, wherein the placement determination unit determines that a program for a specific function is placed in the area with the fewest data write cycles.
5. The control device according to claim 1 or 2, wherein the control device is a vehicle control device.
6. A computer program placement method, comprising: determining the placement of each program stored in a program storage area such that data is written as evenly as possible within the program storage area, based on the number of times data has been written to each area obtained by dividing the program storage area of a memory device into predetermined sizes; and rearranging each program in the program storage area based on the determination.