Memory health monitoring method and device, electronic equipment and storage medium

By setting up SLC characteristic storage space in the memory, monitoring the data write volume in real time and setting alarm conditions, the problem of inaccurate memory health assessment is solved, timely health alarms are achieved, and the risk of memory damage is reduced.

CN119226011BActive Publication Date: 2025-10-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310799695.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-10-10
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

In the existing technology, the health assessment method of memory is single and not accurate enough, and cannot provide detailed life prediction. As a result, users cannot replace the memory in time when it is damaged, causing losses.

Method used

By setting a target storage space with SLC characteristics in the memory, the data write volume is monitored in real time, and alarm conditions are set according to the maximum data write volume to generate health alarm information to remind users of the health status of the memory.

Benefits of technology

Improves the accuracy and stability of storage health assessment, generates health alerts in a timely manner, and reduces losses caused by storage damage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226011B_ABST
    Figure CN119226011B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a memory health monitoring method and device, electronic equipment and storage medium. The method is applied to an electronic equipment, the electronic equipment comprising a memory, a target storage space being arranged in the memory, the target storage space having a single-layer storage unit (SLC) characteristic, and the target storage space being used for storing a data write amount of the memory. The method comprises: reading a current data write amount of the memory from the target storage space; if the current data write amount meets a write warning condition, generating health warning information for the memory; and the write warning condition being determined according to a maximum data write amount of the memory. The memory health monitoring method, device, electronic equipment and storage medium can more accurately evaluate the health of the memory, and enrich the evaluation method of the health of the memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a method, device, electronic device, and storage medium for monitoring the health of a memory. Background Art

[0002] Memory inevitably wears out during use, and accurately assessing memory health (i.e., its lifespan) has long been a challenge for electronics manufacturers. Current industry-wide memory health assessment methods typically reserve a certain number of unused healthy memory blocks and assess their health by counting the usage of these blocks. This approach is relatively simple and inaccurate. Summary of the Invention

[0003] The embodiments of the present application disclose a memory health monitoring method, device, electronic device, and storage medium, which can more accurately evaluate the health of the memory and enrich the evaluation methods of the memory health.

[0004] The present application discloses a memory health monitoring method, which is applied to an electronic device. The electronic device includes the memory, wherein the memory is provided with a target storage space, the target storage space has a single-layer cell (SLC) characteristic, and the target storage space is used to store the amount of data written to the memory. The method includes:

[0005] Reading the current data write amount of the memory from the target storage space;

[0006] If the current data writing amount meets the write alarm condition, health alarm information for the memory is generated; wherein, the write alarm condition is determined based on the maximum data writing amount of the memory, and the health alarm information is used to warn about the health status of the memory.

[0007] The present application discloses a memory health monitoring device, which is applied to an electronic device. The electronic device includes the memory, wherein the memory is provided with a target storage space, the target storage space has a single-layer cell (SLC) characteristic, and the target storage space is used to store the amount of data written to the memory. The device includes:

[0008] A write amount reading module, configured to read the current data write amount of the memory from the target storage space;

[0009] An alarm module is used to generate health alarm information for the memory if the current data writing amount meets the write alarm condition; wherein the write alarm condition is determined based on the maximum data writing amount of the memory, and the health alarm information is used to warn about the health status of the memory.

[0010] An embodiment of the present application discloses an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor implements the method described above.

[0011] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor implements the method described above.

[0012] The memory health monitoring method, device, electronic device, and storage medium disclosed in the embodiments of the present application read the current data write amount of the memory from the target storage space. If the current data write amount meets the write alarm condition, a health alarm message for the memory is generated. The target storage space with the single-layer storage unit (SLC) characteristics in the memory is used to store the data write amount of the memory, which can improve the accuracy and stability of the stored data write amount, ensure the reliability of the read current data write amount, and use the current data write amount and maximum data write amount of the memory to evaluate the health of the memory, which can more accurately evaluate the health of the memory and enrich the evaluation method of the health of the memory. In addition, health alarm information for the memory can be generated in a timely and accurate manner, making it convenient for users to know the health status of the memory and reducing unnecessary losses caused to users due to memory damage. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 This is a diagram of the overall architecture of eMMC in one embodiment;

[0015] Figure 2 This is a diagram of an application scenario of a memory health monitoring method according to an embodiment;

[0016] Figure 3 is a flowchart of a method for monitoring the health of a memory in one embodiment;

[0017] Figure 4Flow chart of a method for monitoring health of a memory in another embodiment;

[0018] Figure 5 Structure diagram of an eMMC in an embodiment;

[0019] Figure 6A Interface diagram of outputting health alarm information and write volume prompt information in an embodiment;

[0020] Figure 6B Interface diagram of outputting write volume prompt information in an embodiment;

[0021] Figure 7 Flow chart of a method for monitoring health of a memory in another embodiment;

[0022] Figure 8 Flow chart of a method for monitoring health of a memory in another embodiment;

[0023] Figure 9 Block diagram of a device for monitoring health of a memory in an embodiment;

[0024] Figure 10 Structure block diagram of an electronic device in an embodiment. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0026] It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present application and the drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally further include steps or units not listed, or can optionally further include other steps or units inherent to the process, method, product or device.

[0027] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element. For example, without departing from the scope of this application, the first partition may be referred to as the second partition, and similarly, the second partition may be referred to as the first partition. Both the first partition and the second partition are storage partitions within the target storage space, but they are not the same storage partition. The term "plurality" used in this application refers to two or more. The term "and / or" used in this application refers to one of the solutions, or any combination of multiple solutions.

[0028] eMMC (Embedded Multi Media Card) is a Flash Memory Card standard that defines the architecture of MMC (Multi Media Card) and the interface and protocol for accessing Flash Memory. eMMC is an extension of MMC that can meet higher standards of performance, cost, size, stability, ease of use, etc. For example, Figure 1 FIG. 1 is a diagram showing the overall architecture of eMMC in one embodiment. Figure 1 As shown, eMMC may include three major parts: Flash Memory, Flash Controller, and Host Interface. Among them, the flash memory can be used to store various types of data such as system, application, and user data, and the flash memory can be NAND flash memory. The flash memory controller can be used to complete functions such as erase and write leveling, bad block management, and ECC (Error Correcting Code, error checking and correction) verification. Compared with directly connecting the flash memory to the host (Host) side, integrating the flash memory controller inside the eMMC can shield the physical characteristics of the flash memory to reduce the complexity of the host-side software and reduce the special processing of the flash memory by the host side. The host interface can be used to provide various interfaces for communication between the eMMC and the host side. The MMC controller in the host side can transmit data with the eMMC according to the various communication interfaces defined in the eMMC bus protocol.

