Disclosure of Invention
The application provides a storage medium conversion method of a memory and electronic equipment, so as to prolong the service life of the memory as much as possible.
In a first aspect, the present application provides a storage medium conversion method of a memory, applied to an electronic device, where the electronic device includes a memory, the memory includes a first storage medium and a second storage medium, a maximum number of erasable times of the second storage medium is greater than a maximum number of erasable times of the first storage medium, the first storage medium includes a plurality of storage areas, and the electronic device includes the memory, the method includes:
When the electronic equipment is activated, a first function is started and used for recording the erasing times of each storage area in a plurality of storage areas, when the erasing times of a first storage area in the plurality of storage areas are larger than or equal to a first quantity, whether the current user data quantity stored in the memory meets a first condition is determined, the first storage area is any one of the storage areas in the first storage medium, the first quantity is the maximum erasable times of the first storage medium, the first condition is related to the current total storage capacity of the first storage medium and the second storage medium, and when the current user data quantity meets the first condition, the first storage medium is converted into the second storage medium.
The activation of the electronic device is a process of connecting the electronic device to the mobile network for the first time and enabling the mobile network to be normally used after the electronic device is started for the first time.
In the method, when the electronic equipment is activated, the first function of the electronic equipment can record the erasing times of each storage area in the plurality of storage areas in the first storage medium, so that the corresponding operation can be conveniently executed when the erasing times of any storage area in the plurality of storage areas is larger than or equal to the first quantity. And when the number of times of erasing of a first storage area in the plurality of storage areas is greater than or equal to a first number, determining that the first storage area reaches the service life, and the storage has the possibility of data identification errors, thereby the electronic device can determine whether the current user data amount stored in the storage meets a first condition, and when the current user data amount meets the first condition, the first storage medium is converted into a second storage medium, and because the maximum number of times of erasing of the second storage medium is greater than the maximum number of times of erasing of the first storage medium, and the storage density of the second storage medium is smaller than that of the first storage medium, the first storage medium is converted into the second storage medium, so that the data density of the storage can be reduced, the possibility of data identification errors can be reduced, and the service life of the storage can be prolonged.
In other words, the electronic device achieves the storage life in any one of the multiple storage areas in the high-level storage medium, and when the current user data volume meets the first condition, the service life of the storage can be replaced by the degradation mode of the storage medium, so that the service life of the electronic device is ensured.
When the memory includes two storage media, the number of times of erasing in any one of the plurality of storage areas in the storage medium of the higher hierarchy reaches the maximum number of times of erasing, and when the user data amount satisfies the first condition, the storage medium of the higher hierarchy is downgraded to the storage medium of the lower hierarchy. When the memory comprises three storage media, when the number of times of erasing in any one of a plurality of storage areas in the storage media of the highest level reaches the maximum number of times of erasing, and the user data volume meets a first condition, the storage media of the highest level is demoted to the storage media of the next highest level, and when the number of times of erasing in any one of a plurality of storage areas in the storage media of the next highest level reaches the maximum number of times of erasing, and the user data volume meets the first condition, the storage media of the next highest level is demoted to the storage media of the low level.
With reference to the first aspect, in certain implementation manners of the first aspect, the first condition includes that the current user data amount is less than or equal to a second amount, where the second amount is a current total storage capacity of the first storage medium and the second storage medium, and when a number of times of erasing of a first storage area in the plurality of storage areas is greater than or equal to the first amount, determining whether the current user data amount stored in the memory meets the first condition includes:
When the current user data amount satisfies a first condition, converting the first storage medium into a second storage medium, wherein the method comprises the steps of converting all the plurality of storage areas into the second storage medium when the current user data amount is equal to the second amount, and converting the first storage area into the second storage medium when the current user data amount is smaller than the second amount.
In the method, when the current user data quantity is smaller than the second quantity, the current user data is not stored in the current first storage medium and the current second storage medium, all the plurality of storage areas in the first storage medium are not required to be converted into the second storage medium, the electronic equipment can only convert the first storage area into the second storage medium, so that the service life of the whole memory can be prolonged, and as the service life of other storage areas except the first storage area in the first storage medium is not reached yet, the data can be stored in the other storage areas except the first storage area in the first storage medium continuously, so that the storage capacity of the memory is ensured.
In addition, when the current user data amount is equal to the second amount, the current user data is stored in the current first storage medium and the second storage medium, the risk of losing a large amount of user data is high, and the electronic device can completely convert the plurality of storage areas into the second storage medium.
With reference to the first aspect, in certain implementation manners of the first aspect, after all of the plurality of storage areas are converted into the second storage medium, the method further includes:
And stopping converting the second storage medium into the first storage medium, wherein when the electronic equipment is activated, the second storage medium is in a state of gradually converting into the first storage medium, the storage capacity of the first storage medium is gradually increased, and the storage capacity of the second storage medium is gradually reduced.
Since the second storage medium is in a state of gradually converting to the first storage medium when the electronic device is activated, the electronic device may still convert the second storage medium to the first storage medium again after converting the first storage medium to the second storage medium.
And one of the conditions of converting the first storage medium into the second storage medium is that the erasing times of the first storage area in the plurality of storage areas in the first storage medium is larger than or equal to the maximum erasable times of the first storage medium, namely the first storage medium reaches the service life, and after the first storage medium reaches the service life, the risk of charge loss exists, and the charge loss can cause the abnormal data storage capacity of the flash memory, so that the electronic equipment cannot be normally used.
In the above method, if the electronic device uses the first storage medium to store data when converting the first storage medium into the second storage medium and then converting the second storage medium into the first storage medium again, there is still a risk of charge loss, and thus an abnormality occurs in data storage, so that it is necessary to convert all of the plurality of storage areas into the second storage medium and then stop converting the second storage medium into the first storage medium.
With reference to the first aspect, in certain implementations of the first aspect, stopping the conversion of the second storage medium to the first storage medium includes:
and stopping converting the second storage medium into the first storage medium according to the first identification.
In the above method, as an implementation manner, after all the plurality of storage areas are converted into the second storage medium, the first identifier may be used to mark the second storage medium, so that the conversion of the second storage medium into the first storage medium is stopped according to the first identifier.
As another implementation, the first identifier may be used to mark the plurality of storage areas before all of the plurality of storage areas are converted to the second storage medium, so that after all of the plurality of storage areas are converted to the second storage medium, the conversion of the second storage medium to the first storage medium is stopped according to the first identifier.
With reference to the first aspect, in certain implementation manners of the first aspect, after converting the first storage area into the second storage medium, the method further includes:
And stopping converting the second storage medium corresponding to the first storage area into the first storage medium.
Since the second storage medium is in a state of gradually converting to the first storage medium when the electronic device is activated, the electronic device may still convert the second storage medium to the first storage medium again after converting the first storage medium to the second storage medium.
And one of the conditions of converting the first storage area into the second storage medium is that the erasing times of the first storage area in the first storage medium is larger than or equal to the maximum erasable times of the first storage medium, namely the first storage medium reaches the service life, and after the first storage medium reaches the service life, the risk of charge loss exists, the charge loss can cause the abnormal data storage capacity of the flash memory, and the electronic equipment cannot be normally used.
In the above method, if the electronic device further converts the second storage medium into the first storage medium after converting the first storage area into the second storage medium, the electronic device may store data through the first storage area, and there is still a risk of charge loss, so that an abnormality occurs in data storage, and therefore, after converting the first storage area into the second storage medium, it is necessary to stop converting the second storage medium corresponding to the first storage area into the first storage medium.
With reference to the first aspect, in some implementations of the first aspect, stopping converting the second storage medium corresponding to the first storage area to the first storage medium includes:
And stopping converting the second storage medium corresponding to the first storage area into the first storage medium according to the second identification.
In the above method, as an implementation manner, after the first storage area is converted into the second storage medium, the second identifier may be used to mark the first storage area, so that the conversion of the second storage medium corresponding to the first storage area into the first storage medium is stopped according to the second identifier.
As another implementation manner, the second identifier may be used to mark the first storage area before the first storage area is converted into the second storage medium, so that after the first storage area is converted into the second storage medium, the conversion of the second storage medium corresponding to the first storage area into the first storage medium is stopped according to the second identifier.
With reference to the first aspect, in certain implementation manners of the first aspect, when the electronic device is activated, a first function is started, including:
when the electronic device is activated, a first function of a register of a first storage medium is started, and when the number of times of erasing of a first storage area in a plurality of storage areas is larger than or equal to a first number, whether the current user data amount stored in the memory meets a first condition is determined, wherein when the number of times of erasing of the first storage area recorded by the register is larger than or equal to the first number, whether the current user data amount stored in the memory meets the first condition is determined.
In the method, the memory can be allocated with different registers for each storage medium in the memory, so that when the electronic device is activated, a first function of the registers of the first storage medium can be started to record the erasing times of a plurality of storage areas in the first storage medium.
With reference to the first aspect, in certain implementations of the first aspect, when the current user data amount is equal to the second amount, converting the plurality of storage areas all into the second storage medium includes:
When the current user data amount is smaller than the third amount, a first interface is displayed, the first interface comprises a first control, the first control is used for triggering the whole conversion of the plurality of storage areas into the second storage medium, and the first operation of the first control is responded to the whole conversion of the plurality of storage areas into the second storage medium.
In the above method, since the storage density of the first storage medium is large, the storage capacity is large, the storage density of the second storage medium is small, and the storage capacity is small, if the first storage medium is directly converted into the second storage medium when the current user data amount is equal to the second amount, the storage capacity becomes small, and the current user data may not be all stored in the second storage medium, it is necessary to determine whether the current user data amount is smaller than the third amount before all the plurality of storage areas in the first storage medium are converted into the second storage medium, and when the current user data amount is smaller than the third amount, all the plurality of storage areas are converted into the second storage medium.
Specifically, when the current user data amount is smaller than the third amount, the electronic device may display a first interface, and provide the user with a function of converting the first storage medium into the second storage medium through the first interface, so that all of the plurality of storage areas are converted into the second storage medium according to the user's requirement.
With reference to the first aspect, in certain implementation manners of the first aspect, displaying the first interface when the current user data amount is less than the third amount includes:
and when the current user data amount is smaller than the third amount, displaying a second interface, wherein the second interface comprises a second control, the second control is used for reminding the user of losing risk of the current user data stored in the user memory and used for triggering and displaying the first control, and the first interface is displayed in response to a second operation of the second control.
In the method, when the current user data size is smaller than the third size, the electronic device may display a second interface, remind the user of the risk of losing the current user data stored in the user memory through the content in the second control in the second interface, and provide an entry for converting all the multiple storage areas into the second storage medium for the user through the second control in the second interface.
With reference to the first aspect, in certain implementations of the first aspect, when the current user data amount is equal to the second amount, converting the plurality of storage areas all into the second storage medium includes:
When the current user data amount is greater than or equal to the third amount, the third interface is displayed, the third interface comprises a third control, the third control is used for triggering all conversion of the plurality of storage areas into the second storage medium when deleting or backing up the current user data stored in the fourth amount of storage, the fourth amount is greater than or equal to the fifth amount, the fifth amount is an amount corresponding to the difference between the storage capacity of the second storage medium and the current user data amount when all the plurality of storage areas are converted into the second storage medium, and the fourth amount of current user data is deleted or backed up and all the plurality of storage areas are converted into the second storage medium in response to the third operation of the third control.
In the above method, the second storage medium may store all of the current user data when all of the plurality of storage areas are converted into the second storage medium after deleting or backing up the fourth amount of current user data, so the electronic device needs to delete or backing up the fourth amount of current user data, and then execute the step of converting all of the plurality of storage areas into the second storage medium, otherwise, the electronic device cannot convert all of the plurality of storage areas into the second storage medium.
Specifically, when the current user data amount is greater than or equal to the third amount, the electronic device may display a third interface, and provide the user with a function of converting the first storage medium into the second storage medium through the third interface, so that all of the plurality of storage areas are converted into the second storage medium according to the user's requirement.
With reference to the first aspect, in certain implementation manners of the first aspect, displaying a third interface when the current user data amount is greater than or equal to a third amount includes:
And when the current user data amount is greater than or equal to the third amount, displaying a fourth interface, wherein the fourth interface comprises a fourth control, the fourth control is used for reminding the user that the current user data stored in the user memory has loss risk and used for triggering the third control to be displayed, and responding to fourth operation of the fourth control, displaying the third interface.
In the above method, when the current user data amount is greater than or equal to the third amount, the electronic device may display a fourth interface, remind the user of the risk of losing the current user data stored in the memory through the content in a fourth control in the fourth interface, and may further provide the user with an entry for deleting or backing up the fourth amount of the current user data through the fourth control in the fourth interface, and convert all the multiple storage areas into the second storage medium.
With reference to the first aspect, in some implementations of the first aspect, in response to a third operation on the third control, deleting a fourth amount of current user data and converting all of the plurality of storage areas to the second storage medium includes:
The method comprises the steps of responding to a third operation on a third control, displaying a fifth interface, wherein the fifth interface comprises a fifth control and current user data stored in a memory, the fifth control is used for triggering deletion of the current user data, responding to the fifth operation on the fifth interface, determining selected data in the current user data, wherein the data amount of the selected data is larger than or equal to a fourth amount, responding to a sixth operation on the fifth control, deleting the selected data, and converting all the multiple storage areas into a second storage medium.
The fifth interface may be an interface of a file management application, the file management application is a tool for managing and organizing user data stored in a memory of the electronic device, the electronic device may display the user data stored in the memory through the interface of the file management application, and a user may delete or backup the user data stored in the memory based on operations on the interface of the file management application.
In the above method, the fifth interface has a fifth control for deleting the current user data stored in the memory, and when receiving the operation of selecting the data by the user, the electronic device may select the current user data stored in the memory, so when receiving the operation of deleting the selected data, the electronic device may delete the selected data, and after deleting, all the plurality of storage areas may be converted into the second storage medium.
In addition, after all of the plurality of storage areas are converted into the second storage medium, the electronic device may restart, and after the restart, the electronic device stores data through the second storage medium.
With reference to the first aspect, in some implementations of the first aspect, the fifth interface further includes a sixth control, where the sixth control is configured to trigger backup of current user data to the first device, the first device is a different device from the electronic device, backup a fourth amount of current user data, and convert all of the plurality of storage areas into the second storage medium, and includes:
And in response to a seventh operation on the sixth control, backing up the selected data to the first device and converting all of the plurality of storage areas into the second storage medium.
In the above method, the fifth interface has a sixth control for backing up the current user data stored in the memory, and when receiving the operation of selecting the data by the user, the electronic device may select the current user data stored in the memory, so when receiving the operation of backing up the selected data, the electronic device may backup the selected data, and after the backup, all the plurality of storage areas may be converted into the second storage medium.
In addition, after all of the plurality of storage areas are converted into the second storage medium, the electronic device may restart, and after the restart, the electronic device stores data through the second storage medium.
With reference to the first aspect, in certain implementation manners of the first aspect, the first storage medium includes any one level storage medium of a multi-layer unit storage medium, a three-layer unit storage medium, a four-layer unit storage medium and a five-layer unit storage medium, and the second storage medium includes any one or more levels storage medium of a one-layer unit storage medium, a multi-layer unit storage medium, a three-layer unit storage medium and a four-layer unit storage medium.
For example, the first storage medium is a four-layer unit storage medium, and the second storage medium is a three-layer unit storage medium.
For another example, the first storage medium is a four-layer unit storage medium, and the second storage medium includes a three-layer unit storage medium and a single-layer unit storage medium.
With reference to the first aspect, in certain implementation manners of the first aspect, the memory is any one of a general flash memory, an embedded multimedia card, a general flash memory multi-chip package memory, a solid state disk, and an embedded multimedia card multi-chip package memory.
For example, the memory is a general purpose flash memory.
In a second aspect, the present application provides a storage medium conversion device of a memory, where the storage medium conversion device of the memory is configured to perform the storage medium conversion method of the memory in any one of the first aspect and the possible implementation manners of the first aspect.
In a third aspect, the present application provides an electronic device comprising one or more processors, a memory and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the storage medium conversion method of the memory in the first aspect and any one of the possible implementations of the first aspect.
In a fourth aspect, the present application provides a chip system comprising a processor for calling and running a computer program from a memory, such that an electronic device on which the chip system is installed performs the storage medium conversion method of the memory in the first aspect and any one of the possible implementations of the first aspect.
In a fifth aspect, the present application provides a computer readable storage medium comprising a computer program which, when run on an electronic device, causes the electronic device to perform the storage medium conversion method of the memory of the first aspect and any one of the possible implementations of the first aspect.
In a sixth aspect, the present application provides a computer program product for, when run on a computer, causing the computer to perform the storage medium conversion method of the memory of the first aspect and any one of the possible implementations of the first aspect.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Detailed Description
In the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or" describes an association of associated objects, meaning that there may be three relationships, e.g., A and/or B, and that there may be A alone, while A and B are present, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one of a alone, b alone or c alone may represent a alone, b alone, c alone, a combination of a and b, a combination of a and c, b and c, or a combination of a, b and c, wherein a, b, c may be single or plural. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
With the continuous upgrading of digital economy and the successive application of technologies such as industrial internet, 5G and the like, electronic devices such as mobile phones and the like have higher requirements on data storage data volume and read-write speed. Therefore, flash memories with larger amounts of stored data and faster read/write speeds are increasingly becoming the priority choice for electronic devices to store data.
Currently, flash memories may include at least two types of storage media, single-layer cells (SLC), multi-layer cells (multi-LEVEL CELL, MLC), triple-layer cells (triple-LEVEL CELL, TLC), quad-LEVEL CELL, QLC, and five-layer cells (penta-LEVEL CELL, PLC), depending on storage capacity, read-write speed, endurance, etc. Because the low-level storage medium has low read-write speed and small storage capacity, the high-level storage medium has low read-write speed and large storage capacity, and when data is stored, the electronic equipment can write the data into the low-level storage medium first, then write the data into the high-level storage medium from the low-level storage medium, and finally store the data into the high-level storage medium.
For example, the flash memory includes two types of storage media, namely SLC and QLC, and since the SLC has a high read/write speed and a large QLC storage capacity, when the flash memory stores data, the data can be stored through the SLC first and then stored into the QLC from the SLC.
Fig. 1 is a schematic diagram of a normal voltage distribution of a plurality of types of storage media. As shown in fig. 1, among the plurality of types of storage media, each storage medium may store a different amount of bit data, and different storage media have different data storage densities and performance characteristics, specifically:
One memory cell (cell) of the SLC is capable of storing one bit of data (1 bit percell). The SLC may have two voltage variations, the two voltage variation states being denoted 0 and 1, respectively. SLC has the characteristics of lowest storage density, small voltage change interval when writing data, and the like, and has about 10 ten thousand erasing life.
One memory cell (cell) of the MLC is capable of storing two bits of data (2 bit percell). MLC requires complex voltage control with four voltage variations, the four voltage variation states being denoted by 00, 01, 10 and 11 respectively. MLC storage density was higher than SLC, with about 1 ten thousand erase-write lives.
One memory cell (cell) of TLC can store three bits of data (3 bit percell). TLC may have eight voltage variations, the eight voltage variation states being represented by 000, 001, 010, 011, 100, 101, 110, and 111, respectively. TLC storage density is 1.5 times that of MLC, with about 3 thousand erasure life.
One memory cell (cell) of the QLC is capable of storing four bits of data (4 bit percell). QLC may have sixteen voltage variations, the sixteen voltage variation states being represented by 1111, 0111, 0011, 1011, 1001, 0001, 0101, 1101, 1100, 0100, 0000, 1000, 1010, 0010, 0110, and 1110, respectively. QLC storage density is 2 times that of MLC, with about 1.3 thousand erase-write lives.
One memory cell (cell) of the PLC can store five bits of data (5 bit percell). The PLC may have thirty-two voltage variations. The PLC storage density is 2 times that of QLC.
The more bits of data are stored per memory cell in the storage medium, the higher the data storage density, and the fewer the number of erasures that can be tolerated.
That is, the high-level storage medium has a large number of bits stored in each storage unit, a high data storage density, and a small number of erasable times, and the low-level storage medium has a small number of bits stored in each storage unit, a low data storage density, and a large number of erasable times.
Fig. 2 is a schematic diagram of a flash memory. As shown in fig. 2, the flash memory includes a substrate (p-subtrate), a source (sourse N +), a drain (drain n+), a bit line (bit line), a floating gate (floating gate), an oxide layer (oxide layer), a control gate (control gate), and a word line (word line).
Data programming (program)/write principle of flash memory:
When writing data, a high voltage is applied to a word line (word line), the source is grounded, and an appropriate voltage is applied to the drain. At this time, the source and the drain are turned on, and electron flow flows between the source and the drain. When the electron flow is strong enough, tunneling occurs, and part of the charge passes through the oxide layer and enters the floating gate, thus completing the writing operation.
Data reading principle of flash memory:
After the charge enters the floating gate, an electrical potential is generated. Applying this potential to the word line can shift the voltage of the word line. Assuming that there is a charge of "1", there is no charge of "0". The data is thus read.
Erase (erase) principle of data of flash memory:
erasing data is to erase the charge in the floating gate, and there are generally two ways:
1. A high voltage is applied to the source and the word line is grounded, so that a high voltage difference is formed between the source and the word line, and a strong potential energy can "suck" electrons in the floating gate out and flow across the oxide layer to the source.
2. A positive voltage is applied to the source and a higher negative voltage is applied to the word line, resulting in a higher voltage difference between the source and the word line, and a strong potential will "squeeze" the charge in the floating gate out, across the oxide layer and toward the source.
Based on the above description, when program or erase operation is performed on the flash memory cell, charges pass through the oxide layer at a higher voltage. Since the mass of charges is very small, they may pass through by tunneling effects in the oxide layer. This means that during program or erase operations, a small portion of the charge passes through the oxide layer.
The higher the voltage, the greater the probability of charge crossover through the oxide layer. These charges can cause minor damage to the oxide layer. Although the effect of a single pass through phenomenon on the oxide layer is small, if program or erase operations are frequently performed, these damages may gradually accumulate, resulting in an increased degree of damage to the oxide layer.
Thus, in general, the more severe the damage to the oxide layer is when the voltage is high. This is because more charge passes through the oxide layer, and the ion and charge collisions therein can result in changes and damage to the oxide layer structure.
It should be noted that the damage degree of the oxide layer also depends on the voltage and time used when the memory is subjected to program or erase operation, and the longer the memory is, the higher the damage degree of the oxide layer is.
FIG. 3 is a schematic diagram illustrating a charge loss process of a flash memory. As shown in fig. 3, damage to the oxide layer can cause charge loss on the floating gate.
As can be seen from fig. 3 (a), the voltage is stable after the programming operation and the amount of charge in the floating gate is stable. For example, the amount of charge in the floating gate at this time is 7.
After a period of use, the flash memory may change from the state shown in (a) of fig. 3 to the state shown in (b) of fig. 3.
As can be seen from fig. 3 (b), over time, the charge in the floating gate is gradually losing and the amount of charge in the floating gate is gradually decreasing.
After a period of use, the flash memory may change from the state shown in fig. 3 (b) to the state shown in fig. 3 (c).
As can be seen from fig. 3 (b), over time, the charge in the floating gate is lost and the amount of charge in the floating gate becomes smaller. For example, the amount of charge in the floating gate is 5 at this time, 2 is lost.
It is understood that charge loss in the flash memory can cause an abnormality in the data retention capacity of the flash memory. In general, one memory cell of QLC is most likely to have data retention abnormality after erasing 1.3K times, one memory cell of TLC is most likely to have data retention abnormality after erasing 3K times, and one memory cell of SLC is most likely to have data retention abnormality after erasing 100K times.
The reason why the abnormality of the data storage capacity of one memory cell of the SLC is the largest after erasing 100K times is that the SLC judgment voltage range is large, and the identification error caused by the charge loss and the threshold voltage deviation is not easy to occur.
FIG. 4 is a schematic diagram showing the relationship between charge loss and data retention anomalies. For ease of illustration, in fig. 4, the relationship between charge loss and data retention anomalies is illustrated by QLC.
As can be seen from fig. 4 (a), the amount of charge in the floating gate is 7 at this time, and the charge in the floating gate is not lost. When the charges in the floating gate are not lost, the difference value between the threshold voltage and the judgment voltage of each memory cell is within a preset range.
It will be appreciated that charge loss may cause the threshold voltage of at least one memory cell to drift in a high threshold direction, which may result in a read error for that memory cell, reducing the reliability of data storage.
As can be seen from fig. 4 (b), the amount of charge in the floating gate is 5, and the charge in the floating gate is lost 2. When the charge in the floating gate is lost, there may be a case where the difference between the threshold voltage of one or more memory cells and the judgment voltage is not within a preset range.
For example, in fig. 4 (b), the threshold voltage of one of the memory cells shifts toward the high threshold direction, so that the difference between the threshold voltage of the memory cell and the judgment voltage is not within the preset range.
Therefore, the charge loss may cause the change of the threshold voltage, resulting in the difference between the threshold voltage and the judgment voltage exceeding the device identification capability of the flash memory, resulting in the loss of data, the more data of the bit stored in each memory cell in the storage medium, the greater the probability of error, and the more likely the data retention capability of the flash memory is abnormal.
In summary, the number of erasable times of the high-level storage medium is small, and with the increase of the number of writing, reading and/or deleting times, the oxide layer of the flash memory may be damaged, so that the charges in the memory are lost, the stored data are read abnormally, that is, the data storage capacity of the flash memory is abnormal, so that the electronic device cannot be used normally, and the overall service life of the electronic device is reduced.
In view of the foregoing, the present application may provide a storage medium conversion method, an electronic device, a chip system, a computer readable storage medium, and a computer program product for a memory, where when at least one of the erasable times in a plurality of storage areas of a first storage medium is greater than or equal to the erasable times of the first storage medium, and the current amount of user data stored in the memory is equal to the current total storage capacity of the first storage medium and a second storage medium, the first storage medium is integrally degraded to the second storage medium, where the number of bits stored in each storage unit of the first storage medium is greater than the number of bits stored in each storage unit of the second storage medium, and the erasable times of the first storage medium is less than the erasable times of the second storage medium, so that the data density of the memory can be reduced, the possibility of data identification errors can be reduced, the erasable times of the memory can be improved, and the service life of the memory can be prolonged.
The storage medium conversion method of the memory can be applied to electronic equipment. The electronic device may be an electronic device with memory and display hardware and corresponding software support.
For example, the electronic device may be a mobile phone, a tablet computer, a smart watch, a vehicle-mounted device, a notebook computer, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a smart car, a smart television, a robot, or the like.
It should be noted that, in some possible implementations, the electronic device may also be referred to as a terminal device, a User Equipment (UE), or the like, which is not limited by the embodiment of the present application.
For convenience of description, fig. 5 illustrates an electronic device 100 as an example of a mobile phone.
As shown in fig. 1, the electronic device 100 may include a processor 101, a communication module 102, a display 103, a camera 104, a sensor 105, an internal memory 106, a USB interface 107, an external memory interface 108, a charge management module 109, a power management module 110, a battery 111, and the like.
Processor 101 may include one or more processing units, for example, processor 101 may include an application processor (application processor, AP), a modem processor, a graphics processor, an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a memory, a video stream codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural-Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors 101.
The display screen 103 is used for displaying images or videos in a human-computer interaction interface. The display screen 103 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, an organic light-emitting diode (OLED), an active-matrix organic LIGHT EMITTING diode (AMOLED), a flexible light-emitting diode (FLED), miniLED, microLED, a Micro-OLED, a quantum dot LIGHT EMITTING diodes (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 103, N being a positive integer greater than 1.
The external memory interface 108 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 101 through an external memory interface 108 to implement data storage functions. For example, files such as music, video streams, etc. are stored in an external memory card.
The internal memory 106 may be used to store computer executable program code that includes instructions. The processor 101 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 106. The internal memory 106 may include a stored program area and a stored data area.
The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 106 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash memory (universal flash storage, UFS), and the like.
Optionally, the electronic device 100 may also include peripheral devices such as a mouse, keys, indicator lights, keyboard, speakers, microphone, etc.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100.
In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Based on the foregoing description, a storage medium conversion method of the memory of the electronic device implementing the present application will be described in detail with reference to fig. 6 to 8. For convenience of explanation, fig. 6 to 8 illustrate an electronic device as an example of a mobile phone.
The mobile phone comprises a flash memory, wherein the flash memory comprises three types of storage media, namely SLC, TLC and QLC.
Because of the high SLC reading and writing speed and large QLC storage capacity, when the flash memory stores data, the data can be stored through SLC first and then stored into QLC from SLC, or can be directly stored into QLC.
The QLC includes a plurality of storage areas, each storage area having a erasure lifetime of about 1.3k, and when the number of erasures of one storage area is greater than or equal to 1.3k, the one storage area may be downgraded to TLC, that is, the flash memory stores data by way of QLC to store data by way of TLC.
Along with the reading, writing and/or storing of various data in the mobile phone, the erasing times of at least one storage area in the QLC is greater than or equal to 1.3k times, and the data volume stored in the flash memory also becomes large, so that the user data volume currently stored in the flash memory is equal to the sum of the current storage capacity of SLC, the current storage capacity of TLC and the current storage capacity of QLC.
Referring to fig. 6-8, fig. 6-8 illustrate a man-machine interface diagram according to an embodiment of the application.
In one implementation, when the number of erasures in at least one storage area in the QLC is greater than or equal to the preset number of erasures (1.3 k times) of the QLC, the amount of user data currently stored in the flash memory is equal to the sum of the current storage capacity of SLC, the current storage capacity of TLC and the current storage capacity of the QLC, and the amount of data currently stored is less than 3/4 of the total storage capacity of the memory, the mobile phone may display the interface 11 as shown in (a) in fig. 6.
Control 1001 may be included in interface 11, where control 1001 is used to alert the user that there is a risk of losing data through text.
For example, the display style of the control 1001 is a capsule shape, and the text displayed in the control 1001 is "data loss alarm".
Upon receiving the user's operation to trigger the control 1001 shown in fig. 6 (a), the mobile phone may change from the interface 11 shown in fig. 6 (a) to the interface 12 shown in fig. 6 (b).
Among other things, control 1002 may be included in interface 12, control 1002 may be used to alert the user through text that the lifetime of the memory device is exhausted, and may automatically reduce the memory capacity to 3/4. Also included in interface 12 may be a control 1003 for indicating that the memory capacity can be reduced to 3/4 (3/4 indicating that the memory capacity is reduced to 3/4 after the QLC storage medium is completely converted to TLC) and a control 1004 for indicating that the memory capacity cannot be reduced to 3/4 (QLC storage medium cannot be converted to TLC).
For example, the text displayed in control 1002 is "storage device lifetime exhausted alert, if memory lifetime is to be extended, memory capacity needs to be reduced to 3/4, is willing.
After receiving the operation of triggering the control 1003 shown in (b) of fig. 6 by the user, the mobile phone may convert all of the plurality of storage areas of the QLC into TLC, and store data in a mode of storing data by TLC.
After all the storage areas of the QLC are converted into TLC by the mobile phone, namely after the data stored by the QLC is switched into the data stored by the TLC, the mobile phone can be restarted automatically, and after the mobile phone is restarted, the flash memory of the mobile phone is changed from comprising QLC, TLC and SLC to comprising TLC and SLC.
When the flash memory of the mobile phone comprises TLC and SLC, the data is stored by TLC. When the mobile phone stores data through TLC, the data can be stored through SLC first, then stored into TLC from SLC, or can be directly stored into TLC.
After receiving the operation of triggering the control 1004 shown in fig. 6 (b) by the user, the mobile phone does not perform any operation, i.e. does not process, and the data still has a risk of losing.
That is, after receiving the operation of triggering the control 1003 shown in (b) in fig. 6 by the user, the interface available to the mobile phone is temporarily inoperable, the background GC of the mobile phone converts all the multiple storage areas of the QLC into TLC, and after completion, the mobile phone can restart and switch to TLC FW operation.
After receiving the operation of triggering the control 1004 shown in fig. 6 (b), the mobile phone does not perform any processing, and the data stored in the memory has a risk of losing.
In another implementation, when the number of erasures in at least one storage area in the QLC is greater than or equal to the preset number of erasures in the QLC, the amount of user data currently stored in the flash memory is equal to the current storage capacity of the SLC, the sum of the current storage capacity of the TLC and the current storage capacity of the QLC, and the amount of data currently stored is greater than or equal to 3/4 of the total storage capacity of the flash memory, the mobile phone may display the interface 11 as shown in (a) in fig. 6.
Upon receiving the user's operation to trigger the control 1001 shown in fig. 6 (a), the mobile phone may change from the interface 11 shown in fig. 6 (a) to display the interface 13 shown in fig. 7 (a).
Among other things, control 1005 may be included in interface 13, control 1005 being used to alert the user through text that the lifetime of the memory device is exhausted, and to alert the user to delete data that can be stored after the memory capacity has been reduced to 3/4. Also included in interface 13 may be a control 1006 and a control 1007, control 1006 for indicating that data can be deleted and reducing the memory capacity to 3/4 (3/4 means that after the QLC storage medium is completely converted to TLC, the memory capacity is reduced to 3/4), control 1007 for indicating that data cannot be deleted and that the memory capacity cannot be reduced to 3/4 (QLC storage medium cannot be converted to TLC).
For example, the text displayed in control 1005 is "storage life out alert," if memory life is to be extended, memory size needs to be reduced to 3/4, is willing. ".
Upon receiving the user's operation to trigger the control 1006 shown in fig. 7 (a), the mobile phone may change from the interface 13 shown in fig. 7 (a) to the interface 14 shown in fig. 7 (b).
Wherein the interface 14 is an interface of the file management APP. Control 1008, control 1009, control 1010, and multiple folders may be included in interface 14. Control 1008 is used to alert the user to delete or backup GB user data. Control 1009 is used to trigger deletion of selected files in interface 13. Control 1010 is used to trigger the selected files in backup interface 13 to a cloud disk or other device. The folders are respectively used for triggering and displaying the user data stored in the folders.
Upon receiving a user selection of at least one of the plurality of folders, the cell phone may change from the interface 14 shown in fig. 7 (b) to displaying the interface 15 shown in fig. 8.
After receiving the user's operation to trigger the control 1009 shown in fig. 8, the mobile phone may delete the data in the selected folder.
The amount of data corresponding to the data in the deleted folder should be greater than or equal to the amount of data displayed in control 1008 that alerts the user to delete or backup.
For example, the amount of data displayed in control 1008 that alerts the user to delete or backup is 80GB, and the amount of data corresponding to the data in the deleted folder is 100GB.
After deleting the data in the selected folder, the mobile phone can convert all the multiple storage areas of the QLC into TLC.
In some embodiments, after receiving the user's operation to trigger the control 1010 shown in fig. 8, the mobile phone may determine whether the amount of user data currently stored in the flash memory is less than or equal to 3/4 of the total storage capacity of TLC, i.e. the actual total storage capacity of the storage capacity, after the QLC storage medium is completely converted into TLC, if so, all the multiple storage areas of the QLC are converted into TLC.
After all the storage areas of the QLC are converted into TLC by the mobile phone, namely after the data stored by the QLC is switched into the data stored by the TLC, the mobile phone can be restarted automatically, and after the mobile phone is restarted, the flash memory of the mobile phone is changed from comprising QLC, TLC and SLC to comprising TLC and SLC.
When the flash memory of the mobile phone comprises TLC and SLC, the data is stored by TLC. When the mobile phone stores data through TLC, the data can be stored through SLC first, then stored into TLC from SLC, or can be directly stored into TLC.
Or after receiving the operation of triggering the control 1010 shown in fig. 8 by the user, the mobile phone may backup the data in the selected folder to the cloud disk or other devices.
The amount of data corresponding to the data in the backed-up folder should be greater than or equal to the amount of data displayed in the control 1008 that reminds the user to delete or backup.
After receiving the operation of triggering the control 1007 shown in (a) of fig. 7 by the user, the mobile phone does not perform any operation, i.e. does not perform processing, and the data still has a risk of losing.
That is, after receiving the operation of triggering the control 1006 shown in fig. 7 (a), the mobile phone may display the interface of the file management APP, prompt deletion or backup, select the data corresponding to the capacity of the reminder in the interface 14, and complete the data without prompting, the mobile phone cannot operate, the background GC of the mobile phone, convert all the multiple storage areas of the QLC into TLC, and after the completion, the mobile phone may restart and switch to TLC FW operation.
After receiving the operation of triggering the control 1007 shown in (a) of fig. 7 by the user, the mobile phone does not perform any processing, and the data stored in the memory has a risk of losing.
In summary, when the erasing times of at least one storage area in the QLC is greater than or equal to the preset erasing times of the QLC, and the current user data amount stored in the flash memory is equal to the sum of the current storage capacity of the SLC, the current storage capacity of the TLC and the current storage capacity of the QLC, the mobile phone can convert all the plurality of storage areas of the QLC into TLC, i.e. degrade all the plurality of storage areas of the QLC into TLC, and change the data stored through the QLC into the data stored through the TLC, thereby reducing the data density of the memory, reducing the possibility of data identification errors, improving the erasable times of the memory, and prolonging the service life of the memory.
In addition, in connection with fig. 9, it should be noted that, after the mobile phone is activated, the SLC and TLC may be gradually converted into QLC according to the use of the user, the storage capacity of the QLC is gradually increased, and the storage capacity of the SLC and TLC is gradually decreased.
After the mobile phone is activated, in the initial use stage, the user data amount required to be stored is small, the data amount required to be backed up from other mobile phones to the mobile phone is large, the reading and writing speed of SLC is fast, and TLC is inferior, so in the initial state, as shown in (a) of FIG. 9, the storage capacities of SLC and TLC are large, and the storage capacity of QLC is small.
With the use of the memory, the amount of user data to be stored increases, and the SLC and TLC of the memory can be automatically gradually converted into QLC, as shown in (b) of fig. 9, the storage capacity of QLC increases, and the storage capacities of SLC and TLC decrease. For example, the QLC includes two storage areas at this time.
With continued use of the memory, the number of erasures of at least one storage area of the QLC is greater than or equal to 1.3 thousand times, at which time it may be determined whether the amount of user data currently stored in the flash memory is equal to the sum of the current storage capacity of the SLC, the current storage capacity of the TLC, and the current storage capacity of the QLC.
For example, as the memory continues to be used, the number of erasures of the two storage areas of the QLC is simultaneously greater than or equal to 1.3 thousand times, as shown in (c) of fig. 9.
If the current stored user data amount in the flash memory is smaller than the sum of the current storage capacity of SLC, the current storage capacity of TLC and the current storage capacity of QLC, converting the storage area in QLC with the erasing times of the storage area larger than or equal to 1.3 thousands of times into TLC.
With the continued use of the memory, SLC and TLC of the memory may be gradually converted into QLC, and the storage areas in the QLC are increased, as shown in (d) of fig. 9, the storage areas with the number of erasing times greater than or equal to 1.3 thousand times in the QLC are increased, that is, the storage areas reaching the end of life are increased.
When the number of times of erasing at least one storage area in the QLC is greater than or equal to the preset number of times of erasing of the QLC, and the amount of user data currently stored in the flash memory is equal to the sum of the current storage capacity of the SLC, the current storage capacity of the TLC and the current storage capacity of the QLC, a conversion condition for converting all the storage areas in the QLC into TLC is triggered, and the mobile phone can display an interface as shown in (a) of fig. 6.
Based on the above description of the scenario, the following describes in detail a storage medium conversion method of a memory provided by an embodiment of the present application, taking an electronic device as an example, with reference to the accompanying drawings and application scenario.
The electronic device comprises a memory, the memory comprises a first storage medium and a second storage medium, the maximum erasable frequency of the second storage medium is larger than that of the first storage medium, and the first storage medium comprises a plurality of storage areas.
The first storage medium includes any one level of storage medium among a multi-level unit storage medium, a three-level unit storage medium, a four-level unit storage medium, and a five-level unit storage medium. The second storage medium includes one layer of unit storage medium, multiple layers of unit storage medium, three layers of unit storage medium, and four layers of storage medium.
The memory may be a flash memory, specifically, any one of a general flash memory (univeral flash storage, UFS), an embedded multimedia card (embedded multimedia card, eMMC), a general flash memory multi-chip package memory (ununited medial coronoid process, uMCP), a solid state disk (solid STATE DRIVE, SSD), and an embedded multimedia card multi-chip package memory (embedded medial coronoid Process, eMCP).
Referring to fig. 10, fig. 10 is a flowchart illustrating a storage medium conversion method of a memory according to an embodiment of the application.
As shown in fig. 10, the storage medium conversion method of the memory provided by the present application may include:
S201, when the electronic equipment is activated, a first function is started, and the first function is used for recording the erasing times of each storage area in the plurality of storage areas.
The activation of the electronic device is a process of starting up the electronic device for the first time, connecting the electronic device to the mobile network for the first time, and enabling the electronic device to be used normally.
After the electronic equipment is activated, various functions of the electronic equipment can be normally used, such as calling, sending short messages, surfing the internet, downloading and using application programs and the like.
The erasing times are the times of erasing and programming of the storage medium in the memory, and are used for indicating the service life of the storage medium in the memory.
It will be appreciated that each time the electronic device performs an erase operation on the memory, the number of times each storage medium in the memory is erased increases, and each time the electronic device performs a program operation on the memory, the number of times each storage medium in the memory is erased increases, so as the electronic device is used, the number of times each storage medium in the memory increases.
The electronic device has a first function for recording the number of erasures for each of a plurality of storage areas in the first storage medium.
When the electronic device is activated, the electronic device can automatically start the first function, so that based on the first function, the electronic device can record the erasing times of each storage area in the plurality of storage areas in the first storage medium, and corresponding operations can be conveniently executed in the plurality of storage areas with the erasing times being greater than or equal to the first number.
In some embodiments, the memory may allocate a different register for each storage medium in the memory such that, upon activation of the electronic device, initiating the first function includes initiating the first function of the register of the first storage medium upon activation of the electronic device.
For example, when the first storage medium is QLC, the first storage medium includes 5 storage areas, namely, storage areas Q1, Q2, Q3, Q4, and Q5, respectively, and when the electronic device is activated, the electronic device may record the number of times of erasing of Q1, Q2, Q3, Q4, and Q5 through the first function.
S202, when the erasing times of a first storage area in the storage areas is larger than or equal to a first quantity, determining whether the current user data quantity stored in the storage meets a first condition, wherein the first storage area is any one of the storage areas in the first storage medium, the first quantity is the maximum erasing times of the first storage medium, and the first condition is related to the current total storage capacity of the first storage medium and the second storage medium.
The greater the erasing times, the higher the oxidation degree of the memory, the higher the damage degree of the oxidation layer of the memory, the more unstable the quantity of charges in the floating gate in the memory, and the risk of charge loss exists, which can lead to abnormal data storage capacity of the memory, abnormal use of electronic equipment and reduced service life of the memory.
Because the first number is the maximum erasable number of times of the first storage medium, when the erasable number of times of the first storage area in the plurality of storage areas is greater than or equal to the first number, the electronic device can determine that the first storage area has reached the service life, and there is a risk of charge loss, which can cause abnormal data storage in the first storage area.
For example, when the first storage medium is QLC and the first number is 1300, the first storage medium includes 5 storage areas, which are respectively storage areas Q1, Q2, Q3, Q4, and Q5, if the number of times of erasing of any Q3 of Q1, Q2, Q3, Q4, and Q5 is equal to 1300, the electronic device may determine that the storage area Q3 reaches the service life, and the electronic device may perform a corresponding operation.
After the electronic device is activated, the low-level storage medium may be gradually converted into the high-level storage medium, so that the storage capacity of the high-level storage medium is gradually increased, and the storage capacity of the low-level storage medium is gradually reduced.
For example, the memory includes three storage media, SLC, TLC, and QLC, respectively, as actual storage media in order from a low level to a high level, and SLC and TLC may be gradually converted into QLC such that the storage capacity of QLC is gradually increased and the storage capacities of SLC and TLC are gradually decreased.
As such, the total storage capacity of the first storage medium and the second storage medium is different at different times as the electronic device is used.
It will be appreciated that as electronic devices are used, the amount of user data that needs to be stored increases, and at different times the amount of user data stored in the memory varies.
Based on the above description, at different moments in time, there are two relations between the total storage capacities of the first storage medium and the second storage medium and the amount of user data stored in the memory, respectively, that the amount of current user data is equal to the current total storage capacities of the first storage medium and the second storage medium, and that the amount of current user data is smaller than the current total storage capacities of the first storage medium and the second storage medium.
It can be seen that the first condition includes that the current amount of user data is less than or equal to the second amount.
For example, when the first storage medium is QLC, the second storage medium is TLC, the first number is 1300 times, and the current total storage capacity of the first storage medium and the second storage medium is also 800GB, the electronic device may determine that the current user data amount is equal to the current total storage capacity of the first storage medium and the second storage medium if the current user data amount is also 800GB, and may determine that the current user data amount is less than the current total storage capacity of the first storage medium and the second storage medium if the current user data amount is 700 GB.
In some embodiments, the memory may allocate a different register for each storage medium in the memory, and determining whether the current amount of user data stored in the memory satisfies the first condition when the number of erasures for a first storage area in the plurality of storage areas is greater than or equal to the first number includes determining whether the current amount of user data stored in the memory satisfies the first condition when the number of erasures for the first storage area recorded by the register is greater than or equal to the first number.
S203, converting the first storage medium into a second storage medium when the current user data quantity meets the first condition.
Based on S202, it is known that the current user data amount may change in real time, and when the current user data amount satisfies the first condition, the first storage medium cannot normally store the user data, the electronic device cannot normally use, and there is a risk of losing a large amount of data.
Therefore, the electronic equipment can convert the first storage medium into the second storage medium, so that the data density of the memory can be reduced, the possibility of data identification errors is reduced, and the service life of the memory is prolonged under the condition that the user experience is not affected.
Referring to fig. 11, taking the memory as the memory 106 in the electronic device 100 shown in fig. 5, the first storage medium is QLC, the second storage medium is TLC, and the maximum number of erasable QLC is 1300, the risk situation of the memory and the risk situation of the memory after the first storage medium is converted into the second storage medium with use of the electronic device will be described. In fig. 11, the transparency is taken as an example to illustrate the lifetime of the memory, and the lower the transparency of the memory 106, the lower the lifetime of the memory, the higher the transparency of the memory, and the longer the lifetime of the memory.
At the beginning of use of the electronic device 100, the memory 106 is not at risk of data storage, and there is no risk of lifetime, and the memory 106 is not likely to have a data recognition error, as shown in fig. 11 (a), at this time, the transparency of the memory 106 is the highest, and the lifetime of the memory 106 is long.
With the use of the electronic device 100, the number of QLC erasures in the memory 106 reaches 1300 times, and there is a possibility that the data identification of the memory 106 is wrong, as shown in (b) of fig. 11, at this time, the transparency of the memory 106 is reduced, and the lifetime risk of the memory 106 occurs.
As the electronic device 100 continues to be used, the number of QLC erasures in the memory 106 reaches 1500, and the memory 106 has a data identification error or a data loss, as shown in (c) of fig. 11, at this time, the transparency of the memory 106 is further reduced, and the lifetime risk of the memory 106 is further increased.
After the electronic device converts the first storage medium in the memory 106 into the second storage medium, the memory 106 reduces the possibility of data identification errors, as shown in (d) of fig. 11, at this time, the memory 106 has an improved transparency of the memory 106 in (d) of fig. 11 and an improved service life of the memory 106 compared to the transparency of the memory 106 in (b) of fig. 11 and (c) of fig. 11.
According to the storage medium conversion method of the storage, through the first function of the electronic equipment, the electronic equipment can record the erasing times of each storage area in the plurality of storage areas, and corresponding operations are conveniently executed when the erasing times of any one of the plurality of storage areas are larger than or equal to the first number. When the number of times of erasing of a first storage area in the plurality of storage areas is greater than or equal to a first number, the first storage area reaches the service life, and the storage has the possibility of data identification errors, so that the electronic device can determine whether the current user data amount stored in the storage meets a first condition, when the current user data amount meets the first condition, the first storage medium is converted into a second storage medium, and when the current user data amount meets the first condition, the maximum number of times of erasing of the second storage medium is greater than the maximum number of times of erasing of the first storage medium, and the storage density of the second storage medium is smaller than that of the first storage medium, the first storage medium is converted into the second storage medium, the data density of the storage can be reduced, the possibility of data identification errors is reduced, the service life of the storage can be prolonged under the condition that the user experience is not affected, in other words, when the current user data amount meets the first condition, the service life of the storage medium is replaced by the mode of the storage medium, and the service life of the storage can be ensured, and the service life of the electronic device is degraded.
Based on the description of S203 in fig. 10 above, in some embodiments, the first condition includes that the current user data amount is less than or equal to a second amount, which is a current total storage capacity of the first storage medium and the second storage medium, and determining whether the current user data amount stored in the memory satisfies the first condition when the number of times of erasing of the first storage area of the plurality of storage areas is greater than or equal to the first amount includes determining whether the current user data amount stored in the memory is equal to the second amount when the number of times of erasing of the first storage area of the plurality of storage areas is greater than or equal to the first amount.
When the current user data amount satisfies the first condition, converting the first storage medium into the second storage medium includes converting all of the plurality of storage areas into the second storage medium when the current user data amount is equal to the second amount, and converting the first storage area into the second storage medium when the current user data amount is less than the second amount.
In addition, the electronic device may also stop converting the second storage medium to the first storage medium after the electronic device converts all of the plurality of storage areas to the second storage medium or converts the first storage area to the second storage medium.
Next, a specific implementation procedure of the storage medium conversion method of the memory of the present application will be described in detail with reference to fig. 12.
Referring to fig. 12, fig. 12 is a flowchart illustrating a storage medium conversion method of a memory according to an embodiment of the application.
As shown in fig. 12, the storage medium conversion method of the memory provided by the present application may include:
S301, when the electronic equipment is activated, a first function is started, wherein the first function is used for recording the erasing times of each storage area in the plurality of storage areas.
S302, when the erasing times of a first storage area in the storage areas is larger than or equal to a first quantity, determining whether the current user data quantity stored in the storage is equal to a second quantity.
The implementation manners of S301 and S302 are similar to those of S201 and S202 in the embodiment shown in fig. 10, and are not described herein.
The electronic device may perform S303 when the current amount of user data stored in the memory is equal to the second amount, and may perform S306 when the current amount of user data stored in the memory is less than the second amount.
S303, when the current user data amount is equal to the second amount, all the storage areas are converted into a second storage medium.
When the current amount of user data is equal to the second amount, the current user data is stored full of the current first storage medium and the second storage medium, the risk of losing a large amount of user data is high, and the electronic device can completely convert the plurality of storage areas into the second storage medium.
For example, when the first storage medium is QLC, the second storage medium is TLC, the first number is 1300 times, and the current total storage capacity of QLC and TLC is 800GB, if the current user data size is also 800GB, the electronic device may determine that the current user data size is equal to the current total storage capacity of QLC and TLC, and the electronic device may convert all of the plurality of storage areas in QLC into TLC.
For example, when the first storage medium is QLC, the second storage medium includes TLC and SLC, the first number is 1300 times, and the current total storage capacity of QLC, TLC and SLC is 800GB, if the current user data size is also 800GB, the electronic device may determine that the current user data size is equal to the current total storage capacity of QLC, TLC and SLC, and the electronic device may convert all of the plurality of storage areas in the QLC into TLC, that is, convert the QLC into a storage medium one level lower than the QLC in TLC and SLC.
In some embodiments, when the current amount of user data is equal to the second amount, converting all of the plurality of storage areas to the second storage medium comprises:
Step 3031a, when the current amount of user data is equal to the second amount, it is determined whether the current amount of user data is less than the third amount.
Wherein the third number is a storage capacity of the second storage medium when all of the plurality of storage areas are converted into the second storage medium.
It will be appreciated that since the storage density of the storage medium of the higher hierarchy is small, the storage capacity is large, and the storage density of the storage medium of the lower hierarchy is large, the storage capacity becomes small if the storage medium of the higher hierarchy is converted into the storage medium of the lower hierarchy. The total storage capacity of the memory is the storage capacity of the highest-level storage medium when all of the low-level storage media are converted into the highest-level storage media.
For example, the total storage capacity of the memory is 1tb, and 1tb is the storage capacity of the first storage medium when the second storage medium is all converted into the first storage medium.
Based on this, when the total storage capacity of the memory is 1TB, and the first storage medium is QLC and the second storage medium is TLC, the storage density of TLC is 3/4 of that of QLC, and after the QLC is converted to TLC, the storage capacity of TLC becomes 768GB.
Based on the above description, the first storage medium has a large storage density, a large storage capacity, and the second storage medium has a small storage density, and when the current user data amount is equal to the second amount, if the first storage medium is directly converted into the second storage medium, the storage capacity becomes small, and the current user data cannot be completely stored in the second storage medium.
It can be seen that when the current user data amount is equal to the second amount, if all the plurality of storage areas in the first storage medium are directly converted into the second storage medium, a situation that storage cannot be performed may occur, and therefore, it is required to determine whether the current user data amount is less than the third amount before all the plurality of storage areas in the first storage medium are converted into the second storage medium.
Step 3032a, when the current user data size is smaller than the third size, displaying a first interface, wherein the first interface comprises a first control, and the first control is used for triggering all conversion of the plurality of storage areas into the second storage medium.
The specific implementation of the first interface may be referred to in fig. 6 (b) for a description of the interface 12.
Specific implementations of the first control can be found in the relevant description of control 1003 in interface 12 shown in fig. 6 (b).
It should be understood that the first interface is taken as the interface 12, the first control is taken as the control 1003 for example, and the specific implementation manner of the first interface and the parameters such as the display position, the display style and the display size of the first control are not limited in the application.
Step 3033a, responsive to a first operation of the first control, converts all of the plurality of storage areas to a second storage medium.
The specific implementation of the first operation may be referred to as a description of the operation of the control 1003 in the interface 12 shown in (b) in fig. 6.
The first operation of the first control is received, which indicates that the user agrees to convert all of the plurality of storage areas in the first storage medium into the second storage medium, and therefore the electronic device can convert all of the plurality of storage areas into the second storage medium.
In some embodiments, when the current amount of user data is less than the third amount, displaying the first interface includes:
And when the current user data amount is smaller than the third amount, displaying a second interface, wherein the second interface comprises a second control, the second control is used for reminding the user that the data stored in the memory is at risk of losing and used for triggering and displaying the first control, and the first interface is displayed in response to a second operation of the second control.
The specific implementation of the second interface may be referred to as a related description of the interface 11 shown in fig. 6 (a).
A specific implementation of the second control may be found in the relevant description of control 1001 in interface 11 shown in fig. 6 (a).
A specific implementation of the second operation may be found in the description of the operation of control 1001 in interface 11 shown in fig. 6 (a).
It should be understood that the second interface is taken as the interface 11, the second control is taken as the control 1001 for illustration, and the specific implementation manner of the second interface and the parameters such as the display position, the display style and the display size of the second control are not limited in the application.
Specifically, when the current user data amount is smaller than the third amount, the electronic device may display a second interface, remind the user of the risk of losing the data stored in the memory through the content in the second control in the second interface, and provide the user with a function of converting the first storage medium into the second storage medium through the second control.
The text content in the second control for reminding the user of the loss risk of the data stored in the memory is not particularly limited.
In other embodiments, when the current amount of user data is equal to the second amount, all of the plurality of storage areas are converted to a second storage medium, comprising:
Step 3031b, when the current user data amount is equal to the second amount, it is determined whether the current user data amount is less than the third amount.
Step 3032b, when the current user data amount is greater than or equal to the third amount, displaying a third interface, where the third interface includes a third control, where the third control is configured to trigger all conversion of the plurality of storage areas into the second storage medium when deleting or backing up the fourth amount of current user data, and the fourth amount is greater than or equal to the fifth amount, where the fifth amount is an amount corresponding to a difference between the storage capacity of the second storage medium and the current user data amount when all the plurality of storage areas are converted into the second storage medium.
The specific implementation of the third interface may be referred to as a related description of the interface 13 shown in (a) of fig. 7.
A specific implementation of the third control may be found in the relevant description of control 1006 in interface 13 shown in fig. 7 (a).
It should be understood that the third interface is taken as the interface 13, and the third control is taken as the control 1006 for illustration, and the specific implementation manner of the third interface and the parameters such as the display position, the display style and the display size of the third control are not limited in the application.
As an example of the fifth number, if the first storage medium is QLC, the second storage medium is TLC, the current storage capacity of QLC is 400GB, the storage density of TLC is 3/4 of QLC, after QLC is converted into TLC, the storage capacity of TLC becomes 100GB, and the current user data is 200GB, then the fifth number is 200GB-100 gb=100 GB.
Based on this, the fourth amount is greater than or equal to the fifth amount, then the fourth amount is greater than or equal to 100GB.
It may be appreciated that when deleting or backing up the fourth amount of current user data, the second storage medium may store the fourth amount of current user data completely when all of the plurality of storage areas are converted into the second storage medium, so the electronic device needs to delete or backing up the fourth amount of current user data, and the electronic device may not be able to convert all of the plurality of storage areas into the second storage medium, otherwise, the electronic device may not be able to convert all of the plurality of storage areas into the second storage medium.
Step 3033b, responsive to a third operation on the third control, deletes or backs up the fourth amount of current user data and converts all of the plurality of storage areas to the second storage medium.
When the current user data amount is greater than or equal to the third amount, if the first storage medium is directly converted into the second storage medium, the storage capacity becomes smaller, and the current user data cannot be stored in the second storage medium entirely.
Therefore, the fourth amount of current user data needs to be deleted or backed up before the electronic device can fully convert the plurality of storage areas into the second storage medium.
In some embodiments, when the current amount of user data is greater than or equal to the third amount, displaying a third interface includes:
And when the current user data amount is greater than or equal to the third amount, displaying a fourth interface, wherein the fourth interface comprises a fourth control, the fourth control is used for reminding the user that the data stored in the memory is at risk of losing and used for triggering the display of the third control, and the third interface is displayed in response to the fourth operation of the fourth control.
The fourth interface may be the same as or different from the second interface.
In the case where the fourth interface is identical to the second interface, the detailed implementation of the fourth interface can be seen from the description of the interface 11 shown in fig. 6 (a).
A specific implementation of the fourth control may be found in the relevant description of control 1001 in interface 11 shown in fig. 6 (a).
Specifically, when the current user data amount is greater than or equal to the third amount, the electronic device may display a fourth interface, remind the user of the risk of losing the data stored in the memory through the content in the fourth control in the fourth interface, and provide the user with a function of converting the first storage medium into the second storage medium through the fourth control.
It should be understood that the fourth interface is taken as the interface 11, the fourth control is taken as the control 1001 for illustration, and the specific implementation manner of the fourth interface and the parameters such as the display position, the display style and the display size of the fourth control are not limited in the application.
In some embodiments, in response to a third operation on the third control, deleting a fourth amount of current user data and converting all of the plurality of storage areas to the second storage medium, comprising:
The method comprises the steps of responding to a third operation on a third control, displaying a fifth interface, wherein the fifth interface comprises a fifth control and current user data stored in a memory, the fifth control is used for triggering deletion of the current user data, responding to the fifth operation on the fifth interface, determining selected data in the current user data, wherein the data amount of the selected data is larger than or equal to a fourth amount, responding to a sixth operation on the fifth control, deleting the selected data, and converting all the multiple storage areas into a second storage medium.
The specific implementation of the fifth interface may be referred to in fig. 7 (b) for a description of the interface 14.
A specific implementation of the fifth control may be found in the associated description of control 1009 in interface 14 shown in fig. 7 (b).
A specific implementation of the sixth operation may be found in the description of the operation of control 1009 in interface 14 shown in fig. 7 (b).
After determining the selected data in the current user data, the electronic device may delete the selected data when receiving the operation (sixth operation) of the fifth control by the user.
It should be understood that, the fifth interface is taken as the interface 14, and the fifth control is taken as the control 1009 for illustration, and the specific implementation manner of the fifth interface and the parameters such as the display position, the display style and the display size of the fifth control are not limited in the present application.
Wherein the fifth operation may be implemented in a variety of ways.
The fifth operation includes a long-press operation and a click operation, for example, a long-press operation is performed on current user data displayed in the fifth interface, a selection frame may be displayed on a folder corresponding to the current user data, and when an operation on the selection frame by a user is received, the electronic device may determine that the user data corresponding to the selection frame is selected data.
The fifth operation may be a voice operation, for example, a voice assistant is added in the electronic device, after receiving a specific wake-up word input by the user voice, the voice assistant may wake up, and when receiving an operation of selecting user data that the user wants to select from among the current user data input by the user voice, the electronic device may determine that the user data corresponding to the selection box is selected data.
In some embodiments, the fifth interface further includes a sixth control, where the sixth control is configured to trigger backup of the current user data to the first device, the first device is a different device than the electronic device, backup a fourth amount of the current user data, and convert all of the plurality of storage areas to a second storage medium, and includes:
And in response to a seventh operation on the sixth control, backing up the selected data to the first device and converting all of the plurality of storage areas into the second storage medium.
The specific implementation of the sixth control may be referred to in fig. 7 (b) for a description of the control 1010 in the interface 14. A specific implementation of the seventh operation may be found in the description of the operation of control 1010 in interface 14 shown in fig. 7 (b).
It should be understood that the sixth control is taken as the control 1010 for illustration, and the present application is not limited to the parameters of the display position, the display style, the display size, etc. of the sixth control.
After determining the selected data in the current user data, the electronic device may backup the selected data to the first device upon receiving the operation (seventh operation) of the sixth control by the user.
The first device may be a cloud server, a mobile phone, a tablet computer, a vehicle-mounted device, a notebook computer, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a smart car, a smart television, a robot, and the like.
The present application is not limited to the specific form of the first device.
S304, marking the second storage medium by adopting the first mark.
When the electronic device is activated, the second storage medium is in a state of gradually converting into the first storage medium, the storage capacity of the first storage medium is gradually increased, and the storage capacity of the second storage medium is gradually reduced.
That is, after converting the first storage medium into the second storage medium, the electronic device may still convert the second storage medium into the first storage medium again.
Based on the above description, one of the conditions of converting the first storage medium into the second storage medium is that the number of times of erasing the first storage area in the plurality of storage areas in the first storage medium is greater than or equal to the maximum number of times of erasing the first storage medium, in other words, one of the conditions of converting the first storage medium into the second storage medium is that the first storage area has reached the service life, there is a risk of charge loss, and the charge loss may cause an abnormality in the data storage capacity of the flash memory, and the electronic device cannot be normally used.
If the first storage medium is converted into the second storage medium, the electronic device converts the second storage medium into the first storage medium again, the electronic device stores data by adopting the first storage medium again, and the memory still has the risk of charge loss, so that the data storage is abnormal, therefore, after all the plurality of storage areas are converted into the second storage medium, the second storage medium needs to be marked by adopting the first identifier, so that preparation is made for stopping converting the second storage medium into the first storage medium.
The form of the first mark is not particularly limited in the present application.
S305, according to the first identification, stopping converting the second storage medium into the first storage medium.
After the first identifier is adopted to mark the second storage medium, the electronic equipment can stop converting the second storage medium into the first storage medium according to the first identifier, so that the situation that the data storage capacity is abnormal due to converting the second storage medium into the first storage medium again can be avoided.
For example, if the first storage medium is a QLC and the second storage medium is a TLC, the electronic device may label the TLC with the first identifier when converting the QLC into the TLC, and thus, the electronic device may stop converting the TLC into the QLC according to the first identifier.
S306, converting the first storage area into a second storage medium when the current user data amount is smaller than the second amount.
When the current user data amount is smaller than the second amount, the current user data does not store the first storage medium and the second storage medium which are full of the current storage capacity, so that the electronic device does not need to convert all of a plurality of storage areas in the first storage medium into the second storage medium, and can convert the first storage area into the second storage medium, and the service life of the whole memory can be prolonged.
In addition, since the number of times of erasing of only the first storage area in the plurality of storage areas in the first storage medium is greater than or equal to the maximum number of times of erasing of the first storage medium, that is, the service life is reached, other storage areas except the first storage area in the first storage device have not reached the service life yet, and other storage areas except the first storage area can be used continuously, so that the storage capacity of the storage device is ensured.
For example, when the first storage medium is QLC and the second storage medium is TLC, the first number is 1300 times, the first storage medium includes 5 storage areas, which are respectively storage areas Q1, Q2, Q3, Q4, and Q5, if the number of times of erasing Q3 in Q1, Q2, Q3, Q4, and Q5 is 1300 times, it is determined that the storage area Q3 reaches the service life, and at this time, if the current user data amount is 400GB, the current total storage capacity of QLC and TLC is 500GB, the current user data amount is smaller than the second number, and the electronic device converts Q3 into the second storage medium.
For example, when the first storage medium is QLC, the second storage medium includes SLC and TLC, the first number is 1300 times, the first storage medium includes 5 storage areas, which are storage areas Q1, Q2, Q3, Q4 and Q5, respectively, if the number of times of erasing of any Q3 of Q1, Q2, Q3, Q4 and Q5 is equal to 1300 times, it is determined that the storage area Q3 reaches the service life, and at this time, if the current user data size is 400GB, the current total storage capacity of SLC, QLC and TLC is 500GB, the current user data size is smaller than the second number, and the electronic device converts Q3 into the second storage medium.
S307, marking the second storage medium corresponding to the first storage area by adopting the second identification.
When the electronic device is activated, the second storage medium is in a state of gradually converting into the first storage medium, the storage capacity of the first storage medium is gradually increased, and the storage capacity of the second storage medium is gradually reduced.
That is, after converting the first storage medium into the second storage medium, the electronic device may still convert the second storage medium into the first storage medium again.
Because one of the conditions of converting the first storage area into the second storage medium is that the number of times of erasing the first storage area in the first storage medium is greater than or equal to the maximum number of times of erasing the first storage medium, in other words, one of the conditions of converting the first storage area into the second storage medium is that the first storage area has reached the service life, there is a risk of charge loss, and the charge loss may cause an abnormal data storage capacity of the flash memory, and the electronic device cannot be used normally.
If the first storage area is converted into the second storage medium, the electronic device converts the second storage medium into the first storage medium again, the electronic device stores data through the first storage area again, and the memory still has the risk of charge loss, so that the data storage is abnormal, and therefore, after the first storage area is converted into the second storage medium, the second storage medium corresponding to the first storage area needs to be marked by adopting the second identifier, so that preparation is made for stopping converting the second storage medium corresponding to the first storage area into the first storage medium.
For example, when the first storage medium is QLC and the second storage medium is TLC, the first number is 1300 times, the first storage medium includes 5 storage areas, and the storage areas are respectively Q1, Q2, Q3, Q4, and Q5, if the number of times of erasing Q3 in Q1, Q2, Q3, Q4, and Q5 is equal to 1300 times, it is determined that the storage area Q3 reaches the service life, and at this time, if the current user data amount is 400GB, the current total storage capacity of QLC and TLC is 500GB, the current user data amount is smaller than the second number, the electronic device converts Q3 into the second storage medium, and marks Q3 with the second identifier.
The form of the second mark is not particularly limited, and the form of the second mark and the form of the first mark can be the same or different.
And S308, according to the second identification, stopping converting the second storage medium corresponding to the first storage area into the first storage medium.
After the second identifier is adopted to mark the first storage area, the electronic equipment can stop converting the second storage medium corresponding to the first storage area into the first storage medium according to the second identifier, so that the situation that the data storage capacity is abnormal due to the fact that the second storage medium is converted into the first storage medium again can be avoided.
For example, when the first storage medium is QLC and the second storage medium is TLC, the first number is 1300, and the first storage medium includes 5 storage areas, which are storage areas Q1, Q2, Q3, Q4, and Q5, respectively, if the number of times of erasing Q3 is equal to 1300, and the current user data size is 400GB, the current total storage capacity of QLC and TLC is 500GB, the current user data size is smaller than the second number, and the electronic device converts Q3 into the second storage medium, and marks Q3 with the second identifier, so that the electronic device may stop converting TLC into QLC according to the second identifier.
It should be noted that S301 to S308 may be regarded as a case where the number of times of erasing of one storage area is greater than or equal to the first number of times of erasing of a plurality of storage areas in the first storage medium, that is, when the number of times of erasing of one storage area is greater than or equal to the first number of times of erasing of a plurality of storage areas, the electronic device may determine whether the current user data amount stored in the memory is equal to the second number, and if the current user data amount is equal to the second number, the electronic device may convert all of the plurality of storage areas into the second storage medium.
If the current amount of user data is less than the second amount, the electronic device may convert the first storage area to a second storage medium.
After the current user data amount is smaller than the second amount, the electronic device may continuously record the erasing times of other storage areas in the plurality of storage areas after converting the first storage area into the second storage medium, and when the erasing times of one storage area appears again to be larger than or equal to the first amount, the electronic device may determine again whether the current user data amount stored in the memory is equal to the second amount, and if the current user data amount is equal to the second amount, the electronic device may completely convert the plurality of storage areas into the second storage medium.
If the current user data amount is smaller than the second amount, the electronic device can convert the storage area with the reappearance erasing times larger than or equal to the first amount into a second storage medium.
If the second storage medium includes two types of storage media, the number of times of erasing of a storage area occurring in the plurality of storage areas in the first storage medium is greater than or equal to the first number, and the current user data amount is equal to the second number, the electronic device may convert all of the plurality of storage areas into a storage medium of a high level in the second storage medium.
If the current amount of user data is less than the second amount, the electronic device may convert the first storage area to a higher-level storage medium of the second storage medium.
After the current user data amount is equal to the second amount, the electronic device may continuously record the number of times of erasing of each storage area in the high-level storage medium in the second storage medium after all the plurality of storage areas are converted into the high-level storage medium in the second storage medium, and when the number of times of erasing of any one storage area is greater than or equal to the maximum number of times of erasing of the high-level storage medium in the second storage medium, and the current user data amount is equal to the second amount, the electronic device may convert the high-level storage medium in the second storage medium into the low-level storage medium in the second storage medium.
For example, when the first storage medium is QLC and the second storage medium is TLC, the first number is 1300 times, the first storage medium includes 5 storage areas, which are storage areas Q1, Q2, Q3, Q4, and Q5, respectively, and if the number of times of erasing Q3 is equal to 1300 times, the electronic device may determine whether the current user data amount is equal to the second number, and if the current user data amount is 500GB, the current total storage capacity of QLC and TLC is 500GB, the current user data amount is equal to the second number, and the electronic device converts all of Q1, Q2, Q3, Q4, and Q5 into TLC.
If the current user data size is 400GB and the current total storage capacity of the QLC and the TLC is 500GB, the current user data size is smaller than the second number, and the electronic equipment converts Q3 into the TLC.
Then, the electronic device may continue recording the number of times of erasing other storage areas in the plurality of storage areas in the QLC through the first function, if the number of times of erasing Q2 is equal to 1300 times, the electronic device may determine whether the current user data amount is equal to the second number, if the current user data amount is 600GB, the current total storage capacity of the QLC and TLC is 600GB, the current user data amount is equal to the second number, and the electronic device converts all of Q1, Q2, Q4, and Q5 into TLC.
If the current user data size is 500GB and the current total storage capacity of the QLC and the TLC is 600GB, the current user data size is smaller than the second number, and the electronic equipment converts Q2 into the TLC.
For example, when the first storage medium is QLC, the second storage medium includes TLC and SLC, the maximum number of times of erasability of the QLC is 1300, the maximum number of times of erasability of the TLC is 3000, the QLC includes Q1, Q2, Q3, Q4 and Q5, and when the number of times of erasability of the Q3 is 1300, the electronic device may determine whether the current user data amount is equal to the current total storage capacity of the QLC, TLC and SLC, and if the current user data amount is 500GB, the current total storage capacity of the QLC, TLC and SLC is 500GB, and the current user data amount is equal to the current total storage capacity of the QLC, TLC and SLC, the electronic device converts all of Q1, Q2, Q3, Q4 and Q5 into TLC.
Next, when the TLC includes T1, T2, T3, T4, and T5, and 5 storage areas, if the number of times of erasing of T2 is equal to 3000, the electronic device may determine whether the current user data amount is equal to the current total storage capacity of TLC and SLC, if the current user data amount is 500GB, the current total storage capacity of TLC and SLC is 500GB, and the current user data amount is equal to the current total storage capacity of TLC and SLC, the electronic device converts all of T1, T2, T3, T4, and T5 into SLC.
If the current user data size is 500GB and the current total storage capacity of the QLC, the TLC and the SLC is 600GB, the current user data size is smaller than the second number, and the electronic equipment only converts Q3 into TLC.
In the application, when the current user data quantity is smaller than the second quantity, the current user data is not stored in the current first storage medium and the second storage medium, and the electronic equipment can only convert the first storage area into the second storage medium without converting all the plurality of storage areas in the first storage medium into the second storage medium, so that the service life of the whole memory can be prolonged, and as the service life of other storage areas except the first storage area in the first memory is not reached, the user data can be stored in the other storage areas except the first storage area continuously, thereby ensuring the storage capacity of the memory.
After the first storage area is converted into the second storage medium, if the electronic device converts the second storage medium into the first storage medium again, the electronic device can store data through the first storage area again, and there is still a risk of charge loss, so that data storage is abnormal, and therefore, after the first storage area is converted into the second storage medium, the conversion of the second storage medium corresponding to the first storage area into the first storage medium is stopped.
In addition, when the current user data amount is equal to the second amount, the current user data is stored in the current first storage medium and the second storage medium, the risk of losing a large amount of user data is high, and the electronic device can completely convert the plurality of storage areas into the second storage medium. After the first storage area is converted into the second storage medium, if the electronic device converts the second storage medium into the first storage medium again, the electronic device may use the first storage medium again to store data, and there is still a risk of charge loss, so that data storage is abnormal, and therefore, after all of the plurality of storage areas are converted into the second storage medium, the conversion of the second storage medium into the first storage medium needs to be stopped.
In addition, when the erasing times of the first storage area in the first storage medium is greater than or equal to the maximum erasable times of the first storage medium, and the current user data amount is equal to the current total storage capacity of the first storage medium and the second storage medium, the electronic equipment can make relevant reminding to a user through an interface, and instruct the user to convert the first storage medium into the second storage medium according to the operation reminding on the interface, so that the user can know the result and benefit of the scheme of converting the first storage medium into the second storage medium, and the user can determine whether to convert the first storage medium into the second storage medium or not, and the use experience of the user is ensured.
The application also provides a storage medium conversion device of the memory.
Next, a storage medium conversion device of a memory according to an embodiment of the present application will be described in detail with reference to fig. 13.
Referring to fig. 13, fig. 13 is a schematic block diagram illustrating a storage medium conversion apparatus of a memory according to an embodiment of the present application.
As shown in fig. 13, the storage medium conversion apparatus of the memory may be integrated in an electronic device to implement the operations corresponding to the electronic device in the embodiments of the method described above, and the storage medium conversion apparatus 400 of the memory of the present application may include a start module 401, a determination module 402, and a conversion module 403.
A starting module 401, configured to start a first function when the electronic device is activated, where the first function is used to record the erasing times of each storage area in the plurality of storage areas;
A determining module 402, configured to determine, when the number of times of erasing of a first storage area of the plurality of storage areas is greater than or equal to a first number, whether the current user data amount stored in the memory satisfies a first condition, where the first storage area is any one of the plurality of storage areas in the first storage medium, the first number is a maximum number of times of erasing of the first storage medium, and the first condition is related to a current total storage capacity of the first storage medium and the second storage medium;
a conversion module 403, configured to convert the first storage medium into the second storage medium when the current user data amount satisfies the first condition.
In some embodiments, the first condition includes the current amount of user data being less than or equal to a second amount, the second amount being a current total storage capacity of the first storage medium and the second storage medium, the determining module 402 being specifically configured to:
When the number of times of erasing of a first storage area of the plurality of storage areas is greater than or equal to a first number, it is determined whether the current amount of user data stored in the memory is equal to a second number.
In some embodiments, the conversion module 403 is specifically configured to:
and converting the first storage area into the second storage medium when the current user data amount is less than the second amount.
In some embodiments, the conversion module 403 is specifically configured to:
And stopping converting the second storage medium into the first storage medium, wherein when the electronic equipment is activated, the second storage medium is in a state of gradually converting into the first storage medium, the storage capacity of the first storage medium is gradually increased, and the storage capacity of the second storage medium is gradually reduced.
In some embodiments, the conversion module 403 is specifically configured to:
and stopping converting the second storage medium into the first storage medium according to the first identification.
In some embodiments, the conversion module 403 is specifically configured to:
and stopping converting the second storage medium corresponding to the first storage area into the first storage medium.
In some embodiments, the conversion module 403 is specifically configured to:
And stopping converting the second storage medium corresponding to the first storage area into the first storage medium according to the second identification.
In some embodiments, the starting module 401 is specifically configured to:
when the electronic device is activated, a first function of a register of a first storage medium is started, and when the number of times of erasing of a first storage area in a plurality of storage areas is larger than or equal to a first number, whether the current user data amount stored in the memory meets a first condition is determined, wherein when the number of times of erasing of the first storage area recorded by the register is larger than or equal to the first number, whether the current user data amount stored in the memory meets the first condition is determined.
In some embodiments, the conversion module 403 is specifically configured to:
When the current user data amount is smaller than the third amount, a first interface is displayed, the first interface comprises a first control, the first control is used for triggering the whole conversion of the plurality of storage areas into the second storage medium, and the first operation of the first control is responded to the whole conversion of the plurality of storage areas into the second storage medium.
In some embodiments, the conversion module 403 is specifically configured to:
and when the current user data amount is smaller than the third amount, displaying a second interface, wherein the second interface comprises a second control, the second control is used for reminding the user of losing risk of the current user data stored in the user memory and used for triggering and displaying the first control, and the first interface is displayed in response to a second operation of the second control.
In some embodiments, the conversion module 403 is specifically configured to:
When the current user data amount is greater than or equal to the third amount, the third interface is displayed, the third interface comprises a third control, the third control is used for triggering all conversion of the plurality of storage areas into the second storage medium when deleting or backing up the current user data stored in the fourth amount of storage, the fourth amount is greater than or equal to the fifth amount, the fifth amount is an amount corresponding to the difference between the storage capacity of the second storage medium and the current user data amount when all the plurality of storage areas are converted into the second storage medium, and the fourth amount of current user data is deleted or backed up and all the plurality of storage areas are converted into the second storage medium in response to the third operation of the third control.
In some embodiments, the conversion module 403 is specifically configured to:
And when the current user data amount is greater than or equal to the third amount, displaying a fourth interface, wherein the fourth interface comprises a fourth control, the fourth control is used for reminding the user that the current user data stored in the user memory has loss risk and used for triggering the third control to be displayed, and responding to fourth operation of the fourth control, displaying the third interface.
In some embodiments, the conversion module 403 is specifically configured to:
The method comprises the steps of responding to a third operation on a third control, displaying a fifth interface, wherein the fifth interface comprises a fifth control and current user data stored in a memory, the fifth control is used for triggering deletion of the current user data, responding to the fifth operation on the fifth interface, determining selected data in the current user data, wherein the data amount of the selected data is larger than or equal to a fourth amount, responding to a sixth operation on the fifth control, deleting the selected data, and converting all the multiple storage areas into a second storage medium.
In some embodiments, the fifth interface further includes a sixth control, where the sixth control is configured to trigger backup of the current user data to the first device, and the first device is a different device from the electronic device, and the conversion module 403 is specifically configured to:
And in response to a seventh operation on the sixth control, backing up the selected data to the first device and converting all of the plurality of storage areas into the second storage medium.
In some embodiments, the first storage medium comprises any one level of storage medium among a multi-level unit storage medium, a three-level unit storage medium, a four-level unit storage medium, and a five-level unit storage medium, and the second storage medium comprises any one or more levels of storage medium among a one-level unit storage medium, a multi-level unit storage medium, a three-level unit storage medium, and a four-level unit storage medium.
In some embodiments, the memory is any one of a general purpose flash memory, an embedded multimedia card, a general purpose flash memory multi-chip package memory, a solid state disk, and an embedded multimedia card multi-chip package memory.
The present application provides, for example, an electronic device comprising one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the storage medium conversion method of the memory in the previous embodiments.
The present application provides, as an example, a chip system including a processor for calling and running a computer program from a memory, so that an electronic device mounted with the chip system performs the storage medium conversion method of the memory in the foregoing embodiment.
The present application illustratively provides a computer-readable storage medium comprising a computer program which, when run on an electronic device, causes the electronic device to perform a storage medium conversion method implementing the memory in the previous embodiments.
The present application illustratively provides a computer program product which, when run on a computer, causes the computer to perform the storage medium conversion method of the memory in the previous embodiments.
In the above-described embodiments, all or part of the functions may be implemented by software, hardware, or a combination of software and hardware. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer codes or instructions. When the computer program code or instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer code or instructions may be stored in a computer readable storage medium. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more available media. Usable media may be magnetic media (e.g., floppy disks, hard disks, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., solid State Disk (SSD)) or the like.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. The storage medium includes a Read Only Memory (ROM) or a random access memory (random access memory, RAM), a magnetic disk or an optical disk, and the like, which can store program codes.