CN111399783A - Data writing method and device of storage equipment, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN111399783A
CN111399783A CN202010322733.2A CN202010322733A CN111399783A CN 111399783 A CN111399783 A CN 111399783A CN 202010322733 A CN202010322733 A CN 202010322733A CN 111399783 A CN111399783 A CN 111399783A
Authority
CN
China
Prior art keywords
invalid
dirty
length
blocks
section
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.)
Granted
Application number
CN202010322733.2A
Other languages
Chinese (zh)
Other versions
CN111399783B (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010322733.2A priority Critical patent/CN111399783B/en
Publication of CN111399783A publication Critical patent/CN111399783A/en
Application granted granted Critical
Publication of CN111399783B publication Critical patent/CN111399783B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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)
  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data writing method and device of storage equipment, electronic equipment and a storage medium, and relates to the technical field of storage equipment. Wherein the storage device includes dirty segments, each dirty segment includes a plurality of consecutive blocks, and the plurality of blocks of each dirty segment includes valid blocks and invalid blocks, the method including: determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid section, wherein the mutually continuous invalid blocks form invalid sections, different invalid sections are discontinuous, and the larger the number of the invalid blocks in the invalid sections is, the longer the length of the invalid sections is; selecting dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval; and writing the data to be written into the selected dirty section so as to improve the writing efficiency.

Description

