[go: up one dir, main page]

WO2016173470A1 - Storage method and system based on embedded multi-media card - Google Patents

Storage method and system based on embedded multi-media card Download PDF

Info

Publication number
WO2016173470A1
WO2016173470A1 PCT/CN2016/080077 CN2016080077W WO2016173470A1 WO 2016173470 A1 WO2016173470 A1 WO 2016173470A1 CN 2016080077 W CN2016080077 W CN 2016080077W WO 2016173470 A1 WO2016173470 A1 WO 2016173470A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage
type
emmc
layer
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2016/080077
Other languages
French (fr)
Chinese (zh)
Inventor
黄猛
黄生儒
薛军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2016173470A1 publication Critical patent/WO2016173470A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

  • the present invention relates to the field of data storage technologies, and in particular, to a storage method and system based on an embedded multimedia card eMMC.
  • eMMC embedded multimedia card
  • Embedded multimedia card is the main storage device in mobile terminals such as mobile phones and tablet computers. It uses NAND flash memory as the storage medium to store software and data in mobile terminals, and its functions and performances follow.
  • the international standard specification JESD84, JESD84 specifies a number of storage characteristics, such as performance indicators, data security, storage reliability, partitioning, communication protocols, and read and write controls. Since the data acquired/generated by different software has different data attributes, the data of different data attributes have different reliability requirements. In order to provide different reliability, eMMC allows multiple storage areas to be set and different reliability for different storage areas. Sexuality, and in order to protect the stored data from being destroyed, the JESD84 specification also defines the function of reliable writing.
  • the current eMMC divides the storage area according to the manner shown in Figure 1 to suit different storage purposes, as shown in Figure 1, eMMC storage.
  • the area is divided into a boot partition of the storage system startup code, stores an encrypted partition with high security requirements, stores a general partition of the mobile terminal's factory data and key system data, and stores user's App, picture, video, and document data.
  • the user data partition visible to the user is also specified in the user data partition as an enhanced user data partition and special protection measures are opened to improve the operation and data reliability in the enhanced user storage area.
  • the storage area division mode shown in Figure 1 is static and coarse-grained. This storage area division method still cannot adapt the difference of data reliability requirements well, and reduces the flexibility of eMMC storage data. Sex.
  • the embodiment of the invention discloses a storage method and system based on the embedded multimedia card eMMC, which can improve the flexibility of the eMMC to store data.
  • a first aspect of the embodiments of the present invention discloses a storage system based on an embedded multimedia card eMMC, where the system includes an application layer, a file system layer, an eMMC block device driver layer, and an eMMC storage device layer, where:
  • the application layer is configured to send a data write request to the file system layer, where the data write request includes data that an application needs to write to the eMMC storage device layer;
  • the file system layer configured to respond to the data write request and determine a data type of the data
  • the eMMC block device driver layer is configured to set a data label in the write command parameter and a reliable write flag bit according to the data type
  • the eMMC storage device layer is configured to determine, from the pre-stored storage list, a target storage space for the data according to the data label and the reliable write flag bit, and store the data in the target storage In space, the storage list includes a storage type of each storage space and an aging degree of each of the storage spaces.
  • the data write request further includes a data attribute of the data
  • a data type of the data is identified based on the data attribute.
  • the data write request further includes an application type of the application
  • a data type of the data is identified based on the application type.
  • the storage type includes a storage type of one unit storing one binary data SLC, a storage type of one unit storing two-bit binary data MLC, and a storage type of one unit storing three-bit binary data TLC. Any one.
  • the data type includes metadata, structured user data, and different errors. Any one of different unstructured user data corresponding to the tolerance level.
  • a second aspect of the embodiments of the present invention discloses a storage method based on an embedded multimedia card eMMC, where the method includes:
  • the application layer sends a data write request to the file system layer, the data write request including data that the application needs to write to the eMMC storage device layer;
  • the file system layer is responsive to the data write request and determines a data type of the data
  • the eMMC block device driver layer sets a data label in the write command parameter and a reliable write flag bit according to the data type
  • the storage list includes a storage type of each storage space and an aging degree of each of the storage spaces.
  • the data write request further includes a data attribute of the data
  • the file system layer responds to the data write request and determines a data type of the data, including:
  • a data type of the data is identified based on the data attribute.
  • the data write request further includes an application type of the application
  • the file system layer responds to the data write request and determines a data type of the data, including:
  • a data type of the data is identified based on the application type.
  • the storage type includes a storage type of one unit storing one bit binary data SLC, a storage type of one unit storing two binary data MLC, and a storage type of one unit storing three bit binary data TLC Any of them.
  • the data type includes metadata, structured user data, and different errors. Any one of different unstructured user data corresponding to the tolerance level.
  • the application layer sends a data write request to the file system layer, where the data write request includes data that the application needs to write to the eMMC storage device layer, and the file system layer determines the response in response to the data write request.
  • the data type of the data the eMMC block device driver layer sets the data label in the write command parameter and the reliable write flag bit according to the data type, and the eMMC storage device layer reads from the pre-stored storage list according to the data label and the reliable write flag bit. Determining a target storage space for the data, and storing the data in the target storage space, wherein the storage list includes a storage type of each storage space and an aging degree of each storage space.
  • the embodiment of the present invention can dynamically adapt the reliability requirement of the data to the reliability provided by the storage medium in the eMMC according to the data type of the data to be stored, thereby improving the flexibility of the eMMC to store data.
  • FIG. 1 is a schematic structural diagram of a storage area partition in a prior art eMMC storage device
  • FIG. 2 is a schematic structural diagram of a storage system based on an embedded multimedia card eMMC according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart diagram of another storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention.
  • the embodiment of the invention discloses a storage method and system based on the embedded multimedia card eMMC, which can dynamically adapt the reliability requirement of the data and the reliability provided by the storage medium according to the data type of the data to be stored, and improve the eMMC.
  • the flexibility of storing data The details are described below separately.
  • FIG. 2 is a schematic structural diagram of a storage system based on an embedded multimedia card eMMC according to an embodiment of the present invention.
  • the system shown in FIG. 2 can be applied to a terminal using an eMMC storage device, such as a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, and a mobile Internet device (MID), a PAD, and the like.
  • a smart phone such as an Android mobile phone, an iOS mobile phone, etc.
  • a tablet computer such as an iOS mobile phone, etc.
  • MID mobile Internet device
  • PAD a mobile Internet device
  • the eMMC storage device includes an eMMC controller and one or more NAND flash memory chips, wherein one or more NAND flash memory chips are storage media for storing data, and the eMMC controller is responsible for internal and external control and communication, and the internal control is mainly
  • the read, write, erase operations and address space management of the storage medium are mainly responsible for communicating with the host, receiving and responding to the commands of the host, and storing the data to be stored by the host to the corresponding storage medium and reading the host.
  • the fetched data is taken out from the corresponding storage medium and sent to the host.
  • the embedded multimedia card eMMC-based storage system may include an application layer 201, a file system layer 202, an eMMC block device driver layer 203, and an eMMC storage device layer 204, wherein:
  • the application layer 201 is configured to send a data write request to the file system layer 202.
  • the data write request may include data that the application needs to write to the eMMC storage device layer 204.
  • the file system layer 202 is configured to respond to the data write request and determine the data type of the data.
  • the data type of the foregoing data may include, but is not limited to, metadata, structured user data, and different unstructured user data corresponding to different error tolerance levels (such as unstructured user data with high error tolerance level and errors). Any one of the unstructured user data and the like having a low tolerance level is not limited in the embodiment of the present invention.
  • metadata is the key data of the file system and has high reliability requirements.
  • Metadata is defined as the data with the highest reliability requirement, that is, the metadata is the data with the highest reliability level; structured user data (such as relationship) Type database system, etc.) is required to store correct and correct data, and its reliability requirements are lower than the reliability requirements of metadata; unstructured user data (such as audio and video data, etc.) is a small number of errors and does not affect Global data has the lowest reliability requirements, and the higher the error tolerance level, the lower the reliability requirements of unstructured user data.
  • structured user data such as relationship) Type database system, etc.
  • unstructured user data such as audio and video data, etc.
  • the data write request may further include the data attribute of the data, and the specific manner of the file system layer 202 responding to the data write request and determining the data type of the data may be:
  • the data type of the data is identified based on the data attribute of the data.
  • the data writing request may further include an application type of the application, and the specific manner of the file system layer 202 responding to the data writing request and determining the data type of the data may be:
  • the data type of the data is identified according to the application type of the application.
  • the eMMC block device driver layer 203 is configured to set the data label Do_data_tag and the reliable write flag bit Do_rel_wr in the write command parameter according to the data type determined by the file system layer 202.
  • the data tag Do_data_tag and the reliable write flag bit Do_rel_wr are two flag bits in the write command parameter, and the data tag Do_data_tag and the reliable write flag bit Do_rel_wr mechanism are only for the write operation, and further, due to the NAND flash memory The original location is updated, so the data tag Do_data_tag and the reliable write flag Do_rel_wr mechanism can be applied to all write operations including writing new data and updating old data.
  • the data tag Do_data_tag is a feature of the eMMC storage device, which allows the eMMC storage device to acquire data that needs to store data from the host.
  • Types, timestamps, configuration parameters, etc. serve as a decision basis for the eMMC storage device layer 204 to allocate storage space for data that needs to be stored.
  • the reliable write flag bit Do_rel_wr is used to identify whether to reliably write the above data. Reliable write is also a feature of the eMMC memory device, and it is an atomic write operation with certain constraints, which requires data that has been reliably written before. It is not damaged in the event of a sudden power failure or system crash.
  • the eMMC block device driver layer 203 may use the data tag Do_data_tag and be reliable.
  • the write flag bit Do_rel_wr is set to 1, which means that the metadata has the highest reliability level, that is, it has the highest reliability requirement; when the file system layer 202 determines the data type of the above data is structured user data (such as mobile banking) When important data or the like, the eMMC block device driver layer 203 can set the data tag Do_data_tag to 0 and set the reliable write flag bit Do_rel_wr to 1, which indicates that the reliability level of the structured user data is the second highest, that is, its The reliability requirement is second highest; when the data type of the above data determined by the file system layer 202 is unstructured user data with low error tolerance level (such as game data or social data, etc.), the eMMC block device driver layer 203 may The data tag Do_data_tag is set to 1, and the reliable write flag bit Do_rel_wr is set to 0, which indicates that the error tolerance level is low for unstructured user data.
  • the level of dependency is low, that is, it has low reliability requirements; when the data type of the above data determined by the file system layer 202 is unstructured user data with high error tolerance level (such as unimportant cached data or exchanged data, etc.)
  • the eMMC block device driver layer 203 can set the data tag Do_data_tag to 0 and the reliable write flag bit Do_rel_wr to 0, which means that the unstructured user data with high error tolerance level has the lowest reliability level, that is, its The reliability requirements are the lowest.
  • the eMMC storage device layer 204 is configured to determine, from the pre-stored storage list, a target storage space for the data according to the data tag Do_data_tag and the reliable write flag bit Do_rel_wr, and store the data in the determined target storage space. .
  • the firmware of the internal controller of the eMMC storage device layer 204 can maintain a storage list, which can include the storage type of each storage space and the aging degree of each storage space, wherein each The degree of aging of the storage space may be determined by the number of erasures and the degree of wear of each storage space.
  • the storage list may also include an idle state of each storage space, such as the remaining space of each storage space (ie, idle Space) capacity or each storage space The ratio of the remaining space capacity to the total space capacity of the storage space, etc., is not limited in the embodiment of the present invention.
  • the storage type of each storage space may include, but is not limited to, a storage type of one unit storing one-bit binary data SLC (Single-Level Cell), and one unit storing storage of two-bit binary data MLC (Multi-Level Cell).
  • the type and the one of the storage types of the three-bit binary data TLC (Trinary-Level Cell) are not limited in the embodiment of the present invention.
  • the storage space of the same storage type can be defined as different reliability levels according to the aging degree of each storage space. For example, the storage space with the storage type SLC can be classified into an SLC storage space with a low degree of aging and a high degree of aging.
  • SLC type storage space of different ages such as SLC type storage space
  • storage space of MLC type can be divided into MLC type storage space with low aging degree and MLC type storage space with high aging degree, etc.
  • MLC type storage of different aging degrees The space where the storage type is TLC can be divided into TLC storage spaces with low aging and TLC storage spaces with high aging, and the storage space of the same storage type. The lower the degree of aging, the higher the reliability level.
  • the eMMC storage device layer 204 can store the metadata and the structured user data in an SLC type storage space and implement a reliable write operation, and can store the unstructured user data in the MLC type storage space, further The eMMC storage device layer 204 can store unstructured user data with a high error tolerance level in an MMC type storage space with a high degree of aging, and store unstructured user data with a low error tolerance level at a low degree of aging. MLC type storage space.
  • the foregoing storage list is as shown in Table 1 below, and the data type of the foregoing data is metadata, structured user data, unstructured user data with low error tolerance level, or high error tolerance level.
  • the unstructured user data when the data type of the data determined by the file system layer 202 is metadata, the eMMC storage device layer 204 preferentially selects the SLC type storage space with the lowest degree of aging for the data, if the SLC type storage space If there is no free space, the eMMC storage device layer 204 selects the MLC type storage space with the lowest degree of aging for the above data.
  • the allocation fails; when the file system layer 202 determines the data of the above data.
  • the eMMC storage device layer 204 preferentially selects the SLC type storage space with the highest degree of aging for the above data, and if there is no free space in the SLC type storage space, the eMMC storage device The layer 204 selects the MLC type storage space with the lowest degree of aging for the above data. If there is no free space in the MLC type storage space, the allocation fails; when the data type of the data determined by the file system layer 202 is low, the error tolerance level is low.
  • the eMMC storage device layer 204 preferentially selects the MLC type storage space with the lowest degree of aging for the above data. If there is no free space in the MLC type storage space, the eMMC storage device layer 204 selects the SLC with the highest degree of aging for the above data. Type storage space, if there is no free space in the SLC type storage space, the allocation fails; when the data type of the above data determined by the file system layer 202 is unstructured user data with high error tolerance level, the eMMC storage device layer 204 The MLC type storage space with the highest degree of aging is selected for the above data.
  • the eMMC storage device layer 204 selects the SLC type storage space with the highest degree of aging for the above data, and if the SLC type storage space is also If there is no free space, the allocation fails.
  • Table 1 is:
  • the embodiments of the present invention can dynamically adapt the data reliability type to the reliability of the storage medium in the eMMC according to the data type of the data to be stored, improve the flexibility of the eMMC storage data, and can meet different reliability requirements.
  • the data is stored in storage spaces of different reliability levels, ensuring the reliability requirements of the data.
  • FIG. 3 is a schematic flowchart of a storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention. Among them, the method shown in FIG. 3 can be applied to the system shown in FIG. 2. As shown in FIG. 3, the embedded multimedia card eMMC-based storage method may include the following steps:
  • the application layer sends a data write request to the file system layer.
  • the data write request may include data that the application needs to write to the eMMC storage device layer.
  • the file system layer responds to the data write request and determines a data type of data to be written.
  • the data type of the foregoing data may include, but is not limited to, metadata, structured user data, and different unstructured user data corresponding to different error tolerance levels (such as unstructured user data with high error tolerance level and errors). Any one of the unstructured user data and the like having a low tolerance level is not limited in the embodiment of the present invention.
  • metadata is the key data of the file system and has high reliability requirements.
  • Metadata is defined as the data with the highest reliability requirement, that is, the metadata is the data with the highest reliability level; structured user data (such as relationship) Type database system, etc.) is required to store correct and correct data, and its reliability requirements are lower than the reliability requirements of metadata; unstructured user data (such as audio and video data, etc.) is a small number of errors and does not affect Global data has the lowest reliability requirements, and the higher the error tolerance level, the lower the reliability requirements of unstructured user data.
  • structured user data such as relationship) Type database system, etc.
  • unstructured user data such as audio and video data, etc.
  • the data write request may further include the data attribute of the data
  • the file system layer responds to the data write request and determines the data type of the data may include:
  • the data type of the data is identified based on the data attribute of the data.
  • the data writing request may further include an application type of the application
  • the file system layer responding to the data writing request and determining the data type of the data may include:
  • the data type of the data is identified according to the application type of the application.
  • the eMMC block device driver layer sets the data label Do_data_tag and the reliable write flag bit Do_rel_wr in the write command parameter according to the above data type.
  • the data tag Do_data_tag and the reliable write flag bit Do_rel_wr are two flag bits in the write command parameter, and the data tag Do_data_tag and the reliable write flag bit Do_rel_wr mechanism are only for the write operation, and further, due to the NAND flash memory The original location is updated, so the data tag Do_data_tag and the reliable write flag Do_rel_wr mechanism can be applied to all write operations including writing new data and updating old data.
  • Do_data_tag is eMMC
  • the reliable write flag bit Do_rel_wr is used to identify whether to reliably write the above data. Reliable write is also a feature of the eMMC memory device, and it is an atomic write operation with certain constraints, which requires data that has been reliably written before. It is not damaged in the event of a sudden power failure or system crash.
  • the eMMC block device driver layer may use the data tag Do_data_tag and the reliable write flag.
  • the bit Do_rel_wr is set to 1, which means that the metadata has the highest reliability level, that is, it has the highest reliability requirement; when the data type of the above data determined by the file system layer is structured user data (such as mobile banking important data, etc.)
  • the eMMC block device driver layer can set the data tag Do_data_tag to 0 and the reliable write flag bit Do_rel_wr to 1, indicating that the structured user data has the second highest reliability level, that is, its reliability requirement.
  • the eMMC block device driver layer can set the data tag Do_data_tag to 1 And set the reliable write flag bit Do_rel_wr to 0, which means that the unstructured user data with low error tolerance level has low reliability level.
  • the eMMC block device driver can set the data tag Do_data_tag to 0 and the reliable write flag bit Do_rel_wr to 0, which means that the unstructured user data with high error tolerance level has the lowest reliability level, that is, it has the lowest reliability requirement.
  • the eMMC storage device layer determines a target storage space for the data from the pre-stored storage list according to the data label and the reliable write flag, and stores the data in the target storage space.
  • the firmware of the internal controller of the eMMC storage device layer may maintain a storage list, and the storage list may include a storage type of each storage space and an aging degree of each storage space, where each storage The degree of aging of the space may be determined by the number of erasures of each storage space and the degree of wear.
  • the storage list may also include an idle state of each storage space, such as the remaining space of each storage space (ie, free space). Capacity or per storage space The ratio of the remaining space capacity to the total space capacity of the storage space, etc., is not limited in the embodiment of the present invention.
  • the storage type of each storage space may include, but is not limited to, a storage type of one unit storing one-bit binary data SLC (Single-Level Cell), and one unit storing storage of two-bit binary data MLC (Multi-Level Cell).
  • the type and the one of the storage types of the three-bit binary data TLC (Trinary-Level Cell) are not limited in the embodiment of the present invention.
  • the storage space of the same storage type can be defined as different reliability levels according to the aging degree of each storage space. For example, the storage space with the storage type SLC can be classified into an SLC storage space with a low degree of aging and a high degree of aging.
  • SLC type storage space of different ages such as SLC type storage space
  • storage space of MLC type can be divided into MLC type storage space with low aging degree and MLC type storage space with high aging degree, etc.
  • MLC type storage of different aging degrees The space where the storage type is TLC can be divided into TLC storage spaces with low aging and TLC storage spaces with high aging, and the storage space of the same storage type. The lower the degree of aging, the higher the reliability level.
  • the eMMC storage device layer can store the metadata and the structured user data in the SLC type storage space and implement a reliable write operation, and can store the unstructured user data in the MLC type storage space. Further, The eMMC storage device layer can store unstructured user data with high error tolerance level in the MMC type storage space with high degree of aging, and store unstructured user data with low error tolerance level in the less aged MLC. Type of storage space.
  • the application layer sends a data write request to the file system layer, where the data write request includes data that the application needs to write to the eMMC storage device layer, and the file system layer determines the response in response to the data write request.
  • the data type of the data the eMMC block device driver layer sets the data label in the write command parameter and the reliable write flag bit according to the data type, and the eMMC storage device layer reads from the pre-stored storage list according to the data label and the reliable write flag bit. Determining a target storage space for the data, and storing the data in the target storage space, wherein the storage list includes a storage type of each storage space and an aging degree of each storage space.
  • the embodiments of the present invention can dynamically adapt the data reliability type to the reliability of the storage medium in the eMMC according to the data type of the data to be stored, improve the flexibility of the eMMC storage data, and can meet different reliability requirements. Data is stored in storage spaces of different reliability levels, ensuring reliable data sexual needs.
  • FIG. 4 is a schematic flowchart diagram of another storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention.
  • 4 is any one of the data to be written as metadata, structured user data, unstructured user data with low error tolerance level, and unstructured user data with high error tolerance level, and the storage list is as follows.
  • Table 1 shows a flow chart of an embedded multimedia card eMMC-based storage method.
  • the embedded multimedia card eMMC-based storage method may include the following steps:
  • the application layer sends a data write request to the file system layer.
  • the file system layer determines the data type of the data to be written included in the data writing request in response to the data writing request.
  • step S403 is performed by the eMMC block device driver layer; when the data type of the data determined in step S402 is structured user data.
  • step S405 is performed by the eMMC block device driver layer; when the data type of the data determined in step S402 is unstructured user data with a low error tolerance level, step S407 is performed by the eMMC block device driver layer; When the data type of the data determined in the data is unstructured user data with a high error tolerance level, step S409 is performed by the eMMC block device driver layer.
  • the eMMC block device driver layer sets the data label Do_data_tag and the reliable write flag bit Do_rel_wr in the write command parameter to 1.
  • the eMMC storage device layer determines that the target storage space for the metadata is the SMC type storage space with the lowest degree of aging, and stores the metadata in the SLC type storage space with the lowest degree of aging.
  • the eMMC storage device layer selects the MLC type storage space with the lowest degree of aging for the metadata, and if there is no free space in the MLC type storage space, the allocation fails.
  • the eMMC block device driver layer sets the data label Do_data_tag in the write command parameter to 0, and sets the reliable write flag bit Do_rel_wr to 1.
  • the eMMC storage device layer determines that the target storage space for structured user data is the SMC type storage space with the highest degree of aging, and stores the structured user data in the highest degree of aging. SLC type storage space.
  • the eMMC storage device layer selects the MLC type storage space with the lowest aging degree for the structured user data, and if there is no free space in the MLC type storage space, the allocation fails. .
  • the eMMC block device driver layer sets the data label Do_data_tag in the write command parameter to 1, and sets the reliable write flag bit Do_rel_wr to zero.
  • the eMMC storage device layer determines that the target storage space for the unstructured user data with low error tolerance level is the least aged MLC type storage space, and stores the unstructured user data with low error tolerance level at the aging degree. The lowest MLC type storage space.
  • the eMMC storage device layer selects the SLC type storage space with the highest degree of aging for the unstructured user data with low error tolerance level, and if there is no SLC type storage space, If there is free space, the allocation fails.
  • the eMMC block device driver layer sets the data tag Do_data_tag to 0 and sets the reliable write flag bit Do_rel_wr to zero.
  • the eMMC storage device layer determines that the target storage space for the unstructured user data with high error tolerance level is the most aging MLC type storage space, and stores the unstructured user data with high error tolerance level at the aging degree. The highest MLC type storage space.
  • the eMMC storage device layer selects the SLC type storage space with the highest degree of aging for the unstructured user data with high error tolerance level, and if there is no SLC type storage space, If there is free space, the allocation fails.
  • the embodiments of the present invention can dynamically adapt the data reliability type to the reliability of the storage medium in the eMMC according to the data type of the data to be stored, improve the flexibility of the eMMC storage data, and can meet different reliability requirements.
  • the data is stored in storage space with different reliability capabilities, ensuring the reliability requirements of the data.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Flash disk, Read-Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

