Fault processing and service life prolonging method and system for power-down storage medium

By designing a reasonable operation logic data structure and control algorithm, the writing process of power-down storage media is optimized, and the problem of low service life of power-down storage media in the existing technology is solved, and a longer service life and lower risk of functional failure is achieved.

CN119832964AActive Publication Date: 2025-04-15SONG RES ELECTRONICS TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411893933.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Due to the difference in the use of existing power-down storage media, the number of erases and service life of a single write area is lower than the nominal value, and even functional failure, resulting in product quality reduction and serious customer complaints or customer return.

Method used

By designing a reasonable operation logic data structure and control algorithm, fault tolerance judgment and writing process optimization can be achieved, the number of times the power-down storage medium is repeatedly written during the use cycle, and the rated service life is extended. The specific steps include initializing the operation logic data structure, reading and verifying the content of the ID area, positioning the use sector, cycling the write operation until the preset judgment condition is reached, switching to the next sector for use, and performing voltage detection during the writing process to judge the external influence.

Benefits of technology

By increasing the number of writes and optimizing the data structure, the service life of the power-down storage medium is extended, the risk of functional failure and product quality is reduced, and customer complaints and customer withdrawals are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832964A_ABST
    Figure CN119832964A_ABST
Patent Text Reader

Abstract

The invention relates to a fault processing and service life prolonging method for a power-down storage medium. The method comprises the following steps: initializing an arithmetic logic data structure; the whole ID area is read, and the ID identification code is inquired from the tail; reading single-frame data stored in the corresponding data area based on the inquired ID identification code, verifying the single-frame data, assigning a working parameter if verification succeeds, and polling ID areas of all sectors of the power-down storage medium in sequence so as to position the sector used before power-down; when data of the working parameter data area and data of the comparison area are different, a write-in process is triggered, write-in operation is cyclically carried out in the single sector, and the next sector is switched to be used until the erasing service life of the single sector reaches a preset judgment condition; setting a rewriting frequency threshold value, performing data reading and writing after writing in a single sector, and entering voltage detection judgment if reading and writing in a data area fail so as to judge whether the sector fails or not. The method has reasonable fault-tolerant judgment, and the rated service life of the dielectric can be prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of storage technology, and in particular relates to a method and system for handling failure of a power-off storage medium and extending its service life. Background Art

[0002] In many electronic devices, power-off storage media plays an indispensable role in preserving critical data.

[0003] However, the key parameters and user data of most smart home appliances need to be memorized when the power is off. Commonly used power-off storage media for home appliances include flash, eeprom, etc. These storage media have a certain number of erase and write cycles and service life, but the differences among these storage media cannot be unified, which will cause severe deviations in important indicators of the power-off storage media, and make the number of erase and write cycles and service life of a single write area lower than the nominal value, and even lead to functional failure, resulting in reduced product quality and serious customer complaints or customer returns.

[0004] Therefore, the present invention provides a method and system for handling power-off storage medium failure and extending service life to solve the above technical problems. Summary of the invention

[0005] In view of the above problems, the purpose of the present invention is to provide a method and system for fault handling and service life extension of a power-off storage medium, which has reasonable fault tolerance judgment, increases the number of repeated writing times of the power-off storage medium during the use cycle, and thus can extend the rated service life of the power-off medium.

[0006] The present invention provides a method for handling a power-off storage medium fault and extending its service life, which comprises:

[0007] S1, after the user turns on the appliance, the program is started and the operation logic data structure is initialized, the operation logic data structure includes the current write sector number, the current ID number, the page write address, the number of write failures and the ID identification code; the operation logic data structure is set as follows: the low address bit in a single sector is used as a data area to store multiple data frames, the high address bit in a single sector is used as an ID area, and the single frame data storage position corresponds to the ID area one by one;

[0008] S2, reading the content of the ID area with the set start address, and reading out the entire ID area and querying the ID identification code from the end;

