Search

CN-121979441-A - Firmware erasing method, firmware erasing device, electronic equipment and storage medium

CN121979441ACN 121979441 ACN121979441 ACN 121979441ACN-121979441-A

Abstract

The application provides a firmware erasing method, a firmware erasing device, electronic equipment and a computer readable storage medium, wherein the method comprises the steps of responding to receiving an erasing instruction aiming at target logic data, and obtaining a mapping item corresponding to the target logic data; judging whether the mapping item corresponding to the target logic data is in an invalid marking state, if not marked as invalid, executing the erasing operation of the target logic data, judging whether the target logic data has the complement logic data, wherein the mapping item of the complement logic data points to a first section, the sum of the erased data volume records corresponding to the complement logic data and the first section is equal to the data volume of the first section, and if the complement logic data exists, marking the mapping item pointing to the first section as invalid. The embodiment of the application can reduce unnecessary time consumption of the erasing process and effectively improve the overall operation efficiency and the user experience.

Inventors

  • REN JIAHONG
  • ZENG YU
  • LAI NAI

Assignees

  • 珠海妙存科技有限公司

Dates

Publication Date
20260505
Application Date
20251205

Claims (10)

  1. 1. A method of firmware erasure, the method comprising the steps of: In response to receiving an erasure instruction for target logic data, acquiring a mapping item corresponding to the target logic data; Judging whether the mapping item corresponding to the target logic data is in an invalid marking state, and if not, executing the erasing operation of the target logic data; Judging whether the target logic data has complement logic data, wherein a mapping item of the complement logic data points to a first section, and the sum of erased data volume records corresponding to the complement logic data and the first section is equal to the data volume of the first section; And if the complement logic data exists, marking the mapping item pointing to the first section as invalid.
  2. 2. The firmware erasure method according to claim 1, wherein the determining whether the target logical data has complement logical data includes: Acquiring first logic data of which the mapping item points to the first section in the target logic data; if the first data volume corresponding to the first logic data is smaller than the data volume of the first section, adding the first data volume and the second data volume to obtain a third data volume, wherein the second data volume represents the erased data volume record corresponding to the first section; And if the third data volume is equal to the data volume of the first section, taking the first logic data as the complement logic data.
  3. 3. The firmware erasing method as claimed in claim 2, wherein if the third data amount is equal to the data amount of the first section, the erased data amount record corresponding to the first section is updated to the third data amount.
  4. 4. The firmware erasing method of claim 2, wherein if the first data amount corresponding to the first logic data is equal to the data amount of the first section, the first logic data is taken as the complement logic data.
  5. 5. The method according to claim 1, wherein the method further comprises: and acquiring a section pointed by a mapping item corresponding to the residual logic data, and updating an erased data volume record corresponding to the section, wherein the residual logic data represents the residual part of the target logic data after the completion logic data is removed.
  6. 6. The firmware erasure method of claim 1, wherein the mapping entry corresponding to the target logical data is stored in a primary mapping table, the method further comprising: If all the mapping items in the primary mapping table are marked as invalid, marking the mapping item corresponding to the primary mapping table as invalid in a secondary mapping table; and if all the mapping items in the secondary mapping table are marked as invalid, marking the mapping item corresponding to the secondary mapping table as invalid in the tertiary mapping table.
  7. 7. The firmware erasure method of claim 6, wherein the method further comprises: writing an updated tertiary mapping table, an updated secondary mapping table and an updated primary mapping table into the flash memory; If the mapping item mark corresponding to the primary mapping table in the secondary mapping table is invalid, skipping writing into the primary mapping table; and if the mapping item mark corresponding to the secondary mapping table in the tertiary mapping table is invalid, skipping writing into the secondary mapping table.
  8. 8. A firmware erasure apparatus, the apparatus comprising: The acquisition module is used for responding to the received erasure instruction aiming at the target logic data and acquiring a mapping item corresponding to the target logic data; the first processing module is used for judging whether the mapping item corresponding to the target logic data is in an invalid marked state, and if the mapping item is not marked as invalid, executing the erasing operation of the target logic data; The first judging module is used for judging whether the target logic data has the complement logic data, the mapping item of the complement logic data points to a first section, and the sum of the erased data volume records corresponding to the complement logic data and the first section is equal to the data volume of the first section; And the second processing module is used for marking the mapping item pointing to the first section as invalid if the complement logic data exists.
  9. 9. An electronic device, comprising: At least one processor; At least one memory for storing at least one program; At least one of the programs is executed by at least one of the processors to perform the method of any of claims 1 to 7.
  10. 10. A computer readable storage medium storing computer executable instructions for performing the method of any one of claims 1 to 7.

