CN111897485A - Data storage method and device, electronic equipment and storage medium - Google Patents

Data storage method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111897485A
CN111897485A CN201910368566.2A CN201910368566A CN111897485A CN 111897485 A CN111897485 A CN 111897485A CN 201910368566 A CN201910368566 A CN 201910368566A CN 111897485 A CN111897485 A CN 111897485A
Authority
CN
China
Prior art keywords
data
storage
stored
block
storage block
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.)
Pending
Application number
CN201910368566.2A
Other languages
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.)
Shanghai Geyi Electronic Co ltd
GigaDevice Semiconductor Beijing Inc
Beijing Zhaoyi Innovation Technology Co Ltd
Original Assignee
Shanghai Geyi Electronic Co ltd
Beijing Zhaoyi Innovation Technology 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 Shanghai Geyi Electronic Co ltd, Beijing Zhaoyi Innovation Technology Co Ltd filed Critical Shanghai Geyi Electronic Co ltd
Priority to CN201910368566.2A priority Critical patent/CN111897485A/en
Publication of CN111897485A publication Critical patent/CN111897485A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

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)

Abstract

The embodiment of the invention discloses a data storage method, a data storage device, electronic equipment and a storage medium, wherein the method comprises the following steps: when a data storage instruction is received, judging whether the size of the data to be stored reaches a first set value or not; if the size of the data to be stored does not reach a first set value, storing the data to be stored in a first storage block, otherwise, storing the data to be stored in a second storage block; and when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block. By adopting the technical scheme, the utilization rate of the storage space is improved, and the space waste is reduced.

Description

