Data storage method and system for automobile electronic control system

By dividing the data storage area and calculating the physical address in the automotive electronic control system, the problem of overall failure caused by partial damage to the storage device is solved, and data storage with high reliability and economy is achieved.

CN121979440APending Publication Date: 2026-05-05CLP TECH INNOVATION ZHILIAN (WUHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CLP TECH INNOVATION ZHILIAN (WUHAN) CO LTD
Filing Date
2025-12-02
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing automotive electronic control systems lack effective bad block avoidance mechanisms when partial damage occurs to storage devices, leading to overall storage device failure and failing to meet high reliability requirements.

Method used

The storage device is divided into data storage areas, and basic information blocks are set at the beginning of each area to generate a basic information dictionary for the data area. The physical address is calculated through the logical relationship between time slices and storage devices. The device automatically switches to a blank area to store data when it is damaged, and RAID 1 mirroring is used to enhance reliability.

Benefits of technology

It enables automatic switching of storage areas when storage devices fail, improving the efficiency, security, and economy of data storage, and meeting the high reliability requirements of automotive electronic control systems for data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979440A_ABST
    Figure CN121979440A_ABST
Patent Text Reader

Abstract

The invention provides an automobile electronic control system data storage method and system, and relates to the field of data storage, the method comprises the following steps: pre-dividing data storage areas on a storage device, and setting a data area basic information block at the initial part of each data storage area; traversing the basic information blocks of all the data storage areas, and generating a data area basic information dictionary in a memory; when a data writing operation is carried out, calculating a target physical address of to-be-stored data on the storage device according to the starting time of the time slice to which the to-be-stored data belongs and the total offset address of the current effective data storage area; and executing data writing, and if writing succeeds, completing the operation. According to the technical scheme, the data storage reliability is improved, and the data storage reliability is further improved through a designed multi-storage-device data mirror image storage auxiliary mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage, and in particular to a data storage method and system for automotive electronic control systems. Background Technology

[0002] Automotive electronics is a general term encompassing both vehicle-mounted and in-vehicle electronic control devices, including engine control systems, chassis control systems, and body electronic control systems. These electronic control systems, composed of sensors, microprocessors, and actuators, enhance vehicle safety, comfort, entertainment, and fuel economy. The proportion of electronic equipment in the overall vehicle cost is increasing year by year. Currently, traditional gasoline vehicles typically require 50-100 MCUs (microcontroller units), while new energy vehicles or intelligent models may have over 200 MCUs. In some vehicles, electronic products account for more than 50% of the total vehicle cost.

[0003] In an automotive electronic control system, the ECU (Electronic Control Unit) receives input signals from sensors, analyzes and calculates the data, adjusts the vehicle's operating parameters based on the calculation results, converts the calculated control parameters into control signals and sends them to the actuators, and simultaneously monitors the vehicle's operating status.

[0004] During the operation of an automotive electronic control system, it is necessary to store sensor-collected data, analyzed and processed information, operational information, and fault information. The host computer and the vehicle networking platform read the data stored in the control system by issuing communication commands for vehicle operation status and fault analysis and processing.

[0005] While sequential data storage without a file system offers advantages such as real-time performance and high speed, it lacks the ability to mitigate damage to certain storage areas, unlike file system storage methods. Consequently, it cannot fully meet the high reliability requirements of automotive electronic control systems for data storage. Summary of the Invention

[0006] The purpose of this invention is to address the problem that when a local physical area of ​​a storage device is damaged, the lack of an effective bad block avoidance mechanism may lead to the failure of the entire storage device, thus failing to meet the high reliability requirements for data storage in the automotive electronics field. This invention provides a data storage method and system for automotive electronic control systems.

[0007] The above-mentioned objective of this application is achieved through the following technical solution: S1: One or more data storage areas are pre-divided on the storage device. Each data storage area has a basic information block at the beginning to record the availability status and start time of the area. S2: When the system starts, iterate through the basic information blocks of all data storage areas and generate a basic information dictionary of data areas in memory. The dictionary contains at least the available flag, start time, end time and total offset address of each area. S3: When performing a data write operation, calculate the target physical address on the storage device based on the start time of the time slice to which the data to be stored belongs, combined with the total offset address of the current valid data storage area. S4: Perform data writing. If the writing is successful, the operation is completed. If the writing fails, the current data area is marked as corrupt, a new data storage area is created in the subsequent blank space of the storage device, the basic information dictionary of the data area is updated, and the data is written to the new area.

[0008] Optionally, step S1 includes: The data blocks of each time slice in the data storage area of ​​the storage device are arranged sequentially and the data area size is consistent.

[0009] Optionally, step S1 may further include: Each time slice of data contains two parts: a data timestamp identifier and valid data. The information in the data timestamp identifier includes the "year, month, day, hour, minute, and second" information of the time slice start time, which is used to identify the uniqueness of the time slice in the data block; Valid data includes: data from a single point in time within a time slice, data from multiple points in time within a time slice, and continuous data streams.

[0010] Optionally, step S2 includes: The basic information dictionary for the data area is an array structure, with the last element representing the currently valid, readable and writable data storage area.

[0011] Optionally, step S2 includes: The formula for calculating the target physical address is: in, The calculated target physical address; This is the total offset address of the current data region, which is the starting physical address of the data region on the storage device; The length of the basic information block in the data area, in bytes; The time difference between the start time of the time slice to be stored and the system's preset initial time base, in seconds; The preset length of a single time slice, in seconds; The fixed length of the data block corresponding to a single time slice on the storage device, in bytes.

[0012] Optionally, step S4 includes: Multiple storage devices are used to synchronously store the same data in RAID 1 mirroring. When reading data from the primary storage device fails, the system automatically switches to the mirrored storage device for reading.

[0013] Optionally, the storage device is a flash memory card or a hard drive.

[0014] A data storage system for an automotive electronic control system, the system comprising: a data writing function module, a data reading function module, a storage device address calculation function module, a data format conversion function module, and a storage device scheduling function module; The data writing function module is used to call the storage device address calculation function module to obtain the physical address of the data storage device. When a storage device write error occurs, the current data area in the basic information dictionary of the data area is set to damaged. A new data area is created in the remaining free area of ​​the storage device, and the information of the new data area is added to the dictionary as the current data area. The new data is then written to the new data area. The data reading module is used to call the data format conversion module to convert the stored format data into PCB circuit format data before returning data to the PCB circuit control system; and to initialize the basic information dictionary of the data area in memory when the electronic control system starts. The storage device address calculation module is used to calculate the physical address of the data stored in the storage device based on the start time of the data time slice; The data format conversion module is used to convert between PCB circuit control system format data and storage device format data; The storage device scheduling function module is used to simultaneously save data with the same time slice to the same physical address data block on multiple storage devices.

[0015] An electronic device includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform a data storage method for an automotive electronic control system.

[0016] A computer-readable storage medium storing instructions that, when executed, perform a data storage method for an automotive electronic control system.

[0017] The beneficial effects of the technical solution provided in this application are: It uses the physical address of the storage device to directly write and read stored data, calculates the corresponding storage address of the data based on the logical relationship between the data storage address and the data occurrence time, and reads and writes stored data at high speed. At the same time, it has the function of avoiding damage to the storage area, realizing efficient, safe and economical storage of automotive electronic control system data, and meeting the high reliability requirements of automotive electronic control system for stored data.

[0018] The present invention has the following technical features: 1. Versatility: This method directly uses the physical address of the storage device to write and read data, without relying on the operating system and file system. It is particularly suitable for microcontroller development and PCB circuit control systems, and can be widely used in automotive electronic control systems that require real-time data storage in ECUs (electronic control units).

[0019] 2. High speed: When reading and writing data, this method directly calculates the physical address in the storage device based on the start time of the data time slice, without the need for time-consuming operations such as searching the file index table or querying the address database, thus improving the data read and write speed. In addition, this method stores data in a contiguous area of ​​the storage device, which reduces the number of storage device addressing operations compared to other non-contiguous area storage methods, further improving the data read and write speed.

[0020] 3. High Reliability: When a portion of the data storage area within the current storage area is damaged, this method automatically recalculates the physical address in a blank area of ​​the storage device and moves the entire data storage to a blank area following the original data storage area. Data is written to avoid the damaged storage area. This method solves the problem of sequential storage without a file system failing due to the inability to read or write to a partial storage area, rendering the entire storage device unusable. Furthermore, this storage method proposes a multi-storage device RAID1 mirroring method to save sequential storage data without a file system, further improving the reliability of the stored data.

[0021] 4. Real-time performance: Since this storage method uses the logical relationship between time slices and storage device addresses to calculate the data storage address, the control system only needs to perform simple logical operations to obtain the data storage address when saving data. It does not need to perform time-consuming storage device file address retrieval operations. Therefore, it is particularly suitable for electronic control systems that acquire and process data in real time to use as their data storage method.

[0022] 5. Economic efficiency: When electronic control systems need to store data, this data storage method can be used to achieve data storage by adding inexpensive solid-state drives, memory cards, and other storage devices to the PCB circuit board. Attached Figure Description

[0023] The present application will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1This is a step diagram of an embodiment of this application; Figure 2 This is a module connection diagram in the embodiments of this application; Figure 3 This is a flowchart illustrating the process executed when a write exception occurs in an embodiment of this application. Figure 4 This is a flowchart illustrating the generation process of the basic information dictionary for the data area in this application embodiment; Figure 5 This is a schematic diagram of the electronic device structure in the embodiments of this application. Detailed Implementation

[0024] To provide a clearer understanding of the technical features, objectives, and effects of this application, the specific embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0025] Embodiments of this application provide a data storage method for an automotive electronic control system.