Data writing method and device of storage equipment, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of storage device technologies, and in particular, to a data writing method and apparatus for a storage device, an electronic device, and a storage medium.
Background
The storage device may be used to write data. When writing data to the storage device, the distribution of writable blocks in some segments is more dispersed, resulting in inefficient data writing.
Disclosure of Invention
In view of the foregoing problems, the present application provides a data writing method and apparatus for a storage device, an electronic device, and a storage medium, so as to improve the foregoing problems.
In a first aspect, an embodiment of the present application provides a data writing method for a storage device, where the storage device includes dirty segments, each dirty segment includes multiple consecutive blocks, and multiple blocks of each dirty segment include a valid block and an invalid block, the method includes: determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid section, wherein the mutually continuous invalid blocks form invalid sections, different invalid sections are discontinuous, and the larger the number of the invalid blocks in the invalid sections is, the longer the length of the invalid sections is; selecting dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval; and writing the data to be written into the selected dirty section.
In a second aspect, an embodiment of the present application provides an apparatus for writing data in a storage device, where the storage device includes dirty segments, each dirty segment includes multiple consecutive blocks, and multiple blocks of each dirty segment include a valid block and an invalid block, the apparatus includes: a segment determining module, configured to determine the number of invalid blocks in each dirty segment of the storage device and the length of each invalid interval, where mutually continuous invalid blocks form invalid intervals, different invalid intervals are discontinuous, and the larger the number of invalid blocks in an invalid interval is, the longer the length of the invalid interval is; the segment selection module is used for selecting dirty segments according to the number of invalid blocks in each dirty segment and the length of each invalid interval; and the data writing module is used for writing the data to be written into the selected dirty section.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs being executed by the processors for performing the methods described above.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
According to the data writing method and device for the storage device, the electronic device and the storage medium, dirty sections are selected according to the number of invalid blocks in each dirty section and the length of an invalid interval, and data to be written are written into the selected dirty sections. The larger the number of the invalid blocks is, the longer the length of the invalid interval is, and the better the distribution continuity of the dirty section invalid blocks selected by combining the length of the invalid interval is, so that the data writing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic diagram of a middle section of a storage device according to an embodiment of the present application.
Fig. 2 shows a flowchart of a data writing method of a storage device according to an embodiment of the present application.
FIG. 3 is a diagram illustrating a dirty section in a storage device according to an embodiment of the present application.
Fig. 4 is a flowchart illustrating a data writing method of a storage device according to another embodiment of the present application.
Fig. 5 is a flowchart illustrating a data writing method of a storage device according to another embodiment of the present application.
Fig. 6 shows a functional block diagram of a data writing apparatus of a storage device according to an embodiment of the present application.
Fig. 7 shows a block diagram of an electronic device according to an embodiment of the present application.
Fig. 8 is a storage unit for storing or carrying program codes for implementing a data writing method of a storage device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In some storage devices, such as hard disks, floppy disks, flash memory, etc., block devices include a plurality of segments (segments), each segment being composed of a plurality of contiguous blocks (blocks), as shown in fig. 1. Fig. 1 is a schematic diagram of a segment, wherein each square is a schematic diagram of a block in the segment, and adjacent blocks are continuous in address. The size of each block is not limited in the embodiment of the present application, and may be 4 kB; the number of blocks included in each segment is not limited in the embodiments of the present application, for example, each segment includes 512 consecutive blocks.
In a storage device, some blocks are valid blocks and some blocks are invalid blocks. The valid block is a block in which the stored data is still in use, or the stored data is data that still needs to be used, for example, the stored data is file data, metadata, and the like. An invalid block is a block that is no longer used, where the stored data is data that does not need to be reused. For example, the storage device is a Flash memory (Flash), and data is stored or read on the Flash memory through a Flash-friendly file System (Flash-friendly file System), so that the valid block may be a block still used by the Flash memory file System, including file data and metadata that the file System needs to use; the invalid block is data that is no longer used by the flash file system, and does not include file data and metadata that are needed by the flash file system. Optionally, the valid block and the invalid block may be distinguished, if the data in the block is no longer used, the block may be marked with an invalid flag, and the invalid block may be confirmed by the invalid flag; and for the block to be used, the block can be marked effectively or not, and the block can be confirmed to be a valid block by a valid mark or no mark.
In the storage device, the blocks included in some segments are valid blocks, and a segment including all valid blocks can be defined as a valid segment (valid segment); some segments include invalid blocks, and a segment including all invalid blocks can be defined as a free segment; some segments include blocks having both valid and invalid blocks, and segments including both valid and invalid blocks may be defined as dirty segments (dirty segments). For example, if the number of blocks included in one segment is 512, 512 valid blocks are included in the valid segment; the idle segment comprises 512 invalid blocks; the number of invalid blocks included in the dirty section is between 1 and 511, the number of valid blocks included is between 1 and 511, and the sum of the numbers of invalid blocks and valid blocks is 512.
In the storage device, data can be read and written in units of blocks, that is, each block can be read and written independently of other blocks. When writing data to the storage device, the data is written segment by segment, and when writing to each segment, the data is written into each block in the segment by taking the block therein as a unit. That is, when writing data to the storage device, a segment may be selected and data written to the blocks in the selected segment. Since the data in the valid block needs to be used and the data in the invalid block is not used, when writing the data, the data is usually written into the invalid block, that is, a segment including the invalid block, such as a free segment or a dirty segment, is selected, and the data is written into the invalid block in the selected segment.
In some embodiments, the free segment is selected for writing data, and the data is sequentially written to each block in the free segment by sequential appending, i.e., sequential writing. When the data amount of the idle sections is insufficient, if the number of the idle sections is smaller than the preset number, performing garbage collection cleaning on the storage device, and deleting some garbage data, so that enough idle sections are cleaned for writing data. The garbage collection cleaning method is not limited in the embodiment of the present application, for example, the garbage data corresponds to a corresponding garbage mark, and the data with the garbage mark is collected. However, in this embodiment, write amplification is caused, and particularly, in the case where the space usage rate is high, severe write amplification is caused.
In other embodiments, a free segment is selected for writing data. And when the data amount of the idle sections is insufficient, if the number of the idle sections is less than the preset number, selecting the dirty sections, and writing the data into the invalid blocks in the dirty sections.
When a dirty segment is selected to write data, since the dirty segment includes both valid blocks and invalid blocks, the distribution of the invalid blocks may be more dispersed, i.e., continuity between the invalid blocks is not high. For discontinuous blocks, when data is written, sequential write randomization can be caused, when data is written, data is written through different write operations, for example, data is written through different I/O operations, and the higher the number of write operations in a segment is, the lower the write efficiency of the segment is, so that the write efficiency of data is lower for dirty segments with scattered invalid block distribution.
Since for consecutive blocks, the data to be written may be written to consecutive blocks at a time, or less frequently than the number of blocks in consecutive blocks. Therefore, the embodiment of the application provides a data writing method and device for a storage device, an electronic device and a storage medium, and the dirty section is selected for writing data by considering the number of invalid blocks in the dirty section and the length of an invalid interval composed of mutually continuous invalid blocks, so that the writing frequency is reduced, and the writing efficiency of the data is improved. The following describes in detail a data writing method, an apparatus, an electronic device, and a storage medium of a storage device provided in embodiments of the present application with specific embodiments.
Referring to fig. 2, a data writing method of a storage device according to an embodiment of the present application is shown. As previously described, the storage device includes dirty segments, each of which includes a plurality of consecutive blocks, and each of the plurality of blocks includes valid blocks and invalid blocks. Specifically, the method comprises the following steps:
step S110: and determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid section, wherein the mutually continuous invalid blocks form invalid sections, different invalid sections are discontinuous, and the larger the number of the invalid blocks in the invalid sections is, the longer the length of the invalid sections is.
In the embodiment of the present application, in each dirty section, an address interval composed of consecutive invalid blocks is defined as an invalid interval (invalid block extensions (s)), and if there are a number of invalid blocks that can be consecutive to each other, the invalid interval includes a number of invalid blocks; there are as many invalid intervals as there are consecutive invalid blocks in them. Optionally, in a segment, if a certain invalid block is not adjacent to any other invalid block, that is, the blocks adjacent to the invalid block are all valid blocks, an interval corresponding to the invalid block may also be defined as an invalid interval, and the number of the invalid blocks included in the invalid interval is 1.
In the embodiment of the present application, each invalid section includes all invalid blocks that can be consecutive, that is, a discontinuity between different invalid sections, or a block existing between the invalid sections that are closest in address, is a valid block. As shown in fig. 3, the shaded blocks in the segment shown in fig. 3 represent valid blocks, the blank blocks represent invalid blocks, and the segment shown in fig. 3 includes 6 invalid sections, and the invalid sections respectively indicated by reference numerals 1 to 4 are all invalid sections with only 1 invalid block; the address indicated by the reference numeral 5 comprises two mutually continuous invalid blocks, and the two invalid blocks indicated by the reference numeral 5 form an invalid interval; reference numeral 6 indicates that three invalid blocks are consecutive to each other, and the three invalid blocks indicated by reference numeral 6 constitute one invalid section.
As previously described, the continuity between blocks indicates continuity in address, and there is no gap in address between two consecutive blocks.
In the embodiment of the application, when data is to be written, a dirty segment needs to be selected, and the data is written to an invalid block in the selected dirty segment. The larger the number of invalid blocks, the more data can be written in the dirty section; the longer the length of the invalid section is, the more data can be written at one time, the fewer the number of writes can be made, and the higher the writing efficiency can be made. Therefore, in the embodiment of the present application, the number of invalid blocks in the dirty section and the length of the invalid interval may be considered together. For each dirty section, the number of invalid blocks therein and the length of the respective invalid interval may be determined.
The invalid interval is composed of invalid blocks, the length of the invalid interval can be positively correlated with the number of the invalid blocks, and the length of the invalid interval is longer as the number of the invalid blocks is larger.
Step S120: and selecting the dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval.
Step S130: and writing the data to be written into the selected dirty section.
And selecting the dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval for writing the data to be written. The number and the length of the invalid interval are considered when the dirty sections are selected, the selected dirty sections have more invalid blocks so as to write more data, the invalid intervals are longer, the writing times are reduced, and the writing efficiency is improved.
For data to be written that needs to be written to the storage device, the selected dirty segment may be written.
In the embodiment of the application, the dirty section used for writing data is selected by combining the number of invalid blocks in the dirty section and the length of each invalid interval, so that the writing efficiency is improved.
In another embodiment of the present application, a method for writing data into a storage device introduces a specific selection manner of a dirty segment. Referring to fig. 4, the method of this embodiment includes:
step S210: determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid interval. The number of the invalid blocks in the invalid section is larger, and the length of the invalid section is longer.
For each dirty section, the number of invalid blocks in the dirty section and the length of each invalid interval in the dirty section are counted.
As an implementation manner, when a dirty section needs to be selected, each dirty section can be scanned in sequence, and invalid blocks in each dirty section are scanned and counted; the invalid interval is scanned and its length is calculated. For example, as shown in fig. 3, the number of invalid blocks may be counted as 9, and invalid sections indicated by reference numerals 1,2, 3, 4, 5 and 6 in fig. 3 may be scanned, and the lengths of the 6 invalid sections may be counted.
Alternatively, the length of the invalid interval and the number of invalid blocks included therein may be positively correlated. In this embodiment, the length of each invalid section may be counted, and the number of invalid blocks in the invalid section may be calculated for each invalid section based on the length of the invalid section. Correspondingly, for each dirty segment, the number of invalid blocks included in each invalid interval may also be determined according to the length of each invalid interval in the dirty segment, so as to determine the number of invalid blocks included in all invalid intervals in the dirty segment as the number of invalid blocks in the dirty segment. For example, the length of the invalid section is m times of the number of invalid blocks in the invalid section, m is greater than 0, and the length of each invalid section divided by m is equal to the number of invalid blocks in the invalid section. Then, for each dirty segment, the value obtained by dividing the length of each invalid interval by m is the number of invalid blocks in each invalid interval, and the sum of the values obtained by dividing the length of each invalid interval by m can be used as the number of invalid blocks in the dirty segment. As for the dirty segment shown in fig. 3, the length of the invalid section is m times of the number of invalid blocks in the invalid section, and the length of each invalid section indicated by reference numerals 1 to 4 is 1 m; for the invalid section indicated by reference numeral 5, the length thereof is 2 m; for the invalid section indicated by reference numeral 6, the length thereof is 3 m. The sum of the values obtained by dividing the length of each invalid section by m is (1+1+1+ 2+3) — 9, and the number of invalid blocks in the dirty section is determined to be 9.
Alternatively, the length of the invalid interval and the number of invalid blocks included therein may be positively correlated. In this embodiment, the length of each invalid section may be counted. For each dirty segment, the sum of the lengths of all invalid intervals in the dirty segment may be obtained as the total length of the invalid intervals in the dirty segment. And calculating the number of invalid blocks in the dirty section according to the total length of the invalid intervals in the dirty section and the positively correlated related parameters. For example, the length of the invalid section is m times of the number of invalid blocks in the invalid section, and m is greater than 0, that is, the correlation parameter of the positive correlation between the length of the invalid section and the number of invalid blocks in the invalid section is m. The total length of the invalid intervals in the dirty section divided by m equals the number of invalid blocks in the dirty section. As for the dirty section shown in fig. 3, the length of the invalid section is m times of the number of invalid blocks in the invalid section, and for each of the invalid sections indicated by reference numerals 1 to 4, the length is 1 m; for the invalid section indicated by reference numeral 5, the length thereof is 2 m; for the invalid section indicated by reference numeral 6, the length thereof is 3 m. The total length of the invalid intervals in the dirty section divided by m is (1m +1m +1m +1m +2m +3m)/m is 9, and the number of invalid blocks in the dirty section is determined to be 9.
As an embodiment, the number of invalid blocks in each dirty section and the length of each invalid interval may also be scanned and counted before the dirty section needs to be selected, and the scanning and counting manner may refer to the above embodiment. When dirty sections need to be selected, the number of invalid blocks in each dirty section and the length of an invalid interval are determined according to a preset statistical result.
In the embodiment of the present application, a correspondence relationship may be established between the length of each invalid section and the invalid section, and the length of each invalid section may be determined according to the correspondence relationship. The number of invalid blocks in each invalid interval can be established with the corresponding relation between the invalid intervals, and the number of invalid blocks in each invalid interval can be determined according to the corresponding relation. In the corresponding relationship, the representation manner of the invalid section is not limited in the embodiment of the present application, for example, the invalid section in each segment may be represented by an identifier of one of the invalid blocks, for example, each invalid section is represented by an identifier of a first invalid block in the invalid section; or by the start position of the invalid section.
In the embodiment of the present application, the larger the number of invalid blocks in the invalid section is, the longer the length of the invalid section is. In one embodiment, the length of the invalid section, that is, how many invalid blocks are in the invalid section, can be directly expressed by the number of invalid blocks, that is, how many invalid sections are, as shown in fig. 3, the lengths of the invalid sections indicated by reference numerals 1,2, 3, 4, 5, and 6 are 1, 1, 1, 1,2, and 3, respectively. In the embodiment of the present application, the number of invalid blocks in an invalid section is described as an example of the length of the invalid section. In each dirty section, the length of the invalid interval is greater than 1 and smaller than the length of the dirty section, and the length of the dirty section is the number of blocks in the dirty section.
In another embodiment, the length of the invalid interval may be m times the number of invalid blocks, where m is greater than zero. Optionally, the value of m may be the number of bytes in the invalid block, that is, how many bytes are in total of all invalid blocks in the invalid interval, which indicates how long the length of the invalid block is; alternatively, m may be any positive integer.
Step S220: and calculating the invalid continuity of each dirty section according to the length of each invalid section in each dirty section, wherein the larger the number of the invalid sections in the dirty section, the higher the invalid continuity of the dirty section.
The dirty sections may be selected according to the number of invalid blocks in each dirty section and the length of each invalid section in steps S220 to S240.
In the embodiment of the present application, the number of times of writing dirty segments having the same number of invalid blocks is measured by the invalid continuity under the same data writing condition. The longer the number of invalid sections in a dirty section, the higher the invalid continuity of the dirty section. For dirty segments with the same number of invalid blocks, the higher the invalid continuity, the fewer the number of data writes. Therefore, the degree of invalid continuity of each dirty section can be calculated.
In one embodiment, the longer the invalid section is, the fewer the number of times data can be written, and the length of the longest invalid section in the dirty section can be used as the invalid continuity of the dirty section.
In this embodiment, it may be assumed that there are n invalid intervals in a dirty segment, where n is a positive integer greater than 0 and has a length of L0,L1,...,Ln-1Then the invalid continuity c in the dirty section can be represented by the formula c ═ maxiLiAnd i is more than or equal to 0 and less than n, wherein i is an integer, and the formula represents that the length of the invalid interval with the longest length is selected as the invalid continuity. For example, the dirty section shown in fig. 3, the longest invalid section is the invalid section indicated by reference numeral 6, and the invalid continuity of the dirty section is the length of the invalid section indicated by reference numeral 6.
In another embodiment, the lengths of the invalid sections may be considered, different weights may be assigned to the lengths of the invalid sections, and the length of the invalid section corresponding to a higher weight is longer, so as to calculate the invalid continuity of the dirty section.
Specifically, in this embodiment, a plurality of length ranges and a correspondence relationship between each length range and a weight in which the longer the length range is, the higher the corresponding weight is may be set in advance.
Each length range represents a length interval, each value in the length range represents a length, and if the length of a certain invalid interval is equal to a certain value in the certain length range, or the length of the certain invalid interval is between the minimum value and the maximum value of the certain length range, it can be represented that the length of the invalid interval corresponds to the length range, or the length of the invalid interval is within the length range. In addition, in order to effectively determine the length range of the invalid section, the different length ranges do not overlap; in order to allow an invalid interval of any length to fall within a range of lengths, all the ranges of lengths may be combined to be the entire length of the dirty section or the entire length of the dirty section minus the length of an invalid block.
For example, k length ranges are provided, each of the k length ranges being [ d ]0,d1),[d1,d2),...,[dk-1,dk)。d0,d1,d2,...,dk-1To dkSequentially increase, [ d ]0,d1) Represents the 1 st length range and is d or more0And is less than d1The length range of (d); [ d1,d2) Represents the 2 nd length range and is greater than or equal to d1And is less than d2And so on. E.g. length of some invalid interval d0Then the invalid section corresponds to a length range [ d ]0,d1). Wherein d is0Greater than or equal to 1, dkEqual to the length of a dirty section, e.g. a dirty section comprising 512 blocks, the length d of a dirty section when the length is expressed in terms of the number of blockskIs 512.
In addition, each length range corresponds to a weight, e.g. length range [ d ]0,d1),[d1,d2),...,[dk-1,dk) Respectively corresponding to weights w0,w1,...,wk-1And, w0,w1,...,wk-1And increases in turn. Alternatively, all weights may be weights less than 1, i.e., wk-1May be 1 or less. The specific value of the weight is not limited in the embodiment of the present application, and when the invalid continuity is calculated for each dirty section, the weights corresponding to the invalid sections with the same length are the same.
For each dirty section, when the invalid continuity of the dirty section is calculated, the continuity of the invalid section in each length range can be calculated and defined as the sub-continuity; and adding all the sub-continuity in the dirty section to obtain the invalid continuity of the dirty section.
Specifically, when the length range corresponding to the length range is defined as the third weight, and the sub-continuity degree corresponding to each length range in each dirty section, the product of the sum of the lengths of all the invalid sections in the same length range and the third weight corresponding to the length range may be calculated according to the correspondence between the length range and the third weight and the length range in which the length of each invalid section is located, and the product is used as the sub-continuity degree corresponding to the length range. And adding the sub-continuity corresponding to each length range to obtain the invalid continuity corresponding to the dirty section.
That is, for each dirty segment, the total length of all invalid sections in each length range may be counted, and the product of the total length and the third weight corresponding to the length range is used as the sub-continuity corresponding to the length range. For each dirty section, each invalid interval is located in a length range, then all invalid intervals can be calculated to obtain one or more sub-continuity, and the sum of all the calculated sub-continuity is taken as the invalid continuity of the dirty section.
For the above calculation, the formula can be used
Figure BDA0002462052820000101
Wherein c represents the invalid continuity of the dirty section, i represents the (i +1) th length range, i represents the 1 st to k-th length ranges when taking values from 0 to (k-1), and aiDenotes the sum of the lengths, w, of the invalid sections within the (i +1) th length rangeiRepresents a third weight corresponding to the (i +1) th length range, ai*wiRepresents the degree of sub-continuity corresponding to the (i +1) th length range, i is 0 or more and (k-1) or less. In k length ranges d0,d1),[d1,d2),...,[dk-1,dk) Respectively corresponding to the third weight of w0,w1,...,wk-1The sum of the lengths of the invalid sections falling within each length range is denoted as a0,a1,...ak-1. Total length of invalid blocks in dirty section is
Figure BDA0002462052820000102
When the length of the invalid interval is expressed by the number of invalid blocks in the invalid interval, the total number of invalid blocks in the dirty section is
Figure BDA0002462052820000103
For example, FIG. 3 shows a portion of a dirty section of length 512, and only the portion of the dirty section shown in FIG. 3 includes invalid blocks. Set 9 length ranges as [1,2), [2,4 ], respectively, corresponding to a third weight of 0, 0.1. Of the 9 length ranges, the (i +1) th length range is [2 ]i,2i+1) And i is an integer of 0 to 9 inclusive. The sum a of the lengths of all invalid sections in the 1 st length range in the dirty section shown in FIG. 301+1+1+ 4, sum of lengths of all invalid sections in the 2 nd length range a12+ 3-5, and the invalid continuity c-4-0 + 5-0.1-0.5.
In this embodiment, if weights are assigned to invalid sections having too small a length, the number of invalid blocks is large, but the invalid blocks are scattered, and the invalid sections are small, and the calculated invalid continuity may be high. Therefore, alternatively, in this embodiment, the invalid continuity may be calculated only with the invalid section larger than the preset length.
For example, when the product of the sum of the lengths of all the invalid sections within the same length range and the third weight corresponding to the length range is calculated according to the correspondence relationship between the length range and the third weight and the length range in which the length of each invalid section is located, and when the product is used as the sub-continuity corresponding to the length range, the product of the sum of the lengths of all the invalid sections within the same length range and greater than a preset length and the third weight corresponding to the length range may be calculated according to the correspondence relationship between the length range and the third weight and the length range in which the length of each invalid section is located, and used as the sub-continuity corresponding to the length range. That is to say, when calculating each sub-continuity, selecting an invalid interval with a length within the current length range greater than a preset length to calculate a length sum, and multiplying the calculated length sum by a third weight corresponding to the current length range to obtain the sub-continuity corresponding to the current length range.
For another example, the weight corresponding to the length range smaller than the preset length is set to be 0, and then all the invalid sections in the length range do not affect the invalid continuity, so that the invalid continuity of the dirty section is prevented from being too high due to the overlapping of the invalid sections with too small lengths. For example, among the weights corresponding to the above 9 length ranges of [1,2), [2,4),. [256,512 ], the length in the length range [1,2) is too short, and the corresponding weight is set to 0. The length range smaller than the preset length may be that the maximum length included in the length range is smaller than the preset length, and if the preset length is 4 and the maximum lengths included in the length ranges [1,2) and [2,4) are both smaller than 4, the length ranges [1,2) and [2,4) are smaller than the preset length 4.
In another embodiment, each invalid section may be associated with a weight, and when calculating the invalid continuity of each dirty section, each invalid section may be multiplied by the corresponding weight, and the product of the invalid section and the corresponding weight may be defined as the sub-continuity corresponding to the invalid section. And adding the sub-continuity corresponding to all invalid intervals in the dirty section to obtain the invalid continuity of the dirty section.
Optionally, in this embodiment, weights respectively corresponding to all possible invalid sections may be preset, that is, all lengths smaller than the length of the dirty section are provided with corresponding weights, and then the weight corresponding to each invalid section in the dirty section may be determined according to the weight correspondence.
Alternatively, in this embodiment, as in the above-described embodiment, a correspondence relationship between the length range and the weight may be set. And determining the weight corresponding to the invalid section according to the length range of the invalid section.
Optionally, in this embodiment, to avoid interference of the invalid section with a length that is too small on the invalid continuity, a product of the invalid section and the corresponding weight may be calculated as a sub-continuity for the invalid section with a length that is greater than or equal to a preset length. That is, the weight corresponding to the invalid section having a length smaller than the preset length may be set to zero, or, when it is determined that the length of the invalid section is greater than or equal to the preset length, the product of the invalid section and the corresponding weight may be calculated as a sub-continuity in the dirty section.
Step S230: and calculating the score of each dirty section according to the number of invalid blocks in each dirty section, the corresponding first weight, the invalid continuity and the corresponding second weight, wherein the number of invalid blocks of different dirty sections corresponds to the first weight with the same size, and the invalid continuity of different dirty sections corresponds to the second weight with the same size.
In the previous step, the number of invalid blocks in each dirty section and the invalid continuity of each dirty section are obtained, the score of each dirty section is determined based on the number of invalid blocks of each dirty section and the invalid continuity, and the score of each dirty section is used as the selection standard of the dirty section.
In the embodiment of the present application, the number of invalid blocks corresponds to a corresponding weight, and for convenience of description, the weight corresponding to the number of invalid blocks is defined as a first weight; the invalid continuity also corresponds to a corresponding weight, and for convenience of description, the weight corresponding to the invalid continuity is defined as a second weight. Wherein, in each dirty section, the corresponding weights of the number of the invalid blocks are the same; the weights corresponding to the invalid continuity are also the same for each dirty segment. For example, the storage device includes x dirty segments, and the number of invalid blocks in each dirty segment is a1,a2To ax(ii) a The invalid continuity of each dirty section is c1,c2To cx。waRepresents a first weight, wcRepresents a second weight, then a1,a2To axCorresponding to waMay be the same; c. C1,c2To cxCorresponding to wcMay be the same. Therefore, the scores of all the dirty sections are calculated under the same standard, and the score difference among different invalid blocks is caused by the number of the invalid blocks and the invalid continuity.
When the score is calculated, for each dirty section, multiplying the number of invalid blocks in the dirty section by a first weight to obtain a first score, multiplying the invalid continuity of the dirty section by a second weight to obtain a second score, and adding the first score and the second score to obtain the score of the dirty section.
Specifically, the formula S ═ a × w can be useda+c*wcCalculating a score, wherein S represents the score of the dirty section, a represents the number of invalid blocks in the dirty section, and waRepresenting a first weight; c denotes the degree of invalid continuity of the dirty section, wcRepresenting a second weight. It can be understood that, when calculating the score of a dirty section, the number a of invalid blocks and the invalid continuity c of the same dirty section are calculated by the formula to obtain the score S of the dirty section.
Optionally, in this embodiment of the present application, for simplicity of calculation, the sum of the first weight and the second weight may be limited to a certain range, for example, if the sum of the first weight and the second weight is 100, w isa+wc=100。
Optionally, in the embodiment of the present application, specific values of the first weight and the second weight are not limited, and may be set according to needs and practical experience. For example, when the amount of data to be written is large, if the amount of data to be written is larger than the preset amount of data, it is desirable to write the data to be written in as few segments as possible, that is, it is desirable to have fewer dirty segments but more invalid blocks for writing data, so as to improve the writing efficiency, and when the amount of data to be written is smaller than or equal to the preset amount of data, the first weight may be increased, and the second weight may be decreased; when the data to be written is less, for example, less than or equal to the preset data amount, the writing of the data can be realized by fewer dirty sections, and a dirty section with higher continuity can be selected to improve the writing efficiency.
Optionally, in this embodiment of the present application, since the writing performance of the blocks is different, the writing speed is different, and the higher the performance of the blocks is, the faster the writing speed is, therefore, when calculating the score of each dirty segment, the writing performance of the invalid block in the dirty segment may also be combined.
Specifically, the higher the performance of the block is, the higher the corresponding performance score is. And counting the performance average scores of all invalid blocks in each dirty section, namely dividing the sum of the performance scores of all invalid blocks in the dirty section by the number of the invalid blocks. Setting weight corresponding to the performance average, and defining the weight as fourth weight. In calculating the score of each dirty section, the number of invalid blocks in the dirty section may be multiplied by a first weight, the invalid continuity of the dirty section may be multiplied by a second weight, and the performance average of the dirty section may be multiplied by a fourth weight, and the obtained value may be used as the score of the dirty section.
For example, as the erase/write frequency of a block is more, the lower the write speed is, the worse the performance of the block with more erase/write frequency can be determined; for another example, when the invalid section length is expressed by the number of invalid blocks, the larger the storage space of one invalid block is, the more data can be written, and the smaller the number of blocks that need to be written for the same amount of data, the fewer the number of writes, and therefore, the block performance can be set to be better as the storage space is larger. When the performance of the measuring block is measured in different modes, weights can be set for different measuring modes, and the performance score of the block is determined based on the weights of the measuring modes.
Step S240: and selecting the dirty section with the highest score.
After determining the score of each dirty segment, the higher the score of the dirty segment is, the more invalid blocks are present and the larger the number of invalid sections with longer length is, the higher the writing efficiency is, and the dirty segment with the highest score can be selected to be used as the dirty segment for data writing.
Step S250: and writing the data to be written into the selected dirty section.
And writing the data required to be written into the storage device into the selected dirty section with the highest score.
Optionally, when writing the dirty section, the data may be written into each invalid section sequentially from front to back according to the address of the dirty section.
Optionally, in order to improve the writing efficiency, the writing may be performed sequentially from large to small according to the length of the invalid interval in the dirty section. And when the data volume of the data to be written which is not written into the dirty section is smaller than the storable quantity of a certain invalid interval and is larger than other invalid intervals which are smaller than the storable quantity of the invalid interval, writing the data which is not written into the dirty section into the invalid interval.
In addition, in order to improve the writing efficiency, when data is written into each invalid section, the writing frequency of each invalid section can be smaller than the number of invalid blocks in the invalid section, wherein each invalid section can be written with the minimum number of times which can be reached, for example, all invalid blocks in each invalid section are written by one-time writing operation, namely, one-time writing operation is written into the invalid section.
Optionally, if an invalid block in the storage device needs to be erased before writing, the data in the invalid block is erased before writing the data to be written into each invalid block of the dirty segment.
Optionally, in this embodiment of the present application, when a dirty segment is selected for writing data to be written, a dirty segment with the highest score may be selected from other dirty segments according to the dirty segment selection manner in this embodiment of the present application, and used for writing other data to be written, or used for partial writing in which current data to be written is not completely written in the storage device; or, the scores of the dirty sections are calculated every other preset time period, when data to be written needs to be written into the storage device, one dirty section with the highest score is selected from the currently unselected dirty sections to be written according to the recently calculated scores, and the currently unselected dirty section represents the dirty section which is not selected when the dirty section is selected according to the recently calculated score.
In the embodiment of the application, the dirty section with the highest score value is obtained under the condition of considering both the number of the invalid blocks and the length of the invalid interval, the number of the invalid blocks is usually large, and the length of the invalid interval is usually long, so that data can be written into one dirty section as much as possible, the number of writing is as few as possible, and the efficiency of data writing is improved.
In addition, since the blocks in the idle segment are all invalid blocks, when data is written into the idle segment, the number of writing times can be as small as possible, for example, the idle segment can be written through one or two writing operations, and therefore, in the embodiment of the present application, the data to be written can be preferentially written into the idle segment. The embodiment of the present application further provides an implementation manner, in which when it is determined that the number of idle segments is small, a dirty segment is selected again for data writing. Specifically, as shown in fig. 5, the following steps may be included.
Step S310: judging whether the number of idle sections in the storage device is smaller than a preset number, if so, executing step S320; if not, go to step S350.
The number of free segments in the storage device is determined and compared to determine if the number is less than a preset number. If so, indicating that the number of idle segments is small, selecting a dirty segment for data writing; if the number of the free segments is larger than or equal to the predetermined value, the data can be written into the free segments preferentially.
Step S320: determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid interval. The number of the invalid blocks in the invalid section is larger, and the length of the invalid section is longer.
Step S330: and selecting the dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval.
Step S340: and writing the data to be written into the selected dirty section.
The specific implementation of steps S310 to S340 may refer to the same or corresponding steps in the foregoing embodiments, and will not be described herein again.
Step S340: and writing the data to be written into the idle segment.
And when the number of the idle segments is larger than or equal to the preset number, selecting the idle segments to write the data needing to be written into the storage equipment.
Optionally, an idle segment may be selected, and the idle segment with the best performance may also be selected. The idle segment with the best performance may be the idle segment with the highest average performance. The performance average score of the idle segment may be calculated according to the performance score of each block in the idle segment and the number of blocks, and specific calculation may refer to the description of calculating the performance average score, which is not described herein again.
When writing data into the free segment, data may be sequentially written into each block in a sequential addition manner, for example, according to the address continuity of the free segment.
In the embodiment of the application, when the number of the idle sections is large, data is written into the idle sections so as to improve the writing efficiency; when the number of the idle segments is small, the dirty segments are selected to be used for writing data according to the number of the invalid blocks in the dirty segments and the length of the invalid interval, so that the writing efficiency of the dirty segments is improved, and the writing efficiency of the storage device is improved as a whole.
The embodiment of the present application further provides a data writing apparatus 400 of a storage device, please refer to fig. 6, where the apparatus 400 may include a segment determining module 410, configured to determine a number of invalid blocks in each dirty segment of the storage device and a length of each invalid section, where mutually consecutive invalid blocks form invalid sections, different invalid sections are discontinuous, and the larger the number of invalid blocks in the invalid sections is, the longer the length of the invalid section is; a segment selection module 420, configured to select a dirty segment according to the number of invalid blocks in each dirty segment and the length of each invalid interval; and a data writing module 430, configured to write the data to be written into the selected dirty segment.
Optionally, the segment selecting module 420 may include: the continuity calculation unit is used for calculating the ineffective continuity of each dirty section according to the length of each ineffective interval in each dirty section, wherein the more the number of the ineffective intervals in the dirty section is, the higher the ineffective continuity of the dirty section is; the score calculation unit is used for calculating the score of each dirty section according to the number of invalid blocks in each dirty section, the corresponding first weight, invalid continuity and the corresponding second weight, wherein the number of the invalid blocks of different dirty sections corresponds to the first weight with the same size, and the invalid continuity of different dirty sections corresponds to the second weight with the same size; and the selecting unit is used for selecting the dirty section with the highest score.
Optionally, the continuity calculating unit may be configured to calculate, for each dirty segment, a product of a sum of lengths of all invalid sections within the same length range and a third weight corresponding to the length range according to a corresponding relationship between the length range and the third weight and a length range in which the length of each invalid section is located, as a sub-continuity corresponding to the length range, where the longer the length range is, the higher the corresponding weight is; and adding the sub-continuity corresponding to each length range to obtain the invalid continuity corresponding to the dirty section.
Optionally, the calculating, according to the corresponding relationship between the length range and the third weight and the length range in which the length of each invalid section is located, a product of a sum of the lengths of all invalid sections within the same length range and the third weight corresponding to the length range as the sub-continuity corresponding to the length range may include: and calculating the product of the sum of the lengths of all invalid sections within the same length range and greater than the preset length and the third weight corresponding to the length range according to the corresponding relation between the length range and the third weight and the length range in which the length of each invalid section is positioned, and taking the product as the sub-continuity corresponding to the length range.
Optionally, the continuity calculation unit may be configured to determine a length of a longest invalid section in each dirty section as the invalid continuity.
Optionally, the number of invalid blocks in the invalid interval may be used as the length of the invalid interval.
Optionally, the storage device further includes an idle segment, where the idle segment includes a plurality of consecutive blocks, and all of the blocks in the idle segment are invalid blocks. The device can also comprise a judging module used for judging whether the number of the idle sections in the storage equipment is less than the preset number; if yes, the segment determining module 410 determines the number of invalid blocks in each dirty segment of the storage device and the length of each invalid interval.
Optionally, the data writing method of the storage device provided in the embodiment of the present application may be executed by a processor. In particular, the method may be performed by a data writing apparatus of a storage device in a processor, or may be performed by a file system for reading and writing data in the storage device, such as a flash memory file system. Alternatively, the data writing means of the storage device may be means in the file system.
It will be clear to those skilled in the art that, for convenience and brevity of description, the various method embodiments described above may be referred to one another; for the specific working processes of the above-described devices and modules, reference may be made to corresponding processes in the foregoing method embodiments, which are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. Each module may be configured in different electronic devices, or may be configured in the same electronic device, and the embodiments of the present application are not limited thereto.
Referring to fig. 7, a block diagram of an electronic device 600 according to an embodiment of the present disclosure is shown. The electronic device may include one or more processors 610 (only one shown), memory 620, and one or more programs. The storage 620 may include a storage device in the embodiment of the present application. The one or more programs are stored in the memory 620 and configured to be executed by the one or more processors 610. The one or more programs are executed by the processor for performing the methods described in the foregoing embodiments.
The processor 610 may include one or more Processing cores, the processor 610 may connect various portions throughout the electronic device 600 using various interfaces and lines, perform various functions of the electronic device 600 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 620, and calling data stored in the memory 620, alternatively, the processor 610 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), Programmable logic Array (Programmable L organic Array, P L a), the processor 610 may be implemented in the form of at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem, etc., wherein the CPU is primarily responsible for Processing operating systems, user interfaces, application programs, etc., the GPU is responsible for displaying content, the modem is used for rendering, and the modem may be implemented separately for communication, or the wireless Processing chip 610 may be implemented.
The Memory 620 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 620 may be used to store instructions, programs, code sets, or instruction sets. The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described above, and the like. The stored data area may also store data created by the electronic device in use, and the like.
Referring to fig. 8, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 700 has stored therein program code that can be called by a processor to execute the methods described in the above-described method embodiments.
The computer-readable storage medium 700 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 700 includes a non-volatile computer-readable storage medium. The computer readable storage medium 700 has storage space for program code 710 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 710 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A data writing method of a storage device, wherein the storage device includes dirty segments, each dirty segment includes a plurality of consecutive blocks, and the plurality of blocks of each dirty segment includes a valid block and an invalid block, the method comprising:
determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid section, wherein the mutually continuous invalid blocks form invalid sections, different invalid sections are discontinuous, and the larger the number of the invalid blocks in the invalid sections is, the longer the length of the invalid sections is;
selecting dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval;
and writing the data to be written into the selected dirty section.
2. The method of claim 1, wherein selecting dirty sections according to the number of invalid blocks in each dirty section and the length of each invalid interval comprises:
calculating the invalid continuity of each dirty section according to the length of each invalid section in each dirty section, wherein the longer invalid sections in the dirty sections are more, and the higher the invalid continuity of the dirty sections is;
calculating the score of each dirty section according to the number of invalid blocks in each dirty section, the corresponding first weight, invalid continuity and the corresponding second weight, wherein the number of invalid blocks of different dirty sections corresponds to the first weight with the same size, and the invalid continuity of different dirty sections corresponds to the second weight with the same size;
and selecting the dirty section with the highest score.
3. The method of claim 2, wherein said calculating the degree of invalid continuity for each dirty section comprises:
for each of the dirty sections it is desirable to,
calculating the product of the sum of the lengths of all invalid sections in the same length range and the third weight corresponding to the length range according to the corresponding relation between the length range and the third weight and the length range in which the length of each invalid section is positioned, and taking the product as the sub-continuity corresponding to the length range, wherein the longer the length range is represented, the higher the corresponding weight is;
and adding the sub-continuity corresponding to each length range to obtain the invalid continuity corresponding to the dirty section.
4. The method according to claim 3, wherein calculating, as the sub-continuity corresponding to the length range, a product of a sum of lengths of all invalid sections within the same length range and the third weight corresponding to the length range according to a corresponding relationship between the length range and the third weight and the length range in which the length of each invalid section is located, comprises:
and calculating the product of the sum of the lengths of all invalid sections within the same length range and greater than the preset length and the third weight corresponding to the length range according to the corresponding relation between the length range and the third weight and the length range in which the length of each invalid section is positioned, and taking the product as the sub-continuity corresponding to the length range.
5. The method of claim 2, wherein said calculating the degree of invalid continuity for each dirty section comprises:
and determining the length of the longest invalid interval in each dirty section as the invalid continuity.
6. The method of claim 1, wherein the number of invalid blocks in an invalid interval is used as the length of the invalid interval.
7. The method of claim 1, wherein the storage device further includes a free segment, the free segment includes a plurality of consecutive blocks, each of the plurality of blocks in the free segment is an invalid block, and before determining the number of invalid blocks in each dirty segment of the storage device and the length of each invalid interval, the method further includes:
judging whether the number of idle sections in the storage device is smaller than a preset number or not;
and if so, executing the step of determining the number of invalid blocks in each dirty section of the storage device and the length of each invalid interval.
8. A data writing apparatus of a storage device, wherein the storage device includes dirty segments, each dirty segment includes a plurality of consecutive blocks, and the plurality of blocks of each dirty segment includes a valid block and an invalid block, the apparatus comprising:
a segment determining module, configured to determine the number of invalid blocks in each dirty segment of the storage device and the length of each invalid interval, where mutually continuous invalid blocks form invalid intervals, different invalid intervals are discontinuous, and the larger the number of invalid blocks in an invalid interval is, the longer the length of the invalid interval is;
the segment selection module is used for selecting dirty segments according to the number of invalid blocks in each dirty segment and the length of each invalid interval;
and the data writing module is used for writing the data to be written into the selected dirty section.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors for performing the method recited in any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN202010322733.2A 2020-04-22 2020-04-22 Data writing method and device of storage device, electronic device and storage medium Active CN111399783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010322733.2A CN111399783B (en) 2020-04-22 2020-04-22 Data writing method and device of storage device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010322733.2A CN111399783B (en) 2020-04-22 2020-04-22 Data writing method and device of storage device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN111399783A true CN111399783A (en) 2020-07-10
CN111399783B CN111399783B (en) 2024-01-16

