Management method for system event records in FLASH storage device

By dividing the FLASH storage device into a data area and an index area, and adopting a linked list structure and a circular erasure strategy, the problems of low erasure and writing efficiency and limited query function of FLASH memory are solved, achieving efficient management and multi-dimensional query, and improving the management efficiency of system event records and the lifespan of the media.

CN121879675APending Publication Date: 2026-04-17XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
Filing Date
2025-12-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

The low write and erase efficiency of FLASH memory affects the efficiency and lifespan of system event log management, and the traditional system event log query function is limited and cannot meet the needs of multi-dimensional retrieval.

Method used

The physical space of the FLASH storage device is divided into independent data area and index area. A system event record storage format based on linked list structure and a sensor index table are defined. A sequential write strategy and a cyclic erase strategy are adopted, combined with a binary search method to achieve efficient querying.

Benefits of technology

The efficiency and lifespan of FLASH storage management have been optimized, and multi-dimensional flexible query and data export functions have been realized, enhancing the practical value and maintainability of system event records.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121879675A_ABST
    Figure CN121879675A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of embedded computer software, and provides a method for managing system event records in FLASH storage equipment, which comprises the following steps of: dividing a FLASH storage space into a data area and an index area; defining a record storage format and an index table based on the sensor linked list; scanning and constructing a management control structural body when the system is initialized; when a record is newly added, a sequential write-in and cyclic erasure strategy is adopted in the data area to maintain the space, and the index table is synchronously updated; multi-dimensional condition query based on a sensor index table or a record timestamp is supported; and the record is converted into a file in a general format to be exported. According to the method, optimization is carried out aiming at the characteristic of high FLASH erasing cost, unnecessary sector erasing is reduced, and the storage life is prolonged; and meanwhile, a multi-dimensional advanced query function based on a sensor, a time period and the like is expanded, and the management efficiency and the practical value of system event records are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of embedded computer software technology and relates to a method for managing system event records in a FLASH storage device. Background Technology

[0002] Prognostics and Health Management (PHM) technology is one of the key technologies in embedded platform operation and maintenance. It can realize fault prediction, diagnosis and location, and significantly improve the reliability and maintainability of the system.

[0003] The Intelligent Platform Management Interface (IPMI), as an open embedded platform management standard, is widely used in PHM systems, providing functions such as status monitoring, fault logging, and reporting. The System Event Log (SEL) is a core component of the IPMI standard, responsible for comprehensively recording various events and alarm information during the operation of the embedded platform, providing crucial data support for system fault diagnosis and maintenance.

[0004] In embedded systems, due to cost considerations and cost-sensitive requirements, flash memory (FLASH) is often used as the non-volatile storage medium. FLASH offers advantages such as low cost, easy integration, and large capacity, but its storage management presents specific challenges: FLASH erase operations must be performed sector-by-sector, and erasing clears all data in the entire sector; modifications to existing data require reading the entire sector, erasing it, and then writing the updated content. This characteristic results in low FLASH write / erase efficiency, and frequent write / erase operations can also affect memory lifespan, thus hindering efficient management of system event logs.

[0005] Furthermore, the existing system event logging function in the IPMI protocol has significant limitations in terms of querying. It only supports single record retrieval by record ID and cannot realize advanced query requirements such as "querying events by time range" or "querying related records by monitoring object". This limits the functional value of system event logging in practical applications. Summary of the Invention

[0006] To address the technical problems of low write / erase efficiency in FLASH memory affecting system event log management efficiency and lifespan, and the inability of traditional system event log query functions to meet multi-dimensional retrieval needs, this invention discloses a method for managing system event logs in a FLASH storage device. The method includes the following steps: S1. Divide the physical space of the FLASH storage device into independent data areas and index areas; S2. Define the system event record storage format based on a linked list structure and the corresponding sensor index table; S3. During system initialization, the data area and the index area are scanned respectively to determine the start and end positions of valid data and the index status, and a control structure for managing the storage status is constructed based on the scan results. S4. When adding a new system event record, a sequential writing strategy is adopted in the data area, and the sector where the oldest record is located is erased when necessary to free up space according to the cyclic erasure strategy, while the sensor index table is updated. S5. Respond to the query request and, based on different query conditions, retrieve the corresponding system event record according to the timestamp field in the sensor index table or record; S6. Read the system event records stored in the data area in sequence, convert them into data files of a preset format, and export them to an external device.

