WO2020186455A1 - Data storage method and storage chip - Google Patents

Data storage method and storage chip Download PDF

Info

Publication number
WO2020186455A1
WO2020186455A1 PCT/CN2019/078724 CN2019078724W WO2020186455A1 WO 2020186455 A1 WO2020186455 A1 WO 2020186455A1 CN 2019078724 W CN2019078724 W CN 2019078724W WO 2020186455 A1 WO2020186455 A1 WO 2020186455A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage
storage area
fast
chip
data amount
Prior art date
Application number
PCT/CN2019/078724
Other languages
French (fr)
Chinese (zh)
Inventor
金龙
周伟伟
商捷
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2019/078724 priority Critical patent/WO2020186455A1/en
Priority to CN201980094038.0A priority patent/CN113574497A/en
Publication of WO2020186455A1 publication Critical patent/WO2020186455A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • This application relates to the field of chip technology, and in particular to a data storage method and a storage chip.
  • basic indicators for measuring the basic performance of a storage device of a terminal device may include sequential reading, sequential writing, random reading, and random writing.
  • typical scenarios of storage experience that users can perceive when using terminal devices are application cold start scenarios.
  • the application cold start speed is strongly correlated with random reading indicators.
  • the cold start of an application not only occurs when the user starts the application for the first time, but may also occur when the application exits to the background, is kicked out due to insufficient memory, and is switched back to the foreground by the user again.
  • the embodiment of the present application discloses a data storage method and a storage chip, which can effectively improve the response speed of the application.
  • an embodiment of the present application discloses a data storage method, the method is applied to a memory chip, and the method includes: acquiring the effective data amount of a fast storage area, and the storage form of the data in the fast storage area is the first A storage form; in the case where the effective data amount of the fast storage area is greater than the first threshold, the fast storage area is converted to a normal storage area, and the storage form of the data in the normal storage area is the second storage form .
  • the storage chip includes a fast storage area to improve the response speed of the application; and when the effective data amount in the fast storage area is too large, such as greater than the first threshold, it indicates that the main chip (also referred to as the host Side, etc.) The space to be used is getting larger and larger.
  • the memory chip can switch the storage form, that is, the memory chip can convert the first storage form of the data in the fast storage area into the second storage form of the data in the ordinary storage area. Second, storage form, so as to expand the physical space of the storage chip without sacrificing the user's visible logical space. It can be understood that the fast storage area is different from the ordinary storage area in the storage form of data.
  • the storage form of data in the fast storage area is the first storage form
  • the storage form of data in the ordinary storage area is the second storage form. That is to say, when the storage form in the storage chip is converted, the names of the storage areas in the storage chip can be mutually converted.
  • the method further includes: acquiring the effective data amount of the ordinary storage area; in the case that the effective data amount of the ordinary storage area is less than a second threshold, The normal storage area is converted into the fast storage area.
  • the storage chip when the effective data amount in the common storage area is less than the second threshold, it indicates that the space to be used by the main chip may be reduced. At this time, the storage chip can store data in the common storage area in the second storage mode. It is converted into the first storage form of data in the fast storage area, thereby improving the response speed of related data in the storage area of the memory chip.
  • the storage form of the data in the storage chip is converted mutually through the effective data amount in the fast storage area or the normal storage area in the storage chip. Therefore, when the application-related data is stored in the storage chip, the storage mode can be changed as needed. For example, the storage mode can be switched between the first storage mode and the second storage mode. It is understandable that the two storage modes are different Therefore, the read and write speeds of the first storage mode and the second storage mode are also different.
  • the read and write speed of the first storage form is greater than that of the second storage form, and when the second storage form is converted to the first storage form (that is, the normal storage area is converted to a fast storage area), the storage The read performance of the data in the chip is improved, and the response speed of the application is improved.
  • the first storage form is converted to the second storage form (that is, the fast storage area is converted to a normal storage area)
  • the physical storage space of the storage chip can be effectively increased, so that more data can be cached or stored in the storage chip .
  • the data stored in the storage chip may not only include data related to various applications (application, APP), but also include key databases, file system metadata, and data related to the virtual memory exchange mechanism. And so on, the embodiment of this application does not limit the data stored in the memory chip. Further, the data listed above can be stored in the fast storage area of the memory chip.
  • the read and write speeds of the first storage form and the second storage form are different, as in the first storage form.
  • the read and write speed of one storage form is greater than that of the second storage form.
  • the read and write response speed of the fast storage area is different from that of the ordinary storage area.
  • the read and write response speed of the fast storage area is greater than that of ordinary storage.
  • the read and write response speed of the area is greater than that of ordinary storage.
  • converting the fast storage area into a normal storage area includes : In the case where the effective data amount of the fast storage area is greater than the first threshold, according to the size of the effective data amount of the fast storage area and the storage space of the first storage form and the second storage form The conversion relationship converts the fast storage area into the normal storage area.
  • the conversion when converting the fast storage area to the normal storage area, the conversion can be performed according to the user's usage, that is, according to the usage of the data in the storage chip; more specifically, according to the usage of the data and the storage space
  • the relationship converts the fast storage area to the normal storage area; thus avoiding the situation that the area is converted too large and not effectively used.
  • the ordinary storage area in the case that the effective data amount of the ordinary storage area is less than a second threshold, the ordinary storage area is converted into the fast storage area , Including: in the case that the effective data amount of the ordinary storage area is less than the second threshold, according to the size of the effective data amount of the ordinary storage area and the difference between the first storage form and the second storage form
  • the storage space conversion relationship converts the ordinary storage area into the fast storage area.
  • the conversion when converting a normal storage area to a fast storage area, the conversion can be based on the user's usage, that is, according to the usage of the data in the storage chip; more specifically, the conversion can be based on the usage of the data and the storage space
  • the relationship converts the ordinary storage area into the fast storage area; thereby avoiding the situation that the data cannot be stored or cached due to the conversion of too many fast storage areas.
  • the converting the ordinary storage area into the fast storage area includes: the case where the wear times of the fast storage area is less than the wear times threshold Next, convert the normal storage area into the fast storage area.
  • the normal storage area and the fast storage area that is, the first storage mode and the second storage mode, can be converted mutually within the range of the wear frequency threshold.
  • the method further includes: in the case that the wear times of the fast storage area is not less than the wear times threshold, complete the fast storage area Converted to the normal storage area.
  • the precondition that the fast storage area and the ordinary storage area can be interchanged may be that the wear times of the fast storage area are less than the wear times threshold, and if the wear times of the fast storage area exceeds the wear times threshold, the fast storage area The storage area cannot be converted to the ordinary storage area, that is, the fast storage area will be completely converted into the ordinary storage area, that is, the first storage form can be completely converted into the second storage form.
  • the method before the obtaining the effective data amount of the fast storage area, the method further includes: allocating the storage chip to the storage chip according to the usage of the application data Fast storage area.
  • the storage chip can allocate a fast storage area based on user application behavior analysis, so that the size of the fast storage area can be more in line with the user's usage, that is, it can be more in line with the data in the storage chip. Storage usage.
  • the first storage form and the second storage form belong to different storage forms of the same storage medium.
  • the first storage form includes a single-level cell (SLC), and the second storage form includes a three-level storage cell (trinary cell).
  • -level cell, TLC or, the first storage form includes SLC
  • the second storage form includes multi-level cell (MLC); or, the first storage form includes MLC, so
  • the second storage form includes TLC; or, the first storage form includes SLC, and the second storage form includes four-layer memory cells QLC.
  • an embodiment of the present application discloses a memory chip, including: an acquiring unit configured to acquire the effective data amount of a fast storage area, the storage form of the data in the fast storage area is the first storage form; a conversion unit, When the effective data amount of the fast storage area is greater than the first threshold, the fast storage area is converted into a normal storage area, and the storage form of the data in the normal storage area is the second storage form.
  • the acquiring unit is further configured to acquire the effective data amount of the ordinary storage area; the conversion unit is further configured to obtain valid data in the ordinary storage area If the amount is less than the second threshold, the normal storage area is converted to the fast storage area.
  • the conversion unit is specifically configured to: when the effective data amount of the fast storage area is greater than the first threshold, according to the fast storage.
  • the size of the effective data amount of the area and the storage space conversion relationship between the first storage form and the second storage form convert the fast storage area into the normal storage area.
  • the conversion unit is specifically configured to, when the effective data amount of the common storage area is less than the second threshold, perform according to the common storage
  • the size of the effective data amount of the area and the storage space conversion relationship between the first storage form and the second storage form convert the ordinary storage area into the fast storage area.
  • the conversion unit is specifically configured to convert the ordinary storage area into a case where the wear count of the fast storage area is less than the wear count threshold.
  • the fast storage area is specifically configured to convert the ordinary storage area into a case where the wear count of the fast storage area is less than the wear count threshold.
  • the conversion unit is further configured to store the fast storage area when the wear times of the fast storage area are not less than the wear times threshold. The area is completely converted into the normal storage area.
  • the storage chip further includes: an allocation unit configured to allocate the fast storage area to the storage chip according to a usage situation of application data.
  • the first storage form and the second storage form belong to different storage forms of the same storage medium.
  • the first storage format includes SLC, and the second storage format includes TLC; or, the first storage format includes SLC, and the second storage format includes SLC.
  • the storage format includes MLC; or, the first storage format includes MLC, and the second storage format includes TLC.
  • an embodiment of the present application discloses a memory chip including a controller and a memory array (such as a NAND flash array), and the controller is configured to execute the method described in the first aspect.
  • an embodiment of the present application discloses a terminal device.
  • the terminal device includes a processor and a storage chip.
  • the processor is used to read and write data by interacting with the storage chip. Perform the method described in the first aspect above.
  • the embodiments of the present application provide a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when the instructions run on a computer, the computer executes the methods described in the above aspects .
  • the embodiments of the present application provide a computer program product including instructions, which when the computer program product runs on a computer, cause the computer to execute the methods described in the foregoing aspects.
  • FIG. 1 is a schematic structural diagram of a main chip provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a memory chip provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data storage method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a scene of a data storage method provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a memory chip provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another memory chip provided by an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of another terminal device provided by an embodiment of the present application.
  • the four basic indicators for measuring the basic performance of the mobile phone memory can include sequential read, sequential write, random read, and random write.
  • the typical scenarios of the storage experience that the user can perceive are often related to random reading. Therefore, how to improve the response speed of the cold start of the application when the user uses the mobile phone is a problem that is being studied by those skilled in the art.
  • a cold start can be understood as the user launching the application for the first time, or a cold start can also be understood as the application retreating from the foreground to the background, and the application is forcibly closed due to insufficient memory, but is called out of the foreground.
  • the boot described here can be understood as booting from the storage medium instead of booting from the memory.
  • the applications described in the embodiments of the present application not only refer to the APP installed in the terminal device, but can also refer to various operating system applications, and some other applications of the system in the terminal device. The understanding is not limited.
  • the data generated by some other applications of the system in the terminal device may be key databases, file system metadata, data related to the virtual memory exchange mechanism, and so on.
  • embodiments of the present application provide a data storage method and a storage chip.
  • Fig. 1 is a schematic structural diagram of a main chip provided by an embodiment of the present application.
  • the main chip can access the storage chip using a storage interface protocol, where the storage interface protocol can include universal flash storage (UFS) interface protocol, embedded multimedia (embedded multimedia card, EMMC) Interface protocol and high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE) interface protocol, etc.
  • UFS universal flash storage
  • EMMC embedded multimedia
  • PCIE peripheral component interconnect express
  • the embodiment of the present application does not limit the type of the storage interface protocol.
  • the following will take the UFS interface protocol as an example to illustrate the main chip and the storage chip involved in the embodiments of the present application.
  • the main chip may include a central processing unit (CPU), a UFS main controller, and a double data rate synchronous dynamic random access memory (DDR SDRAM) controller , DDR SDRAM memory, peripheral controllers and peripherals (peripherals).
  • CPU central processing unit
  • UFS main controller UFS main controller
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • DDR SDRAM memory DDR SDRAM memory
  • peripheral controllers peripherals
  • peripherals peripherals
  • the processor (that is, the main CPU) is used to read and write data by interacting with the storage chip.
  • the processor can be used to couple with the storage chip to execute program instructions stored in the storage chip and so on.
  • the processor can be used to run software running on the main chip such as operating systems, applications, and drivers.
  • the embodiment of the present application does not limit how the processor interacts with the storage chip.
  • the UFS main controller can be used to issue one or more of a read request and a write request conforming to the UFS protocol information unit (UPIU) protocol frame.
  • the UFS main controller can be used to issue a read request conforming to the UPIU protocol frame, thereby requesting to read the data stored in the memory chip.
  • the read request issued by the UFS main controller can be used to read data related to applications (such as hotspot applications or high-frequency applications) and stored in the storage chip.
  • the main chip can be used to couple with the storage chip, so as to read the data and instructions stored in the storage chip.
  • the storage chip includes a fast storage area and a normal storage area.
  • the main chip can read the data in the fast storage area or the normal storage area respectively as needed.
  • the main chip can issue a command according to the logical unit number (LUN) encapsulated in the UPIU protocol frame to access the fast storage area or the normal storage area in the storage chip.
  • LUN logical unit number
  • the DDR controller can be used to control the DDR.
  • the DDR controller can be used to control and update the mapping relationship between the logical address and the physical address in the DDR and so on.
  • Peripheral devices may include input and output interfaces, external memory, analog-to-digital converters, digital-to-analog converters, peripheral processors, and so on.
  • the peripheral device may include a touch screen, a camera, a fingerprint collection, a near field communication element, and various sensors, etc., the embodiment of the present application does not limit the peripheral device.
  • the peripheral device controller can be used to control the peripheral device.
  • the main chip may be chips of various forms, for example, the main chip may be integrated on a system-on chip (SOC).
  • the main chip can be applied to various terminal devices.
  • the main chip can be applied to a mobile phone or a notebook computer, etc., which is not limited in the embodiment of the present application.
  • the main chip shown in FIG. 1 is only an example provided by the embodiment of the present application, and the main chip may have more or less components than the components shown, and two or more components may be combined. Or it can have different configurations of different components and so on.
  • FIG. 2 is a schematic structural diagram of a memory chip provided by an embodiment of the present application, and the memory chip can be connected to the UPIU.
  • the memory chip includes a controller and a memory array such as a NAND flash array.
  • the controller and the storage array can be connected to each other through wires.
  • the controller is the core device of the memory chip, which can be used to rationally allocate the data load on each storage array, and the controller can also be used for data transfer, connecting the storage array and an external serial interface.
  • the controller may further include a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), or the hardware chip may also be a field programmable logic gate array (field programmable logic gate array). gate array, FPGA), etc., which are not limited in the embodiment of the present application.
  • ASIC application-specific integrated circuit
  • FPGA field programmable logic gate array
  • controller may include static random access memory (SRAM).
  • SRAM static random access memory
  • the storage chip can be a chip of various forms.
  • the storage chip can be applied to various storage devices.
  • the storage chip can be applied to a solid state disk (SSD), etc., which is not limited in the embodiment of the present application.
  • the memory chip can also be applied to various terminal devices, for example, the memory chip can be applied to a mobile phone or a notebook computer.
  • the storage chip may include application-related data or programs, etc., and the storage chip may also be divided into different areas, so that the divided areas store different data, and the storage chip Different storage formats or storage media can also be converted mutually. For specific conversion conditions, reference may be made to the method shown in FIG. 5 and/or FIG. 6, which will not be described in detail here.
  • the memory chip may be divided into a fast storage area and a normal storage area. More specifically, the storage array in the memory chip may include a fast storage area and a normal storage area. The fast storage area and the normal storage area have different access speeds. That is, the access speed of the fast storage area is greater than that of the ordinary storage area. It can be understood that, in the embodiment of the present application, the fast storage area can also be converted into a normal storage area. Therefore, the memory chip can be divided into a fast storage area and a first normal storage area. After the fast storage area is converted into a normal storage area, the normal storage area converted from the fast storage area can be understood as the second normal storage area.
  • the memory chip may include a first normal storage area and a second normal storage area.
  • the storage form of the fast storage area data can correspond to the first storage form
  • the storage form of the second general storage area data can correspond to the second storage form.
  • the storage form of the first general storage area data is not limited in this embodiment. It can be understood that, as specifically illustrated in the figure, the ordinary storage area in this application can be understood as the second ordinary storage area.
  • the fast storage area may be an area in NAND. It is understandable that the location of the fast storage area in the storage chip can be known by the main chip through LUN. It can be understood that the embodiment of the present application does not limit the specific location of the fast storage area in the storage chip.
  • the data stored in the fast storage area may include not only application-related data, but also key databases, file system metadata, and data related to the virtual memory exchange mechanism, etc.
  • the embodiment of the present application relates to the fast storage area
  • the stored data is not limited.
  • data related to hot applications can be stored in the fast storage area.
  • the hot applications can also be understood as high-frequency applications, that is, frequently used applications (APP) in terminal devices.
  • APP frequently used applications
  • the high-frequency applications can be understood as An application whose frequency of use exceeds the frequency threshold within a period of time, or the high-frequency application can also be understood as some applications defined by the user and so on.
  • the embodiments of this application do not limit how to define or set high-frequency applications.
  • the embodiment of the present application does not limit the specific type of the memory chip. It can be understood that the memory chip shown in FIG. 2 is only an example provided by the embodiment of the present application, and the memory chip may have more or fewer components than the components shown, and two or more components may be combined. Or it can have different configurations of different components and so on.
  • the fast storage area in the embodiments of the present application may also be referred to as a turbo zone, and the ordinary storage area may be referred to as a slow disk.
  • the slow disk is relative to the access speed of the fast disk.
  • the slow disk may also be called a normal disk, etc., which is not limited in the embodiment of the present application.
  • the terminal device may include a screen, a main chip and a memory chip.
  • the main chip may be the main chip shown in FIG. 1, for example, the main chip may include a screen controller, a peripheral device controller, a DDR, a DDR controller, a UFS host controller, a main CPU, and so on.
  • the memory chip may be the memory chip shown in FIG. 2, wherein the components included in the memory chip are not shown in FIG. 3. It can be understood that the terminal device shown in FIG. 3 also includes peripheral devices and so on.
  • the UFS main controller is connected to the storage chip, and the UFS main controller can be used to interact with the storage chip, so that the terminal device can read the data in the storage chip through the UFS main controller.
  • the main CPU may be used to issue a read request to the storage chip, thereby reading data in the storage chip. It can be understood that the embodiment of the present application does not limit the UFS main controller.
  • the device interacting with the storage chip in the terminal device may be other devices. The embodiment of the present application does not limit whether the UFS main controller exists.
  • the main CPU may include a RISC microprocessor (advanced RISC machines, ARM), etc.
  • RISC microprocessor advanced RISC machines, ARM
  • the embodiment of the present application does not limit the specific type or model of the main CPU.
  • terminal device shown in FIG. 3 is only an example, and it should not be understood as a limitation to the embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data storage method provided by an embodiment of the present application.
  • the method can be applied to the memory chip shown in FIG. 2, and the method can also be applied to the terminal device shown in FIG.
  • the data storage method includes:
  • the storage chip acquires the effective data amount of the fast storage area, and the storage form of the data in the fast storage area is the first storage form.
  • the data stored in the fast storage area may include not only application-related data, but also key databases, file system metadata, and data related to the virtual memory exchange mechanism.
  • the data stored in the fast storage area is not limited. Therefore, the effective data volume acquired by the memory chip can be understood as the data volume of the data stored in the fast storage area acquired by the memory chip.
  • the effective data amount may also be referred to as physical effective data, etc., which is not limited in the embodiment of the present application.
  • the embodiment of the present application does not limit the specific value of the effective data amount, and the specific value may be determined according to actual conditions. .
  • the storage chip converts the fast storage area into a normal storage area, and the storage form of the data in the normal storage area is the second storage form.
  • the storage mode of the data in the storage chip can be converted mutually, for example, between the first storage mode and the second storage mode.
  • the storage form of the data in the storage core in the embodiment of the present application may also include a third storage form, so that the storage form of the data in the memory chip is between the first storage form, the second storage form, and the third storage form. Convert each other.
  • the first storage form, the second storage form, and the third storage form can be understood as different storage forms belonging to the same storage medium.
  • it can be different storage forms of NAND.
  • the embodiment of the present application does not limit the name of the area corresponding to the third storage form.
  • the fast storage area is different from the ordinary storage area in the storage form of data.
  • the storage form of data in the fast storage area is the first storage form
  • the storage form of data in the ordinary storage area is the second storage form. That is to say, when the storage form in the storage chip is converted, the names of the storage areas in the storage chip can be mutually converted.
  • the reading and writing speed of the first storage form and the third storage form, and the reading and writing speed of the second storage form and the third storage form are not limited in the embodiment of the present application.
  • the first storage form and the second storage form may also be the same storage medium, such as fast NAND and slow NAND.
  • the first storage form includes single-level cells (SLC)
  • the second storage form includes three-level cells (trinary-level cells, TLC); or, the first storage form includes SLC, and the second storage form includes SLC.
  • the second storage form includes multi-level cell (MLC); or, the first storage form includes MLC, and the second storage form includes TLC; or, the first storage form includes SLC, and the second storage form includes QLC.
  • MLC multi-level cell
  • the data in the storage particles of the SLC can be moved away, thereby converting the SLC to TLC, and then using TLC to store the data.
  • SLC is 1bit/cell, which is fast and has a long life span of 100,000 cycles per month
  • MLC is 2bit/cell, and has a general life span, about 3000 to 10,000 cycles
  • TLC is 3bit/cell, which is slow Life period, about 500 erasing and writing life
  • QLC is 4bit/cell, about 150 erasing and writing life.
  • the fast storage area can also correspond to the SLC area, and after the fast storage area is converted to the normal storage area, the normal storage area can correspond to the TLC area.
  • the storage The chip can convert the storage form of the fast storage area data from the first storage form to the second storage form of the ordinary storage area data, thereby expanding the physical space of the storage area without sacrificing the user's visible space.
  • the storage chip obtains the effective data amount of the ordinary storage area.
  • the relevant description of the effective data amount of the ordinary storage area may refer to the relevant description of the effective data amount of the fast storage area, which will not be detailed here.
  • the storage chip converts the ordinary storage area into the fast storage area.
  • the values of the first threshold and the second threshold may be the same or different, which is not limited in the embodiment of the present application.
  • the first threshold may be greater than the second threshold, etc.
  • the embodiment of the present application does not limit the first threshold and the second threshold. It can be understood that the first threshold and the second threshold may be independently set by the memory chip, or set by the terminal device, or set by the user, etc., which are not limited in the embodiment of the present application.
  • the storage chip when the effective data amount in the common storage area is less than the second threshold, it means that the space to be used by the main chip may be reduced.
  • the storage chip can change the storage form of the common storage area data from the second
  • the conversion of the storage form to the first storage form is to convert the ordinary storage area into a fast storage area, thereby improving the response speed of related data in the fast storage area.
  • the storage form of the data in the storage chip is converted mutually through the effective data amount in the fast storage area or the normal storage area in the storage chip. Therefore, when the application-related data is stored in the storage chip, the storage mode can be changed as needed. For example, the storage mode can be switched between the first storage mode and the second storage mode. It is understandable that the two storage modes are different Therefore, the read and write speeds of the first storage mode and the second storage mode are also different.
  • the read and write speed of the first storage form is greater than that of the second storage form, and when the second storage form is converted to the first storage form (that is, the normal storage area is converted to a fast storage area), the storage The read performance of the data in the chip is improved, and the response speed of the application is improved.
  • the first storage form is converted to the second storage form (that is, the fast storage area is converted to a normal storage area)
  • the physical storage space of the storage chip can be effectively increased, so that more data can be cached or stored in the storage chip .
  • an application frequently used by a user (called a high-frequency application or a hot application) is installed in a fast storage area
  • the response speed of the application can be improved.
  • Another example is to store the application context state in the fast storage area. When the memory shortage is forcibly closed, when it is recalled again, the response speed of the application can be improved and user satisfaction can be improved.
  • Another example is storing the key data of the system in the fast storage area, which can increase the speed of the system and make the system run more smoothly.
  • the storage chip may determine whether to convert the fast storage area into a normal storage area according to the data size of the effective data amount of the fast storage area. It can be understood that, in the embodiment of the present application, there is a storage space size conversion relationship between the storage space of the first storage form and the storage space of the second storage form, and the read and write speeds of the first storage form and the second storage form are different. The read and write speed of the first storage form is greater than that of the second storage form.
  • the storage form of the data in the fast storage area is mutually converted by the effective data amount in the fast storage area in the storage chip; thus, when the application-related data is stored in the fast storage area, it can be used as needed To switch the storage format, such as switching the storage format between the first storage format and the second storage format. Or, when other key data of the system is stored in the fast storage area, the storage chip can change the storage form as needed, thereby improving the response speed of the key data.
  • converting the fast storage area into a normal storage area includes:
  • the quick storage is based on the size of the effective data amount of the quick storage area and the storage space conversion relationship between the first storage mode and the second storage mode.
  • the area is converted to the normal storage area described above.
  • the storage space conversion relationship between the first storage form and the second storage form may be 1:2, or 1:3, or 2:3, or 1:4, and so on. That is, as an example, the xG space when the storage format is the first storage format can be converted to the 3xG space when the storage format is the second storage format.
  • the storage chip can switch the storage mode of the data in the fast storage area according to the amount of used data and the space conversion relationship between the first storage mode and the second storage mode.
  • the space conversion relationship between SLC and TLC is 1:3, and the first threshold is 15G
  • the effective data amount acquired by the memory chip is 17G, and data may need to be stored in the memory chip. Therefore,
  • the memory chip can convert 10G SLC to 30G TLC to store data, which not only does not sacrifice the user’s visible space, such as the user’s inability to feel the loss of space, etc., but also expands the data storage space to For storage chips to store or cache data.
  • the memory chip can convert 20G SLC into 60G TLC to store more data. It can be understood that each of the above values is only an example, and should not be construed as a limitation to the application.
  • converting the ordinary storage area into the fast storage area includes:
  • the ordinary storage is based on the size of the effective data amount of the ordinary storage area and the storage space conversion relationship between the first storage form and the second storage form. The area is converted to the above fast storage area.
  • the storage chip can switch the storage mode of the data in the fast storage area according to the amount of used data and the space conversion relationship between the first storage mode and the second storage mode.
  • the spatial conversion relationship between SLC and TLC is 1:3, and the second threshold is 8G
  • the effective data amount acquired by the memory chip is 7G, and there may be no need to store data in the memory chip. Therefore,
  • the memory chip can convert 30G TLC to 10G SLC to store data, which not only does not sacrifice the user's visible space, such as the user cannot feel the loss of space, etc., but also because the speed of TLC is slower than that of SLC , So it can also improve data read and write performance. It can be understood that each of the above values is only an example, and should not be construed as a limitation to the application.
  • the storage modes in the memory chip can be interchanged, and there may also be preconditions.
  • the first storage mode in the memory chip can be the same as the second storage mode.
  • Mutual conversion that is, the fast storage area can be converted to the ordinary storage area.
  • the wear count of the fast storage area is not less than the wear count threshold
  • the storage form of the relevant area in the memory chip is completely converted from the first storage form to the second storage form, that is, the fast storage area Fully converted to normal storage area.
  • the precondition for mutual conversion between the first storage form and the second storage form may be that the wear times of the fast storage area is less than the wear times threshold, and if the wear times of the fast storage area exceeds the wear times threshold, then It shows that the storage modes of the fast storage area cannot be converted to each other, that is, the first storage mode can be completely converted to the second storage mode.
  • the threshold of the number of wear times may be determined by the performance of the memory chip, etc. The embodiment of the present application does not limit the setting of the threshold of the number of wear times.
  • the embodiment of the present application also provides a method of how to set the amount of data stored in the fast storage area, that is, before obtaining the effective data amount of the fast storage area, the above method further includes: according to the usage of application data, The storage chip allocates the fast storage area.
  • the storage chip can allocate fast storage areas based on user application behavior analysis.
  • the storage chip may allocate the fast storage area and the first common storage area described in FIG. 2 based on the analysis of user application behavior. That is, the storage chip can first analyze the user's use of the terminal device. For example, after analyzing the user's use of the application data through the terminal device, the storage chip can allocate the fast storage area and the first common storage area according to the user's application situation the size of. For example, by analyzing the usage of application data, the memory chip can use the 10G space in the memory chip as a fast storage area (for example, the second ordinary storage area that can be converted to 30G), and the 20G space in the memory chip as the first ordinary storage area.
  • the numbers shown above are only examples and should not be construed as limiting the application.
  • FIG. 5 is a schematic diagram of a data storage method provided by the embodiment of this application.
  • the fast storage area is The reserved area of the SLC area can be understood as a virtual space.
  • the storage form of the fast storage area is the SLC storage form.
  • the TLC area can be converted to SLC area, that is, the storage form of the data can be converted from TLC storage form to SLC storage form (the solid arrow in the third row in Figure 5).
  • LUm can be understood as the first general storage area described in FIG. 2, and its logical unit number is m.
  • the logical unit number of the TLC area that is, the second general storage area described in FIG. 2 may be LUn.
  • x and y can be any positive numbers, and the application does not limit specific values.
  • the fast storage area enable period when the wear times of the fast storage area is less than the wear threshold, such as the erase count (EC) technical specification, the total amount of effective data in the fast storage area is within the threshold z1GB,
  • the read performance of the fast storage area all hits the SLC, where z1 is any positive number. It can be understood that, in the embodiment of the present application, the number of wear times can also be understood as the number of erasing EC values.
  • the fast storage area suspension period when the wear times of the fast storage area are less than the wear threshold, the total amount of effective data in the fast storage area is outside the threshold z1GB, and the fast storage area starts the SLC to TLC return (after returning to the TLC, the fast
  • the storage area can be called a normal storage area).
  • the total amount of valid data in the ordinary storage area is within the threshold z2GB, the ordinary storage area starts TLC to SLC reverse return, where z2 is any positive number.
  • the fast storage area is permanently closed, that is, the storage form of the data in the memory chip can be completely converted from SLC to TLC, and no longer Continue to convert from TLC to SLC.
  • FIG. 6 is a schematic structural diagram of a memory chip provided by an embodiment of the present application.
  • the memory chip may include:
  • the acquiring unit 601 is configured to acquire the effective data amount of the fast storage area, and the storage form of the data in the fast storage area is the first storage form;
  • the conversion unit 602 is configured to convert the fast storage area into a normal storage area when the effective data amount of the fast storage area is greater than the first threshold, and the storage form of the data in the normal storage area is the second storage form.
  • the storage chip includes a fast storage area to improve the response speed of the application; and when the effective data amount in the fast storage area is too large, such as greater than the first threshold, it indicates that the main chip (also referred to as the host Side, etc.) The space to be used is getting larger and larger.
  • the memory chip can switch the storage form, that is, the memory chip can convert the first storage form of the data in the fast storage area into the second storage form of the data in the ordinary storage area. 2. Storage form, so as to expand the physical space of the storage area without sacrificing the user's visible logical space.
  • the above-mentioned obtaining unit 601 is further configured to obtain the effective data amount of the above-mentioned ordinary storage area;
  • the conversion unit 602 is further configured to convert the normal storage area into the fast storage area when the effective data amount of the normal storage area is less than a second threshold.
  • the storage chip when the effective data amount in the common storage area is less than the second threshold, it indicates that the space to be used by the main chip may be reduced.
  • the storage chip can store data in the common storage area in the second storage mode It is converted into the first storage form of data in the fast storage area, thereby improving the response speed of related data in the storage area of the memory chip.
  • the conversion unit 602 is specifically configured to, when the effective data amount of the fast storage area is greater than the first threshold, according to the size of the effective data amount of the fast storage area and the first
  • the storage space conversion relationship between the storage mode and the second storage mode converts the fast storage area into the normal storage area.
  • the conversion when converting the fast storage area to the normal storage area, the conversion can be performed according to the user's usage, that is, according to the usage of the data in the storage chip; more specifically, according to the usage of the data and the storage space
  • the relationship converts the fast storage area to the normal storage area; thus avoiding the situation that the area is converted too large and not effectively used.
  • the conversion unit 602 is specifically configured to, when the effective data amount of the ordinary storage area is less than the second threshold, according to the size of the effective data amount of the ordinary storage area and the first
  • the storage space conversion relationship between the storage format and the second storage format converts the ordinary storage area into the fast storage area.
  • the conversion when converting a normal storage area to a fast storage area, the conversion can be based on the user's usage, that is, according to the usage of the data in the storage chip; more specifically, the conversion can be based on the usage of the data and the storage space
  • the relationship converts the ordinary storage area into the fast storage area; thereby avoiding the situation that the data cannot be stored or cached due to the conversion of too many fast storage areas.
  • the conversion unit 602 is specifically configured to convert the ordinary storage area into the fast storage area when the wear count of the fast storage area is less than the wear count threshold.
  • the normal storage area and the fast storage area that is, the first storage mode and the second storage mode, can be converted mutually within the range of the wear frequency threshold.
  • the conversion unit 602 is further configured to convert the ordinary storage area into the fast storage area when the wear count of the fast storage area is not less than the wear count threshold.
  • the precondition that the fast storage area and the ordinary storage area can be interchanged may be that the wear times of the fast storage area are less than the wear times threshold, and if the wear times of the fast storage area exceeds the wear times threshold, the fast storage area The storage area cannot be converted to the ordinary storage area, that is, the fast storage area will be completely converted into the ordinary storage area, that is, the first storage form can be completely converted into the second storage form.
  • the foregoing memory chip further includes:
  • the allocating unit 603 is configured to allocate the fast storage area to the storage chip according to the usage of the application data.
  • the storage chip can allocate a fast storage area based on user application behavior analysis, so that the size of the fast storage area can be more in line with the user's usage, that is, it can be more in line with the data in the storage chip. Storage usage.
  • the first storage form and the second storage form belong to different storage forms of the same storage medium.
  • the first storage format includes SLC, and the second storage format includes TLC; or, the first storage format includes SLC, and the second storage format includes MLC; or, the first storage format is Including MLC, and the second storage format includes TLC; or, the first storage format includes SLC, and the second storage format includes four-layer memory cells QLC.
  • each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 4 and/or FIG. 5. It should be noted that each unit refers to a logical division, and does not mean that it corresponds to a specific hardware. Specifically, the function of each unit can be implemented based on various hardware, for example, a processor based on a support instruction set can read The code stored in the memory is implemented by reading the configuration file based on field programmable gate array (FPGA), or based on application-specific integrated circuit (ASIC), or a combination of these The method is not limited in this application.
  • FPGA field programmable gate array
  • ASIC application-specific integrated circuit
  • FIG. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
  • the terminal device can be used to execute the method shown in FIG. 4 and/or FIG. 5.
  • the terminal device may include The memory chip, the memory chip may be the memory chip shown in FIG. 6 and/or FIG. 7. It can be understood that the memory chip units included in the terminal device can refer to the foregoing embodiments, which will not be described in detail here.
  • the terminal device may also include other chips, which will not be described in detail here.
  • the embodiment of the present application also provides a computer-readable storage medium. All or part of the procedures in the foregoing method embodiments may be completed by a computer program instructing relevant hardware.
  • the program may be stored in the foregoing computer storage medium. When the program is executed, it may include the procedures of the foregoing method embodiments.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
  • the modules in the devices in the embodiments of the present application may be combined, divided, and deleted according to actual needs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