[0029] The write life health evaluation of eMMC flash in use has been a problem bothering electronic product design manufacturers, and there is no direct evaluation method at present. In the related technology, the storage particles inside the eMMC flash are usually NAND flash particles, and the technology determines that the entire storage characteristics inevitably have bad blocks, which are divided into bad blocks existing at the factory and bad blocks generated by repeated erasing and writing by users in use. When the number of bad blocks reaches a certain threshold trigger, the eMMC flash can no longer correctly store data, and cannot use the eMMC flash for data storage. When the number of bad blocks is less than the threshold specified by the eMMC flash, it is considered that the eMMC flash is healthy and can be used normally. At present, the industry usually evaluates the health of the eMMC flash in the following ways:

[0030] Method one, a certain number of unused healthy blocks are reserved inside the eMMC flash chip, and when the system finds bad blocks, the healthy blocks are directly replaced with the bad blocks to allow the eMMC flash to continue to be used. When these reserved healthy blocks are exhausted, it is considered that the life of the eMMC flash has basically reached the end, and the eMMC flash will be declared as broken and cannot be used normally.

[0031] Method two, JEDEC (Joint Electron Device Engineering Council, Electronic Engineering Design Development Joint Association) has formulated relevant standards for the health evaluation of eMMC in the formulation of eMMC5.0 protocol: device full life cycle health evaluation models TYPE-A and TYPE-B, which specially establish a set of flash health data statistics inside the eMMC flash chip. The main method is to evaluate the ratio of the number of used reserved healthy blocks to the total number of reserved healthy blocks, and give 1-10 levels according to the ratio, representing 10%-100% of the damage degree. When the damage degree reaches 100%, it is basically declared that the eMMC flash is close to or has been broken and cannot be used normally.

[0032] At present, the write life health evaluation index of eMMC flash is single, and basically depends on the manufacturer to realize, so it is difficult to provide more guidance information in the use process of the flash device, and cannot provide relevant effective information for the user. Moreover, the current evaluation method can only obtain the numerical percentage of the device full life cycle health evaluation models TYPE-A and TYPE-B given by JEDEC through the register query, and the accuracy is poor.

[0033] Embodiments of the present application disclose a memory health monitoring method and device, electronic equipment and storage medium, which can more accurately evaluate the health of the memory and enrich the evaluation method of the health of the memory.

[0034] Figure 2FIG. 1 is an application scenario diagram of a memory health monitoring method in one embodiment. Figure 2 As shown, the memory health monitoring method provided in the embodiment of the present application can be applied to an electronic device 20, which may include but is not limited to mobile phones, wearable devices, vehicle-mounted terminals, tablet computers, PCs (Personal Computers), PDAs (Personal Digital Assistants) and other terminal devices. The electronic device 20 can also be a server device, which is not limited in the embodiment of the present application.

[0035] The electronic device 20 may be provided with a memory 210, which may include a flash memory, etc. Further, the memory 210 may include an eMMC, etc. It should be noted that the memory 210 may also be other types of memory, such as an erasable programmable read only memory (EPROM), an electrically erasable PROM (Electrically Erasable PROM, EEPROM), a random access memory (RAM), etc., and the embodiment of the present application is not limited to this.

[0036] A target storage space may be provided in the memory 210. The target storage space has SLC (Single-Level Cell, single-layer storage unit) characteristics, fast operation and response speed, at least 100,000 erase and write times, and very reliable data storage. In an embodiment of the present application, the target storage space in the memory 210 can be used to store the amount of data written to the memory 210 and to be queried by the operating system or host of the electronic device 20. The electronic device 20 can read the current amount of data written to the memory 210 from the target storage space of the memory 210. If the current amount of data written meets the write alarm condition, a health alarm message is generated for the memory 210. The health alarm message can be used to warn of the health of the memory 210.

[0037] like Figure 3 As shown, in one embodiment, a memory health monitoring method is provided, which can be applied to the above-mentioned electronic device. The method may include the following steps:

[0038] Step 310: Read the current data write amount of the memory from the target storage space.

[0039] The memory of the electronic device may be provided with a target storage space, which has SLC characteristics, fast operation and response speed, at least 100,000 erase and write times, and very reliable data storage. For flash memory such as eMMC, a storage area with SLC characteristics is usually provided, which is specially provided by the memory chip manufacturer to third-party users for storing critical data. For example, it can be used to store key system firmware such as bootloader. The space size of the storage area is about 512KB (kilobytes) to 1MB (megabytes). In an embodiment of the present application, based on the partition structure of the storage area with SLC characteristics provided in the memory, the target storage space can be divided from the storage area with SLC characteristics to store the data written to the memory.

[0040] Each time the electronic device writes data to the memory, the data write amount stored in the target storage space can be updated and maintained to ensure that the data write amount stored in the target storage space is the latest data write amount of the memory. Optionally, the target storage space can be an SLC partition in the memory, or a pSLC (Pseudo Single-Level Cell) partition in the memory, etc. By using the target storage space with SLC characteristics to store the data write amount of the memory, the accuracy and stability of the stored data write amount can be improved, and the accuracy of the assessment of the health of the memory can be further improved. In addition, the original partition structure of the memory is utilized to improve the reasonable utilization rate of the memory.

[0041] When an electronic device needs to evaluate the health of its memory, it can read the current data write amount of the memory from the target storage space in the memory, and determine whether the current data write amount meets the write alarm condition. If it is determined that the current data write amount meets the write alarm condition, it can indicate that the current health of the memory is relatively dangerous, and the life of the memory has ended or is nearing the end, then a health alarm information for the memory can be generated.

[0042] In an embodiment of the present application, the write alarm condition is determined based on the maximum data write amount of the memory. The maximum data write amount may refer to the total write data amount corresponding to the entire life of the memory in theory. The maximum data write amount may be the write amount of the memory for the entire life cycle calibrated when the memory leaves the factory. For example, the write amount of the memory for the entire life cycle calibrated when the memory leaves the factory is 1TBW (terabyte write), then the maximum data write amount may be 1TBW, etc., but is not limited to this.

[0043] Optionally, the write alarm condition can be determined based on the maximum data write amount of the memory. For example, the write alarm condition may be that the current data write amount of the memory reaches the maximum data write amount or is close to the maximum data write amount. In this case, the memory is prone to data loss, and thus the life of the memory can be basically declared over.