[0007] Furthermore, in step S2, the system event record storage format based on the linked list structure and the corresponding sensor index table are configured as follows: In the storage format, each system event record contains a pointer field, which points to the storage address of the next system event record generated by the same sensor; The sensor index table is an array of address pointers, where the array index corresponds to the sensor number. Each array element stores a pointer that points to the storage address of the first system event record generated by the sensor corresponding to that index.

[0008] Furthermore, the pointer field and the pointers stored in the sensor index table have values ​​that are either absolute physical addresses within the FLASH data area or byte offsets relative to the starting address of the data area.

[0009] Furthermore, in step S3, system initialization includes: S31. Sequentially traverse each storage sector of the data area, identify the status of the first record at a predefined position in each sector, take the position of the first record in the sector containing the earliest valid record in time as the starting position of the data, and determine the sector containing the latest valid data in time. S32. Within the sector containing the latest valid data in the time frame, use a binary search method to locate the last valid record in the sector within the sector address range, and record this position as the current data write position. S33. Based on the current data writing position and the data starting position, calculate the total number of valid records in the data area according to preset rules.

[0010] Furthermore, in step S31, the status of the first record at a predefined position within each sector is identified, which is achieved in the following way: Read a predetermined data block at a specific offset position at the beginning of each sector, with a length consistent with the length of a single record, and verify whether its content conforms to the data structure of a valid record in order to determine whether the sector contains a valid record.

[0011] Furthermore, in step S4, the sector containing the oldest record is erased when necessary to free up space according to the cyclic erasure strategy, including: S41. Write the newly added record sequentially to the next available storage unit after the current data write position indicated by the control structure; S42. Before writing, check the status of the target storage unit and its sector. If it is determined that there are no free sectors in the data area or the target unit is unavailable, trigger the sector erasure mechanism. S43. The sector erasure mechanism is as follows: Select the sector in the data area that is the earliest written according to the time order and has no active linked list head pointer pointing to its internal record as the sector to be erased. Before erasing the sector, traverse the sensor index table and update the pointers of those linked list head pointers that point to the sensor located in the sector to be erased, modifying their linked list head pointers to point to the address of the first record stored outside the sector to be erased in the linked list of that sensor.

[0012] Furthermore, in step S4, after updating the sensor index entries, the following is also included: The updated complete index table is written as the new version to an empty location in the index area, and the latest index table currently in effect is marked in the control structure using a version number or a pointer to the latest index table location.

[0013] Further, in step S5, in response to a query request, based on different query conditions and the timestamp field in the sensor index table or record, the corresponding system event record is retrieved, including: S51. When the query condition is a specified record ID, the record is located and read directly according to the correspondence between the ID and the physical order position of the record in the data area. S52. When the query condition is a specified sensor, the sensor index table is indexed according to the sensor number to obtain the address of the first element of the linked list corresponding to the sensor, and the linked list is traversed according to the address of the first element to obtain all records of the sensor. S53. When the query condition is a specified time period, the binary search method is used in the data area based on the timestamp field of the records to locate the records corresponding to the start time point and the end time point respectively, and all records within the time range are returned.

[0014] Further, in step S6, the preset format is CSV format, and the data file converted to the preset format includes: Generate a header containing fields for record ID, record type, timestamp, sensor number, and event type, and then fill in the record data row by row to generate a complete file.

[0015] The system event log management method for embedded platforms such as FLASH storage devices provided by this invention extends the functionality of system event logs through OEM format, adapting to the storage characteristics of FLASH and providing advanced query functions. Compared with the prior art, it has at least the following advantages: 1. The method of the present invention can significantly optimize the efficiency and lifespan of FLASH storage management: by dividing the data area and the index area, and adopting sequential writing, cyclic erasure and dynamic index update strategies, unnecessary sector erasure operations are effectively reduced, the wear of FLASH memory is reduced, and the storage efficiency of system event records and the lifespan of the media are improved.