[0026] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of a data storage method for an automotive electronic control system according to an embodiment of this application, including: S1: One or more data storage areas are pre-divided on the storage device. Each data storage area has a basic information block at the beginning to record the availability status and start time of the area. S2: When the system starts, iterate through the basic information blocks of all data storage areas and generate a basic information dictionary of data areas in memory. The dictionary contains at least the available flag, start time, end time and total offset address of each area. S3: When performing a data write operation, calculate the target physical address on the storage device based on the start time of the time slice to which the data to be stored belongs, combined with the total offset address of the current valid data storage area. S4: Perform data writing. If the writing is successful, the operation is completed. If the writing fails, the current data area is marked as corrupt, a new data storage area is created in the subsequent blank space of the storage device, the basic information dictionary of the data area is updated, and the data is written to the new area.

[0027] As one example, such as Figure 2As shown, in automotive electronic control systems, the "PCB circuit control system" saves data to a "storage device" using this "electronic control system data storage method." The "PCB circuit control system" also reads corresponding time-slice data from the "storage device" using this "electronic control system data storage method." The "PCB circuit control system" refers to all types of electronic control units (ECUs) in automotive electronic control systems. Its core is a microprocessor, typically a single-chip microcomputer, used by the electronic control system to complete data acquisition, data processing, output control, operating status monitoring, and fault diagnosis.

