CN-121979440-A - Data storage method and system for automobile electronic control system
Abstract
The application provides a data storage method and a system of an automobile electronic control system, which relate to the field of data storage, wherein the method comprises the steps of dividing data storage areas on storage equipment in advance, and setting a data area basic information block at the initial part of each data storage area; the method comprises the steps of traversing basic information blocks of all data storage areas, generating a data area basic information dictionary in a memory, calculating a target physical address of the current effective data storage area according to the starting time of a time slice to which data to be stored belongs and the total offset address of the current effective data storage area when data writing operation is carried out, executing data writing, and completing the operation if the writing is successful. The technical scheme of the application improves the data storage reliability, and the designed multi-storage device data mirror image storage auxiliary mode further improves the data storage reliability.
Inventors
- LIU SHUDONG
- XIA TING
- LI XIAOHONG
- JIA HAIYANG
- ZHU JIE
- ZHOU ZILONG
Assignees
- 中电科创智联(武汉)有限责任公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251202
Claims (10)
- 1. A method for storing data of an electronic control system of an automobile, the method comprising the steps of: S1, pre-dividing one or more data storage areas on a storage device, wherein a data area basic information block is arranged at the initial part of each data storage area and is used for recording the available state and the starting time of the area; s2, traversing basic information blocks of all data storage areas when the system is started, and generating a data area basic information dictionary in a memory, wherein the dictionary at least comprises available marks, starting time, ending time and total offset addresses of each area; S3, when the data writing operation is carried out, calculating a target physical address of the current effective data storage area according to the starting time of a time slice to which the data to be stored belongs and combining the total offset address of the current effective data storage area; And S4, performing data writing, if the writing is successful, finishing the operation, if the writing is failed, marking the current data area as damaged, creating a new data storage area in the subsequent blank space of the storage device, updating the data area basic information dictionary, and writing the data into the new area.
- 2. The method for storing data of an electronic control system for an automobile according to claim 1, wherein the step S1 comprises: The data blocks of each time slice in the data storage area in the storage device are sequentially arranged and the data areas are uniform in size.
- 3. The method for storing data in an electronic control system of an automobile according to claim 1, wherein step S1 further comprises: The data of each time slice comprises two parts of a data time stamp mark and valid data; the information in the data timestamp mark comprises 'time, month, day, time and second information' of the starting time of the time slice, and is used for marking the uniqueness of the time slice in the data block; the valid data includes one time point data in a time slice, a plurality of time point data in a time slice and a continuous data stream.
- 4. The method for storing data of an electronic control system for an automobile according to claim 1, wherein step S2 comprises: The data area basic information dictionary is a data group structure, and the last element of the data area basic information dictionary represents a currently effective readable and writable data storage area.
- 5. The method for storing data of an electronic control system for an automobile according to claim 1, wherein step S2 comprises: the calculation formula of the target physical address is as follows: Wherein, the The target physical address is calculated; the total offset address of the current data area, namely the initial physical address of the data area on the storage device; The length of the basic information block of the data area is in bytes; the time difference between the starting time of the time slice to be stored and an initial time reference preset by the system is given in seconds; the unit is second, which is the length of a preset single time slice; The fixed length occupied on the storage device for a data block corresponding to a single time slice is in bytes.
- 6. The method for storing data of an electronic control system for an automobile according to claim 1, wherein step S4 comprises: And synchronously storing the same data in a RAID 1 mirror mode by adopting a plurality of storage devices, and automatically switching to the mirror storage device for reading when the data reading from the main storage device fails.
- 7. The method for storing data in an electronic control system of an automobile according to claim 1, wherein the storage device is a flash memory card or a hard disk.
- 8. A data storage system of an electronic control system of an automobile, for implementing a data storage method of an electronic control system of an automobile according to any one of claims 1 to 7, wherein the system comprises 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 for calling the storage device address calculation function module to acquire the physical address of the data storage device, setting the current data area in the data area basic information dictionary to be damaged when the writing abnormality of the storage device occurs, newly establishing a data area in the residual free area of the storage device, adding the newly established data area information as the current data area into the dictionary, and writing new data into the new data area; the data reading function module is used for calling the data format conversion function module to convert the storage format data into the PCB circuit format data before returning the data to the PCB circuit control system; The storage device address calculation function module is used for calculating a physical address of data stored in the storage device according to the starting time of the data time slice; The data format conversion function module is used for converting the format data of the PCB circuit control system and the format data of the storage device; The storage device scheduling function module is used for simultaneously storing the same time slice data into the same physical address data blocks of a plurality of storage devices.
- 9. An electronic device comprising a processor, a memory, a user interface and a network interface, the memory for storing instructions, the user interface and the network interface for communicating to other devices, the processor for executing the instructions stored in the memory to cause the electronic device to perform the method of storing data for an electronic control system of an automobile as claimed in any one of claims 1-7.
- 10. A computer readable storage medium storing instructions which, when executed by a computer, perform the method of storing data of an electronic control system for a vehicle according to any one of claims 1 to 7.
Description
Data storage method and system for automobile electronic control system Technical Field The application relates to the field of data storage, in particular to a data storage method and system of an automobile electronic control system. Background The automobile electronic is a generic term of an automobile body automobile electronic control device and an automobile-mounted automobile electronic control device, and comprises an engine control system, a chassis control system, an automobile body electronic control system and the like. The electronic control system formed by the sensor, the microprocessor and the executor improves the safety, the comfort, the entertainment and the economy of the automobile, the proportion of the electronic equipment to the whole automobile cost is increasing year by year, at present, 50-100 MCUs (micro control units) are usually needed for the traditional fuel automobile, more than 200 MCUs of the new energy automobile or the intelligent automobile type are likely to be needed, and part of the automobile electronic products account for more than 50% of the whole automobile cost. An ECU (electronic control unit) in the automobile electronic control system receives sensor input signals, analyzes and calculates data, adjusts the running parameters of the automobile according to calculation results, converts the calculated control parameters into control signals, sends the control signals to an actuator, and monitors the running working condition of the automobile. In the working process of the automobile electronic control system, the sensor acquisition data, analysis processing information, operation information and fault information are required to be stored, and the upper computer and the Internet of vehicles platform read the stored data in the control system through issuing communication instructions and are used for analyzing and processing the automobile operation conditions and faults. The method for sequentially storing the file system-free data has the characteristics of instantaneity, high speed and the like, but after part of storage areas are damaged, the method has no function of avoiding the damaged storage areas similar to the file system storage method, and can not completely meet the requirement of an automobile electronic control system on high reliability of data storage. Disclosure of Invention The invention aims to solve the problem that when a local physical area of a storage device is damaged, the whole storage device is possibly invalid due to the lack of an effective bad block rule mechanism, and the high reliability requirement of the automobile electronic field on data storage cannot be met. The above object of the present application is achieved by the following technical solutions: S1, pre-dividing one or more data storage areas on a storage device, wherein a data area basic information block is arranged at the initial part of each data storage area and is used for recording the available state and the starting time of the area; s2, traversing basic information blocks of all data storage areas when the system is started, and generating a data area basic information dictionary in a memory, wherein the dictionary at least comprises available marks, starting time, ending time and total offset addresses of each area; S3, when the data writing operation is carried out, calculating a target physical address of the current effective data storage area according to the starting time of a time slice to which the data to be stored belongs and combining the total offset address of the current effective data storage area; And S4, performing data writing, if the writing is successful, finishing the operation, if the writing is failed, marking the current data area as damaged, creating a new data storage area in the subsequent blank space of the storage device, updating the data area basic information dictionary, and writing the data into the new area. Optionally, step S1 includes: The data blocks of each time slice in the data storage area in the storage device are sequentially arranged and the data areas are uniform in size. Optionally, step S1 further includes: The data of each time slice comprises two parts of a data time stamp mark and valid data; the information in the data timestamp mark comprises 'time, month, day, time and second information' of the starting time of the time slice, and is used for marking the uniqueness of the time slice in the data block; the valid data includes one time point data in a time slice, a plurality of time point data in a time slice and a continuous data stream. Optionally, step S2 includes: The data area basic information dictionary is a data group structure, and the last element of the data area basic information dictionary represents a currently effective readable and writable data storage area. Optionally, step S2 includes: the calculation formula of the target physical address is as follows: Wherein, the The target physi