[0044] Step 320: If the current data write amount meets the write warning condition, generate health warning information for the memory.

[0045] Health warning information can be used to warn users about the health status of the memory. For example, the health warning information can remind users that the life of the memory is about to end or has ended, and it can no longer be used. This makes it convenient for users to know the health status of the memory, and can facilitate users to replace the memory in time, or adjust data storage to reduce the amount of data written to the memory, thereby reducing unnecessary losses to users due to memory damage.

[0046] Optionally, after the electronic device generates health warning information, it can output the health warning information. The method of outputting the health warning information may include but is not limited to displaying the health warning information in the form of pictures or text through a display screen, or playing the health warning information in the form of voice through a speaker, etc. The embodiment of the present application does not limit the method of outputting the health warning information.

[0047] In some embodiments, the timing for the electronic device to evaluate the health of the memory can be set according to actual needs. For example, the health of the memory can be evaluated according to a fixed time period, such as evaluating the health of the memory at a fixed time every day; or, the health of the memory can be evaluated each time the electronic device is started; or, the electronic device can also be connected to a host computer for communication, and when the electronic device receives an evaluation request sent by the host computer, the health of the memory is evaluated, etc., but is not limited to this.

[0048] In some embodiments, after the electronic device reads the current data write amount of the memory from the target storage space and determines whether the current data write amount meets the write alarm condition, the memory information such as the current data write amount read this time and the judgment result (whether the write alarm condition is met) can be reported to the server. The server can monitor the health of the memories on multiple electronic devices, obtain the memory information such as the current data write amount and the judgment result of the memory reported by multiple electronic devices respectively, and store the memory information reported by each electronic device. The memory chip manufacturer can also better monitor the health of the memories on each electronic device based on the memory information stored on the server. Optionally, when the memory of the electronic device fails, the maintenance personnel can use the memory information stored on the server, which intuitively reflects the health of the memory, thereby helping the maintenance personnel to more accurately analyze the problem of the memory and formulate relevant maintenance plans.

[0049] In an embodiment of the present application, the current data write amount of the memory is read from the target storage space. If the current data write amount meets the write alarm condition, health warning information for the memory is generated. The target storage space with single-layer storage unit (SLC) characteristics in the memory is used to store the data write amount of the memory, which can improve the accuracy and stability of the stored data write amount, ensure the reliability of the read current data write amount, and use the current data write amount and maximum data write amount of the memory to evaluate the health of the memory, which can more accurately evaluate the health of the memory and enrich the evaluation method of the health of the memory. In addition, health warning information for the memory can be generated in a timely and accurate manner, making it easier for users to understand the health of the memory and reduce unnecessary losses caused to users by memory damage.

[0050] like Figure 4 As shown, in another embodiment, a memory health monitoring method is provided, which can be applied to the above-mentioned electronic device. The method may include the following steps:

[0051] Step 402: Read the current first data write amount of the memory from the first partition, and / or read the current second data write amount of the memory from the second partition.

[0052] The target storage space may include a first partition and a second partition, both of which are used to store the amount of data written to the memory, and the first partition and the second partition serve as backups for each other, that is, the data stored in the first partition and the second partition are kept synchronized. The first partition and the second partition may be two smaller storage partitions extracted from a storage area with SLC characteristics in the memory. For example, the space size of the first partition and the second partition may be 4KB, 5KB, etc., but not limited to this. The space size of the first partition and the second partition may be the same or different. The first partition and the second partition are extracted from the storage area with SLC characteristics in the memory, specifically used to store the amount of data written to the memory for query by the operating system of the electronic device, which can ensure the accuracy of the current data written to the memory read each time.

[0053] Each time the electronic device writes data to the memory, the data writing amount stored in the first partition and the second partition can be updated and maintained respectively, and the data writing amount recorded in the first partition and the second partition can be ensured to be consistent. Figure 5 FIG. 1 is a schematic diagram of the structure of an eMMC in one embodiment. Figure 5 As shown, SLC / pSLC partitions are set in the eMMC, and the first partition 502 and the second partition 504 can be extracted from the SLC / pSLC partition. The first partition 502 and the second partition 504 back up each other and keep synchronized. The first partition 502 can record the data writing amount A of the memory, and the second partition 504 can record the data writing amount B of the memory. When the data writing amount A and the data writing amount B are correct, the data writing amount A is equal to the data writing amount B.

[0054] When an electronic device needs to evaluate the health of a memory, it can read the current first data write amount of the memory from a first partition of the memory, and upon determining that the current first data write amount is correct, determine whether the current first data write amount meets the write alarm condition; and / or, it can read the current second data write amount of the memory from a second partition of the memory, and upon determining that the current second data write amount is correct, determine whether the current second data write amount meets the write alarm condition.

[0055] As a specific implementation, in order to further ensure the accuracy of the health condition assessment, the electronic device can read the current first data write amount of the memory from the first partition and read the current second data write amount of the memory from the second partition, and determine the correct current data write amount of the memory according to the current first data write amount and the current second data write amount. For example, if it is determined that the current first data write amount is correct, the current first data write amount can be determined as the current data write amount of the memory, if it is determined that the current second data write amount is correct, the current second data write amount can be determined as the current data write amount of the memory, and the like, and subsequent judgment of whether the write warning condition is met is performed. Reading the stored data write amount from the first partition and the second partition at the same time can ensure the accuracy of the values used in the health condition assessment, thereby ensuring the accuracy of the assessment.

[0056] In step 404, in a case where it is determined that the current first data write amount is correct and the current first data write amount meets the write warning condition, or in a case where it is determined that the current second data write amount is correct and the current second data write amount meets the write warning condition, health warning information for the memory is generated.

[0057] In some embodiments, the electronic device can verify the read current first data write amount to determine whether the current first data write amount is correct. In each time of updating the first data write amount stored in the first partition, a first verification value corresponding to the first data write amount stored in the first partition (i.e., the latest data write amount written into the first partition) can be generated, and the first verification value can be used to verify the accuracy of the read first data write amount in the subsequent health assessment process.

[0058] When the electronic device needs to assess the health condition of the memory, the current first data write amount can be read from the first partition, and the first verification value corresponding to the current first data write amount can be read from the first partition, and the current first data write amount can be verified according to the first verification value. If the current first data write amount is verified successfully according to the first verification value, it is determined that the current first data write amount is correct.

[0059] Optionally, the verification algorithm for verifying the current first data write amount can include, but is not limited to, any one of CRC (Cyclic Redundancy Check, cyclic redundancy check code) verification, parity verification, checksum, and the like.