Embodiments of the present invention provide a storage method and system based on an embedded multi-media card (eMMC). The method comprises: an application program layer sends a data write request to a file system layer; the data write request includes data which the application program requires to write into an eMMC storage element layer ; the file system layer responds to the data write request to determine the data type of the data; an eMMC block device drive program layer sets a data label and a reliable write flag bit in a write command parameter according to the data type; and the eMMC storage element layer determines a target storage space for the data from a prestored storage list according to the data label and reliable write flag bit, and stores the data into the target storage space; the storage list comprises a storage type of each storage space and an aging degree of each storage space. Implementation of the embodiments of the present invention can improve the flexibility of eMMC data storage.

Description

一种基于嵌入式多媒体卡eMMC的存储方法及系统Storage method and system based on embedded multimedia card eMMC 技术领域Technical field

本发明涉及数据存储技术领域,具体涉及一种基于嵌入式多媒体卡eMMC的存储方法及系统。The present invention relates to the field of data storage technologies, and in particular, to a storage method and system based on an embedded multimedia card eMMC.

背景技术Background technique

嵌入式多媒体卡(eMMC,embedded Multi Media Card)是当前手机、平板电脑等移动终端中的主要存储器件,其以NAND闪存为存储介质存储移动终端中的软件及数据等,且其功能与性能遵循国际标准规范JESD84,JESD84规范规定了很多存储特性,如性能指标、数据安全、存储可靠性、分区划分、通讯协议及读写控制等。由于不同软件获取/生成的数据具有不同的数据属性,不同数据属性的数据对可靠性的要求也不同,为了提供不同的可靠性,eMMC允许设置多个存储区域并为不同存储区域设置不同的可靠性,且为了保护已存储的数据不被破坏,JESD84规范中还定义了可靠写的功能。但是,eMMC的老化、NAND闪存的磨损不均以及为不同存储区域设置不同可靠性的方式使得eMMC内部的不同存储区域的可靠性存在很大的差异,这将影响存储区域存储的数据的可靠性,此外,突然掉电、系统崩溃等因素也常常导致NAND闪存中的数据损坏、丢失甚至存储介质损坏。Embedded multimedia card (eMMC) is the main storage device in mobile terminals such as mobile phones and tablet computers. It uses NAND flash memory as the storage medium to store software and data in mobile terminals, and its functions and performances follow. The international standard specification JESD84, JESD84 specifies a number of storage characteristics, such as performance indicators, data security, storage reliability, partitioning, communication protocols, and read and write controls. Since the data acquired/generated by different software has different data attributes, the data of different data attributes have different reliability requirements. In order to provide different reliability, eMMC allows multiple storage areas to be set and different reliability for different storage areas. Sexuality, and in order to protect the stored data from being destroyed, the JESD84 specification also defines the function of reliable writing. However, the aging of eMMC, the uneven wear of NAND flash memory, and the different reliability of different storage areas make the reliability of different storage areas within eMMC greatly different, which will affect the reliability of data stored in the storage area. In addition, sudden power loss, system crash and other factors often lead to data corruption, loss or even storage media damage in NAND flash memory.