[0028] As one example, such as Figure 1 As shown in the flowchart, the flowchart describes: 1. When the PCB circuit control system saves data, it calls the data write function interface in the data write function module to start saving the data to the storage device; if the length of the data area dictionary information in memory is 0, it is the first write and the data area creation operation is executed. 2. The data writing function module calls the storage address calculation function interface in the storage device address calculation function module, takes the start time of the time slice where the stored data is located as the input parameter, calculates the physical address of the storage device corresponding to the data at the specified time, and returns the calculated physical address to the data writing function module. 3. The data writing function module calls the function interface in the data format conversion function module to convert the control system format data to the storage device format data, converts the control system format data to the storage device format data, and returns the converted storage device format data to the data writing function module; 4. After step 3, if the storage device mirror saves data, the data writing function module calls the multi-storage device data simultaneous writing function in the storage device scheduling function module to save the data to the same physical address of multiple mirrored storage devices; otherwise, the data writing function module directly saves the data to the specified physical address of the storage device. 5. After data is written to the storage device, the storage device returns the data saving result to the data writing function module. If the storage device is mirrored for data saving, the data saving result for multiple storage devices is returned by the storage device scheduling function module. If an exception occurs during the write operation, a data region creation operation is performed. 6. The data writing function module returns the stored data saving result to the PCB circuit control system.