[0060] As a specific embodiment, each time the first data write amount stored in the first partition is updated, a set verification algorithm can be used to calculate a first verification value corresponding to the latest first data write amount, and the latest first data write amount and the corresponding first verification value can be written to the first partition. When evaluating the health of the memory, the current first data write amount and the corresponding first verification value are read from the first partition, and the set verification algorithm can be used to calculate a third verification value corresponding to the current first data write amount. The third verification value is compared with the read first verification value to determine whether the two are consistent. If the two are consistent, the verification is successful, and it is determined that the read current first data write amount is correct.

[0061] Similar to the method of verifying the current first data write amount read, in some embodiments, the electronic device can verify the second data write amount read to determine whether the current second data write amount is correct. Each time the second data write amount stored in the second partition is updated, a second verification value corresponding to the second data write amount stored in the second partition (i.e., the most recent data write amount written to the second partition) can be generated. This second verification value can be used to verify the accuracy of the read second data write amount during a subsequent health assessment process.

[0062] When the electronic device needs to evaluate the health of the memory, the current second data write amount can be read from the second partition, and a second check value corresponding to the current second data write amount can be read from the second partition, and the current second data write amount can be verified based on the second check value. If the current second data write amount is successfully verified based on the second check value, it is determined that the current second data write amount is correct.

[0063] It should be noted that the verification method for the current second data write amount is similar to the verification method for the current first data write amount introduced in the above embodiment. Therefore, you can refer to the relevant description of verifying the current first data write amount in the above embodiment, and will not repeat it here.

[0064] In an embodiment of the present application, during the process of evaluating the health of the memory, the current first data write amount read from the first partition and the current second data write amount read from the second partition are verified to ensure that the correct current data write amount of the memory is obtained for health evaluation, thereby improving the accuracy of the health evaluation of the memory.

[0065] In some embodiments, when it is detected that the current first data write amount stored in the first partition and / or the current second data write amount stored in the second partition is incorrect, the incorrect data write amount can be corrected. If it is determined that the current first data write amount is incorrect and the current second data write amount is correct, the first data write amount stored in the first partition can be updated according to the current second data write amount. If it is determined that the current first data write amount is correct and the current second data write amount is incorrect, the second data write amount stored in the second partition can be updated according to the current first data write amount.

[0066] In the case where only one of the data write amounts stored in the first partition and the second partition is incorrect, the data write amount stored in the incorrect partition can be corrected using the correct data write amount stored in the other partition, so that the data write amounts stored in the two partitions are correct and consistent.

[0067] If it is determined that both the current first data write amount and the current second data write amount are incorrect, the latest data write amount of the memory can be read from the memory and used to update the first data write amount stored in the first partition and the second data write amount stored in the second partition, respectively. Alternatively, the latest data write amount of the memory can be stored in the memory each time data is written to the memory, i.e., the data write amount of the memory is also recorded in the memory. When it is detected that the data write amounts stored in the first partition and the second partition are both incorrect, the correct data write amount (i.e., the latest data write amount described above) can be read from the memory and used to correct the data write amounts stored in the first partition and the second partition, so that the data write amounts stored in the two partitions are correct and consistent. By using the correction mechanism described above, the data write amounts stored in the two partitions can be ensured to be correct and consistent, and the accuracy of the evaluation of the health of the memory is improved.

[0068] Alternatively, in the case where it is determined that the current first data write amount is correct, the current first data write amount can be used as the current data write amount of the memory, and it can be determined whether the current first data write amount satisfies a write warning condition. If the current first data write amount satisfies the write warning condition, health warning information for the memory can be generated. Alternatively, in the case where it is determined that the current second data write amount is correct, the current second data write amount can be used as the current data write amount of the memory, and it can be determined whether the current second data write amount satisfies a write warning condition. If the current second data write amount satisfies the write warning condition, health warning information for the memory can be generated.

[0069] In some embodiments, the write warning condition can include, but is not limited to, any one of the following:

[0070] (1) The current data writing amount (which may be the correct current first data writing amount, or the correctly determined current second data writing amount) reaches the maximum data writing amount;

[0071] (2) The difference between the maximum data writing amount and the current data writing amount (which may be the correct current first data writing amount or the correctly determined current second data writing amount) is less than or equal to the first writing amount threshold;

[0072] (3) The ratio of the current data writing amount (which may be the correct current first data writing amount, or the correctly determined current second data writing amount) to the maximum data writing amount is greater than or equal to the ratio threshold.

[0073] Among them, the difference between the maximum data writing amount and the current data writing amount is the current remaining data writing amount. If the current remaining data writing amount is less than or equal to the first writing amount threshold, it means that the current data writing amount of the memory is close to the maximum data writing amount, and the memory is basically unusable.

[0074] It should be noted that the first write amount threshold and the ratio threshold described above can be set according to actual needs and are not limited to this in the present embodiment. For example, the ratio threshold can be 90%, 95%, 93%, etc., and the first write amount threshold can be 200KB, 100KB, etc., but are not limited to these. The write alarm condition can also be flexibly set according to actual needs.

[0075] In some embodiments, the electronic device may generate write amount prompt information based on the current data write amount of the memory. The write amount prompt information may be used to indicate the current data write amount and / or the current remaining data write amount. The current remaining data write amount is the difference between the safe data write amount and the current data write amount. The safe data write amount may be determined based on the maximum data write amount.

[0076] Optionally, the safe data write amount can be set based on actual needs and can be less than or equal to the maximum data write amount. For example, the safe data write amount can be a preset percentage of the maximum data write amount (e.g., 80%, 90%, 88%, etc.). By reserving a certain amount of data write, timely replacement of the memory can be ensured, avoiding losses caused by waiting until the memory is completely damaged before replacing it.

[0077] Furthermore, if it is determined that the current data writing amount of the memory satisfies the writing warning condition, a health warning message and a writing amount prompt message may be generated and output. For example, Figure 6A This is a schematic diagram of an interface for outputting health warning information and writing amount prompt information in one embodiment. Figure 6AAs shown, if it is determined that the current data writing amount of the memory meets the write alarm condition, a health alarm message 610 (such as "Warning: The eMMC of this machine is damaged") and a write amount prompt message 620 (such as "The current data writing amount of the eMMC is 1022GB, and the remaining data writing amount is 2GB") can be output.