为了缓解eMMC的性能、可靠性及安全性之间的矛盾,按照JESD84规范,当前的eMMC按照如图1所示方式划分存储区域以适用于不同的存储目的,如图1所示,eMMC的存储区域被划分为存储系统启动代码的启动分区,存储对安全性要求较高的加密分区,存储移动终端的出厂数据及关键系统数据的通用分区,以及存储用户的App、图片、视频及文档等数据且对用户可见的用户数据分区,同时在用户数据分区内指定一定的区域作为增强型用户数据分区并开启特殊的保护措施以提高该增强型用户存储区域内的操作与数据的可靠性。但是,图1所示的存储区域划分方式是静态以及粗粒度的,这种存储区域划分方式仍然不能很好的适配数据可靠性要求的差异,降低了eMMC存储数据的灵活 性。In order to alleviate the contradiction between eMMC performance, reliability and security, according to the JESD84 specification, the current eMMC divides the storage area according to the manner shown in Figure 1 to suit different storage purposes, as shown in Figure 1, eMMC storage. The area is divided into a boot partition of the storage system startup code, stores an encrypted partition with high security requirements, stores a general partition of the mobile terminal's factory data and key system data, and stores user's App, picture, video, and document data. The user data partition visible to the user is also specified in the user data partition as an enhanced user data partition and special protection measures are opened to improve the operation and data reliability in the enhanced user storage area. However, the storage area division mode shown in Figure 1 is static and coarse-grained. This storage area division method still cannot adapt the difference of data reliability requirements well, and reduces the flexibility of eMMC storage data. Sex.

发明内容Summary of the invention

本发明实施例公开了一种基于嵌入式多媒体卡eMMC的存储方法及系统,能够提高eMMC存储数据的灵活性。The embodiment of the invention discloses a storage method and system based on the embedded multimedia card eMMC, which can improve the flexibility of the eMMC to store data.

本发明实施例第一方面公开了一种基于嵌入式多媒体卡eMMC的存储系统,所述系统包括应用程序层、文件系统层、eMMC块设备驱动程序层以及eMMC存储器件层,其中:A first aspect of the embodiments of the present invention discloses a storage system based on an embedded multimedia card eMMC, where the system includes an application layer, a file system layer, an eMMC block device driver layer, and an eMMC storage device layer, where:

所述应用程序层,用于向所述文件系统层发送数据写入请求,所述数据写入请求包括应用程序需要写入所述eMMC存储器件层的数据;The application layer is configured to send a data write request to the file system layer, where the data write request includes data that an application needs to write to the eMMC storage device layer;

所述文件系统层,用于响应所述数据写入请求并确定所述数据的数据类型;The file system layer, configured to respond to the data write request and determine a data type of the data;

所述eMMC块设备驱动程序层,用于根据所述数据类型设置写命令参数中的数据标签以及可靠写标志位;The eMMC block device driver layer is configured to set a data label in the write command parameter and a reliable write flag bit according to the data type;

所述eMMC存储器件层,用于根据所述数据标签以及所述可靠写标志位从预先存储的存储列表中确定出针对所述数据的目标存储空间,并将所述数据存储在所述目标存储空间中,所述存储列表包括每个存储空间的存储类型以及每个所述存储空间的老化程度。The eMMC storage device layer is configured to determine, from the pre-stored storage list, a target storage space for the data according to the data label and the reliable write flag bit, and store the data in the target storage In space, the storage list includes a storage type of each storage space and an aging degree of each of the storage spaces.

在本发明实施例第一方面的第一种可能的实现方式中,所述数据写入请求还包括所述数据的数据属性;In a first possible implementation manner of the first aspect of the embodiment, the data write request further includes a data attribute of the data;

所述文件系统层响应所述数据写入请求并确定所述数据的数据类型的具体方式为:The specific manner in which the file system layer responds to the data write request and determines the data type of the data is:

响应所述数据写入请求,根据所述数据属性识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the data attribute.

结合本发明实施例第一方面,在本发明实施例第一方面的第二种可能的实现方式中,所述数据写入请求还包括所述应用程序的应用程序类型;With reference to the first aspect of the embodiments of the present invention, in a second possible implementation manner of the first aspect of the embodiments, the data write request further includes an application type of the application;

所述文件系统层响应所述数据写入请求确定所述数据的数据类型的具体方式为:The specific manner in which the file system layer determines the data type of the data in response to the data write request is:

响应所述数据写入请求,根据所述应用程序类型识别出所述数据的数据类型。 In response to the data write request, a data type of the data is identified based on the application type.

结合本发明实施例第一方面、本发明实施例第一方面的第一种可能的实现方式或本发明实施例第一方面的第二种可能的实现方式,在本发明实施例第一方面第三种可能的实现方式中,所述存储类型包括一个单元存储一位二进制数据SLC的存储类型、一个单元存储两位二进制数据MLC的存储类型以及一个单元存储三位二进制数据TLC的存储类型中的任意一种。With reference to the first aspect of the embodiments of the present invention, the first possible implementation manner of the first aspect of the embodiment of the present invention, or the second possible implementation manner of the first aspect of the embodiment of the present invention, in the first aspect of the embodiment of the present invention In three possible implementation manners, the storage type includes a storage type of one unit storing one binary data SLC, a storage type of one unit storing two-bit binary data MLC, and a storage type of one unit storing three-bit binary data TLC. Any one.

结合本发明实施例第一方面的第三种可能的实现方式,在本发明实施例第一方面的第四种可能的实现方式中,所述数据类型包括元数据、结构化用户数据以及不同错误容忍级别对应的不同非结构化用户数据中的任意一种。With reference to the third possible implementation manner of the first aspect of the embodiment of the present invention, in a fourth possible implementation manner of the first aspect of the embodiments, the data type includes metadata, structured user data, and different errors. Any one of different unstructured user data corresponding to the tolerance level.

本发明实施例第二方面公开了一种基于嵌入式多媒体卡eMMC的存储方法,所述方法包括:A second aspect of the embodiments of the present invention discloses a storage method based on an embedded multimedia card eMMC, where the method includes:

应用程序层向文件系统层发送数据写入请求,所述数据写入请求包括应用程序需要写入eMMC存储器件层的数据;The application layer sends a data write request to the file system layer, the data write request including data that the application needs to write to the eMMC storage device layer;

所述文件系统层响应所述数据写入请求并确定所述数据的数据类型;The file system layer is responsive to the data write request and determines a data type of the data;

eMMC块设备驱动程序层根据所述数据类型设置写命令参数中的数据标签以及可靠写标志位;The eMMC block device driver layer sets a data label in the write command parameter and a reliable write flag bit according to the data type;

所述eMMC存储器件层根据所述数据标签以及所述可靠写标志位从预先存储的存储列表中确定出针对所述数据的目标存储空间,并将所述数据存储在所述目标存储空间中,所述存储列表包括每个存储空间的存储类型以及每个所述存储空间的老化程度。Determining, by the eMMC storage device layer, a target storage space for the data from a pre-stored storage list according to the data label and the reliable write flag bit, and storing the data in the target storage space, The storage list includes a storage type of each storage space and an aging degree of each of the storage spaces.