[0009] S3, based on the queried ID identification code, read the single frame data stored in the corresponding data area, and perform data verification. If the verification is successful, assign working parameters, and sequentially poll the ID areas of all sectors of the power-off storage medium to locate the sectors used before the power-off;

[0010] S4, setting the data area as a working parameter data area, a parameter backup area and a comparison area, triggering a write process when there is a difference between the data in the working parameter data area and the data in the comparison area, recalculating the number of the next ID area to be written, and cyclically writing operations in a single sector until the erasing life of the single sector reaches a preset judgment condition and then switching to the next sector for use;

[0011] S5, write and read verification covers the data area read and write verification and the ID area read and write verification. If the ID area verification is successful, the write is determined to be successful, and the backup area read and write verification is performed according to the same logic. At the same time, a rewrite number threshold is set, and data is read and written after a single sector is written; if the data area read and write fails, switch to the next ID area to read and write again. After a certain number of rewrite failures, enter the voltage detection judgment, measure the voltage deviation degree according to the voltage variance, if the voltage threshold and voltage deviation are too large, it is determined to be an external influence, and the sector is rewritten after the system is stable. If the number of rewrites exceeds the set number, it is determined that this sector is faulty and switch to writing to the next sector.

[0012] Preferably, the writing process in S4 includes: S41, recalculating the next write ID number according to the current ID number, and calculating the corresponding data area address according to the next write ID number; S42, writing the data into the working parameter data area corresponding to the data area address, reading it out, and verifying it. If the verification is successful, the data is written into the corresponding ID number area, read out and verified again. If the verification is successful again, it is deemed to be successfully written; S43, after successfully writing the working parameter data area, write the same data into the parameter backup area according to the same logic, and synchronously record the current power supply average voltage and voltage variance.

[0013] Preferably, a preset incremental algorithm or a specific coding rule transformation algorithm is used to recalculate the next write ID number based on the current ID number.

[0014] Preferably, the calculation method of the single-sector maximum frame Max described in S1-S5 is specifically: Max<=PAGE_BYTE_NUM / (FRAME_LENGTH+1), wherein PAGE_BYTE_NUM is the maximum number of bytes of a single sector, and FRAME_LENGTH is the data length of a single frame of data.

[0015] Preferably, the relationship between the start address of the data area and the ID area is: StartAddr=(sector start address+current ID number×single frame data length).

[0016] The present invention also provides a system for handling faults and extending the service life of a power-off storage medium, comprising an MCU control unit and a power-off storage medium and a voltage detection unit connected to the MCU control unit at the same time, wherein the power-off storage medium is controlled by the MCU control unit to implement a control algorithm according to a preset erasing logic to execute the method for handling faults and extending the service life of the power-off storage medium; the power-off storage medium can be selected from at least one of an independent EEPROM, a flash memory, and a storable medium inside the MCU, and the power-off storage medium is used to store an operation logic data structure.

[0017] Compared with the related art, the present invention provides a method for troubleshooting and extending the service life of a power-off storage medium, comprising: S1, after the user powers on the appliance, the program is started and the operation logic data structure is initialized; S2, the content of the ID area with a set start address is read, and the entire ID area is read out and the ID identification code is queried from the end; S3, based on the queried ID identification code, a single frame of data stored in the corresponding data area is read, and data verification is performed. If the verification is successful, the working parameters are assigned, and the ID areas of all sectors of the power-off storage medium are polled in sequence to locate the sectors used before the power off; S4, the data area is set as a working parameter data area, a parameter backup area and a comparison area, and when there is a difference between the data in the working parameter data area and the comparison area, a write process is triggered, and the data is re-written. Calculate the ID area number to be written next, and circulate the write operation in a single sector until the single sector erase life reaches the preset judgment condition and then switch to the next sector for use; S5, write read verification covers the data area read and write verification and the ID area read and write verification. If the ID area verification is successful, the write is determined to be successful, and the backup area read and write verification is performed according to the same logic. At the same time, the rewrite number threshold is set, and data is read and written after the single sector is written; if the data area read and write fails, switch to the next ID area to read and write again, and enter the voltage detection judgment after a certain number of rewrite failures, and measure the voltage deviation degree according to the voltage variance. If the voltage threshold and voltage deviation are too large, it is determined to be an external influence. After the system is stable, rewrite the sector. If it exceeds the set rewrite number, it is determined that this sector is faulty and switched to write to the next sector. In the above method, by adding the write period to calculate the voltage variance to consider external factors, a reasonable and efficient data structure and control algorithm are designed to bring reasonable fault tolerance judgment to fault judgment, increase the number of repeated writes of the power-off storage medium during the use cycle, and thus extend the rated service life of the power-off medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic flow chart of a method for handling a power-off storage medium failure and extending its service life according to the present invention;