[0029] Step S1 includes: The data blocks of each time slice in the data storage area of ​​the storage device are arranged sequentially and the data area size is consistent.

[0030] Step S1 also includes: Each time slice of data contains two parts: a data timestamp identifier and valid data. The information in the data timestamp identifier includes the "year, month, day, hour, minute, and second" information of the time slice start time, which is used to identify the uniqueness of the time slice in the data block; Valid data includes: data from a single point in time within a time slice, data from multiple points in time within a time slice, and continuous data streams.

[0031] In one embodiment, this data storage method has a fixed total time range for data storage and a fixed time slice length. Each time slice data storage area in the storage device is arranged sequentially as shown in the diagram, and the data area size is consistent. For example, if the storage time range is one year and each time slice is 10 seconds, then the number of time slice data storage areas required is: (366 days * 24 hours * 60 minutes * 60 seconds) / 10 seconds = 3,162,240. If the time slice data block length is 512 bytes, then the total time slice data size in this example is 1,619,066,880 bytes. In the above example, the data in the current year's time slice uses the same physical address as the previous year, directly overwriting the previous year's data.

[0032] If the data is saved up to the last time slice, the data for the next time slice will be saved back to the location of the first time slice in the storage device. Data is saved to the storage device in a time cycle, with new data overwriting the original data.

[0033] Each time slice of data contains two parts: a timestamp identifier and valid data. The timestamp identifier contains the "year, month, day, hour, minute, second" information of the time slice start time, used to uniquely identify the time slice within the data block. The valid data can be data from one or more time points within the time slice, or it can be a continuous data stream, such as audio or video data. The data format of the valid data saved to the storage device can be determined by the respective protocols according to the actual application requirements of the data.

[0034] In one embodiment, the basic information block of the data area plays a crucial role in the fault-tolerant operation of this data storage method. The storage device can have multiple available storage areas. When a read / write error occurs in the current data area, a new storage area is automatically created in the blank area at the rear of the storage device. The last storage area in the storage device is the currently valid storage area, and its data area availability flag is normal. The availability flags of other data areas are all corrupted. During initialization, the "data read function module" of the electronic control system traverses all data areas to generate a basic information dictionary of the data areas. The dictionary information includes the availability flag, start time, end time, and total offset address. The data area dictionary is an array-type data structure, with the last element being the information of the current data storage area.

[0035] As one embodiment, the distance between each storage area is a fixed size. For example, if the total capacity of the storage device used in the above example is 8GB, then a maximum of 4 data areas can be automatically generated. This method improves the fault tolerance of the storage device and extends its service life.

[0036] Step S2 includes: The basic information dictionary for the data area is an array structure, with the last element representing the currently valid, readable and writable data storage area.

[0037] Step S2 includes: The formula for calculating the target physical address is: in, The calculated target physical address; This is the total offset address of the current data region, which is the starting physical address of the data region on the storage device; The length of the basic information block in the data area, in bytes; The time difference between the start time of the time slice to be stored and the system's preset initial time base, in seconds; The preset length of a single time slice, in seconds; The fixed length of the data block corresponding to a single time slice on the storage device, in bytes.

[0038] Step S4 includes: Multiple storage devices are used to synchronously store the same data in RAID 1 mirroring. When reading data from the primary storage device fails, the system automatically switches to the mirrored storage device for reading.

[0039] The storage device is a flash memory card or a hard drive.