在本发明实施例第二方面的第一种可能的实现方式中,所述数据写入请求还包括所述数据的数据属性;In a first possible implementation manner of the second aspect of the embodiment, the data write request further includes a data attribute of the data;

所述文件系统层响应所述数据写入请求并确定所述数据的数据类型,包括:The file system layer responds to the data write request and determines a data type of the data, including:

响应所述数据写入请求,根据所述数据属性识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the data attribute.

结合本发明实施例第二方面,在本发明实施例第二方面的第二种可能的实现方式中,所述数据写入请求还包括所述应用程序的应用程序类型;With reference to the second aspect of the embodiments of the present invention, in a second possible implementation manner of the second aspect of the embodiment, the data write request further includes an application type of the application;

所述文件系统层响应所述数据写入请求并确定所述数据的数据类型,包括: The file system layer responds to the data write request and determines a data type of the data, including:

响应所述数据写入请求,根据所述应用程序类型识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the application type.

结合本发明实施例第二方面、本发明实施例第二方面的第一种可能的实现方式或本发明实施例第二方面的第二种可能的实现方式,在本发明实施例第二方面的第三种可能的实现方式中,所述存储类型包括一个单元存储一位二进制数据SLC的存储类型、一个单元存储两位二进制数据MLC的存储类型以及一个单元存储三位二进制数据TLC的存储类型中的任意一种。With reference to the second aspect of the embodiments of the present invention, the first possible implementation manner of the second aspect of the embodiment of the present invention, or the second possible implementation manner of the second aspect of the embodiment of the present invention, in the second aspect of the embodiment of the present invention In a third possible implementation manner, the storage type includes a storage type of one unit storing one bit binary data SLC, a storage type of one unit storing two binary data MLC, and a storage type of one unit storing three bit binary data TLC Any of them.

结合本发明实施例第二方面的第三种可能的实现方式,在本发明实施例第二方面的第四种可能的实现方式中,所述数据类型包括元数据、结构化用户数据以及不同错误容忍级别对应的不同非结构化用户数据中的任意一种。With reference to the third possible implementation manner of the second aspect of the embodiment of the present invention, in a fourth possible implementation manner of the second aspect of the embodiment, the data type includes metadata, structured user data, and different errors. Any one of different unstructured user data corresponding to the tolerance level.

本发明实施例中,应用程序层向文件系统层发送数据写入请求,其中,该数据写入请求包括应用程序需要写入eMMC存储器件层的数据,文件系统层响应该数据写入请求确定该数据的数据类型,eMMC块设备驱动程序层根据该数据类型设置写命令参数中的数据标签以及可靠写标志位,eMMC存储器件层根据该数据标签以及该可靠写标志位从预先存储的存储列表中确定出针对该数据的目标存储空间,并将该数据存储在该目标存储空间中,其中,该存储列表包括每个存储空间的存储类型以及每个存储空间的老化程度。实施本发明实施例能够按照需要存储数据的数据类型,将数据的可靠性需求与eMMC内存储介质提供的可靠性进行动态适配,提高了eMMC存储数据的灵活性。In the embodiment of the present invention, the application layer sends a data write request to the file system layer, where the data write request includes data that the application needs to write to the eMMC storage device layer, and the file system layer determines the response in response to the data write request. The data type of the data, the eMMC block device driver layer sets the data label in the write command parameter and the reliable write flag bit according to the data type, and the eMMC storage device layer reads from the pre-stored storage list according to the data label and the reliable write flag bit. Determining a target storage space for the data, and storing the data in the target storage space, wherein the storage list includes a storage type of each storage space and an aging degree of each storage space. The embodiment of the present invention can dynamically adapt the reliability requirement of the data to the reliability provided by the storage medium in the eMMC according to the data type of the data to be stored, thereby improving the flexibility of the eMMC to store data.

附图说明DRAWINGS

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.

图1是现有技术的eMMC存储器件中存储区域分区的结构示意图;1 is a schematic structural diagram of a storage area partition in a prior art eMMC storage device;

图2是本发明实施例公开的一种基于嵌入式多媒体卡eMMC的存储系统的结构示意图; 2 is a schematic structural diagram of a storage system based on an embedded multimedia card eMMC according to an embodiment of the present invention;

图3是本发明实施例公开的一种基于嵌入式多媒体卡eMMC的存储方法的流程示意图;3 is a schematic flowchart of a storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention;

图4是本发明实施例公开的另一种基于嵌入式多媒体卡eMMC的存储方法的流程示意图。FIG. 4 is a schematic flowchart diagram of another storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.

本发明实施例公开了一种基于嵌入式多媒体卡eMMC的存储方法及系统,能够按照需要存储数据的数据类型,将数据的可靠性需求与存储介质提供的可靠性进行动态适配,提高了eMMC存储数据的灵活性。以下分别进行详细说明。The embodiment of the invention discloses a storage method and system based on the embedded multimedia card eMMC, which can dynamically adapt the reliability requirement of the data and the reliability provided by the storage medium according to the data type of the data to be stored, and improve the eMMC. The flexibility of storing data. The details are described below separately.

请参阅图2,图2是本发明实施例公开的一种基于嵌入式多媒体卡eMMC的存储系统的结构示意图。其中,图2所示的系统可以应用于智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile InternetDevices,MID)、PAD等使用eMMC存储器件的终端中,且eMMC存储器件包括eMMC控制器以及一个或多个NAND闪存芯片,其中,一个或多个NAND闪存芯片为存储数据的存储介质,eMMC控制器负责对内对外的控制与通讯,对内主要是控制对存储介质的读、写、擦除操作以及地址空间管理等,对外主要负责与主机进行通讯,接收并响应主机的命令,实现将主机要存储的数据存储到对应的存储介质上以及将主机要读取的数据从对应的存储介质上取出并发送给主机。如图2所示,该基于嵌入式多媒体卡eMMC的存储系统可以包括应用程序层201、文件系统层202、eMMC块设备驱动程序层203以及eMMC存储器件层204,其中:Please refer to FIG. 2. FIG. 2 is a schematic structural diagram of a storage system based on an embedded multimedia card eMMC according to an embodiment of the present invention. The system shown in FIG. 2 can be applied to a terminal using an eMMC storage device, such as a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, and a mobile Internet device (MID), a PAD, and the like. The eMMC storage device includes an eMMC controller and one or more NAND flash memory chips, wherein one or more NAND flash memory chips are storage media for storing data, and the eMMC controller is responsible for internal and external control and communication, and the internal control is mainly The read, write, erase operations and address space management of the storage medium are mainly responsible for communicating with the host, receiving and responding to the commands of the host, and storing the data to be stored by the host to the corresponding storage medium and reading the host. The fetched data is taken out from the corresponding storage medium and sent to the host. As shown in FIG. 2, the embedded multimedia card eMMC-based storage system may include an application layer 201, a file system layer 202, an eMMC block device driver layer 203, and an eMMC storage device layer 204, wherein:

应用程序层201,用于向文件系统层202发送数据写入请求。The application layer 201 is configured to send a data write request to the file system layer 202.

本发明实施例中,该数据写入请求可以包括应用程序需要写入eMMC存储器件层204的数据。 In the embodiment of the present invention, the data write request may include data that the application needs to write to the eMMC storage device layer 204.

文件系统层202,用于响应上述数据写入请求并确定上述数据的数据类型。The file system layer 202 is configured to respond to the data write request and determine the data type of the data.

本发明实施例中,上述数据的数据类型可以包括但不限于元数据、结构化用户数据以及不同错误容忍级别对应的不同非结构化用户数据(如错误容忍级别高的非结构化用户数据以及错误容忍级别低的非结构化用户数据等)中的任意一种,本发明实施例不做限定。其中,元数据是文件系统的关键数据且对可靠性要求高,因此,元数据被定义为对可靠性要求最高的数据,即元数据为可靠性级别最高的数据;结构化用户数据(如关系型数据库系统等)为要求存放正确无误的数据,且其对可靠性的要求相对于元数据对可靠性的要求较低;非结构化用户数据(如音视频数据等)是少量错误并不影响全局的数据,其对可靠性的要求最低,且错误容忍级别越高的非结构化用户数据对可靠性的要求就越低。In the embodiment of the present invention, the data type of the foregoing data may include, but is not limited to, metadata, structured user data, and different unstructured user data corresponding to different error tolerance levels (such as unstructured user data with high error tolerance level and errors). Any one of the unstructured user data and the like having a low tolerance level is not limited in the embodiment of the present invention. Among them, metadata is the key data of the file system and has high reliability requirements. Therefore, metadata is defined as the data with the highest reliability requirement, that is, the metadata is the data with the highest reliability level; structured user data (such as relationship) Type database system, etc.) is required to store correct and correct data, and its reliability requirements are lower than the reliability requirements of metadata; unstructured user data (such as audio and video data, etc.) is a small number of errors and does not affect Global data has the lowest reliability requirements, and the higher the error tolerance level, the lower the reliability requirements of unstructured user data.

作为一种可选的实施方式,上述数据写入请求还可以包括上述数据的数据属性,则文件系统层202响应上述数据写入请求并确定上述数据的数据类型的具体方式可以为:As an optional implementation manner, the data write request may further include the data attribute of the data, and the specific manner of the file system layer 202 responding to the data write request and determining the data type of the data may be:

响应上述数据写入请求,根据上述数据的数据属性识别出上述数据的数据类型。In response to the data write request, the data type of the data is identified based on the data attribute of the data.

作为另一种可选的实施方式,上述数据写入请求还可以包括上述应用程序的应用程序类型,则文件系统层202响应上述数据写入请求并确定上述数据的数据类型的具体方式可以为:As another optional implementation manner, the data writing request may further include an application type of the application, and the specific manner of the file system layer 202 responding to the data writing request and determining the data type of the data may be:

响应上述数据写入请求,根据上述应用程序的应用程序类型识别出上述数据的数据类型。In response to the data write request, the data type of the data is identified according to the application type of the application.

eMMC块设备驱动程序层203,用于根据文件系统层202确定出的数据类型设置写命令参数中的数据标签Do_data_tag以及可靠写标志位Do_rel_wr。The eMMC block device driver layer 203 is configured to set the data label Do_data_tag and the reliable write flag bit Do_rel_wr in the write command parameter according to the data type determined by the file system layer 202.

本发明实施例中,数据标签Do_data_tag以及可靠写标志位Do_rel_wr是写命令参数中的两个标志位,且数据标签Do_data_tag以及可靠写标志位Do_rel_wr机制只针对写操作,此外,由于NAND闪存采取的是非原位置更新,因此,数据标签Do_data_tag以及可靠写标志位Do_rel_wr机制可应用于包括写入新数据以及更新旧数据的全部写操作。其中,数据标签Do_data_tag为eMMC存储器件的一个特性,其允许eMMC存储器件从主机获取需要存储数据的数据 类型、时间戳以及配置参数等,以作为eMMC存储器件层204为需要存储的数据分配存储空间的决策依据。可靠写标志位Do_rel_wr用于标识是否对上述数据进行可靠写,可靠写也是eMMC存储器件的一个特性,且其是带有一定约束条件的原子性写操作,它要求保证之前已经可靠写入的数据在突然掉电或系统崩溃时不被损坏。In the embodiment of the present invention, the data tag Do_data_tag and the reliable write flag bit Do_rel_wr are two flag bits in the write command parameter, and the data tag Do_data_tag and the reliable write flag bit Do_rel_wr mechanism are only for the write operation, and further, due to the NAND flash memory The original location is updated, so the data tag Do_data_tag and the reliable write flag Do_rel_wr mechanism can be applied to all write operations including writing new data and updating old data. The data tag Do_data_tag is a feature of the eMMC storage device, which allows the eMMC storage device to acquire data that needs to store data from the host. Types, timestamps, configuration parameters, etc., serve as a decision basis for the eMMC storage device layer 204 to allocate storage space for data that needs to be stored. The reliable write flag bit Do_rel_wr is used to identify whether to reliably write the above data. Reliable write is also a feature of the eMMC memory device, and it is an atomic write operation with certain constraints, which requires data that has been reliably written before. It is not damaged in the event of a sudden power failure or system crash.