[0078] If it is determined that the current data writing amount of the memory does not meet the writing warning condition, a writing amount prompt information can be generated and output. Figure 6B This is a schematic diagram of an interface for outputting writing amount prompt information in one embodiment. Figure 6B As shown, if it is determined that the current data writing amount of the memory does not meet the write warning condition, a writing amount prompt message 630 may be output (e.g., "The current data writing amount of the MMC is 200GB, and the remaining data writing amount is 824GB"). Through the writing amount prompt message, the user can accurately know the current data writing amount and / or the remaining data writing amount of the memory, and can more intuitively understand the health status of the memory. Based on the current data writing amount and / or the remaining data writing amount of the memory, the user can perform data backup, update the memory in advance, etc.

[0079] In an embodiment of the present application, a first partition and a second partition are extracted from a storage area having SLC characteristics inside the memory. Both the first partition and the second partition are used to store the data write amount of the memory, and the first partition and the second partition back up each other, which can ensure the accuracy of the data write amount used when evaluating the health of the memory, thereby improving the accuracy of the evaluation of the health of the memory.

[0080] like Figure 7 As shown, in another embodiment, a memory health monitoring method is provided, which can be applied to the above-mentioned electronic device. The method may include the following steps:

[0081] Step 702: Obtain a data write request, and write data into the cache space according to the data write request.

[0082] In an embodiment of the present application, a cache space may be set in the memory of the electronic device, and the cache space may be used to cache data to be written to the memory (such as eMMC). The size of the cache space may be set according to actual needs, for example, it may be a cache space of a size of 1MB, 2MB, etc. Optionally, the size of the cache space may also be dynamically adjusted according to the actual write situation of the memory. For example, when the write frequency of the memory is high, a larger cache space may be allocated to reduce the write frequency of the memory, etc., but the present invention is not limited thereto.

[0083] If a data write request from the operating system is obtained, the data to be written into the memory may be obtained according to the data write request, and the data to be written into the memory may be written into the cache space first.

[0084] Step 704: If it is detected that the cache space is full, the data stored in the cache space is written into the memory, and the data writing amount stored in the target storage space is updated according to the target data writing amount of the memory this time.

[0085] The system can detect whether the cache space is full. If the cache space is full, no more data can be written to the cache space, and the data stored in the cache space can be written to the memory. Optionally, the operating system of the electronic device can run a write volume maintenance process. After the data stored in the cache space is written to the memory, a maintenance notification can be sent to the write volume maintenance process. The write volume maintenance process can then update and maintain the data write volume stored in the target storage space based on the maintenance notification.

[0086] As a specific implementation, the write volume maintenance process may add the target data write volume of the current memory write to the data write volume previously stored in the target storage space to update the data write volume stored in the target storage space. The write volume maintenance process may first read the current data write volume of the memory from the target storage space, add the read current data write volume to the target data write volume to obtain an updated data write volume, and then write the updated data write volume to the target storage space to complete the update of the data write volume stored in the target storage space.

[0087] Optionally, since data is written to the memory when the cache space is full, the target data write amount of the memory this time can be the size of the cache space, and the target data write amount of each write to the memory is the same, which is the size of the cache space. The data write amount can be updated by simply appending the target data write amount to the data write amount stored in the target storage space, which can simplify the data write amount update process.

[0088] In some embodiments, the target storage space may include a first partition and a second partition. The first data write amount stored in the first partition may be updated according to the target data write amount of the memory this time, and the second data write amount stored in the second partition may be updated according to the target data write amount of the memory this time, and it is determined whether the updated first data write amount is consistent with the updated second data write amount.

[0089] The first partition and the second partition are kept updated synchronously and back up each other. Optionally, an initial value of the write amount can be determined, and the initial value of the write amount can be written to the first partition as the initial first data write amount, and the initial value of the write amount can be written to the second partition as the initial second data write amount. The initial value of the write amount can be set according to actual needs. The initial value of the write amount can be a pre-set fixed value, or an initial value determined based on a business situation assessment. The business situation can include the size of the software package of the basic application in the operating system, or the size of the space occupied by the boot loader in the operating system. Each time data is written to the memory, the write amount maintenance process can update the first data write amount stored in the first partition and the second data write amount stored in the second partition, and can append the target data write amount of each write to the memory to the first data write amount stored in the first partition and the second data write amount stored in the second partition, thereby updating the data write amount stored in the first partition and the second partition.

[0090] In some embodiments, in order to ensure that the data write amounts stored in the first partition and the second partition are correct and consistent, after the first data write amount and the second data write amount are updated, it can be determined whether the updated first data write amount is consistent with the updated second data write amount. As an embodiment, after the first data write amount and the second data write amount are updated, a first verification value corresponding to the updated first data write amount and a second verification value for the updated second data write amount can be generated, and it can be determined whether the generated first verification value is the same as the generated second verification value. If the generated first verification value is the same as the second verification value, it can be determined that the updated first data write amount is consistent with the updated second data write amount. Furthermore, the write amount maintenance process can write the generated first verification value to the first partition and the generated second verification value to the second partition, which can be used to subsequently verify the correctness of the first data write amount and the second data write amount.

[0091] As another embodiment, after the first data write amount and the second data write amount are updated, the write amount maintenance process may first generate a first verification value corresponding to the updated first data write amount, and generate a second verification value for the updated second data write amount, and write the updated first data write amount and the corresponding first verification value to the first partition, and write the updated second data write amount and the corresponding second verification value to the second partition. The most recently written first data write amount and the first verification value may be read from the first partition again, and the read first verification value may be used to verify the read first data write amount to determine whether the read first data write amount is correct. Similarly, the most recently written second data write amount and the second verification value may be read from the second partition again, and the read second verification value may be used to verify the read second data write amount to determine whether the read second data write amount is correct. If it is determined that the read first data write amount and the second data write amount are both correct, it can be determined that the updated first data write amount is consistent with and correct to the updated second data write amount. It should be noted that the method of verifying the first data write amount and the second data write amount to determine whether they are correct can refer to the relevant description of the health status assessment process of the memory in the previous embodiment, and will not be repeated here.

[0092] If it is detected that the updated first data write amount is different from the updated second data write amount, such as the generated first check value is different from the second check value, or an error is detected during the check, the updated first data write amount and / or the updated second data write amount can be corrected to make the updated first data write amount consistent with the updated second data write amount.

[0093] Optionally, if it is determined that the updated first data write amount is incorrect and the updated second data write amount is correct, the updated first data write amount can be corrected according to the updated second data write amount; if it is determined that the updated second data write amount is incorrect and the updated first data write amount is correct, the updated second data write amount can be corrected according to the updated first data write amount.