A data storage method and a storage chip. The method can be applied in a storage chip, and comprises: obtaining the effective data volume of a fast storage region, a storage form of data in the fast storage region being a first storage form (401); and when the effective data volume of the fast storage region is greater than a first threshold, converting the fast storage region into a normal storage region, a storage form of data in the normal storage region being a second storage form (402). The use of the method can effectively improve the response speed of an application.

Description

数据存储方法及存储芯片Data storage method and storage chip 技术领域Technical field
本申请涉及芯片技术领域,尤其涉及一种数据存储方法及存储芯片。This application relates to the field of chip technology, and in particular to a data storage method and a storage chip.
背景技术Background technique
一般地,衡量终端设备的存储器件基础性能的基础指标可包括顺序读、顺序写、随机读和随机写。同时用户在使用终端设备时可感知的存储体验典型场景比如应用冷启动场景,应用冷启动速度与随机读指标强相关。Generally, basic indicators for measuring the basic performance of a storage device of a terminal device may include sequential reading, sequential writing, random reading, and random writing. At the same time, typical scenarios of storage experience that users can perceive when using terminal devices are application cold start scenarios. The application cold start speed is strongly correlated with random reading indicators.
其中,应用冷启动不仅发生在用户首次启动应用时,也可能是发生在应用退入后台,因内存不足被踢出后,再次被用户切换回前台时。Among them, the cold start of an application not only occurs when the user starts the application for the first time, but may also occur when the application exits to the background, is kicked out due to insufficient memory, and is switched back to the foreground by the user again.
因此,如何提高应用的响应速度亟待解决。Therefore, how to improve the response speed of the application needs to be solved urgently.
发明内容Summary of the invention
本申请实施例公开了一种数据存储方法及存储芯片,能够有效提高应用的响应速度。The embodiment of the present application discloses a data storage method and a storage chip, which can effectively improve the response speed of the application.
第一方面,本申请实施例公开了一种数据存储方法,所述方法应用于存储芯片,所述方法包括:获取快速存储区域的有效数据量,所述快速存储区域的数据的存储形态为第一存储形态;在所述快速存储区域的有效数据量大于第一阈值的情况下,将所述快速存储区域转换为普通存储区域,且所述普通存储区域的数据的存储形态为第二存储形态。In the first aspect, an embodiment of the present application discloses a data storage method, the method is applied to a memory chip, and the method includes: acquiring the effective data amount of a fast storage area, and the storage form of the data in the fast storage area is the first A storage form; in the case where the effective data amount of the fast storage area is greater than the first threshold, the fast storage area is converted to a normal storage area, and the storage form of the data in the normal storage area is the second storage form .
本申请实施例中,存储芯片中通过包括快速存储区域,可提高应用的响应速度;且在快速存储区域中的有效数据量过大如大于第一阈值时,说明主芯片(又或者称为主机侧等等)待使用的空间越来越大,这时,存储芯片可转换存储形态,也就是说,存储芯片可将快速存储区域的数据的第一存储形态转换为普通存储区域的数据的第二存储形态,从而在不牺牲用户可见逻辑空间基础上,扩大存储芯片的物理空间。可以理解,该快速存储区域与普通存储区域在数据的存储形态上不同,如快速存储区域中数据的存储形态为第一存储形态,普通存储区域中数据的存储形态为第二存储形态。也就是说,在转换存储芯片中的存储形态时,该存储芯片中的存储区域的名称得以相互转换。In the embodiment of the present application, the storage chip includes a fast storage area to improve the response speed of the application; and when the effective data amount in the fast storage area is too large, such as greater than the first threshold, it indicates that the main chip (also referred to as the host Side, etc.) The space to be used is getting larger and larger. At this time, the memory chip can switch the storage form, that is, the memory chip can convert the first storage form of the data in the fast storage area into the second storage form of the data in the ordinary storage area. Second, storage form, so as to expand the physical space of the storage chip without sacrificing the user's visible logical space. It can be understood that the fast storage area is different from the ordinary storage area in the storage form of data. For example, the storage form of data in the fast storage area is the first storage form, and the storage form of data in the ordinary storage area is the second storage form. That is to say, when the storage form in the storage chip is converted, the names of the storage areas in the storage chip can be mutually converted.
结合第一方面,在一种可能的实现方式中,所述方法还包括:获取所述普通存储区域的有效数据量;在所述普通存储区域的有效数据量小于第二阈值的情况下,将所述普通存储区域转换为所述快速存储区域。With reference to the first aspect, in a possible implementation manner, the method further includes: acquiring the effective data amount of the ordinary storage area; in the case that the effective data amount of the ordinary storage area is less than a second threshold, The normal storage area is converted into the fast storage area.
本申请实施例中,在普通存储区域中的有效数据量小于第二阈值时,说明主芯片待使用的空间可能会减小,这时,存储芯片可将普通存储区域的数据的第二存储形态转换为快速存储区域的数据的第一存储形态,从而提高存储芯片存储区域中相关数据的响应速度。In the embodiment of the present application, when the effective data amount in the common storage area is less than the second threshold, it indicates that the space to be used by the main chip may be reduced. At this time, the storage chip can store data in the common storage area in the second storage mode. It is converted into the first storage form of data in the fast storage area, thereby improving the response speed of related data in the storage area of the memory chip.
本申请实施例中,通过存储芯片中的快速存储区域或普通存储区域中的有效数据量,来相互转换该存储芯片中的数据的存储形态。从而如将与应用相关的数据存储在该存储芯片时,可根据需要来转换存储形态,如将存储形态在第一存储形态与第二存储形态之间转 换,可以理解,由于两种存储形态不同,因此,第一存储形态与第二存储形态的读写速度也不同。进而如在第一存储形态的读写速度大于第二存储形态的读写速度,且在将第二存储形态转换为第一存储形态时(即将普通存储区域转换为快速存储区域),可使得存储芯片中数据的读性能得以提升,提高应用的响应速度。又如在将第一存储形态转换为第二存储形态时(即将快速存储区域转换为普通存储区域),可有效提高存储芯片的物理存储空间,使得该存储芯片中可缓存或存储更多的数据。In the embodiment of the present application, the storage form of the data in the storage chip is converted mutually through the effective data amount in the fast storage area or the normal storage area in the storage chip. Therefore, when the application-related data is stored in the storage chip, the storage mode can be changed as needed. For example, the storage mode can be switched between the first storage mode and the second storage mode. It is understandable that the two storage modes are different Therefore, the read and write speeds of the first storage mode and the second storage mode are also different. Furthermore, if the read and write speed of the first storage form is greater than that of the second storage form, and when the second storage form is converted to the first storage form (that is, the normal storage area is converted to a fast storage area), the storage The read performance of the data in the chip is improved, and the response speed of the application is improved. Another example is when the first storage form is converted to the second storage form (that is, the fast storage area is converted to a normal storage area), the physical storage space of the storage chip can be effectively increased, so that more data can be cached or stored in the storage chip .
可理解,本申请实施例中,存储芯片中所存储的数据不仅可包括与各种应用(application,APP)相关的数据,还可包括关键数据库,文件系统元数据以及虚拟内存交换机制相关的数据等等,本申请实施例对于该存储芯片中所存储的数据不作限定。进一步的,上述所列举的数据可存储于存储芯片的快速存储区域。It can be understood that in the embodiment of the present application, the data stored in the storage chip may not only include data related to various applications (application, APP), but also include key databases, file system metadata, and data related to the virtual memory exchange mechanism. And so on, the embodiment of this application does not limit the data stored in the memory chip. Further, the data listed above can be stored in the fast storage area of the memory chip.
可理解,本申请实施例中,第一存储形态的存储空间与第二存储形态的存储空间之间有存储空间大小转换关系,以及第一存储形态与第二存储形态的读写速度不同如第一存储形态的读写速度大于第二存储形态的读写速度。可理解,由于第一存储形态与第二存储形态的读写速度不同,因此快速存储区域的读写响应速度与普通存储区域的读写响应速度不同如快速存储区域的读写响应速度大于普通存储区域的读写响应速度。It can be understood that in the embodiment of the present application, there is a storage space size conversion relationship between the storage space of the first storage form and the storage space of the second storage form, and the read and write speeds of the first storage form and the second storage form are different, as in the first storage form. The read and write speed of one storage form is greater than that of the second storage form. It can be understood that because the read and write speeds of the first storage form and the second storage form are different, the read and write response speed of the fast storage area is different from that of the ordinary storage area. For example, the read and write response speed of the fast storage area is greater than that of ordinary storage. The read and write response speed of the area.
结合第一方面或第一方面的任一种可能的实现方式,所述在所述快速存储区域的有效数据量大于第一阈值的情况下,将所述快速存储区域转换为普通存储区域,包括:在所述快速存储区域的有效数据量大于所述第一阈值的情况下,根据所述快速存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述快速存储区域转换为所述普通存储区域。With reference to the first aspect or any one of the possible implementation manners of the first aspect, in the case that the effective data amount of the fast storage area is greater than a first threshold, converting the fast storage area into a normal storage area includes : In the case where the effective data amount of the fast storage area is greater than the first threshold, according to the size of the effective data amount of the fast storage area and the storage space of the first storage form and the second storage form The conversion relationship converts the fast storage area into the normal storage area.
本申请实施例中,在将快速存储区域转换为普通存储区域时,可根据用户的使用情况,即根据存储芯片中数据的使用情况来转换;更具体的,根据数据的使用情况以及存储空间转换关系将快速存储区域转换为普通存储区域;从而避免了区域转换过大,而没有有效利用的情况。In the embodiments of the present application, when converting the fast storage area to the normal storage area, the conversion can be performed according to the user's usage, that is, according to the usage of the data in the storage chip; more specifically, according to the usage of the data and the storage space The relationship converts the fast storage area to the normal storage area; thus avoiding the situation that the area is converted too large and not effectively used.
结合第一方面或第一方面的任一种可能的实现方式,所述在所述普通存储区域的有效数据量小于第二阈值的情况下,将所述普通存储区域转换为所述快速存储区域,包括:在所述普通存储区域的有效数据量小于所述第二阈值的情况下,根据所述普通存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述普通存储区域转换为所述快速存储区域。With reference to the first aspect or any one of the possible implementation manners of the first aspect, in the case that the effective data amount of the ordinary storage area is less than a second threshold, the ordinary storage area is converted into the fast storage area , Including: in the case that the effective data amount of the ordinary storage area is less than the second threshold, according to the size of the effective data amount of the ordinary storage area and the difference between the first storage form and the second storage form The storage space conversion relationship converts the ordinary storage area into the fast storage area.
本申请实施例中,在将普通存储区域转换为快速存储区域时,可根据用户的使用情况,即根据存储芯片中数据的使用情况来转换;更具体的,根据数据的使用情况以及存储空间转换关系将普通存储区域转换为快速存储区域;从而避免了转换过多的快速存储区域,而导致数据无法存储或缓存的情况。In the embodiments of this application, when converting a normal storage area to a fast storage area, the conversion can be based on the user's usage, that is, according to the usage of the data in the storage chip; more specifically, the conversion can be based on the usage of the data and the storage space The relationship converts the ordinary storage area into the fast storage area; thereby avoiding the situation that the data cannot be stored or cached due to the conversion of too many fast storage areas.
结合第一方面或第一方面的任一种可能的实现方式,所述将所述普通存储区域转换为所述快速存储区域,包括:在所述快速存储区域的磨损次数小于磨损次数阈值的情况下,将所述普通存储区域转换为所述快速存储区域。With reference to the first aspect or any one of the possible implementation manners of the first aspect, the converting the ordinary storage area into the fast storage area includes: the case where the wear times of the fast storage area is less than the wear times threshold Next, convert the normal storage area into the fast storage area.
本申请实施例中,通过设置磨损次数阈值,可使得在该磨损次数阈值范围内,使得普通存储区域与快速存储区域即第一存储形态与第二存储形态,能够相互转换。In the embodiment of the present application, by setting the threshold of the number of wear times, the normal storage area and the fast storage area, that is, the first storage mode and the second storage mode, can be converted mutually within the range of the wear frequency threshold.
结合第一方面或第一方面的任一种可能的实现方式,所述方法还包括:在所述快速存储区域的磨损次数不小于所述磨损次数阈值的情况下,将所述快速存储区域完全转换为所述普通存储区域。With reference to the first aspect or any one of the possible implementation manners of the first aspect, the method further includes: in the case that the wear times of the fast storage area is not less than the wear times threshold, complete the fast storage area Converted to the normal storage area.
本申请实施例中,快速存储区域与普通存储区域可以相互转换的前提条件可以为快速存储区域的磨损次数小于磨损次数阈值,而若快速存储区域的磨损次数超过了该磨损次数阈值,则说明快速存储区域无法与普通存储区域相互转换,也就是说,快速存储区域将完全转换为普通存储区域,也即第一存储形态可以完全转换为第二存储形态。In the embodiment of the present application, the precondition that the fast storage area and the ordinary storage area can be interchanged may be that the wear times of the fast storage area are less than the wear times threshold, and if the wear times of the fast storage area exceeds the wear times threshold, the fast storage area The storage area cannot be converted to the ordinary storage area, that is, the fast storage area will be completely converted into the ordinary storage area, that is, the first storage form can be completely converted into the second storage form.
结合第一方面或第一方面的任一种可能的实现方式,所述获取快速存储区域的有效数据量之前,所述方法还包括:根据应用数据的使用情况,为所述存储芯片分配所述快速存储区域。With reference to the first aspect or any one of the possible implementation manners of the first aspect, before the obtaining the effective data amount of the fast storage area, the method further includes: allocating the storage chip to the storage chip according to the usage of the application data Fast storage area.
本申请实施例中,存储芯片可以在用户应用行为分析的基础上,来分配快速存储区域,从而使得该快速存储区域的大小能够更加符合用户的使用情况,也即能够更加符合存储芯片中数据的存储使用情况。In the embodiment of the present application, the storage chip can allocate a fast storage area based on user application behavior analysis, so that the size of the fast storage area can be more in line with the user's usage, that is, it can be more in line with the data in the storage chip. Storage usage.
结合第一方面或第一方面的任一种可能的实现方式,所述第一存储形态与所述第二存储形态属于同一种存储介质的不同存储形态。With reference to the first aspect or any possible implementation manner of the first aspect, the first storage form and the second storage form belong to different storage forms of the same storage medium.
结合第一方面或第一方面的任一种可能的实现方式,所述第一存储形态包括单层存储单元(single-level cell,SLC),所述第二存储形态包括三层存储单元(trinary-level cell,TLC);或者,所述第一存储形态包括SLC,所述第二存储形态包括多层存储单元(multi-level cell,MLC);或者,所述第一存储形态包括MLC,所述第二存储形态包括TLC;或者,所述第一存储形态包括SLC,所述第二存储形态包括四层存储单元QLC。With reference to the first aspect or any possible implementation manner of the first aspect, the first storage form includes a single-level cell (SLC), and the second storage form includes a three-level storage cell (trinary cell). -level cell, TLC); or, the first storage form includes SLC, and the second storage form includes multi-level cell (MLC); or, the first storage form includes MLC, so The second storage form includes TLC; or, the first storage form includes SLC, and the second storage form includes four-layer memory cells QLC.
第二方面,本申请实施例公开了一种存储芯片,包括:获取单元,用于获取快速存储区域的有效数据量,所述快速存储区域的数据的存储形态为第一存储形态;转换单元,用于在所述快速存储区域的有效数据量大于第一阈值的情况下,将所述快速存储区域转换为普通存储区域,且所述普通存储区域的数据的存储形态为第二存储形态。In a second aspect, an embodiment of the present application discloses a memory chip, including: an acquiring unit configured to acquire the effective data amount of a fast storage area, the storage form of the data in the fast storage area is the first storage form; a conversion unit, When the effective data amount of the fast storage area is greater than the first threshold, the fast storage area is converted into a normal storage area, and the storage form of the data in the normal storage area is the second storage form.
结合第二方面,在一种可能的实现方式中,所述获取单元,还用于获取所述普通存储区域的有效数据量;所述转换单元,还用于在所述普通存储区域的有效数据量小于第二阈值的情况下,将所述普通存储区域转换为所述快速存储区域。With reference to the second aspect, in a possible implementation manner, the acquiring unit is further configured to acquire the effective data amount of the ordinary storage area; the conversion unit is further configured to obtain valid data in the ordinary storage area If the amount is less than the second threshold, the normal storage area is converted to the fast storage area.
结合第二方面或第二方面的任一种可能的实现方式,所述转换单元,具体用于在所述快速存储区域的有效数据量大于所述第一阈值的情况下,根据所述快速存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述快速存储区域转换为所述普通存储区域。With reference to the second aspect or any one of the possible implementation manners of the second aspect, the conversion unit is specifically configured to: when the effective data amount of the fast storage area is greater than the first threshold, according to the fast storage The size of the effective data amount of the area and the storage space conversion relationship between the first storage form and the second storage form convert the fast storage area into the normal storage area.
结合第二方面或第二方面的任一种可能的实现方式,所述转换单元,具体用于在所述普通存储区域的有效数据量小于所述第二阈值的情况下,根据所述普通存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述普通存储区域转换为所述快速存储区域。With reference to the second aspect or any one of the possible implementation manners of the second aspect, the conversion unit is specifically configured to, when the effective data amount of the common storage area is less than the second threshold, perform according to the common storage The size of the effective data amount of the area and the storage space conversion relationship between the first storage form and the second storage form convert the ordinary storage area into the fast storage area.
结合第二方面或第二方面的任一种可能的实现方式,所述转换单元,具体用于在所述快速存储区域的磨损次数小于磨损次数阈值的情况下,将所述普通存储区域转换为所述快速存储区域。With reference to the second aspect or any one of the possible implementation manners of the second aspect, the conversion unit is specifically configured to convert the ordinary storage area into a case where the wear count of the fast storage area is less than the wear count threshold. The fast storage area.
结合第二方面或第二方面的任一种可能的实现方式,所述转换单元,还用于在所述快速存储区域的磨损次数不小于所述磨损次数阈值的情况下,将所述快速存储区域完全转换为所述普通存储区域。With reference to the second aspect or any of the possible implementation manners of the second aspect, the conversion unit is further configured to store the fast storage area when the wear times of the fast storage area are not less than the wear times threshold. The area is completely converted into the normal storage area.
结合第二方面或第二方面的任一种可能的实现方式,所述存储芯片还包括:分配单元,用于根据应用数据的使用情况,为所述存储芯片分配所述快速存储区域。With reference to the second aspect or any of the possible implementation manners of the second aspect, the storage chip further includes: an allocation unit configured to allocate the fast storage area to the storage chip according to a usage situation of application data.
结合第二方面或第二方面的任一种可能的实现方式,所述第一存储形态与所述第二存储形态属于同一种存储介质的不同存储形态。With reference to the second aspect or any possible implementation manner of the second aspect, the first storage form and the second storage form belong to different storage forms of the same storage medium.
结合第二方面或第二方面的任一种可能的实现方式,所述第一存储形态包括SLC,所述第二存储形态包括TLC;或者,所述第一存储形态包括SLC,所述第二存储形态包括MLC;或者,所述第一存储形态包括MLC,所述第二存储形态包括TLC。With reference to the second aspect or any one of the possible implementation manners of the second aspect, the first storage format includes SLC, and the second storage format includes TLC; or, the first storage format includes SLC, and the second storage format includes SLC. The storage format includes MLC; or, the first storage format includes MLC, and the second storage format includes TLC.
第三方面,本申请实施例公开了一种存储芯片,所述存储芯片包括控制器以及存储阵列(如NAND flash阵列),所述控制器用于执行上述第一方面所述的方法。In a third aspect, an embodiment of the present application discloses a memory chip including a controller and a memory array (such as a NAND flash array), and the controller is configured to execute the method described in the first aspect.
第四方面,本申请实施例公开了一种终端设备,所述终端设备包括处理器以及存储芯片,所述处理器用于通过与所述存储芯片进行交互来读写数据,所述存储芯片用于执行上述第一方面所述的方法。In a fourth aspect, an embodiment of the present application discloses a terminal device. The terminal device includes a processor and a storage chip. The processor is used to read and write data by interacting with the storage chip. Perform the method described in the first aspect above.
第五方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行上述各方面所述的方法。In a fifth aspect, the embodiments of the present application provide a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when the instructions run on a computer, the computer executes the methods described in the above aspects .
第六方面,本申请实施例提供了一种包括指令的计算机程序产品,当所述计算机程序产品在计算机上运行时,使得计算机执行上述各方面所述的方法。In a sixth aspect, the embodiments of the present application provide a computer program product including instructions, which when the computer program product runs on a computer, cause the computer to execute the methods described in the foregoing aspects.
附图说明Description of the drawings
图1是本申请实施例提供的一种主芯片的结构示意图;FIG. 1 is a schematic structural diagram of a main chip provided by an embodiment of the present application;
图2是本申请实施例提供的一种存储芯片的结构示意图;2 is a schematic structural diagram of a memory chip provided by an embodiment of the present application;
图3是本申请实施例提供的一种终端设备的结构示意图;FIG. 3 is a schematic structural diagram of a terminal device provided by an embodiment of the present application;
图4是本申请实施例提供的一种数据存储方法的流程示意图;FIG. 4 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图5是本申请实施例提供的一种数据存储方法的场景示意图;FIG. 5 is a schematic diagram of a scene of a data storage method provided by an embodiment of the present application;
图6是本申请实施例提供的一种存储芯片的结构示意图;FIG. 6 is a schematic structural diagram of a memory chip provided by an embodiment of the present application;
图7是本申请实施例提供的另一种存储芯片的结构示意图;FIG. 7 is a schematic structural diagram of another memory chip provided by an embodiment of the present application;
图8是本申请实施例提供的另一种终端设备的结构示意图。Fig. 8 is a schematic structural diagram of another terminal device provided by an embodiment of the present application.
具体实施方式detailed description
下面结合本申请实施例中的附图对本申请实施例进行描述。The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
在具体实现中,衡量手机存储器基础性能的四个基础指标可包括顺序读、顺序写、随机读以及随机写。而用户能够感知的存储体验典型场景往往与随机读相关,因此,在用户使用手机的过程中,如何提高应用冷启动的响应速度是本领域技术人员正在研究的问题。In a specific implementation, the four basic indicators for measuring the basic performance of the mobile phone memory can include sequential read, sequential write, random read, and random write. The typical scenarios of the storage experience that the user can perceive are often related to random reading. Therefore, how to improve the response speed of the cold start of the application when the user uses the mobile phone is a problem that is being studied by those skilled in the art.
其中,冷启动可理解为用户首次启动应用,或者,冷启动也可理解为应用从前台退入到后台,因内存不足该应用被强制关闭,但又被调出前台。可理解,这里所描述的启动可 理解为从存储介质中启动,而非从内存启动。可理解,本申请实施例中所描述的应用不单单指终端设备中安装的APP,也可以指各种操作系统应用,以及终端设备中系统的一些其他应用等等,本申请实施例对于该应用的理解不作限定。其中,终端设备中系统的一些其他应用所产生的数据可以为关键数据库,文件系统元数据以及虚拟内存交换机制相关的数据等等。Among them, a cold start can be understood as the user launching the application for the first time, or a cold start can also be understood as the application retreating from the foreground to the background, and the application is forcibly closed due to insufficient memory, but is called out of the foreground. It is understandable that the boot described here can be understood as booting from the storage medium instead of booting from the memory. It is understandable that the applications described in the embodiments of the present application not only refer to the APP installed in the terminal device, but can also refer to various operating system applications, and some other applications of the system in the terminal device. The understanding is not limited. Among them, the data generated by some other applications of the system in the terminal device may be key databases, file system metadata, data related to the virtual memory exchange mechanism, and so on.
为了有效地提高应用冷启动的响应速度,本申请实施例提供了一种数据存储方法,以及存储芯片。In order to effectively improve the response speed of application cold start, embodiments of the present application provide a data storage method and a storage chip.
以下将具体描述本申请实施例中所设涉及的主芯片和存储芯片。The main chip and memory chip involved in the embodiments of the present application will be described in detail below.
参见图1,图1是本申请实施例提供的一种主芯片的结构示意图。本申请实施例中,该主芯片可以以存储接口协议访问存储芯片,其中,该存储接口协议可包括通用闪存存储(universal flash storage,UFS)接口协议、嵌入式多媒体(embedded multi media card,EMMC)接口协议以及高速串行计算机扩展总线标准(peripheral component interconnect express,PCIE)接口协议等等,本申请实施例对于该存储接口协议的类型不作限定。以下将以UFS接口协议为例来说明本申请实施例所涉及的主芯片以及存储芯片。Referring to Fig. 1, Fig. 1 is a schematic structural diagram of a main chip provided by an embodiment of the present application. In this embodiment of the application, the main chip can access the storage chip using a storage interface protocol, where the storage interface protocol can include universal flash storage (UFS) interface protocol, embedded multimedia (embedded multimedia card, EMMC) Interface protocol and high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE) interface protocol, etc. The embodiment of the present application does not limit the type of the storage interface protocol. The following will take the UFS interface protocol as an example to illustrate the main chip and the storage chip involved in the embodiments of the present application.
如图1所示,该主芯片可包括主中央处理器(central processing unit,CPU),UFS主控制器,双倍速率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM)控制器,DDR SDRAM内存,外围设备控制器和外围设备(peripherals)。可理解,本申请实施例中,DDR SDRAM也可简称为DDR。As shown in Figure 1, the main chip may include a central processing unit (CPU), a UFS main controller, and a double data rate synchronous dynamic random access memory (DDR SDRAM) controller , DDR SDRAM memory, peripheral controllers and peripherals (peripherals). It can be understood that in the embodiments of the present application, DDR SDRAM may also be referred to as DDR for short.
其中,处理器(即主CPU)用于通过与存储芯片进行交互来读写数据,例如,处理器可用于与该存储芯片耦合,从而执行该存储芯片中存储的程序指令等等。又如处理器可用于运行操作系统、应用、驱动等主芯片上运行的软件等等。本申请实施例对于该处理器具体如何与存储芯片进行交互不作限定。The processor (that is, the main CPU) is used to read and write data by interacting with the storage chip. For example, the processor can be used to couple with the storage chip to execute program instructions stored in the storage chip and so on. Another example is that the processor can be used to run software running on the main chip such as operating systems, applications, and drivers. The embodiment of the present application does not limit how the processor interacts with the storage chip.
UFS主控制器可用于发出符合UFS协议信息单元(UFS protocol information unit,UPIU)协议帧的读请求和写请求中的一项或多项。该UFS主控制器可用于发出符合UPIU协议帧的读请求,从而请求读取存储芯片中所存储的数据。如该UFS主控制器发出的读请求可用于读取与应用(如热点应用或高频应用)相关的且存储在存储芯片中的数据。The UFS main controller can be used to issue one or more of a read request and a write request conforming to the UFS protocol information unit (UPIU) protocol frame. The UFS main controller can be used to issue a read request conforming to the UPIU protocol frame, thereby requesting to read the data stored in the memory chip. For example, the read request issued by the UFS main controller can be used to read data related to applications (such as hotspot applications or high-frequency applications) and stored in the storage chip.
也就是说,本申请实施例中,主芯片可用于与存储芯片耦合,从而读取存储芯片中存储的数据以及指令。进一步的,存储芯片中包括快速存储区域以及普通存储区域,主芯片在需要读取存储芯片中的数据时,可根据需要分别读取快速存储区域或普通存储区域中的数据。具体的,主芯片可根据封装在UPIU协议帧中的逻辑单元号(logical unit number,LUN)发出命令,从而访问存储芯片中的快速存储区域或普通存储区域。可理解,对于存储芯片中的快速存储区域和普通存储区域的详细描述可参考图2所示的存储芯片,这里先不详述。In other words, in the embodiment of the present application, the main chip can be used to couple with the storage chip, so as to read the data and instructions stored in the storage chip. Further, the storage chip includes a fast storage area and a normal storage area. When the main chip needs to read data in the storage chip, it can read the data in the fast storage area or the normal storage area respectively as needed. Specifically, the main chip can issue a command according to the logical unit number (LUN) encapsulated in the UPIU protocol frame to access the fast storage area or the normal storage area in the storage chip. It can be understood that for a detailed description of the fast storage area and the common storage area in the memory chip, reference may be made to the memory chip shown in FIG. 2, which will not be detailed here.
DDR控制器可用于控制DDR,如该DDR控制器可用于控制更新DDR中的逻辑地址与物理地址映射关系等等。The DDR controller can be used to control the DDR. For example, the DDR controller can be used to control and update the mapping relationship between the logical address and the physical address in the DDR and so on.
外围设备可包括输入和输出接口、外存储器、模数转换器、数模装换器和外围处理器等等。如该外围设备可包括触摸屏、摄像头、指纹采集、近场通信元件和各种传感器等等,本申请实施例对于该外围设备不作限定。其中,外围设备控制器可用于控制该外围设备。Peripheral devices may include input and output interfaces, external memory, analog-to-digital converters, digital-to-analog converters, peripheral processors, and so on. For example, the peripheral device may include a touch screen, a camera, a fingerprint collection, a near field communication element, and various sensors, etc., the embodiment of the present application does not limit the peripheral device. Among them, the peripheral device controller can be used to control the peripheral device.
可理解,该主芯片可以为各种形式的芯片,如该主芯片可以集成于系统级芯片(system on chip,SOC)上。可选的,该主芯片可应用于各种终端设备中,如该主芯片可应用于手机或笔记本电脑中等等,本申请实施例不作限定。It is understandable that the main chip may be chips of various forms, for example, the main chip may be integrated on a system-on chip (SOC). Optionally, the main chip can be applied to various terminal devices. For example, the main chip can be applied to a mobile phone or a notebook computer, etc., which is not limited in the embodiment of the present application.
可理解,图1所示的主芯片仅为本申请实施例提供的一个例子,且该主芯片可具有比示出的部件更多或更少的部件,可以组合两个或更多个部件,或者可具有不同部件的不同配置实现等等。It can be understood that the main chip shown in FIG. 1 is only an example provided by the embodiment of the present application, and the main chip may have more or less components than the components shown, and two or more components may be combined. Or it can have different configurations of different components and so on.
参见图2,图2是本申请实施例提供的一种存储芯片的结构示意图,该存储芯片可与UPIU连接。如图2所示,该存储芯片包括控制器和存储阵列如NAND flash阵列。该控制器和该存储阵列可通过线路相互连接。Referring to FIG. 2, FIG. 2 is a schematic structural diagram of a memory chip provided by an embodiment of the present application, and the memory chip can be connected to the UPIU. As shown in Figure 2, the memory chip includes a controller and a memory array such as a NAND flash array. The controller and the storage array can be connected to each other through wires.
具体的,该控制器为该存储芯片的核心器件,可用于合理调配数据在各个存储阵列上的负荷,以及该控制器还可用于数据中转,连接存储阵列和外部串行接口。Specifically, the controller is the core device of the memory chip, which can be used to rationally allocate the data load on each storage array, and the controller can also be used for data transfer, connecting the storage array and an external serial interface.
可选的,该控制器还可进一步包括硬件芯片,如该硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),或者,该硬件芯片还可以是现场可编程逻辑门阵列(field programmable gate array,FPGA)等等,本申请实施例不作限定。Optionally, the controller may further include a hardware chip. For example, the hardware chip may be an application-specific integrated circuit (ASIC), or the hardware chip may also be a field programmable logic gate array (field programmable logic gate array). gate array, FPGA), etc., which are not limited in the embodiment of the present application.
进一步地,该控制器中可包括静态随机存取存储器(static random access memory,SRAM)。Further, the controller may include static random access memory (SRAM).
可选的,该存储芯片可以为各种形式的芯片。可选的,该存储芯片可应用于各种存储装置中,如该存储芯片可应用于固态硬盘(solid state disk,SSD)中等等,本申请实施例不作限定。可选的,该存储芯片还可应用于各种终端设备中,如该存储芯片可应用于手机或笔记本电脑中等。Optionally, the storage chip can be a chip of various forms. Optionally, the storage chip can be applied to various storage devices. For example, the storage chip can be applied to a solid state disk (SSD), etc., which is not limited in the embodiment of the present application. Optionally, the memory chip can also be applied to various terminal devices, for example, the memory chip can be applied to a mobile phone or a notebook computer.
本申请实施例中,该存储芯片中可包括与应用相关的数据或程序等等,以及该存储芯片还可被划分为不同的区域,从而使得划分后的区域存储不同的数据,以及该存储芯片中不同的存储形态或存储介质之间还可被相互转换。对于具体的转换条件可参考图5和/或图6所示的方法,这里先不详述。In the embodiment of the present application, the storage chip may include application-related data or programs, etc., and the storage chip may also be divided into different areas, so that the divided areas store different data, and the storage chip Different storage formats or storage media can also be converted mutually. For specific conversion conditions, reference may be made to the method shown in FIG. 5 and/or FIG. 6, which will not be described in detail here.
本申请实施例中,该存储芯片可被划分为快速存储区域和普通存储区域,更具体的,该存储芯片中的存储阵列中可包括快速存储区域以及普通存储区域。该快速存储区域和该普通存储区域的访问速度不同。即快速存储区域的访问速度大于普通存储区域的访问速度。可理解,本申请实施例中,由于快速存储区域还可转换为普通存储区域。因此存储芯片可被划分为快速存储区域以及第一普通存储区域,在该快速存储区域转换为普通存储区域后,该快速存储区域所转换后的普通存储区域可理解为第二普通存储区域,这时,存储芯片中可包括第一普通存储区域以及第二普通存储区域。其中,快速存储区域数据的存储形态可对应第一存储形态,而第二普通存储区域数据的存储形态可对应第二存储形态,至于第一普通存储区域数据的存储形态本申请实施例不作限定。可理解,如图特别说明,本申请中的普通存储区域可理解为第二普通存储区域。具体的,如存储芯片中的存储介质类型为NAND时,该快速存储区域可为NAND中的一块区域,可理解,该快速存储区域在存储芯片中的位置主芯片可通过LUN得知。可理解,本申请实施例对于该快速存储区域具体在存储芯片中的位置不作限定。In the embodiment of the present application, the memory chip may be divided into a fast storage area and a normal storage area. More specifically, the storage array in the memory chip may include a fast storage area and a normal storage area. The fast storage area and the normal storage area have different access speeds. That is, the access speed of the fast storage area is greater than that of the ordinary storage area. It can be understood that, in the embodiment of the present application, the fast storage area can also be converted into a normal storage area. Therefore, the memory chip can be divided into a fast storage area and a first normal storage area. After the fast storage area is converted into a normal storage area, the normal storage area converted from the fast storage area can be understood as the second normal storage area. At this time, the memory chip may include a first normal storage area and a second normal storage area. The storage form of the fast storage area data can correspond to the first storage form, and the storage form of the second general storage area data can correspond to the second storage form. The storage form of the first general storage area data is not limited in this embodiment. It can be understood that, as specifically illustrated in the figure, the ordinary storage area in this application can be understood as the second ordinary storage area. Specifically, if the storage medium type in the storage chip is NAND, the fast storage area may be an area in NAND. It is understandable that the location of the fast storage area in the storage chip can be known by the main chip through LUN. It can be understood that the embodiment of the present application does not limit the specific location of the fast storage area in the storage chip.
其中,快速存储区域中所存储的数据不仅可包括与应用相关的数据,还可包括关键数据库,文件系统元数据以及虚拟内存交换机制相关的数据等等,本申请实施例对于该快速存储区域中所存储的数据不作限定。具体的,快速存储区域中可存储与热点应用相关的数据,该热点应用也可理解为高频应用,即为终端设备中频繁使用的应用(application,APP),如该高频应用可理解为一段时间内使用频率超过频率阈值的应用,或者,该高频应用还可理解为用户所定义的一些应用等等。本申请实施例对于如何定义或设置高频应用不作限定。Among them, the data stored in the fast storage area may include not only application-related data, but also key databases, file system metadata, and data related to the virtual memory exchange mechanism, etc. The embodiment of the present application relates to the fast storage area The stored data is not limited. Specifically, data related to hot applications can be stored in the fast storage area. The hot applications can also be understood as high-frequency applications, that is, frequently used applications (APP) in terminal devices. For example, the high-frequency applications can be understood as An application whose frequency of use exceeds the frequency threshold within a period of time, or the high-frequency application can also be understood as some applications defined by the user and so on. The embodiments of this application do not limit how to define or set high-frequency applications.
可理解,本申请实施例对于该存储芯片的具体类型不作限定。可理解,图2所示的存储芯片仅为本申请实施例提供的一个例子,且该存储芯片可具有比示出的部件更多或更少的部件,可以组合两个或更多个部件,或者可具有不同部件的不同配置实现等等。It can be understood that the embodiment of the present application does not limit the specific type of the memory chip. It can be understood that the memory chip shown in FIG. 2 is only an example provided by the embodiment of the present application, and the memory chip may have more or fewer components than the components shown, and two or more components may be combined. Or it can have different configurations of different components and so on.
可理解,本申请实施例中的快速存储区域也可称为快盘(turbo zone),而普通存储区域可称为慢盘。需要说明的是,该慢盘是相对于快盘的访问速度来说的,如该慢盘也可称为普通盘等等,本申请实施例不作限定。It can be understood that the fast storage area in the embodiments of the present application may also be referred to as a turbo zone, and the ordinary storage area may be referred to as a slow disk. It should be noted that the slow disk is relative to the access speed of the fast disk. For example, the slow disk may also be called a normal disk, etc., which is not limited in the embodiment of the present application.
参见图3,图3是本申请实施例提供的一种终端设备的结构示意图。如图3所示,该终端设备可包括屏幕、主芯片和存储芯片。其中,该主芯片可为图1所示的主芯片,如该主芯片可包括屏幕控制器、外围设备控制器、DDR、DDR控制器、UFS主(host)控制器和主CPU等等。该存储芯片可为图2所示的存储芯片,其中,该存储芯片中包含的部件在图3中未示出。可理解,图3所示的终端设备还包括外围设备等等。Refer to FIG. 3, which is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in Figure 3, the terminal device may include a screen, a main chip and a memory chip. The main chip may be the main chip shown in FIG. 1, for example, the main chip may include a screen controller, a peripheral device controller, a DDR, a DDR controller, a UFS host controller, a main CPU, and so on. The memory chip may be the memory chip shown in FIG. 2, wherein the components included in the memory chip are not shown in FIG. 3. It can be understood that the terminal device shown in FIG. 3 also includes peripheral devices and so on.
具体的,该UFS主控制器与该存储芯片连接,该UFS主控制器可用于与存储芯片交互,从而使得该终端设备能够通过UFS主控制器读取该存储芯片中的数据。本申请实施例中,主CPU可用于向存储芯片发出读请求,从而读取存储芯片中的数据。可理解,本申请实施例对于该UFS主控制器不作限定,如在终端设备中与存储芯片交互的器件还可能为其他器件等等,本申请实施例对于该UFS主控制器是否存在不作限定。Specifically, the UFS main controller is connected to the storage chip, and the UFS main controller can be used to interact with the storage chip, so that the terminal device can read the data in the storage chip through the UFS main controller. In the embodiment of the present application, the main CPU may be used to issue a read request to the storage chip, thereby reading data in the storage chip. It can be understood that the embodiment of the present application does not limit the UFS main controller. For example, the device interacting with the storage chip in the terminal device may be other devices. The embodiment of the present application does not limit whether the UFS main controller exists.
具体的,该主CPU可以包括RISC微处理器(advanced RISC machines,ARM)等等,本申请实施例对于该主CPU的具体类型或型号不作限定。Specifically, the main CPU may include a RISC microprocessor (advanced RISC machines, ARM), etc. The embodiment of the present application does not limit the specific type or model of the main CPU.
可理解,图3所示的终端设备仅为一个示例,不应将其理解为对本申请实施例的限定。It can be understood that the terminal device shown in FIG. 3 is only an example, and it should not be understood as a limitation to the embodiment of the present application.
参见图4,图4是本申请实施例提供的一种数据存储方法的流程示意图,该方法可应用于图2所示的存储芯片,以及该方法还可应用于图3所示的终端设备。如图4所示,该数据存储方法包括:Referring to FIG. 4, FIG. 4 is a schematic flowchart of a data storage method provided by an embodiment of the present application. The method can be applied to the memory chip shown in FIG. 2, and the method can also be applied to the terminal device shown in FIG. As shown in Figure 4, the data storage method includes:
401、存储芯片获取快速存储区域的有效数据量,上述快速存储区域的数据的存储形态为第一存储形态。401. The storage chip acquires the effective data amount of the fast storage area, and the storage form of the data in the fast storage area is the first storage form.
可理解,对于存储芯片中包括的快速存储区域的描述可参考前述实施例,这里不再一一详述。本申请实施例中,快速存储区域中所存储的数据不仅可包括与应用相关的数据,还可包括关键数据库,文件系统元数据以及虚拟内存交换机制相关的数据等等,本申请实施例对于该快速存储区域中所存储的数据不作限定。因此,存储芯片所获取的有效数据量可理解为该存储芯片获取的是该快速存储区域中所存储的数据的数据量。或者,该有效数据量还可以称为物理有效数据等等,本申请实施例不作限定。作为示例,如该存储芯片所 获取的有效数据量可为20G,又或者为xG等等,本申请实施例对于该有效数据量的具体取值不作限定,该具体取值可根据实际情况而定。It can be understood that, for the description of the fast storage area included in the memory chip, reference may be made to the foregoing embodiment, which will not be described in detail here. In the embodiment of this application, the data stored in the fast storage area may include not only application-related data, but also key databases, file system metadata, and data related to the virtual memory exchange mechanism. The data stored in the fast storage area is not limited. Therefore, the effective data volume acquired by the memory chip can be understood as the data volume of the data stored in the fast storage area acquired by the memory chip. Alternatively, the effective data amount may also be referred to as physical effective data, etc., which is not limited in the embodiment of the present application. As an example, if the effective data amount acquired by the memory chip may be 20G, or xG, etc., the embodiment of the present application does not limit the specific value of the effective data amount, and the specific value may be determined according to actual conditions. .
402、在上述快速存储区域的有效数据量大于第一阈值的情况下,上述存储芯片将上述快速存储区域转换为普通存储区域,且上述普通存储区域的数据的存储形态为第二存储形态。402. When the effective data amount of the fast storage area is greater than the first threshold, the storage chip converts the fast storage area into a normal storage area, and the storage form of the data in the normal storage area is the second storage form.
本申请实施例中,该存储芯片中数据的存储形态可相互转换,如在第一存储形态与第二存储形态之间相互转换。可理解,本申请实施例中存储芯中数据的存储形态还可包括第三存储形态,从而使得该存储芯片中数据的存储形态在第一存储形态、第二存储形态以及第三存储形态之间相互转换。其中,该第一存储形态、第二存储形态以及第三存储形态可理解为属于同一种存储介质的不同存储形态。作为示例,如可为NAND的不同存储形态。可理解,对于第三存储形态所对应的区域的名称,本申请实施例不作限定。可以理解,该快速存储区域与普通存储区域在数据的存储形态上不同,如快速存储区域中数据的存储形态为第一存储形态,普通存储区域中数据的存储形态为第二存储形态。也就是说,在转换存储芯片中的存储形态时,该存储芯片中的存储区域的名称得以相互转换。可理解,对于第一存储形态与第三存储形态的读写速度大小,以及第二存储形态与第三存储形态的读写速度大小,本申请实施例不作限定。In the embodiment of the present application, the storage mode of the data in the storage chip can be converted mutually, for example, between the first storage mode and the second storage mode. It can be understood that the storage form of the data in the storage core in the embodiment of the present application may also include a third storage form, so that the storage form of the data in the memory chip is between the first storage form, the second storage form, and the third storage form. Convert each other. Among them, the first storage form, the second storage form, and the third storage form can be understood as different storage forms belonging to the same storage medium. As an example, it can be different storage forms of NAND. It can be understood that the embodiment of the present application does not limit the name of the area corresponding to the third storage form. It can be understood that the fast storage area is different from the ordinary storage area in the storage form of data. For example, the storage form of data in the fast storage area is the first storage form, and the storage form of data in the ordinary storage area is the second storage form. That is to say, when the storage form in the storage chip is converted, the names of the storage areas in the storage chip can be mutually converted. It can be understood that the reading and writing speed of the first storage form and the third storage form, and the reading and writing speed of the second storage form and the third storage form are not limited in the embodiment of the present application.
本申请实施例中,第一存储形态与第二存储形态还可为同一种存储介质,如快速的NAND与慢速的NAND。In the embodiment of the present application, the first storage form and the second storage form may also be the same storage medium, such as fast NAND and slow NAND.
作为示例,如第一存储形态包括单层存储单元(single-level cell,SLC),第二存储形态包括三存储层单元(trinary-level cell,TLC);或者,第一存储形态包括SLC,第二存储形态包括多层存储单元(multi-level cell,MLC);或者,第一存储形态包括MLC,第二存储形态包括TLC;或者,第一存储形态包括SLC,第二存储形态包括QLC。作为示例,如在将SLC转换为TLC时,可将SLC的存储颗粒中的数据搬走,从而将SLC转换为TLC,然后再使用TLC来存储数据。而在将TLC转换为SLC时,可将TLC的存储颗粒中的数据如三分之二的数据搬走,从而将TLC转换为SLC,然后再使用SLC来存储数据。作为示例,SLC即1bit/cell,速度快寿命长,月10万次擦写寿命;MLC即2bit/cell,速度一般寿命一般,约3000至10000次擦写寿命;TLC即3bit/cell,速度慢寿命段,约500次擦写寿命;QLC即4bit/cell,约150次擦写寿命。As an example, if the first storage form includes single-level cells (SLC), the second storage form includes three-level cells (trinary-level cells, TLC); or, the first storage form includes SLC, and the second storage form includes SLC. The second storage form includes multi-level cell (MLC); or, the first storage form includes MLC, and the second storage form includes TLC; or, the first storage form includes SLC, and the second storage form includes QLC. As an example, when converting SLC to TLC, the data in the storage particles of the SLC can be moved away, thereby converting the SLC to TLC, and then using TLC to store the data. When converting TLC to SLC, two-thirds of the data in the TLC storage particles can be moved away, thereby converting TLC to SLC, and then using SLC to store the data. As an example, SLC is 1bit/cell, which is fast and has a long life span of 100,000 cycles per month; MLC is 2bit/cell, and has a general life span, about 3000 to 10,000 cycles; TLC is 3bit/cell, which is slow Life period, about 500 erasing and writing life; QLC is 4bit/cell, about 150 erasing and writing life.
也就是说,本申请实施例中,如以SLC和TLC为例,快速存储区域还可对应SLC区域,而在将快速存储区域转换为普通存储区域之后,该普通存储区域可对应TLC区域。That is to say, in the embodiment of the present application, taking SLC and TLC as examples, the fast storage area can also correspond to the SLC area, and after the fast storage area is converted to the normal storage area, the normal storage area can correspond to the TLC area.
本申请实施例中,在快速存储区域中的有效数据量过大如大于第一阈值时,说明主芯片(又或者称为主机侧等等)待使用的空间越来越大,这时,存储芯片可将快速存储区域数据的存储形态由第一存储形态转换为普通存储区域数据的第二存储形态,从而在不牺牲用户可见空间基础上,扩大该存储区域的物理空间。In the embodiment of this application, when the effective data amount in the fast storage area is too large, such as greater than the first threshold, it means that the space to be used by the main chip (also called the host side, etc.) is getting larger and larger. At this time, the storage The chip can convert the storage form of the fast storage area data from the first storage form to the second storage form of the ordinary storage area data, thereby expanding the physical space of the storage area without sacrificing the user's visible space.
403、上述存储芯片获取上述普通存储区域的有效数据量。403. The storage chip obtains the effective data amount of the ordinary storage area.
本申请实施例中,该普通存储区域的有效数据量的相关描述可参考快速存储区域的有效数据量的相关描述,这里不再一一详述。In the embodiment of the present application, the relevant description of the effective data amount of the ordinary storage area may refer to the relevant description of the effective data amount of the fast storage area, which will not be detailed here.
404、在上述普通存储区域的有效数据量小于第二阈值的情况下,上述存储芯片将上述 普通存储区域转换为上述快速存储区域。404. In a case where the effective data amount of the ordinary storage area is less than the second threshold, the storage chip converts the ordinary storage area into the fast storage area.
本申请实施例中,第一阈值与第二阈值的取值可以相同,也可以不同,本申请实施例不作限定。可选的,该第一阈值可以大于该第二阈值等等,本申请实施例对于该第一阈值和该第二阈值不作限定。可理解,该第一阈值和该第二阈值可以由存储芯片自主设置,又或者由终端设备设置,又或者由用户设置等等,本申请实施例不作限定。In the embodiment of the present application, the values of the first threshold and the second threshold may be the same or different, which is not limited in the embodiment of the present application. Optionally, the first threshold may be greater than the second threshold, etc. The embodiment of the present application does not limit the first threshold and the second threshold. It can be understood that the first threshold and the second threshold may be independently set by the memory chip, or set by the terminal device, or set by the user, etc., which are not limited in the embodiment of the present application.
本申请实施例中,在普通存储区域中的有效数据量小于第二阈值时,说明主芯片待使用的空间可能会减小,这时,存储芯片可将普通存储区域数据的存储形态由第二存储形态转换为第一存储形态即将普通存储区域转换为快速存储区域,从而提高该快速存储区域中相关数据的响应速度。In the embodiment of this application, when the effective data amount in the common storage area is less than the second threshold, it means that the space to be used by the main chip may be reduced. At this time, the storage chip can change the storage form of the common storage area data from the second The conversion of the storage form to the first storage form is to convert the ordinary storage area into a fast storage area, thereby improving the response speed of related data in the fast storage area.
本申请实施例中,通过存储芯片中的快速存储区域或普通存储区域中的有效数据量,来相互转换该存储芯片中的数据的存储形态。从而如将与应用相关的数据存储在该存储芯片时,可根据需要来转换存储形态,如将存储形态在第一存储形态与第二存储形态之间转换,可以理解,由于两种存储形态不同,因此,第一存储形态与第二存储形态的读写速度也不同。进而如在第一存储形态的读写速度大于第二存储形态的读写速度,且在将第二存储形态转换为第一存储形态时(即将普通存储区域转换为快速存储区域),可使得存储芯片中数据的读性能得以提升,提高应用的响应速度。又如在将第一存储形态转换为第二存储形态时(即将快速存储区域转换为普通存储区域),可有效提高存储芯片的物理存储空间,使得该存储芯片中可缓存或存储更多的数据。In the embodiment of the present application, the storage form of the data in the storage chip is converted mutually through the effective data amount in the fast storage area or the normal storage area in the storage chip. Therefore, when the application-related data is stored in the storage chip, the storage mode can be changed as needed. For example, the storage mode can be switched between the first storage mode and the second storage mode. It is understandable that the two storage modes are different Therefore, the read and write speeds of the first storage mode and the second storage mode are also different. Furthermore, if the read and write speed of the first storage form is greater than that of the second storage form, and when the second storage form is converted to the first storage form (that is, the normal storage area is converted to a fast storage area), the storage The read performance of the data in the chip is improved, and the response speed of the application is improved. Another example is when the first storage form is converted to the second storage form (that is, the fast storage area is converted to a normal storage area), the physical storage space of the storage chip can be effectively increased, so that more data can be cached or stored in the storage chip .
作为示例,如将用户经常使用的应用(称为高频应用或热点应用)安装于快速存储区域,从而在该应用被冷启动时,能够提高该应用的响应速度。又如将应用上下文状态存储在快速存储区域,当内存紧缺被强制关闭时,又被重新调出时,可提高应用的响应速度,提高用户满意度。又如将系统关键数据存储在快速存储区域,可提高系统运行速度,使得系统运行更流畅。可理解,以上仅为本申请提供的示例,不应将其理解为对本申请的限定。As an example, if an application frequently used by a user (called a high-frequency application or a hot application) is installed in a fast storage area, when the application is cold-started, the response speed of the application can be improved. Another example is to store the application context state in the fast storage area. When the memory shortage is forcibly closed, when it is recalled again, the response speed of the application can be improved and user satisfaction can be improved. Another example is storing the key data of the system in the fast storage area, which can increase the speed of the system and make the system run more smoothly. It can be understood that the above are only examples provided in this application, and should not be construed as limiting the application.
本申请实施例中,存储芯片可根据快速存储区域的有效数据量的数据量大小来决定是否将快速存储区域转换为普通存储区域。可理解,本申请实施例中,第一存储形态的存储空间与第二存储形态的存储空间之间有存储空间大小的转换关系,以及第一存储形态与第二存储形态的读写速度不同如第一存储形态的读写速度大于第二存储形态的读写速度。In the embodiment of the present application, the storage chip may determine whether to convert the fast storage area into a normal storage area according to the data size of the effective data amount of the fast storage area. It can be understood that, in the embodiment of the present application, there is a storage space size conversion relationship between the storage space of the first storage form and the storage space of the second storage form, and the read and write speeds of the first storage form and the second storage form are different. The read and write speed of the first storage form is greater than that of the second storage form.
本申请实施例中,通过存储芯片中的快速存储区域中的有效数据量,来相互转换该快速存储区域数据的存储形态;从而如将与应用相关的数据存储在快速存储区域时,可根据需要来转换存储形态,如将存储形态在第一存储形态与第二存储形态之间转换。又或者,将其他系统关键数据存储在快速存储区域时,该存储芯片可根据需要来转换存储形态,从而提高该关键数据的响应速度。In the embodiments of the present application, the storage form of the data in the fast storage area is mutually converted by the effective data amount in the fast storage area in the storage chip; thus, when the application-related data is stored in the fast storage area, it can be used as needed To switch the storage format, such as switching the storage format between the first storage format and the second storage format. Or, when other key data of the system is stored in the fast storage area, the storage chip can change the storage form as needed, thereby improving the response speed of the key data.
可选的,在上述快速存储区域的有效数据量大于第一阈值的情况下,将上述快速存储区域转换为普通存储区域,包括:Optionally, in the case that the effective data amount of the fast storage area is greater than a first threshold, converting the fast storage area into a normal storage area includes:
在上述快速存储区域的有效数据量大于上述第一阈值的情况下,根据上述快速存储区域的有效数据量的大小以及上述第一存储形态与上述第二存储形态的存储空间转换关系将上述快速存储区域转换为上述普通存储区域。In the case where the effective data amount of the quick storage area is greater than the first threshold, the quick storage is based on the size of the effective data amount of the quick storage area and the storage space conversion relationship between the first storage mode and the second storage mode. The area is converted to the normal storage area described above.
本申请实施例中,第一存储形态与第二存储形态之间的存储空间转换关系可为1:2, 又或者1:3,又或者2:3,又或者1:4等等。也就是说,作为示例,如存储形态为第一存储形态时的xG空间,可转换为存储形态为第二存储形态时的3xG空间。In the embodiment of this application, the storage space conversion relationship between the first storage form and the second storage form may be 1:2, or 1:3, or 2:3, or 1:4, and so on. That is, as an example, the xG space when the storage format is the first storage format can be converted to the 3xG space when the storage format is the second storage format.
本申请实施例中,存储芯片可根据已使用的数据量大小以及第一存储形态与第二存储形态之间的空间转换关系来转换快速存储区域中数据的存储形态。作为示例,如SLC与TLC之间的空间转换关系为1:3,第一阈值为15G时,在存储芯片获取到的有效数据量为17G,则可能还需要往存储芯片中存储数据,因此,存储芯片便可将10G的SLC转换为30G的TLC,从而来存储数据,由此不仅未牺牲用户的可见空间,如用户感觉不到空间的损失等等,而且还可以扩展数据的存储空间,以供存储芯片来存储或缓存数据。又如,存储芯片获取到的数据量为30G或更大,则存储芯片便可将20G的SLC转换为60G的TLC,从而来存储更多的数据。可理解,以上各个数值仅为一种示例,不应理解为对本申请的限定。In the embodiment of the present application, the storage chip can switch the storage mode of the data in the fast storage area according to the amount of used data and the space conversion relationship between the first storage mode and the second storage mode. As an example, if the space conversion relationship between SLC and TLC is 1:3, and the first threshold is 15G, the effective data amount acquired by the memory chip is 17G, and data may need to be stored in the memory chip. Therefore, The memory chip can convert 10G SLC to 30G TLC to store data, which not only does not sacrifice the user’s visible space, such as the user’s inability to feel the loss of space, etc., but also expands the data storage space to For storage chips to store or cache data. For another example, if the amount of data acquired by the memory chip is 30G or greater, the memory chip can convert 20G SLC into 60G TLC to store more data. It can be understood that each of the above values is only an example, and should not be construed as a limitation to the application.
可选的,在上述普通存储区域的有效数据量小于第二阈值的情况下,将上述普通存储区域转换为上述快速存储区域,包括:Optionally, in the case that the effective data amount of the ordinary storage area is less than a second threshold, converting the ordinary storage area into the fast storage area includes:
在上述普通存储区域的有效数据量小于上述第二阈值的情况下,根据上述普通存储区域的有效数据量的大小以及上述第一存储形态与上述第二存储形态的存储空间转换关系将上述普通存储区域转换为上述快速存储区域。In the case where the effective data amount of the ordinary storage area is less than the second threshold, the ordinary storage is based on the size of the effective data amount of the ordinary storage area and the storage space conversion relationship between the first storage form and the second storage form. The area is converted to the above fast storage area.
本申请实施例中,存储芯片可根据已使用的数据量大小以及第一存储形态与第二存储形态之间的空间转换关系来转换快速存储区域中数据的存储形态。作为示例,如SLC与TLC之间的空间转换关系为1:3,第二阈值为8G时,在存储芯片获取到的有效数据量为7G,则可能不需要往存储芯片中存储数据,因此,存储芯片便可将30G的TLC转换为10G的SLC,从而来存储数据,由此不仅未牺牲用户的可见空间,如用户感觉不到空间的损失等等,而且由于TLC的速度比SLC的速度慢,因此还可提高数据的读写性能。可理解,以上各个数值仅为一种示例,不应理解为对本申请的限定。In the embodiment of the present application, the storage chip can switch the storage mode of the data in the fast storage area according to the amount of used data and the space conversion relationship between the first storage mode and the second storage mode. As an example, if the spatial conversion relationship between SLC and TLC is 1:3, and the second threshold is 8G, the effective data amount acquired by the memory chip is 7G, and there may be no need to store data in the memory chip. Therefore, The memory chip can convert 30G TLC to 10G SLC to store data, which not only does not sacrifice the user's visible space, such as the user cannot feel the loss of space, etc., but also because the speed of TLC is slower than that of SLC , So it can also improve data read and write performance. It can be understood that each of the above values is only an example, and should not be construed as a limitation to the application.
可理解,该存储芯片中存储形态能够相互转换,也可以有前提条件,如在上述快速存储区域的磨损次数小于磨损次数阈值的情况下,该存储芯片中第一存储形态可以与第二存储形态相互转换,即快速存储区域可以与普通存储区域相互转换。而在上述快速存储区域的磨损次数不小于上述磨损次数阈值的情况下,将上述存储芯片中相关区域的存储形态由上述第一存储形态完全转换为上述第二存储形态,也即将上述快速存储区域完全转换为普通存储区域。也就是说,第一存储形态与第二存储形态之间可以相互转换的前提条件可以为快速存储区域的磨损次数小于磨损次数阈值,而若快速存储区域的磨损次数超过了该磨损次数阈值,则说明快速存储区域的存储形态无法相互转换,即第一存储形态可以完全转换为第二存储形态。其中,该磨损次数阈值可以由存储芯片的性能决定等等,本申请实施例对于该磨损次数阈值的设置不作限定。It is understandable that the storage modes in the memory chip can be interchanged, and there may also be preconditions. For example, in the case that the wear times of the fast storage area is less than the wear times threshold, the first storage mode in the memory chip can be the same as the second storage mode. Mutual conversion, that is, the fast storage area can be converted to the ordinary storage area. In the case where the wear count of the fast storage area is not less than the wear count threshold, the storage form of the relevant area in the memory chip is completely converted from the first storage form to the second storage form, that is, the fast storage area Fully converted to normal storage area. In other words, the precondition for mutual conversion between the first storage form and the second storage form may be that the wear times of the fast storage area is less than the wear times threshold, and if the wear times of the fast storage area exceeds the wear times threshold, then It shows that the storage modes of the fast storage area cannot be converted to each other, that is, the first storage mode can be completely converted to the second storage mode. The threshold of the number of wear times may be determined by the performance of the memory chip, etc. The embodiment of the present application does not limit the setting of the threshold of the number of wear times.
可理解,本申请实施例还提供了一种如何设置快速存储区域存储数据量大小的方法,即上述获取上述快速存储区域的有效数据量之前,上述方法还包括:根据应用数据的使用情况,为上述存储芯片分配上述快速存储区域。It is understandable that the embodiment of the present application also provides a method of how to set the amount of data stored in the fast storage area, that is, before obtaining the effective data amount of the fast storage area, the above method further includes: according to the usage of application data, The storage chip allocates the fast storage area.
也就是说,存储芯片可以在用户应用行为分析的基础上,来分配快速存储区域。又或者,存储芯片可在用户应用行为分析的基础上,来分配快速存储区域以及图2所描述的第一普通存储区域。即存储芯片可以先分析用户使用终端设备的情况,如分析用户通过终端 设备使用应用的数据情况后,该存储芯片便可以根据该用户使用应用的情况,来分配快速存储区域和第一普通存储区域的大小。如存储芯片通过分析应用数据的使用情况,可以将存储芯片中的10G空间作为快速存储区域(如可转换为30G的第二普通存储区域),而将存储芯片中的20G空间作为第一普通存储区域。可理解,以上所示的数字仅为示例,不应理解为对本申请的限定。In other words, the storage chip can allocate fast storage areas based on user application behavior analysis. Alternatively, the storage chip may allocate the fast storage area and the first common storage area described in FIG. 2 based on the analysis of user application behavior. That is, the storage chip can first analyze the user's use of the terminal device. For example, after analyzing the user's use of the application data through the terminal device, the storage chip can allocate the fast storage area and the first common storage area according to the user's application situation the size of. For example, by analyzing the usage of application data, the memory chip can use the 10G space in the memory chip as a fast storage area (for example, the second ordinary storage area that can be converted to 30G), and the 20G space in the memory chip as the first ordinary storage area. It can be understood that the numbers shown above are only examples and should not be construed as limiting the application.
为更形象的理解本申请实施例所提供的数据存储方法,参见图5,图5是本申请实施例提供的一种数据存储方法的场景示意图,如图5所示,快速存储区域即图中的SLC区域,保留区域可理解为虚拟的空间。如快速存储区域的存储形态为SLC存储形态,当存储芯片中的数据量越来越大(如图5中第二行虚线箭头),如大于xGB时,则可将SLC区域转换为TLC区域,即将数据的存储形态从SLC存储形态转换为TLC存储形态(如图5中第二行实线箭头)。而当存储芯片中的数据量越来越小(如图5中第三行虚线箭头),如小于yGB时,则可将TLC区域转换为SLC区域,即将数据的存储形态从TLC存储形态转换为SLC存储形态(如图5中第三行实线箭头)。可理解,LUm可理解为图2所描述的第一普通存储区域,其逻辑单元号为m。而在将SLC转换为TLC后,该TLC区域即图2所描述的第二普通存储区域的逻辑单元号可以为LUn。其中,x和y可为任意正数,对于具体取值,本申请不作限定。For a more vivid understanding of the data storage method provided by the embodiment of this application, refer to FIG. 5. FIG. 5 is a schematic diagram of a data storage method provided by the embodiment of this application. As shown in FIG. 5, the fast storage area is The reserved area of the SLC area can be understood as a virtual space. For example, the storage form of the fast storage area is the SLC storage form. When the amount of data in the memory chip becomes larger and larger (as shown by the dotted arrow in the second line of Figure 5), if it is larger than xGB, the SLC area can be converted into a TLC area. That is, the storage mode of the data is converted from the SLC storage mode to the TLC storage mode (see the solid arrow in the second row in Figure 5). And when the amount of data in the memory chip is getting smaller and smaller (as shown by the dotted arrow in the third row of Figure 5), if it is less than yGB, the TLC area can be converted to SLC area, that is, the storage form of the data can be converted from TLC storage form to SLC storage form (the solid arrow in the third row in Figure 5). It can be understood that LUm can be understood as the first general storage area described in FIG. 2, and its logical unit number is m. After the SLC is converted to TLC, the logical unit number of the TLC area, that is, the second general storage area described in FIG. 2 may be LUn. Wherein, x and y can be any positive numbers, and the application does not limit specific values.
进一步的,如可将图5所示的示意图分为三个时期,如:Further, the schematic diagram shown in Figure 5 can be divided into three periods, such as:
快速存储区域使能期,在快速存储区域的磨损次数小于磨损次数阈值的情况下,如在擦除次数(erase count,EC)技术规格内,快速存储区域的有效数据总量在门限z1GB以内,快速存储区域读性能全命中SLC,其中,z1为任意正数。可理解,本申请实施例中,磨损次数也可理解为该擦除次数EC值。The fast storage area enable period, when the wear times of the fast storage area is less than the wear threshold, such as the erase count (EC) technical specification, the total amount of effective data in the fast storage area is within the threshold z1GB, The read performance of the fast storage area all hits the SLC, where z1 is any positive number. It can be understood that, in the embodiment of the present application, the number of wear times can also be understood as the number of erasing EC values.
快速存储区域暂停期,在快速存储区域的磨损次数小于磨损次数阈值的情况下,快速存储区域的有效数据总量在门限z1GB外,快速存储区域启动SLC到TLC返还(返还至TLC后,该快速存储区域可称为普通存储区域)。又如在普通存储区域有效数据总量在门限z2GB内,普通存储区域启动TLC到SLC逆返还,其中,z2为任意正数。During the fast storage area suspension period, when the wear times of the fast storage area are less than the wear threshold, the total amount of effective data in the fast storage area is outside the threshold z1GB, and the fast storage area starts the SLC to TLC return (after returning to the TLC, the fast The storage area can be called a normal storage area). For another example, if the total amount of valid data in the ordinary storage area is within the threshold z2GB, the ordinary storage area starts TLC to SLC reverse return, where z2 is any positive number.
快速存储区域关闭期,在快速存储区域的磨损次数不小于磨损次数阈值的情况下,快速存储区域永久关闭,也就是说,存储芯片中数据的存储形态可以由SLC完全转换为TLC,而不能再继续从TLC向SLC转换。During the fast storage area shutdown period, when the wear times of the fast storage area are not less than the wear threshold, the fast storage area is permanently closed, that is, the storage form of the data in the memory chip can be completely converted from SLC to TLC, and no longer Continue to convert from TLC to SLC.
可理解,以上仅为本申请的一个示例,不应将其中的数据量大小或数据量阈值理解为对本申请的限定。It can be understood that the above is only an example of the present application, and the data volume size or the data volume threshold therein should not be understood as a limitation on the present application.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The foregoing describes the method of the embodiment of the present application in detail, and the device of the embodiment of the present application is provided below.
参见图6,图6是本申请实施例提供的一种存储芯片的结构示意图,如图6所示,该存储芯片可以包括:Referring to FIG. 6, FIG. 6 is a schematic structural diagram of a memory chip provided by an embodiment of the present application. As shown in FIG. 6, the memory chip may include:
获取单元601,用于获取快速存储区域的有效数据量,上述快速存储区域的数据的存储形态为第一存储形态;The acquiring unit 601 is configured to acquire the effective data amount of the fast storage area, and the storage form of the data in the fast storage area is the first storage form;
转换单元602,用于在上述快速存储区域的有效数据量大于第一阈值的情况下,将上述快速存储区域转换为普通存储区域,且上述普通存储区域的数据的存储形态为第二存储形态。The conversion unit 602 is configured to convert the fast storage area into a normal storage area when the effective data amount of the fast storage area is greater than the first threshold, and the storage form of the data in the normal storage area is the second storage form.
本申请实施例中,存储芯片中通过包括快速存储区域,可提高应用的响应速度;且在快速存储区域中的有效数据量过大如大于第一阈值时,说明主芯片(又或者称为主机侧等等)待使用的空间越来越大,这时,存储芯片可转换存储形态,也就是说,存储芯片可将快速存储区域的数据的第一存储形态转换为普通存储区域的数据的第二存储形态,从而在不牺牲用户可见逻辑空间基础上,扩大存储区域的物理空间。In the embodiment of the present application, the storage chip includes a fast storage area to improve the response speed of the application; and when the effective data amount in the fast storage area is too large, such as greater than the first threshold, it indicates that the main chip (also referred to as the host Side, etc.) The space to be used is getting larger and larger. At this time, the memory chip can switch the storage form, that is, the memory chip can convert the first storage form of the data in the fast storage area into the second storage form of the data in the ordinary storage area. 2. Storage form, so as to expand the physical space of the storage area without sacrificing the user's visible logical space.
在一种可能的实现方式中,上述获取单元601,还用于获取上述普通存储区域的有效数据量;In a possible implementation manner, the above-mentioned obtaining unit 601 is further configured to obtain the effective data amount of the above-mentioned ordinary storage area;
上述转换单元602,还用于在上述普通存储区域的有效数据量小于第二阈值的情况下,将上述普通存储区域转换为上述快速存储区域。The conversion unit 602 is further configured to convert the normal storage area into the fast storage area when the effective data amount of the normal storage area is less than a second threshold.
本申请实施例中,在普通存储区域中的有效数据量小于第二阈值时,说明主芯片待使用的空间可能会减小,这时,存储芯片可将普通存储区域的数据的第二存储形态转换为快速存储区域的数据的第一存储形态,从而提高存储芯片存储区域中相关数据的响应速度。In the embodiment of the present application, when the effective data amount in the common storage area is less than the second threshold, it indicates that the space to be used by the main chip may be reduced. At this time, the storage chip can store data in the common storage area in the second storage mode It is converted into the first storage form of data in the fast storage area, thereby improving the response speed of related data in the storage area of the memory chip.
在一种可能的实现方式中,上述转换单元602,具体用于在上述快速存储区域的有效数据量大于上述第一阈值的情况下,根据上述快速存储区域的有效数据量的大小以及上述第一存储形态与上述第二存储形态的存储空间转换关系将上述快速存储区域转换为上述普通存储区域。In a possible implementation manner, the conversion unit 602 is specifically configured to, when the effective data amount of the fast storage area is greater than the first threshold, according to the size of the effective data amount of the fast storage area and the first The storage space conversion relationship between the storage mode and the second storage mode converts the fast storage area into the normal storage area.
本申请实施例中,在将快速存储区域转换为普通存储区域时,可根据用户的使用情况,即根据存储芯片中数据的使用情况来转换;更具体的,根据数据的使用情况以及存储空间转换关系将快速存储区域转换为普通存储区域;从而避免了区域转换过大,而没有有效利用的情况。In the embodiments of the present application, when converting the fast storage area to the normal storage area, the conversion can be performed according to the user's usage, that is, according to the usage of the data in the storage chip; more specifically, according to the usage of the data and the storage space The relationship converts the fast storage area to the normal storage area; thus avoiding the situation that the area is converted too large and not effectively used.
在一种可能的实现方式中,上述转换单元602,具体用于在上述普通存储区域的有效数据量小于上述第二阈值的情况下,根据上述普通存储区域的有效数据量的大小以及上述第一存储形态与上述第二存储形态的存储空间转换关系将上述普通存储区域转换为上述快速存储区域。In a possible implementation manner, the conversion unit 602 is specifically configured to, when the effective data amount of the ordinary storage area is less than the second threshold, according to the size of the effective data amount of the ordinary storage area and the first The storage space conversion relationship between the storage format and the second storage format converts the ordinary storage area into the fast storage area.
本申请实施例中,在将普通存储区域转换为快速存储区域时,可根据用户的使用情况,即根据存储芯片中数据的使用情况来转换;更具体的,根据数据的使用情况以及存储空间转换关系将普通存储区域转换为快速存储区域;从而避免了转换过多的快速存储区域,而导致数据无法存储或缓存的情况。In the embodiments of this application, when converting a normal storage area to a fast storage area, the conversion can be based on the user's usage, that is, according to the usage of the data in the storage chip; more specifically, the conversion can be based on the usage of the data and the storage space The relationship converts the ordinary storage area into the fast storage area; thereby avoiding the situation that the data cannot be stored or cached due to the conversion of too many fast storage areas.
在一种可能的实现方式中,上述转换单元602,具体用于在上述快速存储区域的磨损次数小于磨损次数阈值的情况下,将上述普通存储区域转换为上述快速存储区域。In a possible implementation manner, the conversion unit 602 is specifically configured to convert the ordinary storage area into the fast storage area when the wear count of the fast storage area is less than the wear count threshold.
本申请实施例中,通过设置磨损次数阈值,可使得在该磨损次数阈值范围内,使得普通存储区域与快速存储区域即第一存储形态与第二存储形态,能够相互转换。In the embodiment of the present application, by setting the threshold of the number of wear times, the normal storage area and the fast storage area, that is, the first storage mode and the second storage mode, can be converted mutually within the range of the wear frequency threshold.
在一种可能的实现方式中,上述转换单元602,还用于在上述快速存储区域的磨损次数不小于上述磨损次数阈值的情况下,将上述普通存储区域转换为上述快速存储区域。In a possible implementation manner, the conversion unit 602 is further configured to convert the ordinary storage area into the fast storage area when the wear count of the fast storage area is not less than the wear count threshold.
本申请实施例中,快速存储区域与普通存储区域可以相互转换的前提条件可以为快速存储区域的磨损次数小于磨损次数阈值,而若快速存储区域的磨损次数超过了该磨损次数阈值,则说明快速存储区域无法与普通存储区域相互转换,也就是说,快速存储区域将完全转换为普通存储区域,也即第一存储形态可以完全转换为第二存储形态。In the embodiment of the present application, the precondition that the fast storage area and the ordinary storage area can be interchanged may be that the wear times of the fast storage area are less than the wear times threshold, and if the wear times of the fast storage area exceeds the wear times threshold, the fast storage area The storage area cannot be converted to the ordinary storage area, that is, the fast storage area will be completely converted into the ordinary storage area, that is, the first storage form can be completely converted into the second storage form.
在一种可能的实现方式中,如图7所示,上述存储芯片还包括:In a possible implementation manner, as shown in FIG. 7, the foregoing memory chip further includes:
分配单元603,用于根据应用数据的使用情况,为上述存储芯片分配上述快速存储区域。The allocating unit 603 is configured to allocate the fast storage area to the storage chip according to the usage of the application data.
本申请实施例中,存储芯片可以在用户应用行为分析的基础上,来分配快速存储区域,从而使得该快速存储区域的大小能够更加符合用户的使用情况,也即能够更加符合存储芯片中数据的存储使用情况。In the embodiment of the present application, the storage chip can allocate a fast storage area based on user application behavior analysis, so that the size of the fast storage area can be more in line with the user's usage, that is, it can be more in line with the data in the storage chip. Storage usage.
在一种可能的实现方式中,上述第一存储形态与上述第二存储形态属于同一种存储介质的不同存储形态。In a possible implementation manner, the first storage form and the second storage form belong to different storage forms of the same storage medium.
在一种可能的实现方式中,上述第一存储形态包括SLC,上述第二存储形态包括TLC;或者,上述第一存储形态包括SLC,上述第二存储形态包括MLC;或者,上述第一存储形态包括MLC,上述第二存储形态包括TLC;或者,上述第一存储形态包括SLC,所述第二存储形态包括四层存储单元QLC。In a possible implementation manner, the first storage format includes SLC, and the second storage format includes TLC; or, the first storage format includes SLC, and the second storage format includes MLC; or, the first storage format is Including MLC, and the second storage format includes TLC; or, the first storage format includes SLC, and the second storage format includes four-layer memory cells QLC.
需要说明的是,各个单元的实现还可以对应参照图4和/或图5所示的方法实施例的相应描述。需要说明的是,各个单元是指逻辑上的划分,并不表示对应一个特定的硬件,具体的,各个单元的功能可以基于各种硬件来实现,例如,基于支持指令集的处理器通过读取存储在存储器中的代码实现,或者基于现场可编程逻辑门阵列(field programmable gate array,FPGA)读取配置文件实现,或者基于专用集成电路(application-specific integrated circuit,ASIC)来实现,或者结合这些方式来实现,本申请并不限定。It should be noted that the implementation of each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 4 and/or FIG. 5. It should be noted that each unit refers to a logical division, and does not mean that it corresponds to a specific hardware. Specifically, the function of each unit can be implemented based on various hardware, for example, a processor based on a support instruction set can read The code stored in the memory is implemented by reading the configuration file based on field programmable gate array (FPGA), or based on application-specific integrated circuit (ASIC), or a combination of these The method is not limited in this application.
参见图8,图8是本申请实施例提供的一种终端设备的结构示意图,该终端设备可用于执行图4和/或图5所示的方法,如图8所示,该终端设备可包括存储芯片,该存储芯片可为图6和/或图7所示的存储芯片。可理解,该终端设备中所包括的存储芯片的单元可参考前述实施例,这里不再一一详述。Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. The terminal device can be used to execute the method shown in FIG. 4 and/or FIG. 5. As shown in FIG. 8, the terminal device may include The memory chip, the memory chip may be the memory chip shown in FIG. 6 and/or FIG. 7. It can be understood that the memory chip units included in the terminal device can refer to the foregoing embodiments, which will not be described in detail here.
可理解,该终端设备中还可以包括其他芯片,这里不再一一详述。It is understandable that the terminal device may also include other chips, which will not be described in detail here.
本申请实施例还提供了一种计算机可读存储介质。上述方法实施例中的全部或者部分流程可以由计算机程序来指令相关的硬件完成,该程序可存储于上述计算机存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。The embodiment of the present application also provides a computer-readable storage medium. All or part of the procedures in the foregoing method embodiments may be completed by a computer program instructing relevant hardware. The program may be stored in the foregoing computer storage medium. When the program is executed, it may include the procedures of the foregoing method embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the method of the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
本申请实施例装置中的模块可以根据实际需要进行合并、划分和删减。The modules in the devices in the embodiments of the present application may be combined, divided, and deleted according to actual needs.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述 实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims (21)

  1. 一种数据存储方法,其特征在于,所述方法应用于存储芯片,所述方法包括:A data storage method, characterized in that the method is applied to a storage chip, and the method includes:
    获取快速存储区域的有效数据量,所述快速存储区域的数据的存储形态为第一存储形态;Acquiring the effective data amount of the fast storage area, where the storage form of the data in the fast storage area is the first storage form;
    在所述快速存储区域的有效数据量大于第一阈值的情况下,将所述快速存储区域转换为普通存储区域,且所述普通存储区域的数据的存储形态为第二存储形态。In a case where the effective data amount of the fast storage area is greater than the first threshold, the fast storage area is converted to a normal storage area, and the storage form of the data in the normal storage area is the second storage form.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, wherein the method further comprises:
    获取所述普通存储区域的有效数据量;Acquiring the effective data amount of the common storage area;
    在所述普通存储区域的有效数据量小于第二阈值的情况下,将所述普通存储区域转换为所述快速存储区域。In the case that the effective data amount of the normal storage area is less than the second threshold, the normal storage area is converted into the fast storage area.
  3. 根据权利要求1或2所述的方法,其特征在于,所述在所述快速存储区域的有效数据量大于第一阈值的情况下,将所述快速存储区域转换为普通存储区域,包括:The method according to claim 1 or 2, wherein the converting the fast storage area into a normal storage area when the effective data amount of the fast storage area is greater than a first threshold value comprises:
    在所述快速存储区域的有效数据量大于所述第一阈值的情况下,根据所述快速存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述快速存储区域转换为所述普通存储区域。In the case that the effective data amount of the fast storage area is greater than the first threshold, the storage space conversion between the first storage form and the second storage form is based on the size of the effective data volume of the fast storage area The relationship converts the fast storage area into the normal storage area.
  4. 根据权利要求2或3所述的方法,其特征在于,所述在所述普通存储区域的有效数据量小于第二阈值的情况下,将所述普通存储区域转换为所述快速存储区域,包括:The method according to claim 2 or 3, wherein the converting the ordinary storage area into the fast storage area in the case that the effective data amount of the ordinary storage area is less than a second threshold value includes :
    在所述普通存储区域的有效数据量小于所述第二阈值的情况下,根据所述普通存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述普通存储区域转换为所述快速存储区域。In the case where the effective data amount of the normal storage area is less than the second threshold, the storage space conversion between the first storage mode and the second storage mode is based on the size of the effective data amount of the normal storage area The relationship converts the ordinary storage area into the fast storage area.
  5. 根据权利要求2-4任一项所述的方法,其特征在于,所述将所述普通存储区域转换为所述快速存储区域,包括:The method according to any one of claims 2-4, wherein the converting the ordinary storage area into the fast storage area comprises:
    在所述快速存储区域的磨损次数小于磨损次数阈值的情况下,将所述普通存储区域转换为所述快速存储区域。In a case where the wear count of the fast storage area is less than the wear count threshold, the normal storage area is converted into the fast storage area.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method of claim 5, wherein the method further comprises:
    在所述快速存储区域的磨损次数不小于所述磨损次数阈值的情况下,将所述快速存储区域完全转换为所述普通存储区域。In a case where the wear count of the fast storage area is not less than the wear count threshold, the fast storage area is completely converted into the normal storage area.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述获取快速存储区域的有效数据量之前,所述方法还包括:The method according to any one of claims 1 to 6, characterized in that, before the obtaining the effective data amount of the fast storage area, the method further comprises:
    根据应用数据的使用情况,为所述存储芯片分配所述快速存储区域。According to the usage of application data, the fast storage area is allocated to the storage chip.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述第一存储形态与所述第二存储形态属于同一种存储介质的不同存储形态。The method according to any one of claims 1-7, wherein the first storage form and the second storage form belong to different storage forms of the same storage medium.
  9. 根据权利要求1-8任一项所述的方法,其特征在于,The method according to any one of claims 1-8, wherein:
    所述第一存储形态包括单层存储单元SLC,所述第二存储形态包括三层存储单元TLC;The first storage form includes a single-layer storage cell SLC, and the second storage form includes a three-layer storage cell TLC;
    或者,所述第一存储形态包括SLC,所述第二存储形态包括多层存储单元MLC;Alternatively, the first storage form includes SLC, and the second storage form includes a multi-layer memory cell MLC;
    或者,所述第一存储形态包括MLC,所述第二存储形态包括TLC;Alternatively, the first storage form includes MLC, and the second storage form includes TLC;
    或者,所述第一存储形态包括SLC,所述第二存储形态包括四层存储单元QLC。Alternatively, the first storage form includes SLC, and the second storage form includes four-layer memory cells QLC.
  10. 一种存储芯片,其特征在于,包括:A memory chip, characterized in that it comprises:
    获取单元,用于获取快速存储区域的有效数据量,所述快速存储区域的数据的存储形态为第一存储形态;An obtaining unit, configured to obtain the effective data amount of the fast storage area, and the storage form of the data in the fast storage area is the first storage form;
    转换单元,用于在所述快速存储区域的有效数据量大于第一阈值的情况下,将所述快速存储区域转换为普通存储区域,且所述普通存储区域的数据的存储形态为第二存储形态。The conversion unit is configured to convert the fast storage area into a normal storage area when the effective data amount of the fast storage area is greater than the first threshold, and the storage form of the data in the normal storage area is the second storage form.
  11. 根据权利要求10所述的存储芯片,其特征在于,The memory chip of claim 10, wherein:
    所述获取单元,还用于获取所述普通存储区域的有效数据量;The obtaining unit is also used to obtain the effective data amount of the common storage area;
    所述转换单元,还用于在所述普通存储区域的有效数据量小于第二阈值的情况下,将所述普通存储区域转换为所述快速存储区域。The conversion unit is further configured to convert the normal storage area into the fast storage area when the effective data amount of the normal storage area is less than a second threshold.
  12. 根据权利要求10或11所述的存储芯片,其特征在于,The memory chip according to claim 10 or 11, wherein:
    所述转换单元,具体用于在所述快速存储区域的有效数据量大于所述第一阈值的情况下,根据所述快速存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述快速存储区域转换为所述普通存储区域。The conversion unit is specifically configured to, when the effective data amount of the quick storage area is greater than the first threshold, according to the size of the effective data amount of the quick storage area and the first storage form and the The storage space conversion relationship of the second storage form converts the fast storage area into the normal storage area.
  13. 根据权利要求11或12所述的存储芯片,其特征在于,The memory chip according to claim 11 or 12, wherein:
    所述转换单元,具体用于在所述普通存储区域的有效数据量小于所述第二阈值的情况下,根据所述普通存储区域的有效数据量的大小以及所述第一存储形态与所述第二存储形态的存储空间转换关系将所述普通存储区域转换为所述快速存储区域。The conversion unit is specifically configured to: when the effective data amount of the ordinary storage area is less than the second threshold, according to the size of the effective data amount of the ordinary storage area and the difference between the first storage form and the The storage space conversion relationship of the second storage form converts the ordinary storage area into the fast storage area.
  14. 根据权利要求11-13任一项所述的存储芯片,其特征在于,The memory chip according to any one of claims 11-13, wherein:
    所述转换单元,具体用于在所述快速存储区域的磨损次数小于磨损次数阈值的情况下,将所述普通存储区域转换为所述快速存储区域。The conversion unit is specifically configured to convert the ordinary storage area into the fast storage area when the wear count of the fast storage area is less than the wear count threshold.
  15. 根据权利要求14所述的存储芯片,其特征在于,The memory chip according to claim 14, wherein:
    所述转换单元,还用于在所述快速存储区域的磨损次数不小于所述磨损次数阈值的情况下,将所述快速存储区域完全转换为所述普通存储区域。The conversion unit is further configured to completely convert the fast storage area into the normal storage area when the wear count of the fast storage area is not less than the wear count threshold.
  16. 根据权利要求10-15任一项所述的存储芯片,其特征在于,所述存储芯片还包括:15. The memory chip according to any one of claims 10-15, wherein the memory chip further comprises:
    分配单元,用于根据应用数据的使用情况,为所述存储芯片分配所述快速存储区域。The allocation unit is configured to allocate the fast storage area to the storage chip according to the usage situation of the application data.
  17. 根据权利要求10-16任一项所述的存储芯片,其特征在于,所述第一存储形态与所述第二存储形态属于同一种存储介质的不同存储形态。The memory chip according to any one of claims 10-16, wherein the first storage form and the second storage form belong to different storage forms of the same storage medium.
  18. 根据权利要求10-17任一项所述的存储芯片,其特征在于,The memory chip according to any one of claims 10-17, wherein:
    所述第一存储形态包括单层存储单元SLC,所述第二存储形态包括三层存储单元TLC;The first storage form includes a single-layer storage cell SLC, and the second storage form includes a three-layer storage cell TLC;
    或者,所述第一存储形态包括SLC,所述第二存储形态包括多层存储单元MLC;Alternatively, the first storage form includes SLC, and the second storage form includes a multi-layer memory cell MLC;
    或者,所述第一存储形态包括MLC,所述第二存储形态包括TLC;Alternatively, the first storage form includes MLC, and the second storage form includes TLC;
    或者,所述第一存储形态包括SLC,所述第二存储形态包括四层存储单元QLC。Alternatively, the first storage form includes SLC, and the second storage form includes four-layer memory cells QLC.
  19. 一种存储芯片,其特征在于,所述存储芯片包括控制器以及存储阵列,所述控制器用于执行如权利要求1-9任一项所述的方法。A memory chip, characterized in that the memory chip includes a controller and a memory array, and the controller is configured to execute the method according to any one of claims 1-9.
  20. 一种终端设备,其特征在于,所述终端设备包括处理器以及存储芯片,所述处理器用于通过与所述存储芯片进行交互来读写数据,所述存储芯片用于执行如权利要求1-9任一项所述的方法。A terminal device, characterized in that, the terminal device includes a processor and a storage chip, the processor is used to read and write data by interacting with the storage chip, and the storage chip is used to execute 9. The method of any one.
  21. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令, 当所述指令在计算机上运行时,权利要求1-9任一所述的方法得以实现。A computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are run on a computer, the method according to any one of claims 1-9 can be implemented.