Family

ID=71431695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010322733.2A Active CN111399783B (en) 2020-04-22 2020-04-22 Data writing method and device of storage device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN111399783B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513941A (en) * 2013-10-18 2014-01-15 华为技术有限公司 Method and device for writing data
US20140101373A1 (en) * 2012-09-27 2014-04-10 Samsung Electronics Co., Ltd. Method of managing data storage device and data storage device
US20160188462A1 (en) * 2014-12-26 2016-06-30 Research & Business Foundation Sungkyunkwan University Method and apparatus for partial garbage collection in filesystems
US20170060448A1 (en) * 2015-08-26 2017-03-02 OCZ Storage Solutions Inc. Systems, solid-state mass storage devices, and methods for host-assisted garbage collection
CN109871333A (en) * 2017-12-05 2019-06-11 慧荣科技股份有限公司 The method of access flash memory module and relevant flash controller and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101373A1 (en) * 2012-09-27 2014-04-10 Samsung Electronics Co., Ltd. Method of managing data storage device and data storage device
CN103513941A (en) * 2013-10-18 2014-01-15 华为技术有限公司 Method and device for writing data
US20160188462A1 (en) * 2014-12-26 2016-06-30 Research & Business Foundation Sungkyunkwan University Method and apparatus for partial garbage collection in filesystems
US20170060448A1 (en) * 2015-08-26 2017-03-02 OCZ Storage Solutions Inc. Systems, solid-state mass storage devices, and methods for host-assisted garbage collection
CN109871333A (en) * 2017-12-05 2019-06-11 慧荣科技股份有限公司 The method of access flash memory module and relevant flash controller and electronic device

