Data storage control method and data storage control device

The method addresses sector identification issues in data storage by using write order identifiers to manage sectors effectively, ensuring data integrity and reducing processing time and burden during power interruptions.

JP7868313B2Active Publication Date: 2026-06-02NISSAN MOTOR CO LTD

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
NISSAN MOTOR CO LTD
Filing Date
2021-07-12
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing data storage control methods fail to account for unintended power outages during data writing or erasure, leading to difficulties in identifying sectors for reading and writing after restart, especially when the storage control device is interrupted.

Method used

A data storage control method that assigns an identifier indicating the write order to each sector, allowing the system to determine the latest sector for reading and writing by checking data integrity, and adjusting sectors based on the identifier during restarts and power interruptions.

Benefits of technology

Enables accurate identification of sectors for reading and writing, reducing processing burden and time, and ensuring data integrity even after power interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007868313000001
    Figure 0007868313000001
  • Figure 0007868313000002
    Figure 0007868313000002
  • Figure 0007868313000003
    Figure 0007868313000003
Patent Text Reader

Abstract

To appropriately identify sectors to be read and written from a point onwards even when writing or deleting data to the sectors of a storage device is unintentionally suspended.SOLUTION: Provided is a data storage control method for sequentially writing prescribed control data (Dk) into a plurality of sectors (s1 to s3) composed from dividing a storage area of a storage device (12), and that: causes each of the sectors (s1 to s3) to store identifiers (ids1 to ids3) indicating a writing sequence; reads the identifiers for each of the sectors; and sets, based on the read identifiers, a readout target sector (sr) representing a subject to be read out and a write-in target sector (sw) representing a subject to be written in for the control data.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a data storage control method and a data storage control device. [Background technology]

[0002] Patent Document 1 describes a data storage control method in which the storage area of ​​a memory controlled by a predetermined memory controller is divided into multiple blocks (sectors), and control data is erased and written to each sector. In this data storage control method, each sector is used as a unit for writing control data, and when the writing area for control data in the first sector is depleted, all the control data in the second sector is erased and written to the second sector. [Prior art documents] [Patent Documents]

[0003] [Patent Document 1] Japanese Patent Publication No. 2014-154024 [Overview of the project] [Problems that the invention aims to solve]

[0004] The above data storage control method does not account for the situation where the storage control device stops due to factors such as an unintended power outage while writing or erasing control data to each sector. Therefore, depending on the timing of this unintended shutdown of the storage control device, there is a problem in that it may become impossible to identify the sectors on which to read and write control data after the storage control device is restarted.

[0005] In view of these circumstances, the object of the present invention is to appropriately identify the sectors to be read from and written to in subsequent operations, even if the writing or erasure of data to a sector of a storage device is unintentionally interrupted. [Means for solving the problem]

[0006] According to one aspect of the present invention, a data storage control method is provided for sequentially writing predetermined control data to a plurality of sectors formed by dividing the storage area of ​​a storage device. In this data storage control method, an identifier indicating the writing order is stored in each sector, the identifier of each sector is read, and based on the read identifier, the sectors to be read and the sectors to be written are set. In particular, when a data storage control device that controls the storage device is started up after a power outage, Referencing the identifier of each sector, The latest sector, with an identifier indicating the most recent write order. Determine the latest sector The first inspection process is performed on the latest sector, and in the first inspection process, the integrity of the data stored in the latest sector is checked. If the data in the latest sector is incomplete, the sector to be read is set to the previous sector, and the sector to be written is set to the latest sector. The previous sector is assigned an identifier indicating the previous write order relative to the latest sector, and when writing data, It was determined to be incomplete during the first inspection process. The latest sector is overwritten with control data that should be written while the data storage control device is operating. [Effects of the Invention]

[0007] According to the present invention, it is possible to appropriately identify the sectors that should be targeted for reading and writing control data from among a plurality of sectors constituting a memory area. [Brief explanation of the drawing]