[0094] If it is detected that both the updated first data write amount and the updated second data write amount are erroneous, the first data write amount and the second data write amount can be updated again. Alternatively, the first data write amount before the update and the second data write amount before the update can be retrieved again and added to the first data write amount before the update and the second data write amount before the update based on the target data write amount. Optionally, since the memory also maintains the latest data write amount of the memory each time data is written to the memory, the latest data write amount of the memory can be read from the memory and the data write amount stored in the first partition and the second partition can be corrected based on the latest data write amount.

[0095] In an embodiment of the present application, when maintaining the data write amount of the first partition and the second partition, the consistency and correctness of the data write amount stored in the first partition and the second partition are guaranteed, thereby ensuring the accuracy of the subsequent health assessment of the memory.

[0096] Step 706: Read the current data write amount of the memory from the target storage space.

[0097] Step 708: If the current data write amount meets the write warning condition, generate health warning information for the memory.

[0098] The description of steps 706 to 708 can refer to the relevant descriptions in the above embodiments, and will not be repeated here.

[0099] In some embodiments, the electronic device may further collect statistics on data writing information written into the memory within the target time period, and determine a write adjustment strategy based on the data writing information.

[0100] Among them, the data writing information may include the frequency of writing data to the memory within the target time period, and / or the total amount of data written to the memory within the target time period. It should be noted that the target time period can be set according to actual needs, such as 1 day, 1 week, 12 hours, etc., but is not limited to this. When the frequency of writing data to the memory within the target time period is greater than or equal to the frequency threshold, or the total amount of data written to the memory within the target time period is greater than or equal to the second write amount threshold, it can be said that the amount of data written to the memory within the target time period is too large, and a write adjustment strategy can be determined. The write adjustment strategy can be used to reduce the frequency of writing data to the memory, and / or reduce the amount of data written to the memory. The write adjustment strategy can be used to change the writing method of the memory, thereby improving the write life of the memory.

[0101] Optionally, the write adjustment strategy may include increasing the cache space, writing data to other memories, prompting the user to reduce business processing in the electronic device, etc. Increasing the cache space refers to increasing the size of the current cache space. The cache space can store more data, thereby reducing the frequency of writing to the memory. Writing data to other memories refers to writing data to other memories in the electronic device, thereby reducing the amount of writing to the memory. Prompting the user to reduce business processing in the electronic device means outputting a prompt message to reduce the number of times the user performs business processing in the electronic device, thereby reducing the generated business data, that is, reducing the amount of writing to the memory. By detecting the data writing information of the memory over a period of time, the operating system can be warned to change the writing method and improve the write life of the memory.

[0102] In some embodiments, the method of evaluating the health of a memory using the amount of data written can be combined with the method proposed by JEDEC of evaluating the health of a memory using the reserved block usage rate. For example, if it is determined that the current amount of data written meets the write warning condition, the ratio of the number of currently used reserved healthy blocks to the total number of reserved healthy blocks can be obtained. This ratio can be fed back to the manufacturer of the electronic device to help the manufacturer of the electronic device select a more reliable memory chip. For example, a memory chip can be selected that has a smaller ratio of the number of used reserved healthy blocks to the total number of reserved healthy blocks when the amount of data written meets the write warning condition. For another example, the health of the memory can be first evaluated based on the ratio of the number of used reserved healthy blocks to the total number of reserved healthy blocks. When it is detected that this ratio is greater than a set threshold (such as 80%, 90%, etc.), the health of the memory can be evaluated at a second level based on the amount of data written to the memory to determine whether the write warning condition is met. By first performing a rough assessment using the reserved block usage rate and then performing a detailed assessment using the amount of data written, the frequency of reading the memory's data write amount can be reduced, reducing power consumption and resource waste, while ensuring the accuracy of the memory health assessment.

[0103] In an embodiment of the present application, the data writing amount of the memory can be maintained, and the accuracy of the written data writing amount is guaranteed. Cache space is allocated, the writing mechanism of the memory is standardized, the writing frequency of the memory is reduced, and the writing life of the memory is improved.

[0104] like Figure 8 As shown, in another embodiment, a memory health monitoring method is provided, which can be applied to the above-mentioned electronic device. The method may include the following steps:

[0105] Step 802: Wait for the system to issue a data write request.

[0106] Step 804: After the system issues a data write request, the data is written into the cache space.

[0107] Step 806 , determining whether the cache space is full, if so, executing step 808 , if not, executing step 802 .

[0108] Step 808: Write the data in the cache space into the flash memory space.

[0109] Step 810 , after writing is completed, notify the write volume maintenance process to add the current target data write volume to the first partition and the second partition.

[0110] Step 812: Update the checksums corresponding to the first partition and the second partition respectively, and check the data consistency. If there is any inconsistency, make corrections.

[0111] Step 814: Notify the system that the flash memory write capacity maintenance is complete.

[0112] Step 816: Query the current data write amount of the flash memory.

[0113] Step 818 , respectively read the data writing amount stored in the first partition and the second partition, and perform verification to obtain the correct data writing amount.

[0114] Step 820 , determining whether the current data writing amount exceeds or approaches the maximum data writing amount specified by the manufacturer, if so, executing step 822 , if not, executing step 824 .

[0115] Step 822: Output a warning and inform the current amount of data written and the remaining amount of data written.

[0116] Step 824: inform the current data writing amount and the remaining writing amount.

[0117] In the embodiment of the present application, the first and second partitions of the memory, each with single-layer storage unit (SLC) characteristics, are used to store the memory's data write volume, thereby improving the accuracy and stability of the stored data write volume and ensuring the reliability of the current data write volume. Furthermore, the current data write volume and the maximum data write volume are used to assess the health of the memory, enabling a more accurate assessment of the memory's health and enriching the methods for assessing the health of the memory. Furthermore, timely and accurate health warning information for the memory can be generated, making it easier for users to understand the health of the memory and reducing unnecessary losses to users due to memory damage.

[0118] like Figure 9 As shown, in one embodiment, a memory health monitoring device 900 is provided, which can be applied to the above-mentioned electronic device. The electronic device includes a memory, and a target storage space is provided in the memory. The target storage space has SLC characteristics and is used to store the amount of data written to the memory. The memory health monitoring device 900 includes a write amount reading module 910 and an alarm module 920.

[0119] The write volume reading module 910 is used to read the current data write volume of the memory from the target storage space. The alarm module 920 is used to generate health alarm information for the memory if the current data write volume meets the write alarm condition. The write alarm condition is determined based on the maximum data write volume of the memory, and the health alarm information is used to warn about the health of the memory.