[0040] The storage device is a flash memory card (including SD card, SM card, CF card, PCI-e flash memory card, Memory Stick, XD card, eMMC and micro hard disk) or a hard disk (including HDD and SSD).

[0041] A data storage system for an automotive electronic control system, the system comprising: a data writing function module, a data reading function module, a storage device address calculation function module, a data format conversion function module, and a storage device scheduling function module; The data writing function module is used to call the storage device address calculation function module to obtain the physical address of the data storage device. When a storage device write error occurs, the current data area in the basic information dictionary of the data area is set to damaged. A new data area is created in the remaining free area of ​​the storage device, and the information of the new data area is added to the dictionary as the current data area. The new data is then written to the new data area. As one embodiment, the data writing function module provides an external data writing interface, enabling it to write data to a data storage device. When the PCB circuit control system needs to save data, it calls the data writing interface to write the data to the data storage device. Before writing data, the data writing function module calls the "data format conversion function module" to convert the interface input data into storage device format data. It then calls the "storage device address calculation function module" to obtain the physical address of the data storage device. If a storage device write error occurs, the module sets the current data area in the data area basic information dictionary to "damaged," creates a new data area in the remaining free area of ​​the storage device, adds the information of the new data area as the current data area to the dictionary, and writes the new data to the new data area.

[0042] The data reading module is used to call the data format conversion module to convert the stored format data into PCB circuit format data before returning data to the PCB circuit control system; and to initialize the basic information dictionary of the data area in memory when the electronic control system starts. As one embodiment, the data reading function module provides a storage data reading interface and has the function of reading data from the data storage device. When the PCB circuit control system needs to read data, it calls the data reading interface to read data from the data storage device. Before reading data, the data reading function module calls the "storage device address calculation function module" to obtain the physical address of the data storage. Before returning data to the PCB circuit control system, it calls the "data format conversion function module" to convert the stored format data into PCB circuit format data. When the electronic control system starts, it initializes the basic information dictionary of the data area in memory.

[0043] The storage device address calculation module is used to calculate the physical address of the data stored in the storage device based on the start time of the data time slice; As one embodiment, the storage device address calculation module calculates the physical address of the data stored in the storage device based on the start time of the data time slice. This "address calculation module" contains a formula for calculating the physical address of the storage device from the time slice. The input parameter for this formula is the start time of the time slice, and the return result is the physical address of the storage device. The total offset address of the data area corresponds to different data areas and is automatically set by the data writing module based on the storage device's failure status. Basic information about all data areas is stored in system memory in dictionary form.

[0044] The data format conversion module is used to convert between PCB circuit control system format data and storage device format data; As one embodiment, the data format conversion module performs mutual conversion between PCB circuit control system format data and storage device format data. In the "Data Write Function Module," PCB control system format data is converted to storage device format data before being saved to the data storage device. In the "Data Read Function Module," data is read from the storage device, converted to PCB control system format data, and then returned to the PCB control system. PCB system format data refers to data that the PCB system can recognize, while storage device format data refers to the format of data saved to the storage device. PCB system format data and storage device format data can be mutually converted through logical operations. In this data storage method, the effective data storage format within a time slice is determined by each application system. This storage method does not specify the specific format content of the effective data within a time slice, and the format conversion process between effective data and PCB system data is not within the scope of this storage method.

[0045] The storage device scheduling function module is used to simultaneously save data with the same time slice to the same physical address data block on multiple storage devices.

[0046] As one embodiment, the storage device scheduling function module can use multiple storage devices to save data using a mirroring method if enhanced data reliability is required. In this method, when saving data, the storage device scheduling function simultaneously saves data with the same time slice to the same physical address data block on multiple storage devices. When reading data from a storage device, if reading data from the primary storage device fails, it attempts to read from other storage devices.

[0047] In one embodiment, this patent is applied to various types of ECUs in automotive electronic control systems. Using the data storage method of this invention, real-time sensor data and analyzed vehicle operating condition data are saved to storage devices such as SD cards and solid-state drives on the PCB circuit board. When data analysis is required, this method reads historical vehicle operating data from the storage device and transmits it to a host computer or vehicle network for analysis and display, improving the efficiency of automotive electronic product development and testing.