本发明实施例中,举例来说,当文件系统层202确定出的上述数据的数据类型为元数据(如文件系统元数据等)时,eMMC块设备驱动程序层203可以将数据标签Do_data_tag以及可靠写标志位Do_rel_wr均置为1,这表示该元数据的可靠性级别最高,即其对可靠性要求最高;当文件系统层202确定出的上述数据的数据类型为结构化用户数据(如手机银行重要数据等)时,eMMC块设备驱动程序层203可以将数据标签Do_data_tag置为0,并将可靠写标志位Do_rel_wr置为1,这表示该结构化用户数据的可靠性级别次高,即其对可靠性要求次高;当文件系统层202确定出的上述数据的数据类型为错误容忍级别低的非结构化用户数据(如游戏数据或社交数据等)时,eMMC块设备驱动程序层203可以将数据标签Do_data_tag置为1,并将可靠写标志位Do_rel_wr置为0,这表示该错误容忍级别低的非结构化用户数据的可靠性级别低,即其对可靠性要求低;当文件系统层202确定出的上述数据的数据类型为错误容忍级别高的非结构化用户数据(如不重要的缓存数据或交换数据等)时,eMMC块设备驱动程序层203可以将数据标签Do_data_tag置为0,并将可靠写标志位Do_rel_wr置为0,这表示该错误容忍级别高的非结构化用户数据的可靠性级别最低,即其对可靠性要求最低。In the embodiment of the present invention, for example, when the data type of the foregoing data determined by the file system layer 202 is metadata (such as file system metadata, etc.), the eMMC block device driver layer 203 may use the data tag Do_data_tag and be reliable. The write flag bit Do_rel_wr is set to 1, which means that the metadata has the highest reliability level, that is, it has the highest reliability requirement; when the file system layer 202 determines the data type of the above data is structured user data (such as mobile banking) When important data or the like, the eMMC block device driver layer 203 can set the data tag Do_data_tag to 0 and set the reliable write flag bit Do_rel_wr to 1, which indicates that the reliability level of the structured user data is the second highest, that is, its The reliability requirement is second highest; when the data type of the above data determined by the file system layer 202 is unstructured user data with low error tolerance level (such as game data or social data, etc.), the eMMC block device driver layer 203 may The data tag Do_data_tag is set to 1, and the reliable write flag bit Do_rel_wr is set to 0, which indicates that the error tolerance level is low for unstructured user data. The level of dependency is low, that is, it has low reliability requirements; when the data type of the above data determined by the file system layer 202 is unstructured user data with high error tolerance level (such as unimportant cached data or exchanged data, etc.) The eMMC block device driver layer 203 can set the data tag Do_data_tag to 0 and the reliable write flag bit Do_rel_wr to 0, which means that the unstructured user data with high error tolerance level has the lowest reliability level, that is, its The reliability requirements are the lowest.

eMMC存储器件层204,用于根据上述数据标签Do_data_tag以及上述可靠写标志位Do_rel_wr从预先存储的存储列表中确定出针对上述数据的目标存储空间,并将上述数据存储在确定出的目标存储空间中。The eMMC storage device layer 204 is configured to determine, from the pre-stored storage list, a target storage space for the data according to the data tag Do_data_tag and the reliable write flag bit Do_rel_wr, and store the data in the determined target storage space. .

本发明实施例中,eMMC存储器件层204内部控制器的Firmware(固件)可以维护一个存储列表,该存储列表可以包括每个存储空间的存储类型以及每个存储空间的老化程度,其中,每个存储空间的老化程度可以由每个存储空间的已擦除次数以及磨损程度决定,可选的,该存储列表还可以包括每个存储空间的空闲状态,如每个存储空间的剩余空间(即空闲空间)容量或每个存储空 间的剩余空间容量占该存储空间总空间容量的比值等,本发明实施例不做限定。In the embodiment of the present invention, the firmware of the internal controller of the eMMC storage device layer 204 can maintain a storage list, which can include the storage type of each storage space and the aging degree of each storage space, wherein each The degree of aging of the storage space may be determined by the number of erasures and the degree of wear of each storage space. Optionally, the storage list may also include an idle state of each storage space, such as the remaining space of each storage space (ie, idle Space) capacity or each storage space The ratio of the remaining space capacity to the total space capacity of the storage space, etc., is not limited in the embodiment of the present invention.

可选的,每个存储空间的存储类型可以包括但不限于一个单元存储一位二进制数据SLC(Single-Level Cell)的存储类型、一个单元存储两位二进制数据MLC(Multi-Level Cell)的存储类型以及一个单元存储三位二进制数据TLC(Trinary-Level Cell)的存储类型中的任意一种,本发明实施例不做限定。且相同存储类型的存储空间可以根据每个存储空间的老化程度被定义为不同的可靠性级别,如存储类型为SLC的存储空间可以被划分为老化程度低的SLC型存储空间以及老化程度高的SLC型存储空间等不同老化程度的SLC型存储空间,存储类型为MLC的存储空间可以被划分为老化程度低的MLC型存储空间以及老化程度高的MLC型存储空间等不同老化程度的MLC型存储空间,存储类型为TLC的存储空间可以被划分为老化程度低的TLC型存储空间以及老化程度高的TLC型存储空间等不同老化程度的TLC型存储空间,且对于相同存储类型的存储空间而言,其老化程度越低,其可靠性级别就越高。Optionally, the storage type of each storage space may include, but is not limited to, a storage type of one unit storing one-bit binary data SLC (Single-Level Cell), and one unit storing storage of two-bit binary data MLC (Multi-Level Cell). The type and the one of the storage types of the three-bit binary data TLC (Trinary-Level Cell) are not limited in the embodiment of the present invention. The storage space of the same storage type can be defined as different reliability levels according to the aging degree of each storage space. For example, the storage space with the storage type SLC can be classified into an SLC storage space with a low degree of aging and a high degree of aging. SLC type storage space of different ages such as SLC type storage space, storage space of MLC type can be divided into MLC type storage space with low aging degree and MLC type storage space with high aging degree, etc. MLC type storage of different aging degrees The space where the storage type is TLC can be divided into TLC storage spaces with low aging and TLC storage spaces with high aging, and the storage space of the same storage type. The lower the degree of aging, the higher the reliability level.

具体的,eMMC存储器件层204可以将元数据以及结构化用户数据存储在SLC型的存储空间中并实施可靠写操作,且可以将非结构化用户数据存储在MLC型的存储空间中,进一步的,eMMC存储器件层204可以将错误容忍级别高的非结构化用户数据存储在老化程度较高的MLC型的存储空间中,且将错误容忍级别低的非结构化用户数据存储在老化程度较低的MLC型的存储空间中。Specifically, the eMMC storage device layer 204 can store the metadata and the structured user data in an SLC type storage space and implement a reliable write operation, and can store the unstructured user data in the MLC type storage space, further The eMMC storage device layer 204 can store unstructured user data with a high error tolerance level in an MMC type storage space with a high degree of aging, and store unstructured user data with a low error tolerance level at a low degree of aging. MLC type storage space.

本发明实施例中,举例来说,假设上述存储列表如下表1所示且上述数据的数据类型为元数据、结构化用户数据、错误容忍级别低的非结构化用户数据或错误容忍级别高的非结构化用户数据,则当文件系统层202确定出的上述数据的数据类型为元数据时,eMMC存储器件层204优先为上述数据选择老化程度最低的SLC型存储空间,若SLC型存储空间中无空闲空间,则eMMC存储器件层204为上述数据选择老化程度最低的MLC型存储空间,若MLC型存储空间中也无空闲空间,则分配失败;当文件系统层202确定出的上述数据的数据类型为结构化用户数据时,eMMC存储器件层204优先为上述数据选择老化程度最高的SLC型存储空间,若SLC型存储空间中无空闲空间,则eMMC存储器件 层204为上述数据选择老化程度最低的MLC型存储空间,若MLC型存储空间中也无空闲空间,则分配失败;当文件系统层202确定出的上述数据的数据类型为错误容忍级别低的非结构化用户数据时,eMMC存储器件层204优先为上述数据选择老化程度最低的MLC型存储空间,若MLC型存储空间中无空闲空间,则eMMC存储器件层204为上述数据选择老化程度最高的SLC型存储空间,若SLC型存储空间中也无空闲空间,则分配失败;当文件系统层202确定出的上述数据的数据类型为错误容忍级别高的非结构化用户数据时,eMMC存储器件层204优先为上述数据选择老化程度最高的MLC型存储空间,若MLC型存储空间中无空闲空间,则eMMC存储器件层204为上述数据选择老化程度最高的SLC型存储空间,若SLC型存储空间中也无空闲空间,则分配失败,其中,表1为:In the embodiment of the present invention, for example, it is assumed that the foregoing storage list is as shown in Table 1 below, and the data type of the foregoing data is metadata, structured user data, unstructured user data with low error tolerance level, or high error tolerance level. The unstructured user data, when the data type of the data determined by the file system layer 202 is metadata, the eMMC storage device layer 204 preferentially selects the SLC type storage space with the lowest degree of aging for the data, if the SLC type storage space If there is no free space, the eMMC storage device layer 204 selects the MLC type storage space with the lowest degree of aging for the above data. If there is no free space in the MLC type storage space, the allocation fails; when the file system layer 202 determines the data of the above data. When the type is structured user data, the eMMC storage device layer 204 preferentially selects the SLC type storage space with the highest degree of aging for the above data, and if there is no free space in the SLC type storage space, the eMMC storage device The layer 204 selects the MLC type storage space with the lowest degree of aging for the above data. If there is no free space in the MLC type storage space, the allocation fails; when the data type of the data determined by the file system layer 202 is low, the error tolerance level is low. When the user data is structured, the eMMC storage device layer 204 preferentially selects the MLC type storage space with the lowest degree of aging for the above data. If there is no free space in the MLC type storage space, the eMMC storage device layer 204 selects the SLC with the highest degree of aging for the above data. Type storage space, if there is no free space in the SLC type storage space, the allocation fails; when the data type of the above data determined by the file system layer 202 is unstructured user data with high error tolerance level, the eMMC storage device layer 204 The MLC type storage space with the highest degree of aging is selected for the above data. If there is no free space in the MLC type storage space, the eMMC storage device layer 204 selects the SLC type storage space with the highest degree of aging for the above data, and if the SLC type storage space is also If there is no free space, the allocation fails. Table 1 is:

表1 存储列表Table 1 Storage list

存储类型Storage type 老化程度Degree of aging SLC型SLC type low SLC型SLC type high MLC型MLC type low MLC型MLC type high