[0120] In the embodiment of the present application, the target storage space with single-layer storage unit (SLC) characteristics in the memory is used to store the data write amount of the memory, which can improve the accuracy and stability of the stored data write amount, ensure the reliability of the current data write amount read, and use the current data write amount and maximum data write amount of the memory to evaluate the health of the memory, which can more accurately evaluate the health of the memory and enrich the evaluation method of the health of the memory. In addition, it can generate health warning information for the memory in a timely and accurate manner, making it easier for users to understand the health status of the memory and reducing unnecessary losses caused to users by memory damage.

[0121] In one embodiment, the target storage space includes a first partition and a second partition. The first partition and the second partition are both used to store data written to the memory, and the first partition and the second partition serve as backups for each other.

[0122] The write amount reading module 910 is further configured to read the current first data write amount of the memory from the first partition. The alarm module 920 is further configured to generate health alarm information for the memory when determining that the current first data write amount is correct and the current first data write amount meets the write alarm condition.

[0123] Optionally, the write amount reading module 910 is further configured to read the current second data write amount of the memory from the second partition. The alarm module 920 is further configured to generate health alarm information for the memory when it is determined that the current second data write amount is correct and the current second data write amount meets the write alarm condition.

[0124] In one embodiment, the memory health monitoring device 900 further includes a verification module. The verification module is configured to read a first verification value corresponding to the current first data write amount from the first partition; if the verification of the current first data write amount is successful based on the first verification value, the current first data write amount is determined to be correct. The verification module is further configured to read a second verification value corresponding to the current second data write amount from the second partition; if the verification of the current second data write amount is successful based on the second verification value, the current second data write amount is determined to be correct.

[0125] In one embodiment, the memory health monitoring device 900 further includes a correction module. The correction module is configured to update the first data write amount stored in the first partition according to the current second data write amount if it is determined that the current first data write amount is incorrect and the current second data write amount is correct; update the second data write amount stored in the second partition according to the current first data write amount if it is determined that the current first data write amount is correct and the current second data write amount is incorrect; and read the latest data write amount of the memory from the internal memory if it is determined that both the current first data write amount and the current second data write amount are incorrect, and update the first data write amount stored in the first partition and the second data write amount stored in the second partition according to the latest data write amount.

[0126] In one embodiment, the write alarm condition includes any one of the following: the current data write amount reaches the maximum data write amount; the difference between the maximum data write amount and the current data write amount is less than or equal to the first write amount threshold; the proportion of the current data write amount to the maximum data write amount is greater than or equal to the proportion threshold.

[0127] In one embodiment, the memory health monitoring device 900 further includes a write prompt module. The write prompt module is configured to generate write amount prompt information based on the current data write amount. The write amount prompt information is configured to indicate the current data write amount and / or the current remaining data write amount. The current remaining data write amount is the difference between the safe data write amount and the current data write amount. The safe data write amount is determined based on the maximum data write amount.

[0128] In an embodiment of the present application, a first partition and a second partition are extracted from a storage area having SLC characteristics inside the memory. Both the first partition and the second partition are used to store the data write amount of the memory, and the first partition and the second partition back up each other, which can ensure the accuracy of the data write amount used when evaluating the health of the memory, thereby improving the accuracy of the evaluation of the health of the memory.

[0129] In one embodiment, the memory health monitoring device 900 further includes a write module and an update module. The write module is configured to receive a data write request, write data to the cache space according to the data write request, and write the data stored in the cache space to the memory if the cache space is full. The update module is configured to update the data write amount stored in the target storage space according to the target data write amount for this write to the memory.

[0130] In one embodiment, the target storage space includes a first partition and a second partition.

[0131] The update module is also used to update the first data write amount stored in the first partition according to the target data write amount of the memory this time; update the second data write amount stored in the second partition according to the target data write amount of the memory this time; and determine that the updated first data write amount is consistent with the updated second data write amount.

[0132] In one embodiment, the update module is also used to generate a first verification value corresponding to the updated first data write amount, and to generate a second verification value corresponding to the updated second data write amount; if the generated first verification value is the same as the generated second verification value, it is determined that the updated first data write amount is consistent with the updated second data write amount.

[0133] In one embodiment, the correction module is also used to correct the updated first data write amount and / or the updated second data write amount if it is detected that the updated first data write amount is different from the updated second data write amount, so that the updated first data write amount is consistent with the updated second data write amount.

[0134] In one embodiment, the memory health monitoring device 900 further includes a statistics module. The statistics module is configured to collect statistics on data written to the memory within a target time period; the data written information includes the frequency of data written to the memory within the target time period and / or the total amount of data written to the memory within the target time period; and to determine a write adjustment strategy based on the data written information.

[0135] Optionally, the statistical module is also used to determine a write adjustment strategy if the frequency of writing data to the memory during the target time period is greater than or equal to a frequency threshold, or the total data writing amount corresponding to the memory during the target time period is greater than or equal to a second writing amount threshold; the write adjustment strategy is used to reduce the frequency of writing data to the memory, and / or reduce the amount of data written to the memory.

[0136] In an embodiment of the present application, the data writing amount of the memory can be maintained, and the accuracy of the written data writing amount is guaranteed. Cache space is allocated, the writing mechanism of the memory is standardized, the writing frequency of the memory is reduced, and the writing life of the memory is improved.

[0137] Figure 10 FIG. 1 is a structural block diagram of an electronic device in one embodiment. Figure 10 As shown, the electronic device 1000 may include one or more of the following components: a processor 1010, and a memory 1020 coupled to the processor 1010, wherein the memory 1020 may store one or more computer programs, and the one or more computer programs may be configured to implement the methods described in the above embodiments when executed by one or more processors 1010.

[0138] The processor 1010 may include one or more processing cores. The processor 1010 utilizes various interfaces and circuits to connect various components within the electronic device 1000. It executes instructions, programs, code sets, or instruction sets stored in the memory 1020, and accesses data stored in the memory 1020 to perform various functions and process data within the electronic device 1000. Optionally, the processor 1010 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 1010 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 1010 and may be implemented separately via a communication chip.

[0139] The memory 1020 may include a random access memory (RAM) or a read-only memory (ROM). The memory 1020 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1020 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 1000 during use.

[0140] It can be understood that the electronic device 1000 may include more or fewer structural elements than those in the above structural block diagram, for example, including a power module, physical buttons, WiFi (Wireless Fidelity) module, speakers, Bluetooth modules, sensors, etc., and is not limited here.

[0141] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the methods described in the above embodiments.