[0016] 2. The method of this invention enables flexible multi-dimensional queries, overcoming the limitations of existing functions: by extending advanced query functions based on record ID, time period, and sensor number while maintaining compatibility with the IPMI standard. Furthermore, by maintaining the sensor index table and record linked list structure, it supports multi-condition retrieval by time range, by monitored object, and other criteria, greatly improving the practical value and troubleshooting efficiency of system event records.

[0017] 3. It can improve data maintainability and analysis convenience. The method of the present invention has a one-click export function for system event records, which can convert the stored records into a general CSV format file, making it easy to upload to the host computer for further processing and analysis, thereby enhancing the flexibility of data management and system maintainability. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the method for managing system event records in a FLASH storage device according to the present invention. Figure 2 A schematic diagram of an event logging management method for an embedded platform system; Figure 3 A diagram illustrating the system event log data format provided in this embodiment of the invention; Figure 4This is a diagram of the system event record index structure provided in an embodiment of the present invention; Figure 5 Storage area planning diagram provided for embodiments of the present invention; Figure 6 This is a flowchart illustrating the initialization function of the data area control structure provided in an embodiment of the present invention. Figure 7 A flowchart illustrating the function of adding new data to the system event log provided in this embodiment of the invention. Detailed Implementation

[0020] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0021] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features of the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] This invention discloses a method for managing system event records in a FLASH storage device. This method extends the functionality of system event records based on the OEM format to adapt to the storage characteristics of FLASH and provides advanced query functions.

[0023] Specifically, see Figure 1 , Figure 2 As shown, the method includes the following steps: S1. Divide the physical space of the FLASH storage device into independent data areas and index areas; S2. Define the system event record storage format based on a linked list structure and the corresponding sensor index table; S3. During system initialization, the data area and the index area are scanned respectively to determine the start and end positions of valid data and the index status, and a control structure for managing the storage status is constructed based on the scan results. S4. When adding a new system event record, a sequential writing strategy is adopted in the data area, and the sector where the oldest record is located is erased when necessary to free up space according to the cyclic erasure strategy, while the sensor index table is updated. S5. Respond to the query request and, based on different query conditions, retrieve the corresponding system event record according to the timestamp field in the sensor index table or record; S6. Read the system event records stored in the data area in sequence, convert them into data files of a preset format, and export them to an external device.

[0024] In one embodiment of step S1, the system event record storage area is planned as follows: Figure 5 As shown, it includes the following: 1) The storage area is divided into an index area (sectors 0-3) and a data area (sectors 4-36); 2) Create an index control structure for the index area, and record the starting sector number of the index area (0, the upper limit of the index area data (4), and the position of the latest index table; 3) Establish a data area control structure for the data area to record the starting sector number of the data area, the upper limit of the data area, the starting position of the data record, the position of the latest data record, and the total number of data.

[0025] In one embodiment of step S2, the system event record storage format based on the linked list structure and the corresponding sensor index table are configured as follows: In the storage format, each system event record contains a pointer field, which points to the storage address of the next system event record generated by the same sensor; The sensor index table is an array of address pointers, where the array index corresponds to the sensor number. Each array element stores a pointer that points to the storage address of the first system event record generated by the sensor corresponding to that index.

[0026] The pointer field and the pointers stored in the sensor index table have values ​​that are either absolute physical addresses within the FLASH data area or byte offsets relative to the starting address of the data area.

[0027] Specifically, the system event log storage format includes the following: 1) System event log entry format, such as Figure 3 As shown, a system event record is 16 bytes long and includes: 2 bytes record ID, 1 byte record type, 4 bytes timestamp, 1 byte IPMB address, 1 byte logical unit number, 1 byte sensor number, 1 byte event type, 3 bytes data content, and 2 bytes address of the next record for this sensor.

[0028] 2) System event log index table format, such as Figure 4As shown, the index table is a 16-bit unsigned array. The x-th element represents the position of the first system event record of sensor number x in the data area. If the sensor has no system event record, the value is 0xFFFF. Figure 4 In the "Data Content" column, what should be filled in is... Figure 3 The content in [the document / article].

[0029] 3) System event record linked list format, such as Figure 4 As shown, each system event record has a field containing the address of the next record for this sensor. If there is no next record, the value is 0xFFFF.