[0048] In one embodiment, due to the high speed and reliability of the data storage design of this method, the requirement to save real-time data can be met by adding currently inexpensive storage devices such as SD cards and solid-state drives to PCB circuit boards with high data reliability requirements. This reduces the cost of related ECU product development and testing, resulting in significant economic benefits.

[0049] In one embodiment, such as Figure 3 The process is as follows, executed when data is first written or a memory write exception occurs: 1. When the "Data Write to Data Function Module" writes data for the first time (at which point the length of the data area dictionary information in memory is 0) or an error occurs, it triggers the creation of a new data area and begins to create the data area. 2. If the remaining space on the storage device is less than the size of the data area, exit the data area creation process and reject the next step. 3. Set the current data region availability flag in the data region basic information dictionary to "damaged" and its end time to the current time; 4. Add the basic information of the current data region to the basic information dictionary of the data region. The start time is the current time, and the total offset address of the new data region is the end address of the previous data region plus a fixed value. 5. Write the basic information block of the newly created data area, which includes two parts: the data area availability flag and the data area start time. The data area availability flag is normal. 6. Recalculate the physical address for writing data using the total offset address of the new data area, and write the data into the new data area.

[0050] In another embodiment, the basic information dictionary for the data area is initialized. When the electronic control system starts, the "data reading function module" reads the "basic information block of the data area" of the existing data field on the storage device and generates the basic information dictionary of the data area in memory. The processing flow is as follows: Figure 4 As shown, the details are as follows: 1. Read the first data area basic information block from the storage device and begin generating the data area basic information dictionary; 2. Calculate the total offset address of the data area. The total offset address of the first data area is the physical address of the beginning of the storage device plus a fixed value. The total offset address of other data areas is the address of the end of the previous data area plus a fixed value. 3. If the basic information block of the data area is successfully read, create a new data area information entry using the read available information of the data area, start time, and total offset address of the area in step 2, and add it to the basic information dictionary of the data area; 4. Use the start time read in step 3 as the end time of the previous data area in the dictionary, and update the basic information dictionary of the data area; 5. If the data area read is available, the flag is set to normal, and dictionary initialization ends; otherwise, repeat step 6. 6. If the remaining area of ​​the storage device is larger than the size of a data area, then read the content of the next basic data information block; otherwise, end the dictionary initialization.

[0051] In one exemplary embodiment, firstly, when using a file-less sequential storage method to access data, if a portion of the data storage area within the current storage area becomes corrupted, a new data area is automatically created in a blank area of ​​the storage device. The physical address of the data is recalculated using the total offset address of the new data area, and the corrupted storage area is avoided when writing new data. This method solves the problem of the entire storage device becoming unusable due to the inability to read or write to a local storage area in a file-less sequential storage method.

[0052] Secondly, by adding a basic information block of the data area before each data storage area and generating a basic information dictionary of the data area in memory when the control system starts, the "data reading function module" can use the start and end times of the data in the dictionary to read the data saved before the write failure, which improves the reliability of data storage and meets the high reliability requirements of automotive electronic control systems.

[0053] The specific format protocol for valid data storage in time slice data blocks is determined by different applications. This storage method does not specify the specific format protocol for valid data storage. The specific processing flow for mutual conversion between valid data and control system data is not within the scope of this storage method. Therefore, this method is applicable to various electronic control systems.

[0054] Finally, this invention introduces a storage device scheduling function module, which uses a memory mirroring method to save data blocks of the same time slice to the same physical address on different storage devices. When the main storage device experiences a read / write failure, data can be read from the mirrored storage device, further improving data reliability.

[0055] This application also discloses an electronic device. (See reference...) Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. The electronic device 500 may include: at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502.

[0056] The communication bus 502 is used to enable communication between these components.