实施本发明实施例能够按照需要存储数据的数据类型,将数据的可靠性需求与eMMC内存储介质提供的可靠性进行动态适配,提高了eMMC存储数据的灵活性,且能够将不同可靠性需求的数据存储在不同可靠性级别的存储空间中,确保了数据的可靠性需求。The embodiments of the present invention can dynamically adapt the data reliability type to the reliability of the storage medium in the eMMC according to the data type of the data to be stored, improve the flexibility of the eMMC storage data, and can meet different reliability requirements. The data is stored in storage spaces of different reliability levels, ensuring the reliability requirements of the data.

请参阅图3,图3是本发明实施例公开的一种基于嵌入式多媒体卡eMMC的存储方法的流程示意图。其中,图3所示的方法可以应用于图2所示的系统中。如图3所示,该基于嵌入式多媒体卡eMMC的存储方法可以包括以下步骤:Please refer to FIG. 3. FIG. 3 is a schematic flowchart of a storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention. Among them, the method shown in FIG. 3 can be applied to the system shown in FIG. 2. As shown in FIG. 3, the embedded multimedia card eMMC-based storage method may include the following steps:

S301、应用程序层向文件系统层发送数据写入请求。S301. The application layer sends a data write request to the file system layer.

本发明实施例中,该数据写入请求可以包括应用程序需要写入eMMC存储器件层的数据。 In the embodiment of the present invention, the data write request may include data that the application needs to write to the eMMC storage device layer.

S302、文件系统层响应上述数据写入请求并确定需要写入的数据的数据类型。S302. The file system layer responds to the data write request and determines a data type of data to be written.

本发明实施例中,上述数据的数据类型可以包括但不限于元数据、结构化用户数据以及不同错误容忍级别对应的不同非结构化用户数据(如错误容忍级别高的非结构化用户数据以及错误容忍级别低的非结构化用户数据等)中的任意一种,本发明实施例不做限定。其中,元数据是文件系统的关键数据且对可靠性要求高,因此,元数据被定义为对可靠性要求最高的数据,即元数据为可靠性级别最高的数据;结构化用户数据(如关系型数据库系统等)为要求存放正确无误的数据,且其对可靠性的要求相对于元数据对可靠性的要求较低;非结构化用户数据(如音视频数据等)是少量错误并不影响全局的数据,其对可靠性的要求最低,且错误容忍级别越高的非结构化用户数据对可靠性的要求就越低。In the embodiment of the present invention, the data type of the foregoing data may include, but is not limited to, metadata, structured user data, and different unstructured user data corresponding to different error tolerance levels (such as unstructured user data with high error tolerance level and errors). Any one of the unstructured user data and the like having a low tolerance level is not limited in the embodiment of the present invention. Among them, metadata is the key data of the file system and has high reliability requirements. Therefore, metadata is defined as the data with the highest reliability requirement, that is, the metadata is the data with the highest reliability level; structured user data (such as relationship) Type database system, etc.) is required to store correct and correct data, and its reliability requirements are lower than the reliability requirements of metadata; unstructured user data (such as audio and video data, etc.) is a small number of errors and does not affect Global data has the lowest reliability requirements, and the higher the error tolerance level, the lower the reliability requirements of unstructured user data.

作为一种可选的实施方式,上述数据写入请求还可以包括上述数据的数据属性,则文件系统层响应上述数据写入请求并确定上述数据的数据类型可以包括:As an optional implementation manner, the data write request may further include the data attribute of the data, where the file system layer responds to the data write request and determines the data type of the data may include:

响应上述数据写入请求,根据上述数据的数据属性识别出上述数据的数据类型。In response to the data write request, the data type of the data is identified based on the data attribute of the data.

作为另一种可选的实施方式,上述数据写入请求还可以包括上述应用程序的应用程序类型,则文件系统层响应上述数据写入请求并确定上述数据的数据类型可以包括:As another optional implementation manner, the data writing request may further include an application type of the application, and the file system layer responding to the data writing request and determining the data type of the data may include:

响应上述数据写入请求,根据上述应用程序的应用程序类型识别出上述数据的数据类型。In response to the data write request, the data type of the data is identified according to the application type of the application.

S303、eMMC块设备驱动程序层根据上述数据类型设置写命令参数中的数据标签Do_data_tag以及可靠写标志位Do_rel_wr。S303. The eMMC block device driver layer sets the data label Do_data_tag and the reliable write flag bit Do_rel_wr in the write command parameter according to the above data type.

本发明实施例中,数据标签Do_data_tag以及可靠写标志位Do_rel_wr是写命令参数中的两个标志位,且数据标签Do_data_tag以及可靠写标志位Do_rel_wr机制只针对写操作,此外,由于NAND闪存采取的是非原位置更新,因此,数据标签Do_data_tag以及可靠写标志位Do_rel_wr机制可应用于包括写入新数据以及更新旧数据的全部写操作。其中,数据标签Do_data_tag为eMMC 存储器件的一个特性,其允许eMMC存储器件从主机获取需要存储数据的数据类型、时间戳以及配置参数等,以作为eMMC存储器件层为需要存储的数据分配存储空间的决策依据。可靠写标志位Do_rel_wr用于标识是否对上述数据进行可靠写,可靠写也是eMMC存储器件的一个特性,且其是带有一定约束条件的原子性写操作,它要求保证之前已经可靠写入的数据在突然掉电或系统崩溃时不被损坏。In the embodiment of the present invention, the data tag Do_data_tag and the reliable write flag bit Do_rel_wr are two flag bits in the write command parameter, and the data tag Do_data_tag and the reliable write flag bit Do_rel_wr mechanism are only for the write operation, and further, due to the NAND flash memory The original location is updated, so the data tag Do_data_tag and the reliable write flag Do_rel_wr mechanism can be applied to all write operations including writing new data and updating old data. Where the data tag Do_data_tag is eMMC A feature of the memory device that allows the eMMC memory device to obtain data types, time stamps, and configuration parameters from the host that need to store data to serve as a basis for the eMMC memory device layer to allocate storage space for data that needs to be stored. The reliable write flag bit Do_rel_wr is used to identify whether to reliably write the above data. Reliable write is also a feature of the eMMC memory device, and it is an atomic write operation with certain constraints, which requires data that has been reliably written before. It is not damaged in the event of a sudden power failure or system crash.

本发明实施例中,举例来说,当文件系统层确定出的上述数据的数据类型为元数据(如文件系统元数据等)时,eMMC块设备驱动程序层可以将数据标签Do_data_tag以及可靠写标志位Do_rel_wr均置为1,这表示该元数据的可靠性级别最高,即其对可靠性要求最高;当文件系统层确定出的上述数据的数据类型为结构化用户数据(如手机银行重要数据等)时,eMMC块设备驱动程序层可以将数据标签Do_data_tag置为0,并将可靠写标志位Do_rel_wr置为1,这表示该结构化用户数据的可靠性级别次高,即其对可靠性要求次高;当文件系统层确定出的上述数据的数据类型为错误容忍级别低的非结构化用户数据(如游戏数据或社交数据等)时,eMMC块设备驱动程序层可以将数据标签Do_data_tag置为1,并将可靠写标志位Do_rel_wr置为0,这表示该错误容忍级别低的非结构化用户数据的可靠性级别低,即其对可靠性要求低;当文件系统层确定出的上述数据的数据类型为错误容忍级别高的非结构化用户数据(如不重要的缓存数据或交换数据等)时,eMMC块设备驱动程序层可以将数据标签Do_data_tag置为0,并将可靠写标志位Do_rel_wr置为0,这表示该错误容忍级别高的非结构化用户数据的可靠性级别最低,即其对可靠性要求最低。In the embodiment of the present invention, for example, when the data type of the data determined by the file system layer is metadata (such as file system metadata, etc.), the eMMC block device driver layer may use the data tag Do_data_tag and the reliable write flag. The bit Do_rel_wr is set to 1, which means that the metadata has the highest reliability level, that is, it has the highest reliability requirement; when the data type of the above data determined by the file system layer is structured user data (such as mobile banking important data, etc.) When the eMMC block device driver layer can set the data tag Do_data_tag to 0 and the reliable write flag bit Do_rel_wr to 1, indicating that the structured user data has the second highest reliability level, that is, its reliability requirement. High; when the file system layer determines that the data type of the above data is unstructured user data with low error tolerance level (such as game data or social data, etc.), the eMMC block device driver layer can set the data tag Do_data_tag to 1 And set the reliable write flag bit Do_rel_wr to 0, which means that the unstructured user data with low error tolerance level has low reliability level. That is, it has low reliability requirements; when the data type of the above data determined by the file system layer is unstructured user data with high error tolerance level (such as unimportant cached data or exchanged data, etc.), the eMMC block device driver The layer can set the data tag Do_data_tag to 0 and the reliable write flag bit Do_rel_wr to 0, which means that the unstructured user data with high error tolerance level has the lowest reliability level, that is, it has the lowest reliability requirement.

S304、eMMC存储器件层根据上述数据标签以及上述可靠写标志位从预先存储的存储列表中确定出针对上述数据的目标存储空间,并将上述数据存储在该目标存储空间中。S304. The eMMC storage device layer determines a target storage space for the data from the pre-stored storage list according to the data label and the reliable write flag, and stores the data in the target storage space.

本发明实施例中,eMMC存储器件层内部控制器的Firmware(固件)可以维护一个存储列表,该存储列表可以包括每个存储空间的存储类型以及每个存储空间的老化程度,其中,每个存储空间的老化程度可以由每个存储空间的已擦除次数以及磨损程度决定,可选的,该存储列表还可以包括每个存储空间的空闲状态,如每个存储空间的剩余空间(即空闲空间)容量或每个存储空间的 剩余空间容量占该存储空间总空间容量的比值等,本发明实施例不做限定。In the embodiment of the present invention, the firmware of the internal controller of the eMMC storage device layer may maintain a storage list, and the storage list may include a storage type of each storage space and an aging degree of each storage space, where each storage The degree of aging of the space may be determined by the number of erasures of each storage space and the degree of wear. Optionally, the storage list may also include an idle state of each storage space, such as the remaining space of each storage space (ie, free space). Capacity or per storage space The ratio of the remaining space capacity to the total space capacity of the storage space, etc., is not limited in the embodiment of the present invention.

可选的,每个存储空间的存储类型可以包括但不限于一个单元存储一位二进制数据SLC(Single-Level Cell)的存储类型、一个单元存储两位二进制数据MLC(Multi-Level Cell)的存储类型以及一个单元存储三位二进制数据TLC(Trinary-Level Cell)的存储类型中的任意一种,本发明实施例不做限定。且相同存储类型的存储空间可以根据每个存储空间的老化程度被定义为不同的可靠性级别,如存储类型为SLC的存储空间可以被划分为老化程度低的SLC型存储空间以及老化程度高的SLC型存储空间等不同老化程度的SLC型存储空间,存储类型为MLC的存储空间可以被划分为老化程度低的MLC型存储空间以及老化程度高的MLC型存储空间等不同老化程度的MLC型存储空间,存储类型为TLC的存储空间可以被划分为老化程度低的TLC型存储空间以及老化程度高的TLC型存储空间等不同老化程度的TLC型存储空间,且对于相同存储类型的存储空间而言,其老化程度越低,其可靠性级别就越高。Optionally, the storage type of each storage space may include, but is not limited to, a storage type of one unit storing one-bit binary data SLC (Single-Level Cell), and one unit storing storage of two-bit binary data MLC (Multi-Level Cell). The type and the one of the storage types of the three-bit binary data TLC (Trinary-Level Cell) are not limited in the embodiment of the present invention. The storage space of the same storage type can be defined as different reliability levels according to the aging degree of each storage space. For example, the storage space with the storage type SLC can be classified into an SLC storage space with a low degree of aging and a high degree of aging. SLC type storage space of different ages such as SLC type storage space, storage space of MLC type can be divided into MLC type storage space with low aging degree and MLC type storage space with high aging degree, etc. MLC type storage of different aging degrees The space where the storage type is TLC can be divided into TLC storage spaces with low aging and TLC storage spaces with high aging, and the storage space of the same storage type. The lower the degree of aging, the higher the reliability level.