[0030] In one embodiment of step S3, the established control structure includes at least the data area start position, the current write position, and the index table version information. System initialization includes the following steps: S31. Sequentially traverse each storage sector of the data area, identify the status of the first record at a predefined position in each sector, take the position of the first record in the sector containing the earliest valid record in time as the starting position of the data, and determine the sector containing the latest valid data in time. S32. Within the sector containing the latest valid data in the time frame, use a binary search method to locate the last valid record in the sector within the sector address range, and record this position as the current data write position. S33. Based on the current data writing position and the data starting position, calculate the total number of valid records in the data area according to preset rules.

[0031] Furthermore, in step S31, the status of the first record at a predefined position within each sector is identified, which is achieved in the following way: Read a predetermined data block at a specific offset position at the beginning of each sector, with a length consistent with the length of a single record, and verify whether its content conforms to the data structure of a valid record in order to determine whether the sector contains a valid record.

[0032] Specifically, the system event log management program initialization method includes two parts: the data area control structure initialization method and the index area control structure initialization method.

[0033] The initialization method for the data area control structure is as follows: Figure 6 As shown, it includes the following steps: Step 1: Determine the current data location; Step 2: Starting from the current data position, traverse backwards through the first data record of each sector, taking the position of the first data record of the last non-empty sector as the starting position of the data. Step 3: Subtract the data position from the data start position and take the modulo of the upper limit of the data range to obtain the total number of data.

[0034] More specifically, the process of determining the current data position in step 1 is as follows: Step 1.1: Traverse the first data record of all sectors; Step 1.2: If the first data record of all sectors is empty, then the data position is 0; Step 1.3: If the first data record of all sectors is not empty, then there is an error in the previous data record. Erase the first sector and set the data position to 0. Step 1.4: Locate the last sector where the first data record is not empty; Step 1.5: Within this sector, use a binary search method to find the position of the last data record, and use that as the current data position.

[0035] The initialization operation of the index area control structure includes the following steps: Step 2.1: Traverse the first data entry of each sector; Step 2.2: If all sectors are empty, set the latest index number to 0; Step 2.3: Find the last non-empty sector, traverse all the data in that sector, find the last index table entry, and use its number as the latest index number.

[0036] In one embodiment of step S4, erasing the sector containing the oldest record to free up space when necessary, according to a cyclic erasure strategy, includes: S41. Write the newly added record sequentially to the next available storage unit after the current data write position indicated by the control structure; S42. Before writing, check the status of the target storage unit and its sector. If it is determined that there are no free sectors in the data area or the target unit is unavailable, trigger the sector erasure mechanism. S43. The sector erasure mechanism is as follows: Select the sector in the data area that is the earliest written according to the time order and has no active linked list head pointer pointing to its internal record as the sector to be erased. Before erasing the sector, traverse the sensor index table and update the pointers of those linked list head pointers that point to the sensor located in the sector to be erased, modifying their linked list head pointers to point to the address of the first record stored outside the sector to be erased in the linked list of that sensor.

[0037] In an improved embodiment of step S4, after updating the sensor index entries, the method further includes: The updated complete index table is written as the new version to an empty location in the index area, and the latest index table currently in effect is marked in the control structure using a version number or a pointer to the latest index table location.

[0038] More specifically, the method for adding system event logs is as follows: Figure 7 As shown, it includes the following steps: Step 4.1: Use the storage space following the current data position as the location to write the new data; Step 4.2: Check if the storage space where the new data is to be written is empty. If it is not empty, there is an anomaly in the previous data storage. Mark the sector as a sector to be erased. Step 4.3: Check if the next sector of the sector containing the newly added data is empty. If it is not empty, it means that the data area is about to reach its limit. Mark the sector as a sector to be erased. Step 4.4: If there are sectors to be erased, perform sector erasure and index update; Step 4.5: Write the new data to the corresponding storage space.