Data storage method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data storage, in particular to a data storage method and device, electronic equipment and a storage medium.
Background
The EMMC (Embedded Multi Media Card) is established by the MMC association, mainly aims at the standard specification of an Embedded memory of products such as a mobile phone or a tablet computer, and consists of an Embedded memory solution, and is provided with an MMC multimedia interface, a flash memory (such as nand flash) and an EMMC controller. More and more mobile devices employ an EMMC chip as a memory cell.
When storing user data (for example, data such as photos and videos shot by a user through a mobile phone), the user data can be stored in a nand flash storage medium from a user terminal (for example, a front end of the mobile phone) to an EMMC chip, due to the storage characteristic of the nand flash, each time the data is stored, one storage page must be written at a time, and different nands have storage pages with different sizes, for example, the storage pages can be 4KB, 8KB or 16 KB. According to the agreement of the EMMC protocol, the write-in unit of the user data is 512 bytes, so a set of data storage scheme needs to be formulated, which not only meets the requirement of nand, but also meets the agreement of the EMMC protocol. The existing data storage scheme is as follows: if the size of the user data is not larger than the size of one storage block space, filling the whole storage block in a mode of filling invalid data; or, if the size of the user data is not larger than the size of the storage space of one storage page, the whole storage page is filled by filling invalid data.
Obviously, the data storage method has the problems of space waste and low space utilization rate.
Disclosure of Invention
The embodiment of the invention provides a data storage method, a data storage device, electronic equipment and a storage medium, and the method can improve the utilization rate of a storage space.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a data storage method, where the method includes:
when a data storage instruction is received, judging whether the size of the data to be stored reaches a first set value or not;
if the size of the data to be stored does not reach a first set value, storing the data to be stored in a first storage block, otherwise, storing the data to be stored in a second storage block;
and when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block.
In a second aspect, an embodiment of the present invention provides a data storage apparatus, including:
the judging module is used for judging whether the size of the data to be stored reaches a first set value or not when a data storage instruction is received;
the first storage module is used for storing the data to be stored to a first storage block if the size of the data to be stored does not reach a first set value, and otherwise, storing the data to be stored to a second storage block;
and the second storage module is used for transferring the data stored in the first storage block to the second storage block when the total amount of the data stored in the first storage block reaches the first set value.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the data storage method according to any one of claims 1 to 7.
In a fourth aspect, embodiments of the invention provide a storage medium containing computer-executable instructions which, when executed by a computer processor, implement a data storage method as claimed in any one of claims 1 to 7.
According to the data storage method provided by the embodiment of the invention, when a data storage instruction is received, whether the size of data to be stored reaches a first set value is judged, if the size of the data to be stored does not reach the first set value, the data to be stored is stored in a first storage block, otherwise, the data to be stored is stored in a second storage block, when the total amount of the data stored in the first storage block reaches the first set value, the data stored in the first storage block is transferred to the second storage block, and the data stored in the first storage block is integrated and transferred to the second storage block, so that each storage space is fully utilized, the data stored in each storage space is valid data, the use of invalid data is avoided, the utilization rate of the storage space is improved, and the waste of the storage space is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the contents of the embodiments of the present invention and the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a data storage method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating another data storage method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a data storage method according to a second embodiment of the present invention;
fig. 4 is a schematic flow chart of another data storage method according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of a data reading process according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of a data storage device according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the present invention clearer, the technical solutions of the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Fig. 1 is a schematic flow chart of a data storage method according to an embodiment of the present invention. The data storage method disclosed in the present embodiment may be performed by a data storage device, wherein the device may be implemented by software and/or hardware and is generally integrated in a chip, such as an EMMC chip or the like. Referring specifically to fig. 1, the method comprises the steps of:
step 110, when a data storage instruction is received, determining whether the size of the data to be stored reaches a first set value, if the size of the data to be stored does not reach the first set value, continuing to execute step 120, and if the size of the data to be stored reaches the first set value, continuing to execute step 130.
The data storage instruction comprises size information of data to be stored, the data storage instruction is generated by an operating system according to a trigger instruction of a user, for example, the user wants to store a photo, the photo is the user data to be stored, the user realizes the storage of the photo by triggering a storage button, when the storage button is triggered by the user, a related program on the operating system side is triggered to generate the data storage instruction, and the data storage instruction is further issued to an EMMC controller of an EMMC chip.
In order to meet the requirement of nand memory characteristics, each write operation must write one memory page at a time, taking the storage capacity of one memory page as 16KB as an example, that is, the first setting value is 16KB, and in order to meet the convention of the EMMC protocol, the write unit of user data is 512 bytes (that is, the logical block addressing LBA is 512 bytes), and each memory page corresponds to 32 LBAs. When the size of the data to be stored is 16KB, storing the data to be stored in a second storage block, and when the size of the data to be stored is not more than 16KB, storing the data to be stored in a storage page of a first storage block, wherein LBAs of data not stored in the storage page are filled by invalid data FF, and the data to be stored is valid data. And when the total amount of valid data stored in a first storage block reaches 16KB, transferring the valid data stored in the first storage block to the second storage block. According to the storage scheme, the data in each storage page of the second storage block can be guaranteed to be valid data, and invalid data is not required to be filled, so that the capacity of one storage page can be achieved, each storage space is fully utilized, the utilization rate of the storage space is improved, and the occupation of the invalid data on the storage space is reduced.
And step 120, storing the data to be stored in a first storage block.
And step 130, storing the data to be stored in a second storage block.
Step 140, when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block.
Specifically, referring to the flowchart of another data storage method shown in fig. 2, when the user data is a small amount of data that is less than the storage capacity of one storage page, the user data is stored to the first storage block T1, and when the user data is a large amount of data that is the storage capacity of one storage page, the user data is stored to the second storage block T2; and calculates the total amount of data stored in the first memory block T1 in real time, and once the total amount of data stored in the first memory block T1 reaches the storage capacity of one memory page (the storage capacity of one memory page is 16KB in fig. 2 as an example), integrates the data stored in the first memory block T1 into one memory page of the second memory block T2.
According to the data storage method provided by the embodiment, when a data storage instruction is received, whether the size of data to be stored reaches a first set value is judged, if the size of the data to be stored does not reach the first set value, the data to be stored is stored in a first storage block, otherwise, the data to be stored is stored in a second storage block, when the total amount of the data stored in the first storage block reaches the first set value, the data stored in the first storage block is transferred to the second storage block, and the data stored in the first storage block is integrated and transferred to the second storage block, so that each storage space is fully utilized, the data stored in each storage space is valid data, the use of invalid data is avoided, the utilization rate of the storage space is improved, and the waste of the storage space is reduced.
Example two
Fig. 3 is a schematic flow chart of a data storage method according to a second embodiment of the present invention. On the basis of the foregoing embodiment, the present embodiment is further optimized, and the optimization has the advantages of improving the utilization rate of the storage space and reducing the waste of the storage space, specifically referring to fig. 3, the method includes the following steps:
step 310, when a data storage instruction is received, determining whether the size of the data to be stored reaches a first set value, if the size of the data to be stored does not reach the first set value, continuing to execute step 320, and if the size of the data to be stored reaches the first set value, continuing to execute step 330.
And step 320, storing the data to be stored to a first storage block.
And step 330, storing the data to be stored in a second storage block.
Step 340, when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block.
And 350, when the total amount of the data stored in the second storage block reaches a second set value, transferring the data stored in the second storage block to a third storage block.
The first memory block and the second memory block are SLC (Single-Level Cell, Single-layer memory) blocks, and the third memory block is a TLC (triple-Level Cell, triple-layer memory) block. SLC/TLC is a storage grain type for nand flash, where each cell of an SLC block can store 1bit of data and each cell of a TLC block can store 3 bits of data. The first set value is the storage capacity of one SLC memory page and the second set value is the storage capacity of one TLC memory block.
Specifically, referring to another data storage method flowchart shown in fig. 4, when the user data is a small amount of data that is less than the storage capacity of one storage page, the user data is stored in the first storage block T1, and when the user data is a large amount of data that is the storage capacity of one storage page, the user data is stored in the second storage block T2; and calculates the total amount of data stored in the first memory block T1 in real time, once the total amount of data stored in the first memory block T1 reaches the storage capacity of one memory page (the storage capacity of one memory page is 16KB in fig. 4 for example), integrates the data stored in the first memory block T1 into one memory page of the second memory block T2, and empties the first memory block T1 to continue to store a small amount of data; meanwhile, the total amount of data stored in the second storage block T2 is calculated in real time, and when the total amount of data stored in the second storage block T2 reaches the storage capacity of one TLC storage block, the data stored in the second storage block T2 is moved to the third storage block T3, and the second storage block T2 is emptied to continue to store the data of which the total amount of data reaches one page.
In the data storage method provided in this embodiment, when a data storage command is received, it is determined whether the size of the data to be stored reaches a first set value, and if the size of the data to be stored does not reach the first set value, storing the data to be stored to a first storage block, otherwise, storing the data to be stored to a second storage block, transferring the data stored in the first storage block to the second storage block when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the second storage block to a third storage block when the total amount of the data stored in the second storage block reaches a second set value, therefore, the data stored in the second storage block and the third storage block are both valid data, the occupation of invalid data on the storage space is reduced, and the space utilization rate is improved.
On the basis of the above embodiment, further, the method further includes: the mapping relation between the logical address and the physical address of the data stored in the first storage block is recorded through the first table, the mapping relation between the logical address and the physical address of the data stored in the second storage block is recorded through the second table, the mapping relation between the logical address and the physical address of the data stored in the third storage block is recorded through the third table, so that the storage address of the data is accurately recorded, the accuracy of subsequent data reading is ensured, and because each storage page in the second storage block stores data with the data quantity reaching the storage capacity of one storage page, for example, each storage page stores 16KB of data, compared with the case that each storage page only stores 512 bytes of data, the mapping relation between the logical address and the physical address of the stored data is greatly reduced, so that when the data reading operation is carried out, the physical address storing target data can be quickly found according to the mapping relation between the logical address and the physical address, therefore, the data storage method provided by the embodiment can also achieve the effect of simplifying the data reading process.
Further, the method further comprises: and when the total amount of the data stored in the second storage block reaches a second set value, locking the second table to prevent that new data is written into the second storage block in the process of transferring the data stored in the second storage block to a third storage block, so that the total amount of the data finally transferred into the third storage block exceeds the storage capacity of one TLC storage block, and further, the problem of data storage error occurs.
Further, the method further comprises:
when a data reading instruction is received, respectively searching physical addresses corresponding to the logical addresses in the first table, the second table and the third table according to the logical address of target data;
and reading the target data based on the physical address.
Wherein the data read instruction contains a logical address of the target data. Specifically, referring to the schematic diagram of the data reading flow shown in fig. 5, the data reading method includes:
step 510, when a data reading instruction is received, looking up a physical address corresponding to the logical address in the first table according to the logical address of the target data.
Step 520, judging whether the physical address corresponding to the logical address is found, if so, executing step 570, otherwise, executing step 530.
Step 530, looking up a physical address corresponding to the logical address in the second table according to the logical address of the target data.
And 540, judging whether the physical address corresponding to the logical address is found, if so, executing 570, and otherwise, executing 550.
And step 550, searching a physical address corresponding to the logical address in the third table according to the logical address of the target data.
And 560, judging whether the physical address corresponding to the logical address is found, if so, executing 570, otherwise, executing 580, ending the process, and outputting an error prompt message.
Step 570, reading the target data based on the physical address.
And 580, ending the process and outputting error prompt information.
The physical addresses corresponding to the logical addresses are respectively searched in the first table, the second table and the third table according to the logical addresses of the target data, and the total amount of mapping relations between the logical addresses and the physical addresses recorded in the second table and the third table is relatively small, so that the physical addresses corresponding to the logical addresses can be searched quickly, the searching speed is increased, and the data reading process is simplified.
EXAMPLE III
Fig. 6 is a schematic structural diagram of a data storage device according to a third embodiment of the present invention. Referring to fig. 6, the apparatus includes: a judging module 610, a first storage module 620 and a second storage module 630;
the determining module 610 is configured to determine whether the size of the data to be stored reaches a first set value when a data storage instruction is received; a first storage module 620, configured to store the data to be stored in a first storage block if the size of the data to be stored does not reach a first set value, and otherwise, store the data to be stored in a second storage block; a second storage module 630, configured to transfer the data stored in the first storage block to the second storage block when the total amount of the data stored in the first storage block reaches the first set value.
Further, the apparatus further comprises:
and the third storage module is used for transferring the data stored in the second storage block to a third storage block when the total amount of the data stored in the second storage block reaches a second set value.
Further, the apparatus further comprises: and the recording module is used for recording the mapping relation between the logical address and the physical address of the data stored in the first storage block through a first table, recording the mapping relation between the logical address and the physical address of the data stored in the second storage block through a second table, and recording the mapping relation between the logical address and the physical address of the data stored in the third storage block through a third table.
Further, the device further comprises a locking module, configured to lock the second table when the total amount of data stored in the second storage block reaches a second set value.
Further, the first memory block and the second memory block are SLC single-layer memory blocks, and the third memory block is a TLC three-layer memory block.
Further, the first set value is a storage capacity of an SLC memory page, and the second set value is a storage capacity of a TLC memory block.
Further, the apparatus further comprises:
the searching module is used for respectively searching physical addresses corresponding to the logical addresses in the first table, the second table and the third table according to the logical addresses of the target data when a data reading instruction is received;
and the reading module is used for reading the target data based on the physical address.
The data storage device provided in this embodiment, when receiving the data storage command, determines whether the size of the data to be stored reaches the first set value, if the size of the data to be stored does not reach the first set value, storing the data to be stored to a first storage block, otherwise, storing the data to be stored to a second storage block, transferring the data stored in the first storage block to the second storage block when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the second storage block to a third storage block when the total amount of the data stored in the second storage block reaches a second set value, therefore, the data stored in the second storage block and the third storage block are both valid data, the occupation of invalid data on the storage space is reduced, and the space utilization rate is improved.
The data storage device provided by the embodiment of the invention can execute the data storage method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Technical details that are not described in detail in the above embodiments may be referred to a data storage method provided in any embodiment of the present invention.
Example four
Fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in FIG. 7, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set of program modules (e.g., determination module 610, first storage module 620, and second storage module 630 of the data storage device) configured to perform the functions of embodiments of the present invention.
A program/utility 40 having a set of program modules 42 (e.g., a data storage determination module 610, a first storage module 620, and a second storage module 630) may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing a data storage method provided by an embodiment of the present invention, the method including:
when a data storage instruction is received, judging whether the size of the data to be stored reaches a first set value or not;
if the size of the data to be stored does not reach a first set value, storing the data to be stored in a first storage block, otherwise, storing the data to be stored in a second storage block;
and when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement the data storage method provided by the embodiment of the present invention.
Of course, those skilled in the art can understand that the processor can also implement the technical solution of the data storage method provided by any embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a data storage method provided in an embodiment of the present invention, where the method includes:
when a data storage instruction is received, judging whether the size of the data to be stored reaches a first set value or not;
if the size of the data to be stored does not reach a first set value, storing the data to be stored in a first storage block, otherwise, storing the data to be stored in a second storage block;
and when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the data storage method provided by any embodiments of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of storing data, comprising:
when a data storage instruction is received, judging whether the size of the data to be stored reaches a first set value or not;
if the size of the data to be stored does not reach a first set value, storing the data to be stored in a first storage block, otherwise, storing the data to be stored in a second storage block;
and when the total amount of the data stored in the first storage block reaches the first set value, transferring the data stored in the first storage block to the second storage block.
2. The method of claim 1, further comprising:
and when the total amount of the data stored in the second storage block reaches a second set value, transferring the data stored in the second storage block to a third storage block.
3. The method according to claim 2, wherein the mapping relationship between the logical address and the physical address of the data stored in the first memory block is recorded by a first table, the mapping relationship between the logical address and the physical address of the data stored in the second memory block is recorded by a second table, and the mapping relationship between the logical address and the physical address of the data stored in the third memory block is recorded by a third table.
4. The method according to claim 3, wherein the second table is locked when the total amount of data stored in the second storage block reaches a second set value.
5. The method of any of claims 1-4, wherein the first memory block and the second memory block are SLC single-tier memory blocks, and the third memory block is a TLC three-tier memory block.
6. The method of claim 5, wherein the first set value is the storage capacity of one SLC page and the second set value is the storage capacity of one TLC block.
7. The method according to any one of claims 1-4, further comprising:
when a data reading instruction is received, respectively searching physical addresses corresponding to the logical addresses in the first table, the second table and the third table according to the logical address of target data;
and reading the target data based on the physical address.
8. A data storage device, characterized in that the device comprises:
the judging module is used for judging whether the size of the data to be stored reaches a first set value or not when a data storage instruction is received;
the first storage module is used for storing the data to be stored to a first storage block if the size of the data to be stored does not reach a first set value, and otherwise, storing the data to be stored to a second storage block;
and the second storage module is used for transferring the data stored in the first storage block to the second storage block when the total amount of the data stored in the first storage block reaches the first set value.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the data storage method according to any of claims 1-7 when executing the computer program.
10. A storage medium containing computer-executable instructions which, when executed by a computer processor, implement the data storage method of any one of claims 1-7.
CN201910368566.2A 2019-05-05 2019-05-05 Data storage method and device, electronic equipment and storage medium Pending CN111897485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910368566.2A CN111897485A (en) 2019-05-05 2019-05-05 Data storage method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910368566.2A CN111897485A (en) 2019-05-05 2019-05-05 Data storage method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111897485A true CN111897485A (en) 2020-11-06