[0008] [Figure 1] Figure 1 is a block diagram illustrating one configuration of a data storage control device for executing the data storage control method in each embodiment of the present invention. [Figure 2] Figure 2 is a flowchart illustrating the startup process. [Figure 3] Figure 3 is a flowchart illustrating the process during shutdown. [Figure 4] Figure 4 illustrates the results (operation) of the data storage control method of the first embodiment. [Figure 5] Figure 5 illustrates the results (operation) of the data storage control method of the second embodiment. [Figure 6] Figure 6 illustrates the results (operation) of the data storage control method of the third embodiment. [Figure 7] Figure 7 illustrates the results (operation) of the data storage control method of the fourth embodiment. [Figure 8] Figure 8 illustrates the results (operation) of executing the data storage control method of the fifth embodiment. [Figure 9A] Figure 9A is a diagram illustrating a data storage control method as an example. [Figure 9B] Figure 9B illustrates the problems that arise in the data storage control method according to the reference example. [Modes for carrying out the invention]

[0009] Hereinafter, each embodiment of the present invention will be described in detail with reference to the drawings.

[0010] [First Embodiment] Figure 1 is a block diagram illustrating one configuration of an in-vehicle electronic control unit (ECU10) which serves as a data storage control device for executing the data storage control method in this embodiment. The ECU10 includes a non-volatile memory 12, a RAM 14, and a CPU 16.

[0011] The non-volatile memory 12 is composed of flash memory or the like, in which its storage area is divided into multiple sectors s (four sectors s1 to s4 in Figure 1) that can individually write, erase, and read data.

[0012] In particular, each sector s1 to s3 contains an identifier id that indicates the write order. s , predetermined control data D input from various sensors mounted on the vehicle and from the higher-level controller 18 k(D1, D2, D3, D4, D5...) and checksums for checking data corruption within each sector s are stored. On the other hand, sector s4 stores information about failures (physical failures) in each sector s1 to s3. In the following, to distinguish sector s4 from sectors s1 to s3, these will be referred to as the "failure information sector s4".

[0013] RAM14 functions as a storage area for temporarily storing processing data used for each process executed by the CPU16.

[0014] The CPU 16 writes, erases, and reads data to each sector s1-s3 and the fault information sector s4 in accordance with the commands of the higher-level controller 18.

[0015] More specifically, CPU16 controls data D k Of these, the updated values ​​are written to sectors s1 to s3 in a predetermined order (for example, sector s1, sector s2, and sector s3). Then, when the memory area allocated to a certain sector sk (k=1,2,3...) is filled, the data stored in the next sector sk+1 (the old control data D from the previous time) is written. k After erasing (etc.), the CPU 16 writes to sector sk+1 (hereinafter also referred to as "basic write control"). In other words, in basic write control, the CPU 16 writes by sequentially sliding the write destination within each sector s1 to s3.

[0016] Furthermore, CPU16 receives control data D k In response to requests from the higher-level controller 18 using this, control data D is retrieved from the sector s where the most recent data is stored (i.e., the sector s that was written to immediately before). k The data is read and output to the higher-level controller 18 as appropriate (hereinafter also referred to as "basic read control").

[0017] Furthermore, in addition to the basic read control and basic write control described above, the CPU 16 of this embodiment also handles data (id) for a certain sector s.s , D k ), when an unexpected power-off occurs during writing or erasing and stops the ECU10, interrupting this scene, at the time of subsequent restart of the ECU10, data (id s , D k ), when reading, identify the sector s (read target sector s r ), and at the time of subsequent normal operation of the ECU10, data (id s , D k ), when writing, identify the sector s (write target sector s w ). Execute the control logic for this. Hereinafter, the startup process, normal operation process, and shutdown process of the ECU10 that can realize this control logic will be described.

[0018] (Startup process of ECU10) Figure 2 is a flowchart for explaining the process at the startup of the ECU10. The process shown in Figure 2 starts, for example, from the reception of an ECU startup command from the upper controller 18.