[0039] The specific process of sector erasure and index update in step 4.4 is as follows: Step 4.4.1: Traverse all the first element addresses in the index area and filter out the sensors whose first element of the system event record list is located in the sector to be erased; Step 4.4.2: For each sensor whose first element in the system event record list is located within the sector to be erased, traverse its system event record list to find the first system event record located outside the sector to be erased. Step 4.4.3: Use the address of the first system event record located outside the sector to be erased as the address of the new first element of the linked list, and update the address of the first element of the linked list in the index table; Step 4.4.4: Compare the latest index number with the upper limit of the index area data to determine if there is still free storage space in the index area; Step 4.4.5: If there is no free storage space in the index area, erase the entire index area and set the latest index number to 0; Step 4.4.6: Locate the latest index table based on the latest index number, write the modified index table to the adjacent free storage space, and increment the latest index number by 1. Step 4.4.7: Erase the sectors in the data area that need to be erased.

[0040] Further, in step S5, in response to a query request, based on different query conditions and the timestamp field in the sensor index table or record, the corresponding system event record is retrieved, including: S51. When the query condition is a specified record ID, the record is located and read directly according to the correspondence between the ID and the physical order position of the record in the data area. S52. When the query condition is a specified sensor, the sensor index table is indexed according to the sensor number to obtain the address of the first element of the linked list corresponding to the sensor, and the linked list is traversed according to the address of the first element to obtain all records of the sensor. S53. When the query condition is a specified time period, the binary search method is used in the data area based on the timestamp field of the records to locate the records corresponding to the start time point and the end time point respectively, and all records within the time range are returned.

[0041] In one embodiment of step S6, the preset format is CSV format, and converting the data file to the preset format includes: generating a header containing fields such as record ID, record type, timestamp, sensor number, and event type, and filling the record data row by row to generate a complete file.

[0042] Specifically, this includes: generating a CSV file header and writing it to the generated file, with the content including: record ID, record type, timestamp, IPMB address, logical unit number, sensor number, event type, and data content; sequentially traversing all system event records; for each system event record, converting it to a hexadecimal string and adding comma separators, writing the generated string to the generated file; and transmitting the generated file to the host computer via any communication method.

[0043] Furthermore, in another embodiment of the present invention, S7, a system event record clearing operation, specifically includes the following process: S71, Erase all sectors of the data area; S72. Erase all sectors of the index area; S73. Set the current data position, data start position, and total number of data in the data area to 0; S74. Set the latest index number of the index area to 0.

[0044] This invention optimizes the design to address the high write / erase costs of FLASH memory, implementing a method for managing event logs in embedded platform systems. By dividing the storage area into a data area and an index area and using a linked list structure to manage records, unnecessary sector writes are avoided. Furthermore, the system event log functionality is extended based on the Original Equipment Manufacturer (OEM) format, enabling advanced multi-dimensional queries based on ID, time period, and sensor, thus improving the management efficiency and practicality of event logs in embedded platform systems.

[0045] Specifically, compared with the prior art, the embodiments of the present invention achieve the following technical effects: 1. The method of the present invention can significantly optimize the efficiency and lifespan of FLASH storage management: by dividing the data area and the index area, and adopting sequential writing, cyclic erasure and dynamic index update strategies, unnecessary sector erasure operations are effectively reduced, the wear of FLASH memory is reduced, and the storage efficiency of system event records and the lifespan of the media are improved.

[0046] 2. The method of this invention enables flexible multi-dimensional queries, overcoming the limitations of existing functions: by extending advanced query functions based on record ID, time period, and sensor number while maintaining compatibility with the IPMI standard. Furthermore, by maintaining the sensor index table and record linked list structure, it supports multi-condition retrieval by time range, by monitored object, and other criteria, greatly improving the practical value and troubleshooting efficiency of system event records.

[0047] 3. It can improve data maintainability and analysis convenience. The method of the present invention has a one-click export function for system event records, which can convert the stored records into a general CSV format file, making it easy to upload to the host computer for further processing and analysis, thereby enhancing the flexibility of data management and system maintainability.

[0048] Obviously, those skilled in the art should understand that the steps of the above-described embodiments of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using device-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular combination of hardware and software.