Also Published As

Publication number Publication date
CN111399783B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN111324303B (en) SSD garbage recycling method, SSD garbage recycling device, computer equipment and storage medium
CN111309267B (en) Storage space allocation method and device, storage equipment and storage medium
CN111382129B (en) File defragmentation method, device, storage medium and related equipment
CN109284233B (en) Garbage recovery method of storage system and related device
CN113220239A (en) Erasing and writing method, device and equipment for flash storage and readable storage medium
CN111813347B (en) Garbage recycling space management method and device and computer readable storage medium
CN110727385B (en) Desktop icon sorting method and device, electronic equipment and storage medium
CN114610650A (en) Memory compression method and device, storage medium and electronic equipment
CN111209257B (en) File system fragmentation method and device
CN113687949B (en) Server deployment method, device, deployment equipment and storage medium
CN111061429B (en) Data access method, device, equipment and medium
CN102169464B (en) Caching method and device used for non-volatile memory, and intelligent card
CN111399783A (en) Data writing method and device of storage equipment, electronic equipment and storage medium
CN111459682B (en) Frequency adjustment method, device, electronic equipment and storage medium
CN116188244B (en) Method, device, equipment and storage medium for distributing image blocks
CN112000591A (en) SSD (solid State disk) scanning method and device capable of appointing logical block address, computer equipment and storage medium
CN109671127B (en) Method and device for realizing waveform drawing
CN112817526B (en) Data storage method, device and medium
CN115328656A (en) Dynamic memory intelligent expansion method, device, equipment and storage medium
CN109271538A (en) A kind of picture storage method and relevant device
CN112256462B (en) Service life prediction method, device and medium of NAND Flash memory
CN115185803A (en) Method and device for evaluating performance of storage system and electronic equipment
CN111090633A (en) Small file aggregation method, device and equipment of distributed file system
CN113867651B (en) Hard disk data cleaning method and device and computing equipment
CN113360356B (en) Method for identifying reading cheating behaviors, computing device and computer storage medium

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
GR01 Patent grant
GR01 Patent grant