PCT/CN2019/078724 2019-03-19 2019-03-19 Data storage method and storage chip WO2020186455A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/078724 WO2020186455A1 (en) 2019-03-19 2019-03-19 Data storage method and storage chip
CN201980094038.0A CN113574497A (en) 2019-03-19 2019-03-19 Data storage method and storage chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/078724 WO2020186455A1 (en) 2019-03-19 2019-03-19 Data storage method and storage chip

Publications (1)

Publication Number Publication Date
WO2020186455A1 true WO2020186455A1 (en) 2020-09-24

Family

ID=72518876

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/078724 WO2020186455A1 (en) 2019-03-19 2019-03-19 Data storage method and storage chip

Country Status (2)

Country Link
CN (1) CN113574497A (en)
WO (1) WO2020186455A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045483A1 (en) * 2021-09-23 2023-03-30 华为技术有限公司 Storage device and data storage method and storage system
CN117785619A (en) * 2024-02-27 2024-03-29 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114564151A (en) * 2022-02-28 2022-05-31 深圳忆联信息系统有限公司 Method and device for improving SSD data retention, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914410A (en) * 2013-01-08 2014-07-09 联想(北京)有限公司 Storage device, electronic device and data access method
CN105867834A (en) * 2015-01-22 2016-08-17 深圳市硅格半导体有限公司 Data arrangement method of storage device
CN106843762A (en) * 2017-01-17 2017-06-13 北京联想核芯科技有限公司 The method and solid state hard disc of managing storage area
CN106873912A (en) * 2017-02-16 2017-06-20 郑州云海信息技术有限公司 The dynamic partition storage method and device, system of TLC chip solid state hard discs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914410A (en) * 2013-01-08 2014-07-09 联想(北京)有限公司 Storage device, electronic device and data access method
CN105867834A (en) * 2015-01-22 2016-08-17 深圳市硅格半导体有限公司 Data arrangement method of storage device
CN106843762A (en) * 2017-01-17 2017-06-13 北京联想核芯科技有限公司 The method and solid state hard disc of managing storage area
CN106873912A (en) * 2017-02-16 2017-06-20 郑州云海信息技术有限公司 The dynamic partition storage method and device, system of TLC chip solid state hard discs

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045483A1 (en) * 2021-09-23 2023-03-30 华为技术有限公司 Storage device and data storage method and storage system
CN117785619A (en) * 2024-02-27 2024-03-29 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state
CN117785619B (en) * 2024-02-27 2024-05-10 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state