[0049] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method of managing system event logging in a FLASH memory device, comprising: include: The physical space of the FLASH storage device is divided into independent data areas and index areas; Define the system event record storage format based on a linked list structure and the corresponding sensor index table; During system initialization, the data area and the index area are scanned respectively to determine the start and end positions of valid data and the index status, and a control structure for managing the storage status is constructed based on the scan results; When adding a new system event record, a sequential write strategy is adopted in the data area, and the sector where the oldest record is located is erased to free up space when necessary according to the cyclic erase strategy, while the sensor index table is updated. In response to a query request, the system retrieves the corresponding system event record based on the timestamp field in the sensor index table or record, according to different query conditions. The system event records stored in the data area are read sequentially, converted into data files of a preset format, and exported to an external device.

2. The method of claim 1, wherein the system event record is a record of a system event in a FLASH memory device. The system event record storage format based on the linked list structure and the corresponding sensor index table configuration are as follows: In the storage format, each system event record contains a pointer field, which points to the storage address of the next system event record generated by the same sensor; The sensor index table is an array of address pointers, where the array index corresponds to the sensor number. Each array element stores a pointer that points to the storage address of the first system event record generated by the sensor corresponding to that index.

3. The method of claim 2, wherein the system event record is a system event record in a FLASH memory device. The pointer field and the pointers stored in the sensor index table have values ​​that are either absolute physical addresses within the FLASH data area or byte offsets relative to the starting address of the data area.

4. The method of claim 1, wherein the system event record is a system event record in a FLASH memory device. System initialization includes: The system sequentially traverses each storage sector of the data area, identifies the status of the first record at a predefined position in each sector, takes the position of the first record in the sector containing the earliest valid record in time as the starting position of the data, and determines the sector containing the latest valid data in time. Within the sector containing the latest valid data in the time frame, use a binary search method to locate the last valid record in the sector within the sector address range, and record this position as the current data write position; Based on the current data write position and the data start position, the total number of valid records in the data area is calculated according to preset rules.

5. The method for managing system event records in a FLASH storage device according to claim 4, characterized in that, The status of the first record at a predefined position within each sector is identified in the following way: Read a predetermined data block at a specific offset position at the beginning of each sector, with a length consistent with the length of a single record, and verify whether its content conforms to the data structure of a valid record in order to determine whether the sector contains a valid record.

6. The method for managing system event records in a FLASH storage device according to claim 1, characterized in that, Based on a cyclic erasure strategy, the sector containing the oldest record is erased when necessary to free up space, including: The newly added record is sequentially written to the next available storage unit after the current data write position indicated by the control structure; Before performing a write operation, the status of the target storage unit and its sector is checked. If it is determined that there are no free sectors in the data area or the target unit is unavailable, the sector erasure mechanism is triggered. The sector erasure mechanism is as follows: select the sector in the data area that is the earliest written according to the time order and has no active linked list head pointer pointing to its internal record as the sector to be erased. Before erasing the sector, traverse the sensor index table and update the pointers of those linked list head pointers that point to the sensor located in the sector to be erased, modifying their linked list head pointers to point to the address of the first record stored outside the sector to be erased in the linked list of that sensor.

7. The method of claim 6, wherein the system event record is a system event record in a FLASH memory device. After updating the sensor index entries, the following is also included: The updated complete index table is written as the new version to an empty location in the index area, and the latest index table currently in effect is marked in the control structure using a version number or a pointer to the latest index table location.

8. The method of claim 1, wherein the system event record is a system event record in a FLASH memory device. In response to a query request, based on different query conditions and the timestamp field in the sensor index table or records, the corresponding system event records are retrieved, including: When the query condition is a specified record ID, the record is located and read directly based on the correspondence between the ID and the physical order of the record in the data area; When the query condition is a specified sensor, the sensor index table is indexed according to the sensor number to obtain the address of the first element of the linked list corresponding to the sensor, and the linked list is traversed according to the address of the first element to obtain all records of the sensor. When the query condition is a specified time period, the binary search method is used in the data area based on the timestamp field of the records to locate the records corresponding to the start time and end time respectively, and all records within that time range are returned.

9. The method of claim 1, wherein the system event record is a system event record in a FLASH memory device. The preset format is CSV format, and the data files converted to the preset format include: ​ Generate a header containing fields for record ID, record type, timestamp, sensor number, and event type, and then fill in the record data row by row to generate a complete file.