[0142] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a ROM, or the like.

[0143] As used herein, any reference to memory, storage, database, or other medium may include nonvolatile and / or volatile memory. Suitable nonvolatile memory may include ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as external cache memory. By way of illustration and not limitation, RAM may be in various forms, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus DRAM (RDRAM), and direct Rambus DRAM (DRDRAM).

[0144] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.

[0145] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0146] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.

[0147] In addition, the functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0148] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0149] The above describes in detail a memory health monitoring method, device, electronic device, and storage medium disclosed in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. At the same time, for those skilled in the art, based on the concept of the present application, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present application.

Claims

1. A memory health monitoring method, characterized in that: The electronic device includes the memory, wherein a target storage space is provided in the memory, the target storage space has a single-layer storage unit (SLC) characteristic, the target storage space is used to store the amount of data written to the memory, the target storage space includes a first partition and a second partition, the first partition and the second partition are both used to store the amount of data written to the memory, and the first partition and the second partition serve as a backup for each other; The method comprises: Reading a current first data write amount of the memory from the first partition; generating health warning information for the memory when it is determined that the current first data write amount is correct and the current first data write amount meets a write warning condition; and / or, Reading a current second data write amount of the memory from the second partition; generating health warning information for the memory when it is determined that the current second data write amount is correct and the current second data write amount meets a write warning condition; The write alarm condition is determined based on the maximum data write amount of the memory, and the health alarm information is used to warn about the health status of the memory.

2. The method according to claim 1, characterized in that When it is determined that the current first data write amount is correct and the current first data write amount meets the write warning condition, before generating health warning information for the memory, the method further includes: Reading a first checksum corresponding to the current first data write amount from the first partition; If verification of the current first data writing amount is successful according to the first verification value, it is determined that the current first data writing amount is correct; When it is determined that the current second data write amount is correct and the current second data write amount meets the write warning condition, before generating health warning information for the memory, the method further includes: Reading a second check value corresponding to the current second data write amount from the second partition; If the current second data writing amount is successfully verified according to the second verification value, it is determined that the second data writing amount is correct.

3. The method according to claim 1, characterized in that The method further comprises: If it is determined that the current first data writing amount is wrong and the current second data writing amount is correct, updating the first data writing amount stored in the first partition according to the current second data writing amount; If it is determined that the current first data writing amount is correct and the current second data writing amount is incorrect, updating the second data writing amount stored in the second partition according to the current first data writing amount; If it is determined that the current first data write amount and the current second data write amount are both incorrect, the latest data write amount of the memory is read from the memory, and the first data write amount stored in the first partition and the second data write amount stored in the second partition are updated respectively according to the latest data write amount.

4. The method according to claim 1, wherein The write alarm condition includes any one of the following: The current data writing amount reaches the maximum data writing amount; the current data writing amount includes the correct current first data writing amount and / or the correct current second data writing amount; A difference between the maximum data writing amount and the current data writing amount is less than or equal to a first writing amount threshold; The ratio of the current data writing amount to the maximum data writing amount is greater than or equal to a ratio threshold.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Generate writing amount prompt information based on the current data writing amount, wherein the writing amount prompt information is used to prompt the current data writing amount and / or prompt the current remaining data writing amount; the current data writing amount includes the correct current first data writing amount and / or the correct current second data writing amount; The current remaining data writing amount is the difference between the safety data writing amount and the current data writing amount, and the safety data writing amount is determined according to the maximum data writing amount.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining a data write request, and writing data into the cache space according to the data write request; If it is detected that the cache space is full, the data stored in the cache space is written into the memory, and the first data write amount stored in the first partition is updated according to the target data write amount written to the memory this time, and the second data write amount stored in the second partition is updated according to the target data write amount written to the memory this time.

7. The method according to claim 6, characterized in that The method further comprises: It is determined whether the updated first data writing amount is consistent with the updated second data writing amount.

8. The method according to claim 7, characterized in that The determining whether the updated first data write amount is consistent with the updated second data write amount includes: generating a first check value corresponding to the updated first data write amount, and generating a second check value corresponding to the updated second data write amount; Determining that the generated first check value is the same as the generated second check value; If the generated first check value is the same as the generated second check value, it is determined that the updated first data write amount is consistent with the updated second data write amount.

9. The method according to claim 8, characterized in that The method further comprises: If it is detected that the updated first data write amount is different from the updated second data write amount, the updated first data write amount and / or the updated second data write amount are corrected to make the updated first data write amount consistent with the updated second data write amount.

10. The method according to any one of claims 6 to 9, characterized in that: The method further comprises: Counting data writing information written to the memory during a target time period; the data writing information includes the frequency of writing data to the memory during the target time period, and / or the total amount of data written to the memory during the target time period; A write adjustment strategy is determined according to the data write information.

11. The method according to claim 10, characterized in that Determining a write adjustment strategy according to the data write information includes: If the frequency of writing data to the memory within the target time period is greater than or equal to the frequency threshold, or the total data writing amount corresponding to the memory within the target time period is greater than or equal to the second writing amount threshold, then a write adjustment strategy is determined; the write adjustment strategy is used to reduce the frequency of writing data to the memory and / or reduce the amount of data written to the memory.

12. The method according to any one of claims 1 to 4 and 6 to 9, characterized in that: The memory includes an embedded multimedia card eMMC, and the target storage space includes an SLC partition and / or a pseudo single-layer storage unit pSLC partition.

13. A memory health monitoring device, characterized in that: The electronic device includes the memory, wherein a target storage space is provided in the memory, the target storage space has a single-layer storage unit (SLC) characteristic, the target storage space is used to store the amount of data written to the memory, the target storage space includes a first partition and a second partition, the first partition and the second partition are both used to store the amount of data written to the memory, and the first partition and the second partition serve as a backup for each other; The device comprises: A write amount reading module, configured to read a current first data write amount of the memory from the first partition; an alarm module, configured to generate health alarm information for the memory when it is determined that the current first data write amount is correct and the current first data write amount meets a write alarm condition; and / or, The write amount reading module is used to read the current second data write amount of the memory from the second partition; The alarm module is configured to generate health alarm information for the memory when it is determined that the current second data write amount is correct and the current second data write amount meets a write alarm condition; The write alarm condition is determined based on the maximum data write amount of the memory, and the health alarm information is used to warn about the health status of the memory.

14. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the processor is caused to implement the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Alarming method of memory space inadequate in network storage system

    CN101291250A

  • Fast data recovery method and system based on flash memory

    CN108038026A