具体的,eMMC存储器件层可以将元数据以及结构化用户数据存储在SLC型的存储空间中并实施可靠写操作,且可以将非结构化用户数据存储在MLC型的存储空间中,进一步的,eMMC存储器件层可以将错误容忍级别高的非结构化用户数据存储在老化程度较高的MLC型的存储空间中,且将错误容忍级别低的非结构化用户数据存储在老化程度较低的MLC型的存储空间中。Specifically, the eMMC storage device layer can store the metadata and the structured user data in the SLC type storage space and implement a reliable write operation, and can store the unstructured user data in the MLC type storage space. Further, The eMMC storage device layer can store unstructured user data with high error tolerance level in the MMC type storage space with high degree of aging, and store unstructured user data with low error tolerance level in the less aged MLC. Type of storage space.

本发明实施例中,应用程序层向文件系统层发送数据写入请求,其中,该数据写入请求包括应用程序需要写入eMMC存储器件层的数据,文件系统层响应该数据写入请求确定该数据的数据类型,eMMC块设备驱动程序层根据该数据类型设置写命令参数中的数据标签以及可靠写标志位,eMMC存储器件层根据该数据标签以及该可靠写标志位从预先存储的存储列表中确定出针对该数据的目标存储空间,并将该数据存储在该目标存储空间中,其中,该存储列表包括每个存储空间的存储类型以及每个存储空间的老化程度。实施本发明实施例能够按照需要存储数据的数据类型,将数据的可靠性需求与eMMC内存储介质提供的可靠性进行动态适配,提高了eMMC存储数据的灵活性,且能够将不同可靠性需求的数据存储在不同可靠性级别的存储空间中,确保了数据的可靠 性需求。In the embodiment of the present invention, the application layer sends a data write request to the file system layer, where the data write request includes data that the application needs to write to the eMMC storage device layer, and the file system layer determines the response in response to the data write request. The data type of the data, the eMMC block device driver layer sets the data label in the write command parameter and the reliable write flag bit according to the data type, and the eMMC storage device layer reads from the pre-stored storage list according to the data label and the reliable write flag bit. Determining a target storage space for the data, and storing the data in the target storage space, wherein the storage list includes a storage type of each storage space and an aging degree of each storage space. The embodiments of the present invention can dynamically adapt the data reliability type to the reliability of the storage medium in the eMMC according to the data type of the data to be stored, improve the flexibility of the eMMC storage data, and can meet different reliability requirements. Data is stored in storage spaces of different reliability levels, ensuring reliable data Sexual needs.

请参阅图4,图4是本发明实施例公开的另一种基于嵌入式多媒体卡eMMC的存储方法的流程示意图。其中,图4是以需要写入的数据为元数据、结构化用户数据、错误容忍级别低的非结构化用户数据以及错误容级别高的非结构化用户数据中的任意一种且存储列表如表1所示为例的基于嵌入式多媒体卡eMMC的存储方法的流程示意图。如图4所示,该基于嵌入式多媒体卡eMMC的存储方法可以包括以下步骤:Please refer to FIG. 4. FIG. 4 is a schematic flowchart diagram of another storage method based on an embedded multimedia card eMMC according to an embodiment of the present invention. 4 is any one of the data to be written as metadata, structured user data, unstructured user data with low error tolerance level, and unstructured user data with high error tolerance level, and the storage list is as follows. Table 1 shows a flow chart of an embedded multimedia card eMMC-based storage method. As shown in FIG. 4, the embedded multimedia card eMMC-based storage method may include the following steps:

S401、应用程序层向文件系统层发送数据写入请求。S401. The application layer sends a data write request to the file system layer.

S402、文件系统层响应上述数据写入请求,确定上述数据写入请求中包括的需要写入的数据的数据类型。S402. The file system layer determines the data type of the data to be written included in the data writing request in response to the data writing request.

本发明实施例中,当步骤S402中确定出的数据的数据类型为元数据时,由eMMC块设备驱动程序层执行步骤S403;当步骤S402中确定出的数据的数据类型为结构化用户数据时,由eMMC块设备驱动程序层执行步骤S405;当步骤S402中确定出的数据的数据类型为错误容忍级别低的非结构化用户数据时,由eMMC块设备驱动程序层执行步骤S407;当步骤S402中确定出的数据的数据类型为错误容忍级别高的非结构化用户数据时,由eMMC块设备驱动程序层执行步骤S409。In the embodiment of the present invention, when the data type of the data determined in step S402 is metadata, step S403 is performed by the eMMC block device driver layer; when the data type of the data determined in step S402 is structured user data. Step S405 is performed by the eMMC block device driver layer; when the data type of the data determined in step S402 is unstructured user data with a low error tolerance level, step S407 is performed by the eMMC block device driver layer; When the data type of the data determined in the data is unstructured user data with a high error tolerance level, step S409 is performed by the eMMC block device driver layer.

S403、eMMC块设备驱动程序层将写命令参数中的数据标签Do_data_tag以及可靠写标志位Do_rel_wr均置为1。S403. The eMMC block device driver layer sets the data label Do_data_tag and the reliable write flag bit Do_rel_wr in the write command parameter to 1.

S404、eMMC存储器件层确定出针对元数据的目标存储空间为老化程度最低的SLC型存储空间,并将元数据存储在该老化程度最低的SLC型存储空间。S404. The eMMC storage device layer determines that the target storage space for the metadata is the SMC type storage space with the lowest degree of aging, and stores the metadata in the SLC type storage space with the lowest degree of aging.

本发明实施例中,若SLC型存储空间中无空闲空间,则eMMC存储器件层为元数据选择老化程度最低的MLC型存储空间,若MLC型存储空间中也无空闲空间,则分配失败。In the embodiment of the present invention, if there is no free space in the SLC type storage space, the eMMC storage device layer selects the MLC type storage space with the lowest degree of aging for the metadata, and if there is no free space in the MLC type storage space, the allocation fails.

S405、eMMC块设备驱动程序层将写命令参数中的数据标签Do_data_tag置为0,并将可靠写标志位Do_rel_wr置为1。S405. The eMMC block device driver layer sets the data label Do_data_tag in the write command parameter to 0, and sets the reliable write flag bit Do_rel_wr to 1.

S406、eMMC存储器件层确定出针对结构化用户数据的目标存储空间为老化程度最高的SLC型存储空间,并将结构化用户数据存储在该老化程度最高的 SLC型存储空间。S406. The eMMC storage device layer determines that the target storage space for structured user data is the SMC type storage space with the highest degree of aging, and stores the structured user data in the highest degree of aging. SLC type storage space.

本发明实施例中,若SLC型存储空间中无空闲空间,则eMMC存储器件层为结构化用户数据选择老化程度最低的MLC型存储空间,若MLC型存储空间中也无空闲空间,则分配失败。In the embodiment of the present invention, if there is no free space in the SLC type storage space, the eMMC storage device layer selects the MLC type storage space with the lowest aging degree for the structured user data, and if there is no free space in the MLC type storage space, the allocation fails. .

S407、eMMC块设备驱动程序层将写命令参数中的数据标签Do_data_tag置为1,并将可靠写标志位Do_rel_wr置为0。S407. The eMMC block device driver layer sets the data label Do_data_tag in the write command parameter to 1, and sets the reliable write flag bit Do_rel_wr to zero.

S408、eMMC存储器件层确定出针对错误容忍级别低的非结构化用户数据的目标存储空间为老化程度最低的MLC型存储空间,并将错误容忍级别低的非结构化用户数据存储在该老化程度最低的MLC型存储空间。S408. The eMMC storage device layer determines that the target storage space for the unstructured user data with low error tolerance level is the least aged MLC type storage space, and stores the unstructured user data with low error tolerance level at the aging degree. The lowest MLC type storage space.

本发明实施例中,若MLC型存储空间中无空闲空间,则eMMC存储器件层为错误容忍级别低的非结构化用户数据选择老化程度最高的SLC型存储空间,若SLC型存储空间中也无空闲空间,则分配失败。In the embodiment of the present invention, if there is no free space in the MLC type storage space, the eMMC storage device layer selects the SLC type storage space with the highest degree of aging for the unstructured user data with low error tolerance level, and if there is no SLC type storage space, If there is free space, the allocation fails.

S409、eMMC块设备驱动程序层将数据标签Do_data_tag置为0,并将可靠写标志位Do_rel_wr置为0。S409. The eMMC block device driver layer sets the data tag Do_data_tag to 0 and sets the reliable write flag bit Do_rel_wr to zero.

S410、eMMC存储器件层确定出针对错误容忍级别高的非结构化用户数据的目标存储空间为老化程度最高的MLC型存储空间,并将错误容忍级别高的非结构化用户数据存储在该老化程度最高的MLC型存储空间。S410. The eMMC storage device layer determines that the target storage space for the unstructured user data with high error tolerance level is the most aging MLC type storage space, and stores the unstructured user data with high error tolerance level at the aging degree. The highest MLC type storage space.

本发明实施例中,若MLC型存储空间中无空闲空间,则eMMC存储器件层为错误容忍级别高的非结构化用户数据选择老化程度最高的SLC型存储空间,若SLC型存储空间中也无空闲空间,则分配失败。In the embodiment of the present invention, if there is no free space in the MLC type storage space, the eMMC storage device layer selects the SLC type storage space with the highest degree of aging for the unstructured user data with high error tolerance level, and if there is no SLC type storage space, If there is free space, the allocation fails.

实施本发明实施例能够按照需要存储数据的数据类型,将数据的可靠性需求与eMMC内存储介质提供的可靠性进行动态适配,提高了eMMC存储数据的灵活性,且能够将不同可靠性需求的数据存储在不同可靠性能力的存储空间中,确保了数据的可靠性需求。The embodiments of the present invention can dynamically adapt the data reliability type to the reliability of the storage medium in the eMMC according to the data type of the data to be stored, improve the flexibility of the eMMC storage data, and can meet different reliability requirements. The data is stored in storage space with different reliability capabilities, ensuring the reliability requirements of the data.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。 A person skilled in the art may understand that all or part of the various steps of the foregoing embodiments may be performed by a program to instruct related hardware. The program may be stored in a computer readable storage medium, and the storage medium may include: Flash disk, Read-Only Memory (ROM), Random Access Memory (RAM), disk or optical disk.

以上对本发明实施例所提供的一种基于嵌入式多媒体卡eMMC的存储方法及系统进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The storage method and system based on the embedded multimedia card eMMC provided by the embodiments of the present invention are described in detail. The principles and implementation manners of the present invention are described in the specific examples. The description of the above embodiments is only The method for understanding the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in specific embodiments and application scopes. The description should not be construed as limiting the invention.