[0019] Figure 2 is a flow chart of the writing process in the present invention;

[0020] Figure 3 The present invention is a schematic structural diagram of a system for handling power-off storage medium failure and extending service life. DETAILED DESCRIPTION

[0021] The present invention provides a method for handling a power-off storage medium fault and extending its service life, aiming to solve the problem that the differences of existing power-off storage media cannot be unified, resulting in a service life lower than a nominal value.

[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] Please refer to the attached Figure 1-2 As shown, the present invention provides a method for handling power-off storage medium failure and extending service life:

[0024] S1, after the user turns on the power of the appliance, the program is started and the operation logic data structure is initialized, the operation logic data structure includes the current write sector number, the current ID number, the page write address, the number of write failures and the ID identification code; the operation logic data structure is set as follows: the low address bit in a single sector is used as a data area to store multiple data frames, the high address bit in a single sector is used as an ID area, and the single frame data storage position corresponds to the ID area one by one.

[0025] In this embodiment, the calculation method of the single-sector maximum frame Max is specifically: Max<=PAGE_BYTE_NUM / (FRAME_LENGTH+1), wherein the PAGE_BYTE_NUM is the maximum number of bytes of a single sector, and the FRAME_LENGTH is the data length of a single frame of data; the relationship between the starting address of the data area and the ID area is: StartAddr=(sector starting address+current ID number×single frame data length).

[0026] S2, read the content of the ID area with a set start address, read out the entire ID area and query the ID identification code from the end.

[0027] S3, based on the queried ID identification code, read the single frame data stored in the corresponding data area, and implement data verification. If the verification is successful, assign working parameters, and poll the ID areas of all sectors of the power-off storage medium in sequence to locate the sectors used before the power-off.

[0028] In this embodiment, all the sector ID areas in the power-off storage medium are polled through S3 to query the sectors used before the power-off. Because the ID area has less data than the data area, the reading range is reduced, the number of bytes of the ID area identification code is small, and the speed is fast. Compared with the traditional polling method of verifying the data area, the query algorithm directly affected by this data structure can initialize the control system faster.

[0029] S4, setting the data area as the working parameter data area, parameter backup area and comparison area, triggering the writing process when there is a difference between the data in the working parameter data area and the comparison area, recalculating the number of the next ID area to be written, and cyclically writing in a single sector until the erasing life of the single sector reaches the preset judgment condition and then switching to the next sector for use.

[0030] In this embodiment, the write process described in S4 includes: S41, recalculating the next write ID number according to the current ID number, and calculating the corresponding data area address according to the next write ID number; S42, writing the data to the working parameter data area corresponding to the data area address, reading it out, and verifying it. If the verification is successful, the data is written to the corresponding ID number area, read out and verified again. If the verification is successful again, it is deemed to be successfully written; S43, after successfully writing the working parameter data area, write the same data to the parameter backup area according to the same logic, and synchronously record the current power supply average voltage and voltage variance.

[0031] Specifically, the next write-in ID number is recalculated according to the current ID number using a preset incremental algorithm or a specific encoding rule transformation algorithm.

