eMMC Data Protection Method, Device, eMMC Package and Storage Medium
Through the eMMC controller detecting voltage and implementing a multi-level data protection strategy, the black screen problem of display screen caused by voltage drop or power loss in smart vehicles is solved, ensuring the normal operation of eMMC firmware and the correct data writing, and preventing display failure.
Patent Information
- Application Number
- CN202011446894.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2040-12-09
AI Technical Summary
In smart vehicles, the voltage drop or power loss of the eMMC causes the display to black, the eMMC firmware is damaged, and the internal space cannot be indexed, resulting in data error writing and display failure.
The input power supply voltage is detected by the eMMC controller and a multi-level control strategy is implemented, including performing different degrees of data protection measures within different voltage ranges, such as stopping read and write operations, resetting the current page data, or resetting the flash memory to a newly powered-on state, to avoid data miswrite when the voltage is unstable.
Effectively protect the eMMC firmware, prevent data miswrite, ensure the display of the display normally, and avoid firmware damage and display failure caused by unstable voltage.
Smart Images

Figure CN114627942B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technologies of intelligent vehicles and memories, and in particular, to a method and device for eMMC data protection, an eMMC package, and a storage medium. Background Art
[0002] eMMC (Embedded Multi Media Card) is a standard specification for embedded memories established by the MMC Association, mainly for products such as mobile phones or tablets. Currently, eMMC is increasingly applied to intelligent vehicles and is mainly used for storing display screen data of intelligent cockpits.
[0003] In some cases, the display screen may go black, and error data may appear in the eMMC information system, causing machine failures. In some cases, the data table is so severely damaged that it cannot be repaired, and the eMMC cannot index the internal space, ultimately resulting in firmware damage and device failure.
[0004] In summary, there is an urgent need for an eMMC data protection method to ensure the normal display of the display screen. Summary of the Invention
[0005] Embodiments of the present invention provide a method and device for eMMC data protection, an eMMC package, and a readable storage medium to avoid incorrect data writing and ensure the normal display of the display screen.
[0006] In a first aspect, embodiments of the present invention provide an eMMC data protection method, including:
[0007] After the eMMC controller is powered on, detect the input power supply voltage of the eMMC;
[0008] If the voltage is lower than the first voltage threshold and higher than the second voltage threshold, stop the read and write operations of the flash memory through the eMMC controller until the voltage reaches a stable condition;
[0009] If the voltage is lower than the second voltage threshold and higher than the third voltage threshold, reset the current page data of the flash memory through the eMMC controller;
[0010] If the voltage is lower than the third voltage threshold, reset the flash memory to the just-powered-on state through the eMMC controller;
[0011] Wherein, the first voltage threshold is greater than the second voltage threshold, and the second voltage threshold is greater than the third voltage threshold.
[0012] In a second aspect, embodiments of the present invention further provide an eMMC data protection device, including:
[0013] A detection module, configured to detect the input power supply voltage of the eMMC after the eMMC controller is powered on;
[0014] A stop module, configured to, if the voltage is lower than a first voltage threshold and higher than a second voltage threshold, stop the read and write operations of the flash memory through the eMMC controller until the voltage reaches a stable condition;
[0015] A first reset module, configured to, if the voltage is lower than the second voltage threshold and higher than a third voltage threshold, reset the current page data of the flash memory through the eMMC controller;
[0016] A second reset module, configured to, if the voltage is lower than the third voltage threshold, reset the flash memory to the just-powered-on state through the eMMC controller;
[0017] Wherein, the first voltage threshold is greater than the second voltage threshold, and the second voltage threshold is greater than the third voltage threshold.
[0018] In a third aspect, an embodiment of the present invention further provides an eMMC package, including a host and a storage allocation module. The storage allocation module includes an eMMC controller and a flash memory. The host includes:
[0019] One or more processors;
[0020] A memory, configured to store one or more programs,
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the eMMC data protection method according to any embodiment.
[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the eMMC data protection method according to any embodiment is implemented.
[0023] In the embodiment of the present invention, after the eMMC controller is powered on, the input power supply voltage of the eMMC is detected, so that voltage detection can be performed from the beginning of the eMMC operation, and power-off or voltage drop during the eMMC firmware loading and initialization process can be effectively captured; through a multi-level control method, damage to the eMMC firmware and incorrect data writing are avoided, and the normal display of the display screen is ensured. In the multi-level control method provided in this embodiment, when it is determined that the voltage falls within different voltage ranges, different degrees of data protection strategies are executed through the eMMC controller, effectively protecting the correct data written after the flash memory is powered on and erasing the possibly incorrect data. Description of the Drawings
[0024] Figure 1aIt is a schematic structural diagram of the eMMC package provided in this embodiment;
[0025] Figure 1b It is a flowchart of the first eMMC data protection method provided in the embodiment of the present invention;
[0026] Figure 2 It is a flowchart of the second eMMC data protection method provided in the embodiment of the present invention;
[0027] Figure 3 It is a schematic structural diagram of an eMMC data protection device provided in the embodiment of the present invention;
[0028] Figure 4 It is a schematic structural diagram of a host provided in the embodiment of the present invention. Detailed implementation manners
[0029] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the convenience of description, only parts related to the present invention are shown in the drawings, rather than all structures.
[0030] In order to clearly introduce the eMMC data protection method provided in this embodiment, first, the eMMC package applicable to this method will be introduced. Figure 1a It is a schematic structural diagram of the eMMC package provided in this embodiment. The eMMC package 10 includes a host 110 and a storage allocation module 120. The storage allocation module 120 includes an eMMC controller 121 and a flash memory (NAND flash memory) 122. Optionally, the flash memory 122 can be in the form of multiple chips stacked, and the eMMC controller 121 (such as ASIC) is stacked on the flash memory 122.
[0031] The flash memory 122 includes a user data area and a user-invisible area. The user-invisible area is used to store firmware, a parameter distribution table, and a physical-logical mapping table.
[0032] The host 110 can send instructions and data to be written into the flash memory to the eMMC controller 121. The eMMC controller 121 responds to the instructions and writes the data into the flash memory. The functions of the eMMC controller 121 include: processing the host interface protocol, processing the flash memory interface protocol, ensuring reliable reading and programming, and managing flash memory access and resources.
[0033] It should be noted that the host 110 also includes a clock generator (not shown) and an output circuit (not shown) for synchronizing the clocks in the storage allocation module 120. Other general structures in the eMMC package can refer to the prior art and will not be elaborated here.
[0034] During the research process, the inventors found that when the intelligent vehicle is ignited, due to the instantaneous increase in current, the voltage of the eMMC will drop or even lose power. Through the test and analysis of the eMMC, the inventors creatively discovered that whether it is a write operation on the user data area or the writing and updating of the firmware's own data table (especially the physical logical mapping table), it requires stable voltage support. If the voltage drops or power is lost at this time, the write operation will fail. In severe cases, the data may be miswritten to an unpredictable address, resulting in serious damage to the physical logical mapping table that cannot be recovered. The eMMC controller will be unable to index the internal space, leading to firmware damage, eMMC failure, and ultimately a black screen on the display.
[0035] To solve the above problems, based on the structure of the above eMMC package, the embodiment of the present invention provides a first eMMC data protection method, and its flowchart is as Figure 1b shown, which is applicable to the situation of protecting the flash memory data in the eMMC package. This method can be executed by an eMMC data protection device, which can be composed of software and / or hardware and is generally integrated in the host. Optionally, the device can also be integrated in an electronic device outside the eMMC package. The electronic device can be a terminal or a server, and it controls the eMMC controller to perform operations on the flash memory by sending instructions to the eMMC controller. For the operations of the eMMC controller on the flash memory, refer to S120 to S140.
[0036] Combined with Figure 1a and Figure 1b , the method provided in this embodiment specifically includes:
[0037] S100. After the eMMC controller is powered on, detect the input power supply voltage of the eMMC.
[0038] Assume that the execution entity is the host. After the host powers on, it sends command CMD0 to the eMMC controller. The eMMC controller and the flash memory are powered on through the same power supply. After the eMMC controller powers on, the voltage climbs continuously. After reaching the stable voltage of 3.3V, firmware loading is performed. After the loading is completed, it receives CMD0 sent by the host, and the eMMC controller enters the idle state. If the voltage remains stable without dropping, the eMMC controller will continue to complete the firmware initialization and return a response in the ready state to the host. If the host still does not receive the ready state response from the eMMC controller after sending CMD0, it will send CMD1 to the eMMC controller after a fixed period of time to inquire whether the firmware initialization is completed. If the firmware initialization is not completed (possibly due to voltage drop or power failure), it is in the busy state. When the host receives that the busy bit in R3 is 0, it continuously sends CMD1 to inquire; or, the host does not receive any response (possibly due to voltage drop or power failure during firmware loading). Whether a failure occurs during the loading process or the initialization process, it may cause flash write errors or even firmware damage. Therefore, after the eMMC controller powers on and before receiving the ready state response from the eMMC controller, the input power supply voltage of the eMMC is detected.
[0039] S110. Compare the voltage with the first voltage threshold, the second voltage threshold, and the third voltage threshold. If the voltage is lower than the first voltage threshold and higher than the second voltage threshold, jump to S120. If the voltage is lower than the second voltage threshold and higher than the third voltage threshold, jump to S130. If the voltage is lower than the third voltage threshold, jump to S140.
[0040] Specifically, if the voltage is lower than the first voltage threshold, a data protection event is triggered. Then, according to the magnitude relationship between the voltage and the first voltage threshold, the second voltage threshold, and the third voltage threshold, the corresponding hierarchical processing method is executed.
[0041] S120. Stop the read and write operations of the flash memory through the eMMC controller until the voltage reaches the stable condition.
[0042] S130. Reset the current page data of the flash memory through the eMMC controller.
[0043] S140. Reset the flash memory to the just-powered-on state through the eMMC controller.
[0044] S120 to S140 are hierarchical data protection policies. The first voltage threshold is greater than the second voltage threshold, and the second voltage threshold is greater than the third voltage threshold. Users can flexibly set each voltage threshold according to the eMMC data protection effect. Preferably, after multiple tests, the first voltage threshold is determined to be 2.475V, the second voltage threshold is 2.29V, and the third voltage threshold is 0.73V.
[0045] At S120, if the voltage is within the range of 2.29V to 2.475V, the host or an external electronic device sends an instruction to the eMMC controller to stop the read and write operations of the flash memory until the voltage reaches a stable condition. Specifically, if the voltage drops to the range of 2.29V to 2.475V, that is, just after the voltage drop and the voltage is not low, it can be considered that if the voltage continues to drop, the flash memory will write incorrect data, and the data already written is correct. Then, the eMMC controller stops the read and write operations of the flash memory until the voltage reaches the fourth voltage threshold and maintains the set duration. The fourth voltage threshold is greater than the first voltage threshold, for example, it is 2.525V, and the set duration can be 150 μs. Exemplarily, an internal clock is used as a reference. For example, if the current clock pulse is 1MHz, it is converted to a time of 1 μs, that is, when it remains above 2.525V within 150 pulses, it can be judged as meeting the requirement. If the number of pulses is less than 150, it is considered that the voltage is still fluctuating.
[0046] Optionally, after the voltage reaches a stable condition, if the host needs, it can control the eMMC controller to perform a complete physical logical mapping table recovery without being interfered by the firmware. Specifically, clear the physical logical mapping table currently running on the flash memory and write the backup physical logical mapping table to the flash memory. The backup physical logical table is an internal backup file of the eMMC chip and is stored in the flash memory NAND Flash of the eMMC chip. NAND Flash is a non-volatile memory, and the data stored in it remains even without power supply.
[0047] At S130, if the voltage is within the range of 0.73V to 2.29V, the host or an external electronic device sends an instruction to the eMMC controller to reset the current page data of the flash memory. Specifically, if the voltage drops to the range of 0.73V to 2.29V, that is, the voltage drops to a relatively low level, incorrect data will be written to the current page of the flash memory, then the current page data can be erased. After resetting, the current page of the mapping table is consistent with the current page of the flash memory.
[0048] At S140, if the voltage is lower than 0.73, the host or an external electronic device sends an instruction to the eMMC controller to reset the flash memory to the just-powered-on state. Specifically, if the voltage drops below 0.73 and a power-off event occurs, there may be incorrect data written from the just-powered-on state to the current moment, and thus all the data written from the just-powered-on state to the current moment is erased.
[0049] Optionally, if the voltage is higher than the first voltage threshold, the current task is normally executed, such as writing host data.
[0050] In the embodiments of the present invention, after the host is powered on, by detecting the input power supply voltage of the eMMC, voltage detection can be performed from the very beginning of the eMMC operation, effectively capturing power-off or voltage drop situations during the eMMC firmware loading and initialization processes; through a multi-level control method, damage to the eMMC firmware and incorrect data writing are avoided, ensuring the normal display of the display screen. In the multi-level control method provided in this embodiment, when it is determined that the voltage falls within different voltage ranges, different degrees of data protection strategies are executed by the eMMC controller, effectively protecting the correct data written after the flash memory is powered on and erasing the possibly incorrect data.
[0051] In the above embodiments and the following embodiments, from the perspective of the data writing process, the physical-logical mapping table plays a very important role in managing the overall global space, and it is of crucial significance to ensure the correctness of the data in the physical-logical mapping table. Based on this, the operation of the eMMC controller on the flash memory is specifically the operation on the physical-logical mapping table in the flash memory. Specifically, if the voltage is lower than the first voltage threshold and higher than the second voltage threshold, the eMMC controller stops the read and write operations of the physical-logical mapping table until the voltage reaches the stable condition; if the voltage is lower than the second voltage threshold and higher than the third voltage threshold, the eMMC controller resets the current page data of the physical-logical mapping table; if the voltage is lower than the third voltage threshold, the eMMC controller erases the data imported into the physical-logical mapping table after the flash memory is powered on.
[0052] Figure 2 It is a flowchart of the second eMMC data protection method provided by the embodiments of the present invention. This embodiment refines the operation of resetting the current page data of the flash memory by the eMMC controller.
[0053] As Figure 2 shown, it specifically includes the following steps:
[0054] S200. After the eMMC controller is powered on, detect the input power supply voltage of the eMMC.
[0055] As Figure 1aAs shown, the eMMC controller includes a first register (Vcc-Drop Occurences) and a second register (Vcc-Droop Occurences). The first register is used to detect the number of power-off times of the voltage, that is, the number of times below the third voltage threshold (such as 0.73v), and the second register is used to detect the number of voltage droop times, that is, the number of times below the first voltage threshold (2.475v) and above the third voltage threshold (0.73v). In the scenario where the display screen goes black, it is found that the data in both the first register and the second register increases, indicating that there is a voltage droop or even a power-off situation.
[0056] Optionally, after the eMMC controller is powered on, read the number of power-off times in the first register and the number of voltage droop times in the second register in the eMMC controller; if the number of power-off times is incremented by 1, determine that the voltage is below the third voltage threshold; if the number of voltage droop times is incremented by 1, determine that the voltage is below the first voltage threshold; read the voltage, and determine whether the voltage is higher than the second voltage threshold.
[0057] Specifically, after the host is powered on, send CMD62+0x96C9D71C to the eMMC controller to read the data in the two registers. If the number of droop times is incremented by 1, further convert the voltage into a digital signal through an A / D convertor (analog / digital converter). For example, 2.475v is converted into a digital signal of 11000010. Then determine whether the voltage is higher than the second voltage threshold through the digital signal.
[0058] S210. Compare the voltage with the first voltage threshold, the second voltage threshold, and the third voltage threshold. If the voltage is below the first voltage threshold and above the second voltage threshold, jump to S220. If the voltage is below the second voltage threshold and above the third voltage threshold, jump to S230. If the voltage is below the third voltage threshold, jump to S240.
[0059] S220. Stop the read and write operations of the flash memory through the eMMC controller until the voltage reaches a stable condition.
[0060] S230. Check whether the host write transaction is currently being executed through the eMMC controller. If the host write transaction is currently being executed, execute S231; if the host write transaction is not currently being executed, execute S232.
[0061] S231. Erase the physical-logical mapping table data of the current page of the flash memory through the eMMC controller, and copy the backup physical-logical mapping table data to the current page of the flash memory.
[0062] S232. Copy the backup physical-logical mapping table data to the current page of the flash memory through the eMMC controller.
[0063] Optionally, for the case where the voltage drops to the range of 0.73V to 2.29V, the startup process of the eMMC controller and the flash memory will roll back to the voltage ramping stage. After the voltage stabilizes (reaches 3.3V), the firmware will be reloaded and re-initialized.
[0064] S240. Reset the flash memory to the just-powered-on state through the eMMC controller.
[0065] Erase the data imported into the physical-logical mapping table after the flash memory is powered on through the eMMC controller. Due to power-off, the startup process of the eMMC controller and the flash memory will roll back to the voltage ramping stage. After the voltage stabilizes (reaches 3.3V), the firmware will be reloaded and re-initialized.
[0066] In this embodiment, by reading the power-off count in the first register and the voltage drop count in the second register in the eMMC controller, it is possible to directly know that the voltage is lower than the third voltage threshold and whether it is higher than the first voltage threshold, without the need to read the voltage in real time to judge the data size, which simplifies the data reading operation. By detecting whether a host write transaction is currently being executed, it is possible to accurately capture whether there is incorrect data written to the current page, thereby selectively erasing the physical-logical mapping table of the current page to avoid incorrect data writing; moreover, by copying the backup physical-logical mapping table data to the current page of the flash memory, it is ensured that the correct physical-logical mapping table is stored in the flash memory, ensuring the normal operation of data reading and writing operations.
[0067] Figure 3 FIG. is a schematic structural diagram of an eMMC data protection device provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the situation of protecting the flash memory data in the eMMC package. In combination Figure 3 , the eMMC data protection device includes: a detection module 310, a stop module 320, a first reset module 330, and a second reset module 340.
[0068] The detection module 310 is configured to detect the input power supply voltage of the eMMC after the eMMC controller is powered on;
[0069] The stop module 320 is configured to stop the read and write operations of the flash memory through the eMMC controller if the voltage is lower than the first voltage threshold and higher than the second voltage threshold until the voltage reaches the stable condition;
[0070] The first reset module 330 is configured to reset the current page data of the flash memory through the eMMC controller if the voltage is lower than the second voltage threshold and higher than the third voltage threshold;
[0071] The second reset module 340 is configured to reset the flash memory to the just-powered-on state through the eMMC controller if the voltage is lower than the third voltage threshold;
[0072] Among them, the first voltage threshold is greater than the second voltage threshold, and the second voltage threshold is greater than the third voltage threshold.
[0073] In the embodiment of the present invention, after the eMMC controller is powered on, the input power supply voltage of the eMMC is detected, so that voltage detection can be performed from the beginning of the eMMC operation, effectively capturing the power-off or voltage drop during the eMMC firmware loading and initialization process; through a multi-level control method, damage to the eMMC firmware and incorrect data writing are avoided, ensuring the normal display of the display screen. In the multi-level control method provided in this embodiment, when it is determined that the voltage falls within different voltage ranges, different degrees of data protection strategies are executed through the eMMC controller, effectively protecting the correct data written after the flash memory is powered on and erasing the possibly incorrect data.
[0074] Optionally, the stop module 320 is used to stop the read and write operations of the flash memory through the eMMC controller if the voltage is lower than the first voltage threshold and higher than the second voltage threshold until the voltage reaches the fourth voltage threshold and maintains for a set duration; where the fourth voltage threshold is greater than the first voltage threshold; the device further includes a clearing and writing module, which is used to clear the physical logical mapping table running on the flash memory and write the backup physical logical mapping table to the flash memory after the voltage reaches the stable condition.
[0075] Optionally, the first reset module 330 is used to check whether the host write transaction is currently being executed through the eMMC controller if the voltage is lower than the second voltage threshold and higher than the third voltage threshold; if the host write transaction is currently being executed, erase the physical logical mapping table data of the current page of the flash memory through the eMMC controller and copy the backup physical logical mapping table data to the current page of the flash memory; if the host write transaction is not currently being executed, copy the backup physical logical mapping table data to the current page of the flash memory through the eMMC controller.
[0076] Optionally, the second reset module 340 is used to erase the data imported into the physical logical mapping table after the flash memory is powered on through the eMMC controller if the voltage is lower than the third voltage threshold.
[0077] Optionally, the detection module 310 is used to read the power-off times in the first register and the voltage drop times in the second register in the eMMC controller after the eMMC controller is powered on; if the power-off times are incremented by 1, it is determined that the voltage is lower than the third voltage threshold; if the voltage drop times are incremented by 1, it is determined that the voltage is lower than the first voltage threshold; read the voltage and determine whether the voltage is higher than the second voltage threshold.
[0078] Optionally, the first voltage threshold is 2.475v, the second voltage threshold is 2.29v, the third voltage threshold is 0.73v, and the fourth voltage threshold is 2.525v.
[0079] The eMMC data protection device provided by an embodiment of the present invention can execute the eMMC data protection method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0080] An embodiment of the present invention further provides an eMMC package, which includes a host and a storage allocation module. The storage allocation module includes an eMMC controller and a flash memory. For the specific structure, please refer to Figure 1a , which will not be elaborated here.
[0081] Figure 4 FIG. is a schematic structural diagram of a host provided by an embodiment of the present invention. As Figure 4 shown, the host includes a processor 40, a memory 41, an input device 42, and an output device 43. The number of processors 40 in the host can be one or more. Figure 4 Here, one processor 40 is taken as an example. The processor 40, the memory 41, the input device 42, and the output device 43 in the host can be connected through a bus or other means. Figure 4 Here, connection through a bus is taken as an example.
[0082] The memory 41, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the eMMC data protection method in the embodiment of the present invention (for example, the detection module 310, the stop module 320, the first reset module 330, and the second reset module 340 in the eMMC data protection device). The processor 40 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 41, that is, the above-mentioned eMMC data protection method is implemented.
[0083] The memory 41 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function. The data storage area can store data created according to the use of the terminal, etc. In addition, the memory 41 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 41 may further include a memory remotely set relative to the processor 40, and these remote memories can be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0084] The input device 42 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the device. The output device 43 may include a display device such as a display screen.
[0085] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the eMMC data protection method of any embodiment.
[0086] The computer storage medium of the embodiments of the present application may adopt any combination of one or more computer-readable media. The computer-readable media may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program, which can be used by or in combination with an instruction execution system, apparatus, or device.
[0087] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0088] The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.
[0089] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or, it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).
[0090] Note that the above is only the preferred embodiment of this application and the technical principles applied. Those skilled in the art will understand that this application is not limited to the specific embodiments described here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of this application. Therefore, although this application has been described in more detail through the above embodiments, this application is not limited to the above embodiments. Without departing from the concept of this application, it can also include more other equivalent embodiments, and the scope of this application is determined by the scope of the appended claims.
Claims
1. An eMMC data protection method, characterized in that Including: After the eMMC controller is powered on, detect the input power supply voltage of the eMMC; If the voltage is lower than the first voltage threshold and higher than the second voltage threshold, stop the read and write operations of the flash memory through the eMMC controller until the voltage reaches a stable condition; If the voltage is lower than the second voltage threshold and higher than the third voltage threshold, reset the current page data of the flash memory through the eMMC controller; If the voltage is lower than the third voltage threshold, reset the flash memory to the just-powered-on state through the eMMC controller; Among them, after the eMMC controller is powered on, detecting the input power supply voltage of the eMMC includes: after the eMMC controller is powered on, reading the power-down times in the first register and the voltage drop times in the second register in the eMMC controller; if the power-down times plus 1, determine that the voltage is lower than the third voltage threshold; if the voltage drop times plus 1, determine that the voltage is lower than the first voltage threshold; read the voltage, and determine whether the voltage is higher than the second voltage threshold; the first voltage threshold is greater than the second voltage threshold, and the second voltage threshold is greater than the third voltage threshold.
2. The method according to claim 1, wherein The stopping the read and write operations of the flash memory through the eMMC controller until the voltage reaches a stable condition includes: Stopping the read and write operations of the flash memory through the eMMC controller until the voltage reaches the fourth voltage threshold and maintaining a set duration; Among them, the fourth voltage threshold is greater than the first voltage threshold; After the voltage reaches a stable condition, it further includes: Empty the physical logical mapping table running on the flash memory, and write the backup physical logical mapping table to the flash memory.
3. The method according to claim 1, wherein The resetting the current page data of the flash memory through the eMMC controller includes: Checking whether a host write transaction is currently executed through the eMMC controller; If a host write transaction is currently executed, erase the physical logical mapping table data of the current page of the flash memory through the eMMC controller, and copy the backup physical logical mapping table data to the current page of the flash memory; If a host write transaction is not currently executed, copy the backup physical logical mapping table data to the current page of the flash memory through the eMMC controller.
4. The method according to claim 1, wherein The resetting the flash memory to the just-powered-on state through the eMMC controller includes: Erasing the data imported into the physical logical mapping table after the flash memory is powered on through the eMMC controller.
5. The method according to claim 1, characterized in that, The execution entity of the eMMC data protection method is a host or an electronic device outside the eMMC package.
6. The method according to any one of claims 1-5, characterized in that, The first voltage threshold is 2.475v, the second voltage threshold is 2.29v, and the third voltage threshold is 0.73v.
7. The method according to claim 2, characterized in that, The fourth voltage threshold is 2.525v.
8. An eMMC data protection device, characterized in that, Including: A detection module, used to detect the input power supply voltage of the eMMC after the eMMC controller is powered on; A stop module, used to stop the read and write operations of the flash memory through the eMMC controller if the voltage is lower than the first voltage threshold and higher than the second voltage threshold until the voltage reaches a stable condition; A first reset module, configured to reset the current page data of the flash memory through the eMMC controller if the voltage is lower than the second voltage threshold and higher than the third voltage threshold; A second reset module, configured to reset the flash memory to the just-powered-on state through the eMMC controller if the voltage is lower than the third voltage threshold; Wherein, after the eMMC controller is powered on, detecting the input power supply voltage of the eMMC includes: after the eMMC controller is powered on, reading the power-down times in the first register and the voltage drop times in the second register in the eMMC controller; if the power-down times are incremented by 1, determining that the voltage is lower than the third voltage threshold; if the voltage drop times are incremented by 1, determining that the voltage is lower than the first voltage threshold; reading the voltage, and determining whether the voltage is higher than the second voltage threshold; the first voltage threshold is greater than the second voltage threshold, and the second voltage threshold is greater than the third voltage threshold.
9. An eMMC packaged product, comprising a host and a storage allocation module, the storage allocation module comprising an eMMC controller and a flash memory, characterized in that, The host includes: One or more processors; A memory, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the eMMC data protection method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the eMMC data protection method according to any one of claims 1-7.
Citation Information
Patent Citations
Flash memory and its control method
CN101154447A
Memory storage device, memory controller and memory control method
CN103198861A