Claims (10)

一种基于嵌入式多媒体卡eMMC的存储系统,其特征在于,所述系统包括应用程序层、文件系统层、eMMC块设备驱动程序层以及eMMC存储器件层,其中:A storage system based on an embedded multimedia card eMMC, characterized in that the system comprises an application layer, a file system layer, an eMMC block device driver layer and an eMMC storage device layer, wherein: 所述应用程序层,用于向所述文件系统层发送数据写入请求,所述数据写入请求包括应用程序需要写入所述eMMC存储器件层的数据;The application layer is configured to send a data write request to the file system layer, where the data write request includes data that an application needs to write to the eMMC storage device layer; 所述文件系统层,用于响应所述数据写入请求并确定所述数据的数据类型;The file system layer, configured to respond to the data write request and determine a data type of the data; 所述eMMC块设备驱动程序层,用于根据所述数据类型设置写命令参数中的数据标签以及可靠写标志位;The eMMC block device driver layer is configured to set a data label in the write command parameter and a reliable write flag bit according to the data type; 所述eMMC存储器件层,用于根据所述数据标签以及所述可靠写标志位从预先存储的存储列表中确定出针对所述数据的目标存储空间,并将所述数据存储在所述目标存储空间中,所述存储列表包括每个存储空间的存储类型以及每个所述存储空间的老化程度。The eMMC storage device layer is configured to determine, from the pre-stored storage list, a target storage space for the data according to the data label and the reliable write flag bit, and store the data in the target storage In space, the storage list includes a storage type of each storage space and an aging degree of each of the storage spaces. 根据权利要求1所述的系统,其特征在于,所述数据写入请求还包括所述数据的数据属性;The system of claim 1 wherein said data write request further comprises a data attribute of said data; 所述文件系统层响应所述数据写入请求并确定所述数据的数据类型的具体方式为:The specific manner in which the file system layer responds to the data write request and determines the data type of the data is: 响应所述数据写入请求,根据所述数据属性识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the data attribute. 根据权利要求1所述的系统,其特征在于,所述数据写入请求还包括所述应用程序的应用程序类型;The system of claim 1 wherein said data write request further comprises an application type of said application; 所述文件系统层响应所述数据写入请求确定所述数据的数据类型的具体方式为:The specific manner in which the file system layer determines the data type of the data in response to the data write request is: 响应所述数据写入请求,根据所述应用程序类型识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the application type. 根据权利要求1~3任一项所述的系统,其特征在于,所述存储类型包 括一个单元存储一位二进制数据SLC的存储类型、一个单元存储两位二进制数据MLC的存储类型以及一个单元存储三位二进制数据TLC的存储类型中的任意一种。The system according to any one of claims 1 to 3, wherein said storage type package A unit stores a storage type of one bit binary data SLC, a storage type of one unit storing two binary data MLC, and a storage type of one unit storing three bit binary data TLC. 根据权利要求4所述的系统,其特征在于,所述数据类型包括元数据、结构化用户数据以及不同错误容忍级别对应的不同非结构化用户数据中的任意一种。The system of claim 4, wherein the data type comprises any one of metadata, structured user data, and different unstructured user data corresponding to different error tolerance levels. 一种基于嵌入式多媒体卡eMMC的存储方法,其特征在于,所述方法包括:A storage method based on an embedded multimedia card eMMC, characterized in that the method comprises: 应用程序层向文件系统层发送数据写入请求,所述数据写入请求包括应用程序需要写入eMMC存储器件层的数据;The application layer sends a data write request to the file system layer, the data write request including data that the application needs to write to the eMMC storage device layer; 所述文件系统层响应所述数据写入请求并确定所述数据的数据类型;The file system layer is responsive to the data write request and determines a data type of the data; eMMC块设备驱动程序层根据所述数据类型设置写命令参数中的数据标签以及可靠写标志位;The eMMC block device driver layer sets a data label in the write command parameter and a reliable write flag bit according to the data type; 所述eMMC存储器件层根据所述数据标签以及所述可靠写标志位从预先存储的存储列表中确定出针对所述数据的目标存储空间,并将所述数据存储在所述目标存储空间中,所述存储列表包括每个存储空间的存储类型以及每个所述存储空间的老化程度。Determining, by the eMMC storage device layer, a target storage space for the data from a pre-stored storage list according to the data label and the reliable write flag bit, and storing the data in the target storage space, The storage list includes a storage type of each storage space and an aging degree of each of the storage spaces. 根据权利要求6所述的方法,其特征在于,所述数据写入请求还包括所述数据的数据属性;The method of claim 6 wherein said data write request further comprises a data attribute of said data; 所述文件系统层响应所述数据写入请求并确定所述数据的数据类型,包括:The file system layer responds to the data write request and determines a data type of the data, including: 响应所述数据写入请求,根据所述数据属性识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the data attribute. 根据权利要求6所述的方法,其特征在于,所述数据写入请求还包括所述应用程序的应用程序类型; The method of claim 6 wherein said data write request further comprises an application type of said application; 所述文件系统层响应所述数据写入请求并确定所述数据的数据类型,包括:The file system layer responds to the data write request and determines a data type of the data, including: 响应所述数据写入请求,根据所述应用程序类型识别出所述数据的数据类型。In response to the data write request, a data type of the data is identified based on the application type. 根据权利要求6~8任一项所述的方法,其特征在于,所述存储类型包括一个单元存储一位二进制数据SLC的存储类型、一个单元存储两位二进制数据MLC的存储类型以及一个单元存储三位二进制数据TLC的存储类型中的任意一种。The method according to any one of claims 6 to 8, wherein the storage type comprises a storage type of one unit storing one bit binary data SLC, a storage type of one unit storing two-bit binary data MLC, and a unit storage Any of the storage types of the three-bit binary data TLC. 根据权利要求9所述的方法,其特征在于,所述数据类型包括元数据、结构化用户数据以及不同错误容忍级别对应的不同非结构化用户数据中的任意一种。 The method of claim 9, wherein the data type comprises any one of metadata, structured user data, and different unstructured user data corresponding to different error tolerance levels.
PCT/CN2016/080077 2015-04-27 2016-04-22 Storage method and system based on embedded multi-media card Ceased WO2016173470A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510204376.9 2015-04-27
CN201510204376.9A CN106155580B (en) 2015-04-27 2015-04-27 A kind of storage method and system based on embedded multi-media card eMMC

Publications (1)

Publication Number Publication Date
WO2016173470A1 true WO2016173470A1 (en) 2016-11-03

Family

ID=57198976

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/080077 Ceased WO2016173470A1 (en) 2015-04-27 2016-04-22 Storage method and system based on embedded multi-media card

Country Status (2)

Country Link
CN (1) CN106155580B (en)
WO (1) WO2016173470A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110289039B (en) * 2018-03-19 2021-07-27 北京兆易创新科技股份有限公司 Debugging method and device of eMMC
CN108513197A (en) * 2018-04-11 2018-09-07 四川斐讯信息技术有限公司 A kind of data-storage system and date storage method of intelligent earphone
CN108595123B (en) * 2018-04-26 2021-06-01 青岛海信移动通信技术股份有限公司 Data storage method and device of mobile terminal
CN109324762A (en) * 2018-10-11 2019-02-12 郑州云海信息技术有限公司 A construction method, device, device and storage medium for a storage system
CN114489487A (en) * 2021-12-29 2022-05-13 深圳星火半导体科技有限公司 Data storage protection method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102301369A (en) * 2011-05-30 2011-12-28 华为终端有限公司 Data storage device access method and device
CN102799484A (en) * 2012-07-11 2012-11-28 中兴通讯股份有限公司 Method and device for running multiple operating systems by mobile terminal
CN103221927A (en) * 2010-11-24 2013-07-24 索尼爱立信移动通讯有限公司 Dynamically configurable embedded flash memory for electronic devices
CN103280238A (en) * 2013-06-27 2013-09-04 山东量子科学技术研究院有限公司 EMMC controller based on FPGA, and working method of eMMC controller
JP2014059872A (en) * 2012-09-14 2014-04-03 Samsung Electronics Co Ltd EMBEDDED MULTIMEDIA CARD (eMMC), HOST CONTROLLING THE SAME, AND METHOD OF OPERATING eMMC SYSTEM

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130079706A (en) * 2012-01-03 2013-07-11 삼성전자주식회사 Method of operating storage device including volatile memory
CN103488578B (en) * 2012-12-28 2016-05-25 晶天电子(深圳)有限公司 Virtual memory facilities (VMD) application/driver
US8929146B1 (en) * 2013-07-26 2015-01-06 Avalanche Technology, Inc. Controller management of memory array of storage device using magnetic random access memory (MRAM)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103221927A (en) * 2010-11-24 2013-07-24 索尼爱立信移动通讯有限公司 Dynamically configurable embedded flash memory for electronic devices
CN102301369A (en) * 2011-05-30 2011-12-28 华为终端有限公司 Data storage device access method and device
CN102799484A (en) * 2012-07-11 2012-11-28 中兴通讯股份有限公司 Method and device for running multiple operating systems by mobile terminal
JP2014059872A (en) * 2012-09-14 2014-04-03 Samsung Electronics Co Ltd EMBEDDED MULTIMEDIA CARD (eMMC), HOST CONTROLLING THE SAME, AND METHOD OF OPERATING eMMC SYSTEM
CN103280238A (en) * 2013-06-27 2013-09-04 山东量子科学技术研究院有限公司 EMMC controller based on FPGA, and working method of eMMC controller

Also Published As

Publication number Publication date
CN106155580B (en) 2019-04-12
CN106155580A (en) 2016-11-23

Similar Documents

Publication Publication Date Title
KR102904679B1 (en) Memory system and operating method thereof
TWI764232B (en) Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device and host device
US8762625B2 (en) Stochastic block allocation for improved wear leveling
US9645895B2 (en) Data storage device and flash memory control method
US11727997B2 (en) RPMB improvements to managed NAND
US9804960B2 (en) Overprovision capacity in a data storage device
US8745309B2 (en) Cooperative memory management
US8935459B2 (en) Heuristics for programming data in a non-volatile memory
US10126970B2 (en) Paired metablocks in non-volatile storage device
KR102507140B1 (en) Data storage device and operating method thereof
US20240192883A1 (en) Management of Storage Space in Solid State Drives to Support Proof of Space Activities
US9569126B2 (en) Data storage device and flash memory control method
JP2013137771A (en) Mount-time reconciliation of data availability
US9646721B1 (en) Solid state drive bad block management
KR20100097456A (en) Memory system and address allocating method of flash translation layer thereof
WO2016173470A1 (en) Storage method and system based on embedded multi-media card
US9619165B1 (en) Convertible leaf memory mapping
US11218164B2 (en) Data storage device and non-volatile memory control method
US11226738B2 (en) Electronic device and data compression method thereof
US20130159604A1 (en) Memory storage device and memory controller and data writing method thereof
US10671322B1 (en) Method for performing storage space management, associated data storage device, and controller thereof
US20170115925A1 (en) Valid data merging method, memory controller and memory storage apparatus
US20170052708A1 (en) Method for accessing flash memory and associated memory controller and electronic device
US20170083235A1 (en) Device capable of using external volatile memory and device capable of releasing internal volatile memory
US9116794B2 (en) Storage device data protection system

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: 16785901

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: 16785901

Country of ref document: EP

Kind code of ref document: A1