Also Published As

Publication number Publication date
CN113574497A (en) 2021-10-29

Similar Documents

Publication Publication Date Title
US11797180B2 (en) Apparatus and method to provide cache move with non-volatile mass memory system
KR102500661B1 (en) Cost-optimized single-level cell-mode non-volatile memory for multi-level cell-mode non-volatile memory
US11709623B2 (en) NAND-based storage device with partitioned nonvolatile write buffer
TWI730753B (en) Memory module, method for managing operational state data in said memory module, and host device
TWI492061B (en) Selective enablement of operating modes or features via host transfer rate detection
US20230350595A1 (en) Data Migration Method, Host, and Solid State Disk
CN107908571B (en) Data writing method, flash memory device and storage equipment
WO2020186455A1 (en) Data storage method and storage chip
US10877686B2 (en) Mass storage device with host initiated buffer flushing
US9164804B2 (en) Virtual memory module
US10067676B2 (en) Hybrid memory drives, computer system, and related method for operating a multi-mode hybrid drive
CN112115067A (en) Flash memory physical resource set management device and method and computer readable storage medium
KR20150055413A (en) Data storage device
US20230236971A1 (en) Memory management method and apparatus
CN115113799A (en) Host command execution method and device
JP2018500697A (en) Method and apparatus for detecting transaction conflicts and computer system
CN116235138A (en) Data reading method and related device applied to solid state disk SSD
EP4325367A1 (en) Method and device for data caching
CN114625307A (en) Computer readable storage medium, and data reading method and device of flash memory chip
US20210109674A1 (en) Memory command queue management
CN113495850A (en) Method and device for managing garbage collection program and computer readable storage medium
TWI810876B (en) Method and computer program product and apparatus for data access in response to host discard commands
US20230153237A1 (en) Method and device for storing data
US20240036771A1 (en) Memory configuration method, apparatus, electronic device, and storage medium
US20220083280A1 (en) Method and apparatus to reduce latency for random read workloads in a solid state drive

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19920372

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19920372

Country of ref document: EP

Kind code of ref document: A1