[0057] The user interface 503 may include a display screen, and optionally, the user interface 503 may also include a standard wired interface or a wireless interface.

[0058] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0059] This application also discloses a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute the above-described method for storing data in an automotive electronic control system.

[0060] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure.

[0061] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A data storage method for an automotive electronic control system, characterized in that, The method includes the following steps: S1: One or more data storage areas are pre-divided on the storage device. Each data storage area has a basic information block at the beginning to record the availability status and start time of the area. S2: When the system starts, iterate through the basic information blocks of all data storage areas and generate a basic information dictionary of data areas in memory. The dictionary contains at least the available flag, start time, end time and total offset address of each area. S3: When performing a data write operation, calculate the target physical address on the storage device based on the start time of the time slice to which the data to be stored belongs, combined with the total offset address of the current valid data storage area. S4: Perform data writing. If the writing is successful, the operation is completed. If the writing fails, the current data area is marked as corrupt, a new data storage area is created in the subsequent blank space of the storage device, the basic information dictionary of the data area is updated, and the data is written to the new area.

2. The data storage method for an automotive electronic control system as described in claim 1, characterized in that, Step S1 includes: In a storage device, the data blocks of each time slice in the data storage area are arranged sequentially and the data area size is consistent.

3. The data storage method for an automotive electronic control system as described in claim 1, characterized in that, Step S1 also includes: Each time slice of data contains two parts: a data timestamp identifier and valid data. The information in the data timestamp identifier includes the "year, month, day, hour, minute, and second" information of the time slice start time, which is used to identify the uniqueness of the time slice in the data block; Valid data includes: data from a single point in time within a time slice, data from multiple points in time within a time slice, and continuous data streams.

4. The data storage method for an automotive electronic control system as described in claim 1, characterized in that, Step S2 includes: The basic information dictionary for the data area is an array structure, with the last element representing the currently valid, readable and writable data storage area.

5. The data storage method for an automotive electronic control system as described in claim 1, characterized in that, Step S2 includes: The formula for calculating the target physical address is: in, The calculated target physical address; This is the total offset address of the current data region, which is the starting physical address of the data region on the storage device; The length of the basic information block in the data area, in bytes; The time difference between the start time of the time slice to be stored and the system's preset initial time base, in seconds; The preset length of a single time slice, in seconds; The fixed length of the data block corresponding to a single time slice on the storage device, in bytes.

6. The data storage method for an automotive electronic control system as described in claim 1, characterized in that, Step S4 includes: Multiple storage devices are used to synchronously store the same data in RAID 1 mirroring. When reading data from the primary storage device fails, the system automatically switches to the mirrored storage device for reading.

7. The data storage method for an automotive electronic control system as described in claim 1, characterized in that, The storage device is a flash memory card or a hard drive.

8. A data storage system for an automotive electronic control system, used to implement the data storage method for an automotive electronic control system as described in any one of claims 1-7, characterized in that, The system includes: a data writing function module, a data reading function module, a storage device address calculation function module, a data format conversion function module, and a storage device scheduling function module; The data writing function module is used to call the storage device address calculation function module to obtain the physical address of the data storage device. When a storage device write error occurs, the current data area in the basic information dictionary of the data area is set to damaged. A new data area is created in the remaining free area of ​​the storage device, and the information of the new data area is added to the dictionary as the current data area. The new data is then written to the new data area. The data reading module is used to call the data format conversion module to convert the stored format data into PCB circuit format data before returning data to the PCB circuit control system; and to initialize the basic information dictionary of the data area in memory when the electronic control system starts. The storage device address calculation module is used to calculate the physical address of the data stored in the storage device based on the start time of the data time slice; The data format conversion module is used to convert between PCB circuit control system format data and storage device format data; The storage device scheduling function module is used to simultaneously save data with the same time slice to the same physical address data block on multiple storage devices.

9. An electronic device, characterized in that, The device includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform the data storage method for an automotive electronic control system as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a computer, perform the data storage method for an automotive electronic control system as described in any one of claims 1-7.