[0032] It should be noted that if the sector erase life is N, compared with writing at a fixed position in a single sector, the erase life described in this step is: the maximum number of frames of a single sector × the total number of sectors × N, which greatly extends the rated service life of the dielectric.

[0033] S5, write and read verification covers the data area read and write verification and the ID area read and write verification. If the ID area verification is successful, the write is determined to be successful, and the backup area read and write verification is performed according to the same logic. At the same time, a rewrite number threshold is set, and data is read and written after a single sector is written; if the data area read and write fails, switch to the next ID area to read and write again. After a certain number of rewrite failures, enter the voltage detection judgment, measure the voltage deviation degree according to the voltage variance, if the voltage threshold and voltage deviation are too large, it is determined to be an external influence, and the sector is rewritten after the system is stable. If the number of rewrites exceeds the set number, it is determined that this sector is faulty and switch to writing to the next sector.

[0034] In the above method, by adding the write period to calculate the voltage variance to take external factors into account, a reasonable and efficient data structure and control algorithm are designed to provide reasonable fault-tolerant judgment for fault judgment, increase the number of repeated writes to the power-off storage medium during the use cycle, and thus extend the rated service life of the power-off medium.

[0035] Please refer to the attached Figure 3 As shown, the present invention provides a system for fault handling and service life extension of a power-off storage medium, comprising an MCU control unit 1 and a power-off storage medium 2 and a voltage detection unit 3 connected to the MCU control unit 1 at the same time, wherein the power-off storage medium 2 is controlled by the MCU control unit 1 to implement a control algorithm according to a preset erasing logic to execute a method for fault handling and service life extension of the power-off storage medium 2; the power-off storage medium 2 can be selected from at least one of an independent EEPROM, a flash memory, and an MCU internal storage medium, and the power-off storage medium 2 is used to store an operation logic data structure.

[0036] Compared with the related art, the present invention provides a method for troubleshooting and extending the service life of a power-off storage medium, comprising: S1, after the user powers on the appliance, the program is started and the operation logic data structure is initialized; S2, the content of the ID area with a set start address is read, and the entire ID area is read out and the ID identification code is queried from the end; S3, based on the queried ID identification code, a single frame of data stored in the corresponding data area is read, and data verification is performed. If the verification is successful, the working parameters are assigned, and the ID areas of all sectors of the power-off storage medium are polled in sequence to locate the sectors used before the power off; S4, the data area is set as a working parameter data area, a parameter backup area and a comparison area, and when there is a difference between the data in the working parameter data area and the comparison area, a write process is triggered, and the data is re-written. Calculate the ID area number to be written next, and circulate the write operation in a single sector until the single sector erase life reaches the preset judgment condition and then switch to the next sector for use; S5, write read verification covers the data area read and write verification and the ID area read and write verification. If the ID area verification is successful, the write is determined to be successful, and the backup area read and write verification is performed according to the same logic. At the same time, the rewrite number threshold is set, and data is read and written after the single sector is written; if the data area read and write fails, switch to the next ID area to read and write again, and enter the voltage detection judgment after a certain number of rewrite failures, and measure the voltage deviation degree according to the voltage variance. If the voltage threshold and voltage deviation are too large, it is determined to be an external influence. After the system is stable, rewrite the sector. If it exceeds the set rewrite number, it is determined that this sector is faulty and switched to write to the next sector. In the above method, by adding the write period to calculate the voltage variance to consider external factors, a reasonable and efficient data structure and control algorithm are designed to bring reasonable fault tolerance judgment to fault judgment, increase the number of repeated writes of the power-off storage medium during the use cycle, and thus extend the rated service life of the power-off medium.

[0037] The above-described embodiments should be understood as illustrative rather than limiting the scope of protection of the present invention, which is subject to the claims. For those skilled in the art, some non-essential improvements and adjustments made to the present invention still fall within the scope of protection of the present invention without departing from the essence and scope of the present invention.

Claims