[0019] First, the CPU 16 reads the failure sector information from the failure information sector s4 (step S110). Then, the CPU 16 determines whether there is a failed sector s among the sectors s1 to s3 (step S120). If the CPU 16 determines that there is a failed sector s, it excludes the sector s from the targets of subsequent read and write processes (Yes in step S120 and step S130). On the other hand, if the CPU 16 determines that there is no failed sector s, it skips the process of step S130 (No in step S120).

[0020] Next, the CPU 16 reads the identifiers id s1 ~id s3 of all sectors s1 to s3 (excluding this if there is a failed sector s) (step S140). Further, the CPU 16 reads the identifier id sla attached to the latest sector s indicating the latest write order laThis is decided (step S150).

[0021] Next, CPU16 processes the latest sectors la The data stored in (id sla ,D k ) checks for damage (step S160). Specifically, CPU16 checks the latest sector s la Using the checksum stored in a portion of the memory area, the data (id sla ,D k Inspect for damage to ).

[0022] Then, CPU16 processes the data (id sla ,D k If it is determined that there is no damage to the latest sector s la The sectors to read are s r This is determined (Yes in step S170 and in step S200).

[0023] On the other hand, CPU16 processes the data (id sla ,D k If it is determined that there is damage to sector s4, the fault information of sector s4 is updated (step S180), and the latest sector s la The identifier id indicates the previous write order. la1-1 The previous sector s la1-1 The sectors to read are s r This is determined (No. in step S170 and step S190).

[0024] Then, CPU16 reads the configured target sector s r From data (id sr ,D k Control data D, such as reading ) and outputting it to the upper controller 18. k The process to make it available for use is executed (step S210).

[0025] (Processing during normal operation of ECU10) CPU16 processes the data (id) of each sector s. s ,D kIn response to a request for an update, the above basic write control and read control are executed, and the data update results are stored in RAM14 as appropriate.

[0026] (Processing when ECU10 stops) Figure 3 is a flowchart illustrating the process when the ECU 10 is stopped. The process shown in Figure 3 is initiated, for example, by receiving an ECU start command from the higher-level controller 18.

[0027] First, the CPU 16 reads fault sector information from fault information sector s4 (step S310). Then, the CPU 16 determines whether or not a faulty sector s exists in each sector s1 to s3 (step S320). If the CPU 16 determines that a faulty sector s exists, it excludes that sector s from subsequent read and write operations (Yes in step S320 and step S330). On the other hand, if the CPU 16 determines that no faulty sector s exists, it skips the process in step S330 (No in step S320).

[0028] Next, CPU16 uses the identifier id of all sectors s1~s3 (excluding any faulty sector s). s1 ~id s3 The CPU 16 reads out the identifier id, which indicates the most recent write order. sla The latest sectors marked with la write to sector s w This is decided (step S350).

[0029] Furthermore, CPU16 has the latest sector s la+1 Delete all data and control data D k , check sub, and identifier id sla Write the data (steps S360 to S390).

[0030] Based on the processes described above, the effects of this embodiment will be explained in comparison with the reference example.

[0031] Figure 9A is a diagram illustrating a data storage control method related to a reference example. In particular, the data storage control method related to the reference example includes the identifier id. s Without using control data D, each sector s is sent to the control data D. k A control method for writing to sector s1 is assumed. As shown in the figure, in the data storage control method according to the reference example, when the ECU 10 is writing to a specific sector s1 and the storage area of ​​sector s1 is filled, the storage area of ​​the next sector s2 is erased and control data D is written sequentially from the beginning of sector s2. k Write the message.

[0032] In the data storage control method described in the above example, if the ECU 10 stops due to an unintended power interruption during writing to sector s1 or erasing sector s2, it becomes impossible to identify the sector s that should be written to or read from when the ECU 10 restarts. This will be explained in more detail.

[0033] Figure 9B illustrates the problems that arise in the data storage control method according to the reference example. As shown in the figure, in the data storage control method of the reference example, if an unintended power outage occurs after writing to sector s1 but before erasing the data recorded in sector s2, the ECU 10 will stop with the data in the next sector s2 not being erased (see Figure 9B(a)).

[0034] Therefore, if the ECU10, which has stopped in this manner, is restarted later, control data D will be stored in all sectors s (s1 to s3 in the diagram). k Since it will be in a state where it is written, the latest sector s that should be read la (Latest control data D) k Identifying the sector s) in which the data is stored becomes difficult (see Figure 9B(b)).

[0035] On the other hand, Figure 4 is a diagram illustrating the result (operation) of executing the data storage control method of this embodiment. As shown in the figure, with the data storage control method of this embodiment, control data D is stored in a portion of the storage area of ​​each sector s1 to s3.k Identifier id indicating the order in which to write s (In the diagram, "No.2", "No.3", and "No.4") will be stored in memory.

[0036] Therefore, even if an unintended power outage occurs after writing to sector s1 but before erasing the data in the next sector s2, as described above, when the ECU10 is restarted, the latest sector s that should be read will be read. la+1 This allows for optimal discrimination (see Figure 4(b)).

[0037] The configuration and effects of this embodiment, as described above, will now be summarized.

[0038] In this embodiment, predetermined control data D is stored in multiple sectors s1 to s3, which are formed by dividing the storage area of ​​the storage device (non-volatile memory 12). k A data storage control method is provided that writes the data sequentially.

[0039] This data storage control method assigns an identifier id to each of sectors s1 to s3 to indicate the write order. s1 ~id s3 Store the identifiers id for each sector s1 to s3. s1 ~id s3 Read the ID, and retrieve the identifier id. s Based on control data D k The sectors to be read are s r and the sectors to be written to s w Set it.

[0040] This results in control data D k When reading and writing, control data D k This allows for the appropriate identification of sectors s that should be targeted for reading and writing.

[0041] Also, the identifier id for each sector s s Control data D can be accessed (read and compared) simply by referring to it. kSince it is possible to determine which sector s to write to, the processing burden can be reduced compared to using all the data stored in each of the sectors s1 to s3. As a result, the processing power required of the ECU 10 can be reduced, or the processing time can be shortened.

[0042] In particular, in this embodiment, the data (id s ,D k When writing to the target sector s, w Control data D k ID along with identifier s Write it down.

[0043] This ensures that even if the ECU10 unexpectedly stops due to a power interruption during data writing, the control data D will be recorded during subsequent writing (while the ECU10 is operating after restarting). k The identifier id, which was written along with the identifier id s Refer to the appropriate sectors to write to. w It is possible to identify this.

[0044] Furthermore, in the data storage control method of this embodiment, the sector to be read s r The identifier id indicates the most recent write order. sla The latest sectors marked with la Set to . Also, write target sectors s w The latest sectors la Set to this.

[0045] As a result, even if the ECU10 unintentionally stops due to a power outage during data writing, the latest control data D will be read when the data is read after the stop (when the ECU10 restarts). k The latest sector that was stored la A read operation can be performed on the latest control data D. k The latest sector that was stored la Identify and appropriately control data D kWriting can be executed. That is, more specific control logic for selecting appropriate sectors s during both data reading and data writing is realized.

[0046] Furthermore, in this embodiment, an ECU 10 as a data storage control device in which the above data storage control method is executed is provided. This ECU 10 writes predetermined control data D to a plurality of sectors s1 to s3 formed by dividing the storage area of a storage device (nonvolatile memory 12). k in order.

[0047] In particular, the ECU 10 includes a storage unit that stores an identifier id indicating the writing order for each of the sectors s1 to s3, a reading unit that reads the identifiers id of each of the sectors s1 to s3, and a setting unit that sets a reading target sector s and a writing target sector s that are the reading targets of the control data D based on the read identifier id. s to id s1 ~id s3 and a setting unit that sets a reading target sector s and a writing target sector s that are the writing targets of the control data D based on the read identifier id. s to id k for the control data D r and a writing target sector s w is provided.

[0048] Thereby, a suitable system configuration for executing the data storage control method of this embodiment is realized.

[0049] [Second Embodiment] Hereinafter, the second embodiment will be described. The same elements as those in the first embodiment are denoted by the same reference numerals, and the description thereof will be omitted.

[0050] In this embodiment, the ECU 10 executes a first inspection process (step S160) for inspecting the integrity of the data (id, D) stored in the latest sector s. And when the data (id, D) of the latest sector s is incomplete, the ECU 10 sets the reading target sector s to the previous sector s. la stored in the latest sector s sla , D k ). And when the data (id, D) of the latest sector s la is incomplete, the ECU 10 sets the reading target sector s sla , D k ) is incomplete, the reading target sector s r to the previous sector s la1-1Set to and write target sectors s w latest sectors la Set it to the data (id). sla ,D k When writing to the latest sector, la Control data D k Overwrite the previous file.