Description

Firmware erasing method, firmware erasing device, electronic equipment and storage medium Technical Field Embodiments of the present application relate to, but are not limited to, the field of storage technologies, and in particular, to a firmware erasing method, a firmware erasing device, an electronic device, and a computer readable storage medium. Background The NAND flash memory maintains the corresponding relation between the logical address and the physical address through the mapping table, so that the actual storage position of the data in the flash memory is positioned. The mapping table contains a plurality of mapping entries, each mapping entry corresponding to a logical data area (section). When the Embedded multimedia controller (Embedded MultiMediaCard, eMMC) receives an erase command for logical data of less than one section capacity, the logical data is directly erased, but the corresponding mapping item is not updated. This causes a problem in that if the erase command for the batch of logical data is received again later, the firmware performs repeated erase operations because it cannot recognize that it has been erased through the mapping table, thereby making unnecessary time consuming. Disclosure of Invention The embodiment of the application provides a firmware erasing method, a firmware erasing device, electronic equipment and a computer readable storage medium, which aim to reduce unnecessary erasing process time consumption and effectively improve user experience. In a first aspect, an embodiment of the present application provides a firmware erasing method, including the following steps: In response to receiving an erasure instruction for target logic data, acquiring a mapping item corresponding to the target logic data; Judging whether the mapping item corresponding to the target logic data is in an invalid marking state, and if not, executing the erasing operation of the target logic data; Judging whether the target logic data has complement logic data, wherein a mapping item of the complement logic data points to a first section, and the sum of erased data volume records corresponding to the complement logic data and the first section is equal to the data volume of the first section; And if the complement logic data exists, marking the mapping item pointing to the first section as invalid. The embodiment of the application at least comprises the following beneficial effects: in the embodiment of the application, after receiving an erasure instruction of target logic data, firmware firstly acquires a mapping item corresponding to the target logic data, then judges whether the mapping item is in an invalid marked state, and when the mapping item is not marked as invalid, executes erasure operation of the target logic data, and then further judges whether the target logic data has complement logic data, wherein the mapping item of the complement logic data points to a first section, and the sum of erased data volume records corresponding to the complement logic data and the first section is equal to the data volume of the first section. If the complement logic data exists, all mapping entries pointing to the first section are marked as invalid. According to the embodiment of the application, by accumulating the erased data quantity of a single section, only when the accumulated value reaches the capacity of the section, mapping items corresponding to all related logic data are uniformly marked as invalid at one time. After the mode is adopted, when the system subsequently receives the erasure command aiming at the same batch of logic data, the system can directly identify that the data is erased through the invalid state of the mapping item, so that the repeated execution of the erasure action is avoided, the unnecessary time consumption of the erasure procedure is obviously reduced, and the overall operation efficiency and the user experience are effectively improved. In one possible implementation manner, the determining whether the complement logic data exists in the target logic data includes: Acquiring first logic data of which the mapping item points to the first section in the target logic data; if the first data volume corresponding to the first logic data is smaller than the data volume of the first section, adding the first data volume and the second data volume to obtain a third data volume, wherein the second data volume represents the erased data volume record corresponding to the first section; And if the third data volume is equal to the data volume of the first section, taking the first logic data as the complement logic data. In one possible implementation manner, if the third data amount is equal to the data amount of the first section, the erased data amount record corresponding to the first section is updated to the third data amount. In one possible implementation manner, if the first data amount corresponding to the first logic data is equal to the data amount