1. A method for handling power-off storage medium failure and extending service life, characterized in that: The method for handling power-off storage medium failure and extending service life includes: S1, after the user turns on the appliance, the program is started and the operation logic data structure is initialized, the operation logic data structure includes the current write sector number, the current ID number, the page write address, the number of write failures and the ID identification code; the operation logic data structure is set as follows: the low address bit in a single sector is used as a data area to store multiple data frames, the high address bit in a single sector is used as an ID area, and the single frame data storage position corresponds to the ID area one by one; S2, reading the content of the ID area with a set start address, and reading out the entire ID area and querying the ID identification code from the end; S3, based on the queried ID identification code, read the single frame data stored in the corresponding data area, and perform data verification. If the verification is successful, assign working parameters, and sequentially poll the ID areas of all sectors of the power-off storage medium to locate the sectors used before the power-off; S4, setting the data area as a working parameter data area, a parameter backup area and a comparison area, triggering a write process when there is a difference between the data in the working parameter data area and the data in the comparison area, recalculating the number of the next ID area to be written, and cyclically writing operations in a single sector until the erasing life of the single sector reaches a preset judgment condition and then switching to the next sector for use; S5, write and read verification covers the data area read and write verification and the ID area read and write verification. If the ID area verification is successful, the write is determined to be successful, and the backup area read and write verification is performed according to the same logic. At the same time, a rewrite number threshold is set, and data is read and written after a single sector is written; if the data area read and write fails, switch to the next ID area to read and write again. After a certain number of rewrite failures, enter the voltage detection judgment, measure the voltage deviation degree according to the voltage variance, if the voltage threshold and voltage deviation are too large, it is determined to be an external influence, and the sector is rewritten after the system is stable. If the number of rewrites exceeds the set number, it is determined that this sector is faulty and switch to writing to the next sector.

2. A method for handling power-off storage medium failure and extending service life according to claim 1, characterized in that: The writing process described in 45 includes: S41, recalculating the next write ID number according to the current ID number, and calculating the corresponding data area address according to the next write ID number; S42, writing the data into the working parameter data area corresponding to the data area address, then reading it out and verifying it. If the verification is successful, writing the data into the corresponding ID number area, reading it out again and verifying it. If the verification is successful again, it is deemed to be successfully written; S43, after successfully writing the working parameter data area, writing the same data into the parameter backup area according to the same logic, and synchronously recording the current power supply average voltage and voltage variance.

3. The method for handling power-off storage medium failure and extending service life according to claim 2, characterized in that: The next write ID number is recalculated according to the current ID number using a preset incremental algorithm or a specific encoding rule transformation algorithm.

4. The method for handling power-off storage medium failure and extending service life according to claim 1, characterized in that: The calculation method of the single-sector maximum frame Max described in S1-S5 is specifically: Max<=PAGE_BYTE_NUM / (FRAME_LENGTH+1), wherein PAGE_BYTE_NUM is the maximum number of bytes of a single sector, and FRAME_LENGTH is the data length of a single frame of data.

5. The method for handling power-off storage medium failure and extending service life according to claim 1, characterized in that: The relationship between the start address of the data area and the ID area is: StartAddr = (sector start address + current ID number × single frame data length).

6. A system for handling power-off storage medium faults and extending service life, characterized in that: The system includes an MCU control unit and a power-off storage medium and a voltage detection unit connected to the MCU control unit at the same time. The power-off storage medium is controlled by the MCU control unit according to a preset erasing logic to implement a control algorithm to execute a fault handling and service life extension method for the power-off storage medium; the power-off storage medium can be selected from at least one of an independent EEPROM, a flash memory, and an MCU internal storage medium, and the power-off storage medium is used to store an operation logic data structure.

Citation Information

Patent Citations

  • Data processing method and terminal equipment

    CN110209349A

  • Data storage device and system having adaptive brownout detection

    US20150025821A1

  • Data accessing method, memory controlling circuit unit and memory storage device

    US20190163363A1