[0051] Figure 5 is a diagram illustrating the result (operation) of executing the data storage control method of this embodiment. In the example shown in Figure 5, control data D is sent to sector s1. k If the ECU10 is unexpectedly stopped due to a power outage or other reason during the data writing process, the control data D in sector s1 will be lost. k This results in a state where only a portion of the data is written (Figure 5(a)).

[0052] In this case, during the startup process of the next ECU10, an identifier id indicating the latest write order is used. la Sector s1 (latest sector s) is labeled "No. 4" in Figure 5. la ) to read sector s r If determined to be so, at the time of reading (step S200), the incomplete control data D stored in sector s1 is read. k This will be read out.

[0053] In contrast, with the control logic of this embodiment, if the ECU10 stops unintentionally, the identifier id will be generated during the next startup process. sla1 The latest sectors marked with la (sector s1) data (id sla1 ,D k If the previous identifier id is determined to be incomplete (damaged) (Figure 5(b)), sla1-1 The previous sector s la1 -1 is the number of sectors to read. r The settings are configured and reading is performed (Figure 5(c)).

[0054] Furthermore, during subsequent writing operations of the ECU10, the latest sector s of data is corrupted. la(Sector s1) is the sector s to be written to. w It is set to that data (id s1 ,D k ) is overwritten (Figure 5(d)). Therefore, when writing after an unintended shutdown of the ECU 10, it is possible to suitably avoid a situation in which writing is performed while a sector s1 with corrupted data remains. As a result, the occurrence of a situation in which the number of sectors s with corrupted data increases due to multiple unintended shutdowns of the ECU 10 is suppressed.

[0055] [Third Embodiment] The third embodiment will be described below. Elements similar to those in the first or second embodiment will be denoted by the same reference numerals, and their descriptions will be omitted.

[0056] In this embodiment, the ECU10 receives data (id s ,D k When writing to the latest sector, la Even after executing a write operation and completing the write, the next time sector s la+1 It maintains the data stored in it, and then the data that is executed afterwards (id s ,D k When reading the data from the next sector, la+1 The data stored in (id sla+1 ,D k Delete ).

[0057] Figure 6 is a diagram illustrating the results (operation) of executing the data storage control method of this embodiment. As shown in Figure 6, according to this embodiment, the latest sector s la When writing to (sector s1), the next sector s that will be written to next will be written to. la+1 The data in sector s2 is preserved (Figure 6(a)).

[0058] And then, data to sector s1 (id s ,D k If ECU10 unexpectedly stops during the writing process, the next sector s that will be written to will be read during the subsequent read operation (startup process).la+1 (Sector s2) is erased (Figure 6(b)). Furthermore, during subsequent writing (normal operation), the next sector s la+1 Control data D for k The write operation will then be performed (Figure 6(c)).

[0059] This results in control data D k If ECU10 unexpectedly stops during writing, the number of sectors to be erased during subsequent writing will be determined by the next sector s la+1 It can be limited to only that. That is, the control data D whose writing was interrupted. k The latest sectors have become incomplete. la Since the erase process for sector s1 can be omitted, the time required for the write process (especially the processing time when writing after passing through an unintended ECU 10) can be further reduced.

[0060] [Fourth Embodiment] The fourth embodiment will be described below. Elements similar to those in the first to third embodiments will be denoted by the same reference numerals, and their descriptions will be omitted.

[0061] In this embodiment, the ECU10 receives data (id s ,D k When writing ) control data D k After writing the identifier id s Write it down.

[0062] Figure 7 is a diagram illustrating the result (operation) of executing the data storage control method of this embodiment. In this embodiment, the sector s to be written to is w For (sector s1), control data D k After writing the identifier id s1 Since the data is written, if the ECU10 stops unintentionally during data writing, the identifier id for sector s1 will be written. s1 The writing process will not be completed (Figure 7(a)).

[0063] Therefore, during subsequent read operations (the next startup process), the identifier id s1 Sector s1 (latest sector s) is missing. la ) is the sector to be written to s w Not set to the previous sector s la1-1 (Sector s3) is the sector to be read from s r This will be set to (Figure 7(b)).

[0064] Therefore, the reading and processing of data in sector s1, where the data is incomplete due to an unintended halt of ECU10 during the writing process, can be omitted.

[0065] More specifically, the identifier id for sector s1 s1 While the writing of the control data D is complete, k If the ECU10 unexpectedly stops before the writing process is complete, the target sector s will be read during the next startup process. r To determine this, sector s1 (latest sector s la ) data (identifier id s1 and control data D k ) and sector s3 (previous sector s la1 -1) data (identifier id s3 and control data D k After reading both sectors s1 and sector s3, it is determined that sector s1 is incomplete, and then sector s3 is read from the target sector s r It is necessary to perform a process to set this. In contrast, with the control logic of this embodiment, sector s1 (latest sector s la If ECU10 unexpectedly stops while writing data to ), the identifier id s1 Since it will be in a state where it has not been written, the identifier id of sector s1 s1 Without performing the process of reading sector s3 (previous sector s la1 -1) to read sectors r It can be set to that.

[0066] [Fifth Embodiment] The fifth embodiment will be described below. Elements similar to those in the first to fourth embodiments will be denoted by the same reference numerals, and their descriptions will be omitted.

[0067] In this embodiment, the ECU10 controls the latest sector s la A second inspection process is performed to check whether the data stored in is corrupted. Then, the ECU10 checks the latest sector s la If the data is corrupted, the latest sector s la It was determined that the latest sector s la write to sector s w and the sectors to be read s r Remove it from the list of candidates.

[0068] Figure 8 is a diagram illustrating the results (operation) of executing the data storage control method of this embodiment. In particular, in this embodiment, due to the effects of unintended shutdown of ECU 10, the latest sector s la Let's consider a scenario where sector s1 is physically damaged (Figure 8(a)). In such a scenario, during subsequent read operations (the next startup process), sector s1, which was determined to have corrupted data, will be judged as physically damaged (Figure 8(b)). Then, sector s1 will be read from sector s r It was excluded from the candidates, and last time sector s la1 -1 (sector s3) is the sector s to be read. r This will be set to (Figure 8(c)).

[0069] Furthermore, during subsequent writing (when ECU10 is activated), sector s1 (the latest sector s) which was determined to be physically faulty, will be checked. la ) but the sectors to be written to s w It is excluded from the candidates, and the next sector s la+1 The sectors to be written to are s w This will be set to (Figure 8(d)).

[0070] Therefore, with the control logic of this embodiment, in a scenario where a specific sector s (sector s1 in Figure 8) physically fails and data reading and writing becomes impossible, it is possible to avoid performing data reading and writing to the failed sector s1. As a result, by repeatedly reading and writing data to the failed sector s1, control data D obtained by referring to all sectors s1 to s3, including sector s1, can be obtained. k This can guarantee the legitimacy of the claim.

[0071] [Differentiation] In the modified data storage control method, the control logic described in the fourth embodiment (write target sector s) is based on the data storage control method of the fifth embodiment. w Control data D k After writing the identifier id s The logic used is to write to the latest sector s. la Of the data stored, control data D k The identifier id is corrupted, and sla If it has been written (is readable), the latest sector s la It is determined that it is physically broken.

[0072] This will result in the latest sectors la Writing data to control data D k from identifier id sla Because it is done in this order, an unintended shutdown of ECU10 may occur during writing, and the latest sector s la If the data is incomplete, at least the identifier id sla This is limited to situations where the writing process has not been completed and the data cannot be read (see Figure 7). Therefore, the latest sector s la When reading the data, control data D k Despite the identifier being corrupted, sla The condition that it is readable is the latest sector s laThis applies only when there is an abnormality in the device itself (i.e., a physical malfunction).

[0073] Therefore, if the modified data storage control method is used, the latest sectors la This allows for more accurate detection of physical malfunctions.

[0074] Although embodiments of the present invention have been described above, the configurations described in the above embodiments represent only a part of the application examples of the present invention and are not intended to limit the technical scope of the present invention. For example, in the above embodiments, an in-vehicle ECU 10 equipped with a non-volatile memory 12 as a storage device was described as one embodiment of a data storage control device for executing the data storage control method of the present invention. However, the data storage control device is not limited to this, and can be realized by any computer equipped with a non-volatile memory as a storage device that can retain data even when the power supply is cut off.

[0075] Furthermore, the above embodiments can be combined with each other to the extent that they do not contradict each other. [Explanation of Symbols]

[0076] 10 ECUs, 12 non-volatile memory, 14 RAM, 16 CPUs, 18 higher-level controllers, s1~s3 sectors

Claims

1. A data storage control method that sequentially writes predetermined control data to multiple sectors formed by dividing the storage area of ​​a storage device, Each of the sectors is given an identifier indicating the write order, Read the identifier for each of the sectors, Based on the identifier read, the sectors to be read and the sectors to be written to are set for reading the control data. When the data storage control device that controls the storage device starts up after the power is cut off, it refers to the identifier of each sector and determines the latest sector to which the identifier indicating the latest write order is attached. The first check process is performed on the latest sector that has been determined. In the first inspection process, the integrity of the data stored in the latest sector is checked, If the data in the latest sector is incomplete, The sector to be read is set to the previous sector, and the sector to be written is set to the latest sector. The aforementioned previous sector is assigned the identifier that indicates the write order immediately preceding the latest sector. When writing data, the latest sector determined to be incomplete in the first inspection process is overwritten with the control data to be written while the data storage control device is operating. Data storage control method.

2. A data storage control method according to claim 1, When writing data, the identifier is written to the target sector along with the control data. Data storage control method.

3. A data storage control method according to claim 1, When writing data, even after writing to the latest sector is completed, the data stored in the next sector, which is assigned the identifier indicating the next write order after the latest sector, is maintained. When data is read subsequently, the data stored in the next sector is erased. Data storage control method.

4. A data storage control method according to claim 1, When writing data, the identifier is written after the control data is written. Data storage control method.

5. A data storage control method according to claim 1, A second inspection process is performed to check whether the data stored in the latest sector is corrupted. If the data in the latest sector is corrupted, it is determined that the latest sector is physically faulty, and the latest sector is excluded from the candidates for the sector to be written to and the sector to be read from. Data storage control method.

6. A data storage control device that sequentially writes predetermined control data to multiple sectors formed by dividing the storage area of ​​a storage device, A storage unit that stores an identifier indicating the write order in each of the sectors, A reading unit that reads the identifier of each of the sectors, A setting unit sets the target sectors for reading the control data and the target sectors for writing the control data based on the identifier read out, Equipped with, The aforementioned setting unit is, When the data storage control device that controls the storage device starts up after the power is cut off, it refers to the identifier of each sector and determines the latest sector to which the identifier indicating the latest write order is attached. The first check process is performed on the latest sector that has been determined. In the first inspection process, the integrity of the data stored in the latest sector is checked, If the data in the latest sector is incomplete, The sector to be read is set to the previous sector, and the sector to be written is set to the latest sector. The aforementioned previous sector is assigned the identifier that indicates the write order immediately preceding the latest sector. When writing data, the latest sector determined to be incomplete in the first inspection process is overwritten with the control data to be written while the data storage control device is operating. Data storage and control device.