Family

ID=73169217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910368566.2A Pending CN111897485A (en) 2019-05-05 2019-05-05 Data storage method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111897485A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506442A (en) * 2020-12-22 2021-03-16 深圳市时创意电子有限公司 Flash memory chip data processing method and device, electronic equipment and storage medium
CN112948440A (en) * 2021-03-09 2021-06-11 北京小米移动软件有限公司 Page data processing method and device, terminal and storage medium
CN113010116A (en) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 Data processing method and device, terminal equipment and readable storage medium
CN116340214A (en) * 2023-02-28 2023-06-27 中科驭数(北京)科技有限公司 Cache data storage and reading method, device, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130046229A (en) * 2011-10-27 2013-05-07 주식회사 현대케피코 A data protecting method and system during reprogramming electronic control unit
CN103477393A (en) * 2011-03-31 2013-12-25 桑迪士克科技股份有限公司 Multi-layer memory system with three memory layers having different bit per cell storage capacities
CN104182362A (en) * 2013-05-24 2014-12-03 联想(北京)有限公司 Data use control method and movable storage device
CN104281538A (en) * 2013-07-03 2015-01-14 联想(北京)有限公司 Storage device capacity expanding and snapping method and storage devices
CN104572478A (en) * 2013-10-14 2015-04-29 联想(北京)有限公司 Data access method and data access device
CN105787012A (en) * 2016-02-23 2016-07-20 深圳市瑞驰信息技术有限公司 Method for improving small file processing capability of storage system and storage system
CN109542814A (en) * 2017-09-21 2019-03-29 三星电子株式会社 The method and system that data are transmitted between storage equipment is connected to by the P2P of PCI-EXPRESS

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103477393A (en) * 2011-03-31 2013-12-25 桑迪士克科技股份有限公司 Multi-layer memory system with three memory layers having different bit per cell storage capacities
KR20130046229A (en) * 2011-10-27 2013-05-07 주식회사 현대케피코 A data protecting method and system during reprogramming electronic control unit
CN104182362A (en) * 2013-05-24 2014-12-03 联想(北京)有限公司 Data use control method and movable storage device
CN104281538A (en) * 2013-07-03 2015-01-14 联想(北京)有限公司 Storage device capacity expanding and snapping method and storage devices
CN104572478A (en) * 2013-10-14 2015-04-29 联想(北京)有限公司 Data access method and data access device
CN105787012A (en) * 2016-02-23 2016-07-20 深圳市瑞驰信息技术有限公司 Method for improving small file processing capability of storage system and storage system
CN109542814A (en) * 2017-09-21 2019-03-29 三星电子株式会社 The method and system that data are transmitted between storage equipment is connected to by the P2P of PCI-EXPRESS

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506442A (en) * 2020-12-22 2021-03-16 深圳市时创意电子有限公司 Flash memory chip data processing method and device, electronic equipment and storage medium
CN112948440A (en) * 2021-03-09 2021-06-11 北京小米移动软件有限公司 Page data processing method and device, terminal and storage medium
CN113010116A (en) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 Data processing method and device, terminal equipment and readable storage medium
CN116340214A (en) * 2023-02-28 2023-06-27 中科驭数(北京)科技有限公司 Cache data storage and reading method, device, equipment and medium
CN116340214B (en) * 2023-02-28 2024-01-02 中科驭数(北京)科技有限公司 Cache data storage and reading method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US11216362B2 (en) Data storage device and operating method thereof
US10296224B2 (en) Apparatus, system and method for increasing the capacity of a storage device available to store user data
CN111897485A (en) Data storage method and device, electronic equipment and storage medium
KR102691851B1 (en) Nonvolatile memory device, data storage apparatus including the same and operating method thereof
CN111459844B (en) Data storage device and method for accessing logical-to-physical address mapping table
WO2021036370A1 (en) Method and device for pre-reading file page, and terminal device
KR20120105294A (en) Memory controller controlling a nonvolatile memory
US11210226B2 (en) Data storage device and method for first processing core to determine that second processing core has completed loading portion of logical-to-physical mapping table thereof
US20160062659A1 (en) Virtual memory module
US11526439B2 (en) Storage device and operating method thereof
CN110543435B (en) Mixed mapping operation method, device and equipment of storage unit and storage medium
US11537328B2 (en) Method and apparatus for executing host commands
CN110543284A (en) Garbage collection method and device for storage block, electronic equipment and storage medium
KR20200114212A (en) Data storage device and operating method thereof
US10866858B2 (en) Memory systems having reduced memory channel traffic and methods for operating the same
US10684953B2 (en) Data storage apparatus capable of varying map cache buffer size
US20240086113A1 (en) Synchronous write method and device, storage system and electronic device
KR20200114086A (en) Controller, memory system and operating method thereof
CN115080457A (en) Controller and operation method thereof
CN111897484B (en) Data storage method and device, electronic equipment and storage medium
KR20210018570A (en) Controller, operating method thereof and storage device including the same
CN111897744B (en) Data writing method and device, electronic equipment and storage medium
CN111897745B (en) Data storage method and device, electronic equipment and storage medium
KR20150096177A (en) Method for performing garbage collection and flash memory apparatus using the method
WO2023056687A1 (en) Solid state disk and data manipulation method and apparatus therefor, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 101, Floor 1-5, Building 8, Yard 9, Fenghao East Road, Haidian District, Beijing 100094

Applicant after: Zhaoyi Innovation Technology Group Co.,Ltd.

Applicant after: SHANGHAI GEYI ELECTRONIC Co.,Ltd.

Address before: 100083 12 Floors, Block A, Tiangong Building, Science and Technology University, 30 College Road, Haidian District, Beijing

Applicant before: GIGADEVICE SEMICONDUCTOR(BEIJING) Inc.

Applicant before: SHANGHAI GEYI ELECTRONIC Co.,Ltd.

CB02 Change of applicant information