A storage device simulation method and device, electronic equipment and storage medium

By creating a simulated file system using SSD attribute information, the problem of wear and tear during SSD firmware anomaly detection is solved, achieving lossless read and write testing and extending the lifespan of storage devices.

CN120872713BActive Publication Date: 2026-01-23SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511384829.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-01-23
Estimated Expiration
2045-09-26

AI Technical Summary

Technical Problem

In existing technologies, direct read/write tests during solid-state drive (SSD) firmware anomaly detection lead to NAND flash memory wear and reduce the lifespan of storage devices.

Method used

By obtaining the attribute information of the storage device, determining the storage structure information, creating a simulated file system, and converting the logical address of the data write request into the physical address, the simulated file system is used to perform read and write tests, avoiding direct writing to the storage device.

Benefits of technology

It extends the lifespan of storage devices and avoids damage caused by direct read/write tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120872713B_ABST
    Figure CN120872713B_ABST
Patent Text Reader

Abstract

The application discloses a storage device simulation method and device, electronic equipment and a storage medium, and relates to the technical field of computers. According to the obtained storage device attribute information, the storage structure information of the storage device is determined, and then the simulation file system of the storage device is created according to the storage structure information. When any data write request is received, the logical address information of the data write request is converted into physical address information by the storage firmware of the storage device, and then the to-be-written data of the data write request is written into the storage device and the simulation file system according to the physical address information, so that the simulation file system and the storage device are kept synchronous. When the storage firmware is subjected to read-write test, the simulation file system is used to replace the storage device to perform read-write test, the same test effect of directly performing read-write test on the storage device can be achieved, the loss of the storage device caused by directly writing the read-write test data into the storage device is avoided, and the service life of the storage device is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a storage device simulation method and device, electronic equipment and a storage medium. BACKGROUND

[0002] A solid state disk (SSD) is a storage device with a semiconductor flash memory as a core storage medium. The SSD firmware is responsible for converting logical read-write instructions issued by the host into physical addresses of the NAND flash memory. However, the SSD firmware may have abnormalities, resulting in address conversion errors. Therefore, how to detect abnormalities in the SSD firmware has become a key research content.

[0003] In related technologies, a read-write test is usually initiated on the SSD to verify whether the SSD firmware has abnormalities. However, the current read-write test requires real read, write and erase operations on the physical space of the SSD. Repeatedly erasing and writing the SSD will cause wear and tear of the NAND flash memory, reducing the service life of the storage device. If a simulated storage device is used for read-write testing, the wear and tear of the storage device caused by read-write testing can be avoided. Therefore, there is an urgent need for a simulation method for a storage device, which is of great significance to prolonging the service life of the storage device. SUMMARY

[0004] The present application provides a storage device simulation method and device, electronic equipment and a storage medium to at least solve the problem of wear and tear caused by directly writing read-write test data into the storage device when testing the storage firmware in related technologies.

[0005] The present application provides a storage device simulation method, comprising:

[0006] obtaining attribute information of a storage device;

[0007] determining storage structure information of the storage device according to the attribute information of the storage device;

[0008] creating a simulation file system of the storage device according to the storage structure information of the storage device;

[0009] when receiving any data write request, determining corresponding physical address information according to logical address information of the data write request based on the storage firmware of the storage device;

[0010] writing the to-be-written data of the data write request to the simulation file system according to the physical address information.

[0011] The present application also provides a storage device simulation device, comprising:

[0012] an obtaining module configured to obtain attribute information of a storage device;

[0013] The first determining module is configured to determine the storage structure information of the storage device according to the attribute information of the storage device.

[0014] The creating module is configured to create the simulation file system of the storage device according to the storage structure information of the storage device.

[0015] The second determining module is configured to, when receiving any data write request, determine the corresponding physical address information according to the logical address information of the data write request based on the storage firmware of the storage device.

[0016] The writing module is configured to write the to-be-written data of the data write request into the simulation file system according to the physical address information.

[0017] The application further provides an electronic device, including a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of any of the storage device simulation methods.

[0018] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of any of the storage device simulation methods.

[0019] The application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the steps of any of the storage device simulation methods.

[0020] According to the application, the storage structure information of the storage device is determined according to the obtained attribute information of the storage device, the simulation file system of the storage device is created according to the storage structure information, when receiving any data write request, the logical address information of the data write request is converted into physical address information by the storage firmware of the storage device, and then the to-be-written data of the data write request is written into the storage device and the simulation file system according to the physical address information, so that the simulation file system is kept synchronized with the storage device. When performing read-write test on the storage firmware, the simulation file system is used to replace the storage device to perform read-write test, which can achieve the same test effect of directly performing read-write test on the storage device, avoids the loss of the storage device caused by directly writing the read-write test data into the storage device, and prolongs the service life of the storage device. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 This is a schematic diagram of the network structure upon which the embodiments of this application are based;

[0023] Figure 2 A flowchart illustrating the storage device simulation method provided in this application embodiment;

[0024] Figure 3 A schematic diagram of an exemplary physical plane provided for embodiments of this application;

[0025] Figure 4 This is a schematic diagram of the structure of the storage device simulation apparatus provided in the embodiments of this application;

[0026] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0028] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0029] Solid-state drives (SSDs) are storage devices that use semiconductor flash memory as their core storage medium. The underlying storage medium is called NAND flash memory, which has gained widespread application in recent years. Based on the number of bits of data stored in a single NAND storage cell, NAND writing methods can be categorized into four types: SLC, MLC, TLC, and QLC, corresponding to 1, 2, 3, and 4 bits of data stored per cell, respectively. QLC is the latest writing method developed by major NAND manufacturers, and most mainstream products currently use TLC or a hybrid SLC / TLC writing method. Word lines (wls) are key wires controlling the read and write operations of storage cells, forming the core connection structure of the flash memory array together with bit lines. The core function of word lines is to select storage cells in a specific row and control these cells to perform write, read, or erase operations by applying different voltages.

[0030] The four memory modes, SLC, MLC, TLC, and QLC, correspond to page sizes of 1, 2, 3, and 4, respectively. For SLC, MLC, and TLC modes, the page size is fixed and does not change with different word line values. However, in QLC mode, the page size varies. Most word lines contain pages of size 4, but a small number of pages are smaller than 4. Therefore, the overall NAND address structure no longer remains a rectangular volume.

[0031] In related technologies, read-write tests are typically performed on SSDs to verify whether there are any anomalies in the SSD firmware. However, current read-write tests require actual read, write, and erase operations on the physical space of the SSD. Repeated write and erase operations on the SSD cause wear and tear on the NAND flash memory, reducing the lifespan of the storage device. If read-write tests are performed using simulated storage devices, the wear and tear caused by read-write tests can be avoided. Therefore, there is an urgent need for a method to simulate storage devices, which is of great significance for extending the lifespan of storage devices.

[0032] To address the aforementioned technical problems, this application provides a storage device emulation method, apparatus, electronic device, and storage medium. The method includes: acquiring attribute information of the storage device; determining storage structure information of the storage device based on the attribute information; creating a simulated file system for the storage device based on the storage structure information; determining corresponding physical address information based on the logical address information of the data write request when any data write request is received, using the storage firmware of the storage device; and writing the data to be written in the data write request to the simulated file system based on the physical address information. The method provided above determines the storage structure information of the storage device based on the acquired storage device attribute information, creates a simulated file system for the storage device based on the storage structure information, and when any data write request is received, converts the logical address information of the data write request to physical address information using the storage firmware of the storage device, and then writes the data to be written in the data write request to both the storage device and the simulated file system based on the physical address information, thus keeping the simulated file system synchronized with the storage device. When performing read / write tests on storage firmware, using a simulated file system instead of the storage device can achieve the same test results as directly testing the storage device. This avoids damage to the storage device caused by directly writing test data to the storage device and extends the lifespan of the storage device.

[0033] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0034] The specific application environment architecture or specific hardware architecture on which the execution of the storage device simulation method depends is described here.

[0035] First, the network structure on which this application is based will be explained:

[0036] The storage device simulation method, apparatus, electronic device, and storage medium provided in this application are applicable to simulating storage devices, such as... Figure 1 The diagram shown is a schematic of the network structure on which this application embodiment is based. It mainly includes a user terminal and a server terminal. The server terminal includes the device to be simulated. The user terminal is used to initiate a data write request to the server terminal. The server terminal is used to respond to the data write request initiated by the user terminal and to simulate the storage device based on the storage device simulation method provided in this application embodiment.

[0037] This application provides a storage device simulation method for simulating storage devices. The execution subject of this application embodiment is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, and other electronic devices that can be used for storage device simulation.

[0038] like Figure 2 The diagram shown is a flowchart illustrating a storage device simulation method provided in an embodiment of this application. The method includes:

[0039] Step 201: Obtain the attribute information of the storage device.

[0040] Specifically, a storage device includes multiple storage blocks. For any given storage block (blk), a storage block includes multiple word line groups (wl groups, abbreviated as wlg). A word line group contains multiple word lines, a word line contains multiple storage pages, and a storage page contains multiple data units, also known as the smallest write unit. The attribute information of the storage device is provided by the manufacturer.

[0041] Accordingly, obtaining the attribute information of the storage device provides data support for determining the storage structure information of the storage device.

[0042] Step 202: Determine the storage structure information of the storage device based on its attribute information.

[0043] Specifically, the storage structure information is calculated based on the attribute information of the storage device, and the structure of the corresponding storage block can be determined according to the storage structure information.

[0044] Accordingly, the physical condition of NAND is characterized by the storage structure information, providing a data reference for the subsequent creation of a simulated file system for the storage device.

[0045] Step 203: Create a simulated file system for the storage device based on the storage structure information of the storage device.

[0046] Specifically, the simulated file system for a storage device can simulate the structure of NAND flash memory. Based on the storage structure information of the storage device, a simulated file system for the storage device is created. The simulated file system consists of multiple files, each file consists of multiple storage blocks, each storage block contains multiple word lines, each word line contains multiple storage pages, and each storage page contains multiple data units.

[0047] Accordingly, by creating a simulated file system for the storage device, data can be written to the simulated file system when testing the storage firmware, avoiding direct writing to the storage device.

[0048] Step 204: When any data write request is received, the corresponding physical address information is determined based on the storage firmware of the storage device and the logical address information of the data write request.

[0049] Specifically, the storage firmware is used to convert the logical address information of a data write request into physical address information. The physical address information structure of the underlying NAND can be described as an eight-dimensional structure, where an eight-dimensional coordinate system determines the address of a data frame (df), corresponding to a fixed-size data unit. The eight-dimensional structure includes channel coordinates (ch), core (ce), logical unit (lun), physical plane (plain), block, word line (wl), page, and data unit (df). Among these, the channel, core, logical unit, and physical plane dimensions can implement parallel read and write operations, but the word line and page dimensions must be written sequentially in a certain order. The eight-dimensional structure is shown in Table 1.

[0050] Table 1 Physical Address Information Structure Table

[0051]

[0052] Accordingly, the eight-dimensional structure of physical address information represents the physical location corresponding to the data write request, and also represents the location in the simulated file system, so that the data can be written to the corresponding file location.

[0053] Step 205: Based on the physical address information, write the data to be written in the data writing request to the simulated file system.

[0054] Specifically, the target file name, ch_ce_lun_plain.dat, is determined based on the first four dimensions of the physical address information. Then, the specific file location in the simulated file system is determined sequentially based on the storage block, word line, storage page, and data unit in the physical address information, and the data is written to that file location. At the same time, the data is also written to the corresponding NAND flash memory based on the physical address information.

[0055] Correspondingly, the simulated file system simulates the actual situation of the storage device. That is, the data to be written is written to the simulated file system. When performing read and write tests on the storage firmware, using the simulated file system instead of the storage device can achieve the same test effect as directly performing read and write tests on the storage device. This avoids the wear and tear on the storage device caused by directly writing the read and write test data to the storage device and extends the service life of the storage device.

[0056] Based on the above embodiments, as one implementable approach, in one embodiment, determining the storage structure information of the storage device according to the attribute information of the storage device includes:

[0057] Step 2021: Determine the storage structure information of the storage device based on the number of storage strings, the number of storage areas, the number of storage pages contained in the word lines of each storage area, and the number of word line groups contained in each storage area.

[0058] The attribute information of the storage device includes the number of storage strings in each storage block, the number of storage areas, the number of storage pages contained in each word line in each storage area, and the number of word line groups contained in each storage area.

[0059] Specifically, a storage device comprises multiple storage blocks. For any given storage block (blk), the storage block includes multiple word line groups (wl groups, abbreviated as wlgs). A word line group contains multiple word lines, and a word line contains multiple pages. All word lines of a storage block are divided into multiple storage strings, and each storage string contains one word line. Taking a word line group as a unit, all word line groups are divided into multiple storage sections, thus all word lines (wls) and all pages contained within them are also divided into several storage sections. The number of pages in all word lines within each storage section is the same. Typically, when the storage section is SLC, the number of pages in each word line of that storage section is 1; when the storage section is QLC, the number of pages in each word line of that storage section is less than or equal to 4. The attribute information of the storage device is provided by the manufacturer. Based on the content represented by the storage structure information, a simulated file system can be created. The total number of storage blocks contained in the storage device is expressed as... The total number of word lines contained in any memory block is represented as The total number of memory pages contained in any word line is represented as The total number of data units contained in any memory page is expressed as The total number of word lines contained in any memory block is expressed as The total number of storage strings contained in any storage block is expressed as .

[0060] Specifically, in one embodiment, for any storage block in the storage device, the number of word line groups corresponding to various numbers of storage pages in the storage block can be determined based on the number of storage pages contained in each storage area and the number of word line groups contained in each storage area; the total number of word line groups in the storage block can be determined based on the number of word line groups contained in each storage area and the number of storage areas; or, the total number of word line groups in the storage block can be determined based on the number of word line groups corresponding to various numbers of storage pages; the total number of word lines in the storage block can be determined based on the total number of word line groups in the storage block and the number of storage strings; the total number of storage pages in the storage block can be determined based on the number of word line groups corresponding to various numbers of storage pages and the number of storage strings. The storage structure information of the storage device includes the total number of word line groups, the total number of word lines, and the total number of storage pages for each storage block.

[0061] Specifically, for any given storage block, the number of storage pages to be counted is first determined, i.e., the number of pages to be counted is determined. Then iterate through each memory page to find the number of pages. The number of word lines in each storage area is accumulated to obtain the number of word lines corresponding to the number of various storage pages in the storage block.

[0062] Specifically, in one embodiment, the number of word lines corresponding to the number of various memory pages in a memory block can be determined based on the following formula:

[0063]

[0064] in, Indicates that the storage page is The number of character lines corresponding to the time. Indicates the number of memory pages contained in the word line. Indicates its range of values, This indicates the storage area number, starting from 0 and counting up to... , This represents the number of storage areas contained in any given storage block. Indicates the number is The number of word lines contained in the storage area. Indicates its range of values, Indicates the number is The number of memory pages contained in the word line of the memory area. This indicates the range of its values.

[0065] Specifically, for any memory block, each memory region is traversed sequentially, and the number of word lines contained in each memory region is summed to obtain the total number of word lines in the memory block.

[0066] Specifically, in one embodiment, the total number of word lines in a memory block can be determined based on the following formula:

[0067]

[0068] in, This indicates the total number of word lines in a memory block. This indicates the total number of storage areas in the storage block. Indicates the first One storage area, Indicates the first The number of word lines contained in each memory area.

[0069] Specifically, for any memory block, by iterating through the memory pages of various types and summing the number of word lines corresponding to the number of memory pages of each type, the total number of word lines in the memory block can be obtained.

[0070] Specifically, in one embodiment, the total number of word lines in a memory block can be determined based on the following formula:

[0071]

[0072] in, This indicates the total number of word lines in a memory block. Indicates the number of memory pages contained in the word line. Indicates that the storage page is The number of character lines corresponding to the time.

[0073] Specifically, in one embodiment, the total number of word lines in a memory block can be determined based on the following formula:

[0074]

[0075] in, This indicates the total number of word lines in a memory block. This indicates the total number of word line groups contained in each memory block. Indicates the number of stored strings.

[0076] Specifically, for any given storage block, the number of storage pages to be counted is first determined, i.e., the number of pages to be counted is determined. Then, obtain the number of word lines corresponding to the number of storage pages. Based on the number of word lines corresponding to the number of storage pages, and the number of storage strings, obtain the total number of word lines with the same number of storage pages. Then, based on the total number of word lines with the same number of storage pages and the number of storage pages, obtain the total number of storage pages of this type in the storage block. Add them together to obtain the total number of storage pages in the storage block.

[0077] Specifically, in one embodiment, the total number of storage pages in a storage block can be determined based on the following formula:

[0078]

[0079] in, This represents the total number of storage pages in a storage block. Indicates that the storage page is The number of character lines corresponding to the time. Indicates the number of memory pages contained in the word line. Indicates the number of stored strings.

[0080] For example, the structure of a storage block is shown in Table 2:

[0081] Table 2 Storage Block Structure Table

[0082]

[0083] Specifically, the entire table represents all word lines in a fixed storage block, and all storage pages in each word line. Each column represents a storage string, and there are 3 storage strings in the storage block. Each row represents a word line group, and the number of word lines in a word line group is determined by the number of storage strings. The first column of the table represents the coordinates of the wl corresponding to the column containing string 0. Starting from the second column, every 4 columns represent a wl, representing pages 0-3 respectively. Some wls contain fewer than 4 pages (the corresponding empty spaces are represented by NA). Each wl in a wlg contains the same number of pages. The numbers in the cells of the main part of the table represent the sequential numbering of all pages in the entire blk according to the wl order. Table 2 contains 19 wlgs, divided into 5 sections, including: wlg 0, wlg 1-6, wlg 7-9, wlg 10-16, and wlg 17-18. According to Table 2, , , , , , as well as .

[0084] Accordingly, the storage structure information of the storage device characterizes the structure of the storage device, making it easier to create a corresponding simulated file system based on the storage structure information.

[0085] Based on the above embodiments, as an implementable approach, in one embodiment, writing the data to be written according to the data write request to the simulated file system based on the physical address information includes:

[0086] Step 2051: Based on the target physical plane represented by the high-dimensional information of the physical address information, locate the corresponding target file in the simulation file system; wherein, both the target physical plane and the target file include multiple data blocks;

[0087] Step 2052: Based on the low-dimensional information of the physical address information, write the data to be written in the data writing request to the target file;

[0088] Step 2053, wherein the high-dimensional information includes the target channel coordinates, target core coordinates, target logical unit coordinates, and target physical plane coordinates.

[0089] Specifically, the eight-dimensional structure representing the data write request consists of target channel coordinates, target core coordinates, target logical unit coordinates, target physical plane coordinates, target data block coordinates, target word line coordinates, target storage page coordinates, and target minimum write unit. Among these, the four dimensions of channel, core, logical unit, and physical plane are high-dimensional information, while storage block (blk), word line (wl), storage page (page), and data unit (df) are low-dimensional information.

[0090] Specifically, the high-dimensional information of the physical address is used to locate a file. Each file stores the first four dimensions as a four-dimensional cross-section. The filename is in the form of ch_ce_lun_plain.dat. Within each file, the file is built sequentially from the outermost layer to the innermost layer, following the order of storage blocks, word lines, storage pages, and data units. During file creation, the data of each data unit is saved in lexicographical order. The simulated file system contains multiple files, each corresponding to a different physical plane in the NAND flash memory. The physical plane accessed by the data write request is the target physical plane, i.e., the target file in the simulated file system. Upon receiving a data write request, the logical address information represented by the data write request is converted into corresponding physical address information by the storage firmware. The physical address information is analyzed, and based on the high-dimensional information, the target physical plane is obtained. Then, the corresponding filename is found in the simulated file system, thus determining the target file. The target physical plane contains multiple data blocks, each representing a different storage block. Each storage block contains multiple word lines, each word line contains multiple storage pages, and each storage page contains multiple data units. After determining the target file, the specific file is located based on the content represented by the low-dimensional information, and the data to be written in the data writing request is written to the corresponding position in the target file.

[0091] Specifically, the total number of storage blocks contained in the storage device is expressed as The storage block number is represented as The total number of word lines contained in any memory block is represented as The letter bar number is represented as , that is, the coordinates of the word line. The total number of memory pages contained in any word line is represented as . The storage page number is represented as The total number of data units contained in any memory page is expressed as The data unit number is represented as The total number of word lines contained in any memory block is expressed as The numbering of the character line group is represented as follows The total number of storage strings contained in any storage block is expressed as The storage string number is represented as Assuming And none of them are worth following Change for the sake of change, then The coordinates are saved in the file in the following order:

[0092] (0,0,0,0),(0,0,0,1),(0,0,1,0),(0,0,1,1),

[0093] (0,1,0,0),(0,1,0,1),(0,1,1,0),(0,1,1,1),

[0094] (1,0,0,0),(1,0,0,1),(1,0,1,0),(1,0,1,1),

[0095] (1,1,0,0),(1,1,0,1),(1,1,1,0),(1,1,1,1)

[0096] Accordingly, the target physical plane is determined by high-dimensional information, the data unit corresponding to the data write request is located by low-dimensional information, and the location information represented by the physical address information is split to convert the information stored in the storage device into the location information stored in the simulated file system, so as to facilitate the storage of the data to be written into the simulated file system.

[0097] Specifically, in one embodiment, the target data block type corresponding to the data write request can be determined based on the target data block coordinates in the low-dimensional information. The target data block type is divided into two types: a first type and a second type. In the first type, each word line contains a uniform number of storage pages, while in the second type, each word line contains a different number of storage pages. When the target data block type is the first type, the cumulative number of storage pages before the target data block coordinates is determined based on the target data block coordinates, the total number of word lines in the first type of data block, and the number of storage pages per word line in the first type of data block. Based on the cumulative number of storage pages before the target data block coordinates, the target word line coordinates, the target storage page coordinates, the target minimum write unit coordinates, and the physical byte size of each minimum write unit, the physical byte offset corresponding to the data write request is determined. Based on the physical byte offset, the data to be written in the data write request is written to the target file.

[0098] The low-dimensional information includes the target data block coordinates, target word line coordinates, target storage page coordinates, and target minimum write unit coordinates.

[0099] Specifically, the storage block, word line, storage page, and data unit represented by the physical address information of the data write request are respectively determined as the target data block, target word line, target storage page, and target minimum write unit. Based on the coordinates of the target data block, the corresponding storage block can be located. Storage blocks typically contain two types: Type I and Type II. Type I data blocks are typically SLCs, and their word lines usually contain one storage page. Type II data blocks are typically QLCs, and their word lines can contain one, two, three, or four storage pages. The number of storage pages contained in the word lines varies in different storage areas within a Type II data block. For any given target physical plane, Type I storage blocks are typically placed first, followed by Type II storage blocks.

[0100] when hour, This represents the maximum coordinates of the first type of data block; that is, when the first type of data block is SLC, the target data block is... For the first type of data block, each word line contains 1 storage page. It contains multiple storage blocks within the target physical plane. The cumulative number of storage pages preceding the target data block is the total number of storage pages contained in the preceding data blocks. This cumulative number of storage pages can be determined using the following formula:

[0101]

[0102] in, This indicates the cumulative number of storage pages preceding the target data block, first set to... , This indicates the block number, which is counted starting from 0. This indicates the total number of word lines in each memory block.

[0103] For example, such as Figure 3 The diagram shown is an exemplary physical plane structure provided in this application embodiment. Different storage block coordinates of the NAND structure use different SLC / MLC / TLC / QLC modes to store data, that is, the size of the page dimension can also change with the change of storage block coordinates. Typically, SLC / TLC and SLC / QLC are used in combination. Figure 3 For mixed use of SLC / QLC, when the storage block coordinates Located in the SLC mode region, the page dimension size is fixed at 1, when the storage block coordinates In the QLC mode region, the size of the page dimension is related to the word line coordinates. The storage blocks are used in SLC mode. The storage blocks are used in QLC mode, where The number of storage blocks. When hour, ,when hour, From the number The section where wl is located is determined by the section where wlg is located. Let the section number where wl is located be... ,but , That is, the first three blks are used in SLC mode, and the remaining blks are used in QLC mode. Assuming there is only one storage string, taking three wlks as an example, the word lines... , and This represents any three adjacent word lines, where... The WL contains only 3 pages. , ,when hour, ,when hour, .

[0104] Accordingly, when the target minimum write unit is within the first type of data block region, the cumulative number of storage pages before the target data block is calculated using a formula.

[0105] Specifically, in one embodiment, the storage page offset of the data write request in the target data block can be determined based on the cumulative number of storage pages before the target data block coordinates and the target word line coordinates in the low-dimensional information; the physical byte offset corresponding to the data write request can be determined based on the storage page offset of the data write request in the target data block, the target storage page coordinates, the number of minimum write units contained in each storage page, the target minimum write unit coordinates, and the physical byte size of each minimum write unit.

[0106] Specifically, the coordinates of the target word line in the low-dimensional information are: The storage page offset of the data write request in the target data block is determined by the cumulative number of storage pages before the target word line within the storage block containing the target data block. This storage page offset in the target data block can be determined based on the following formula:

[0107]

[0108] in, This represents the cumulative number of pages stored before the target word line, i.e., the page offset within the target data block. This represents the cumulative number of storage pages preceding the target data block. Indicates the coordinates of the target character line.

[0109] Accordingly, when the target minimum write unit is within the first type of data block region, the cumulative number of storage pages before the target word line and the storage page offset before the target storage page are calculated by formula.

[0110] Specifically, in one embodiment, the physical byte offset corresponding to the data write request can be determined based on the following formula:

[0111]

[0112] in, This represents the physical byte offset corresponding to the data write request. This indicates the storage page offset within the target data block for the data write request. Indicates the coordinates of the target storage page. This represents the minimum number of write units contained in each memory page. This represents the coordinates of the smallest written cell of the target. This represents the physical bytes of each smallest unit of writing.

[0113] Accordingly, when the target minimum write unit is within the first type of data block area, the physical byte offset corresponding to the data write request is calculated by formula.

[0114] Specifically, in one embodiment, when the target data block type is the second type, the cumulative number of storage pages before the target data block coordinates is determined based on the maximum coordinates of the first type of data block, the total number of word lines of the first type of data block, the target data block coordinates, and the total number of storage pages contained in the second type of storage block; the storage area of ​​the target storage block is traversed, and the currently traversed storage area is taken as the target storage area; the target word line coordinates are taken as word line traversal coordinates; it is determined whether the word line traversal coordinates exceed the last word line in the target storage area; if the word line traversal coordinates do not exceed the last word line in the target storage area, the storage page offset of the data write request in the target data block is determined based on the cumulative number of storage pages before the target data block coordinates, the target word line coordinates, and the number of storage pages contained in each word line in the target storage area.

[0115] Specifically, for the second type of data block, when the second type of data block is a QLC, the target data block is... The second type of data block contains 1, 2, 3, or 4 memory pages per word line. For any given target physical plane, the first type of memory blocks are typically placed first, followed by the second type of memory blocks. Indicates from the first The storage blocks at the beginning and after this block are all type 2 storage blocks. hour, ,when hour, It will be numbered The location of the word line is determined by the storage area.

[0116] Specifically, in one embodiment, the word line traversal coordinates are determined based on the following formula:

[0117]

[0118] in, Indicates the coordinates of the word line traversal. Indicates the coordinates of the target character line.

[0119] Specifically, the target data block contains multiple storage areas. Different storage areas contain different numbers of word lines, and the number of storage pages contained within each word line varies. Each storage area is traversed sequentially, and the currently traversed storage area is designated as the target storage area. It is then determined whether the word line traversal coordinates exceed the last word line within the target storage area. If the coordinates of the character line traversal do not exceed the last character line in the target memory area, then the target character line coordinates exist within the current target memory area. Indicates the number of word lines contained in the target memory area. Indicates the number of stored strings. This represents the coordinates of the last word line in the target storage area. If the word line traversal coordinates do not exceed the last word line in the target storage area, the storage page offset before the target word line is determined, which is the storage page offset of the data request in the target data block.

[0120] Accordingly, when the target data block is of the second type, since the number of storage pages contained in the word line is different in different storage areas, the storage areas are traversed sequentially by word line traversal coordinates, and the storage pages of the traversed storage areas are accumulated. This achieves the accumulation of the number of storage pages in the second type of target data block, thereby providing data support for determining the physical offset of the target minimum write unit.

[0121] When the target smallest write unit is within the second type of data block area, the target data block is first determined, and then the target storage area is traversed by word line traversal coordinates. By traversing in sequence, the target word line corresponding to the data write request is gradually located.

[0122] Specifically, in one embodiment, when the target data block type is the second type, the cumulative number of storage pages preceding the target data block coordinates can be determined based on the following formula:

[0123]

[0124] in, This represents the cumulative number of storage pages preceding the target data block coordinates. This represents the maximum coordinates of the first type of data block. This indicates the total number of word lines in a data block of type 1. Indicates the coordinates of the target data block. This indicates the total number of storage pages contained in the second type of storage block.

[0125] Specifically, This represents the cumulative number of storage pages in the first type of data block preceding the target data block. This indicates the total number of second-type data blocks preceding the target data block. This represents the cumulative number of storage pages in the second type of data blocks preceding the target data block.

[0126] Specifically, in one embodiment, the storage page offset of the data write request in the target data block is determined based on the following formula:

[0127]

[0128] in, This represents the page offset within the target data block, i.e., the cumulative number of pages preceding the target data block coordinates. This represents the cumulative number of storage pages preceding the target data block. Indicates the coordinates of the word line traversal. This indicates the number of memory pages contained in each word line of the target memory area.

[0129] Accordingly, because the number of storage pages contained in the word lines of different storage areas within a second-type data block varies, the total number of storage pages contained in different second-type data blocks also varies. The total number of storage pages for the second type of data block is calculated separately and accumulated with the total number of storage pages for the first type of data block to obtain the total number of all storage pages before the target data block, i.e., the cumulative number of storage pages, which narrows the range of the smallest write unit to the target data block.

[0130] Specifically, in one embodiment, the storage device simulation method further includes: when the word line traversal coordinates exceed the last word line in the target storage area, determining a storage page count accumulation value based on the number of word line groups, the number of storage strings, and the number of storage pages contained in each word line in the target storage area; accumulating the storage page count accumulation value to the cumulative storage page count to update the cumulative storage page count; updating the word line traversal coordinates based on the number of word line groups and the number of storage strings in the target storage area; continuing to traverse the target storage block to update the target storage area, and returning to the step of determining whether the word line traversal coordinates exceed the last word line in the target storage area, until the word line traversal coordinates do not exceed the last word line in the target storage area.

[0131] Specifically, when If the traversal coordinates of the character line exceed the last character line in the target storage area, that is, the target character line coordinates do not exist in the current target storage area, then continue traversing the next storage area. The next storage area is determined as the target storage area, and the accumulated value of the storage page number is determined.

[0132] Specifically, in one embodiment, the word line traversal coordinates can be updated based on the following formula:

[0133]

[0134] in, Indicates the coordinates of the word line traversal. Indicates coordinates as The number of word lines in the target memory area.

[0135] Specifically, the next storage area is identified as the target storage area, and the process returns to the step of determining whether the word line traversal coordinates exceed the last word line in the target storage area, until the word line traversal coordinates do not exceed the last word line in the target storage area.

[0136] Accordingly, by iterating through the loop and comparing the word line traversal coordinates with the last word line of the target storage area, the target storage area where the target minimum write unit is located is further determined after the target data block is determined. This allows for the subsequent calculation of the physical offset of the target minimum write unit, thus obtaining the cumulative number of storage pages before the target storage area.

[0137] Specifically, in one embodiment, the cumulative number of storage pages can be updated based on the following formula:

[0138]

[0139] in, This indicates the updated cumulative number of storage pages. This indicates the cumulative number of stored pages before the update. This represents the accumulated value of the storage page count. Indicates the number of word line groups contained in the target memory area. Indicates the number of stored strings. This indicates the number of memory pages contained in each word line of the target memory area. If the target word line coordinates do not exist in the current target memory area, the number of memory pages in the current target memory area is added to the cumulative number of memory pages before the update.

[0140] Accordingly, through This allows for the accumulation of the total number of pages in the target storage area if the current target storage area is not the storage area where the smallest write unit is located during a single traversal of the target storage area.

[0141] Specifically, in one embodiment, a user's read / write test request for the storage device can also be obtained; in response to the read / write test request, a read / write test is performed on the simulated file system to obtain the read / write test simulation result; and the read / write test simulation result is used as the read / write test result of the storage device.

[0142] Specifically, the storage device simulation method is used to test whether the storage firmware has any abnormalities. First, a user's data write request to the storage device is obtained. The storage device responds to the data write request, converting the logical address information of the data write request into physical address information using the device firmware. Based on the physical address information, the data is written to the simulated file system and simultaneously written to the NAND flash memory. The user then sends a data read request to the storage device. The logical address information of the data read request is the same as that of the data write request. The storage device firmware then converts the logical address information of the data read request into physical address information, locates the target file in the simulated file system based on the physical address information, and reads the data from the target file. By comparing the written data and the read data, it is determined whether the storage firmware has any abnormalities. When the written data and the read data are the same, the read / write test simulation result indicates that the storage firmware is normal, and therefore the read / write test result of the storage device is normal. When the written data and the read data are different, the read / write test simulation result indicates that the storage firmware has an abnormality, and therefore the read / write test result of the storage device is abnormal.

[0143] Accordingly, when the storage firmware exhibits anomalies, the logical address information is converted into different physical address information during read and write test requests. By performing a write test request first and then a read test request using the storage firmware, the consistency of the obtained data is determined, thus enabling testing for storage firmware anomalies. Furthermore, during the testing process, since the simulated file system can realistically simulate the physical structure of NAND, writing data to the simulated file system can also test the storage firmware, avoiding the damage caused by directly writing to NAND when the storage firmware is faulty, thereby extending the lifespan of the NAND.

[0144] Specifically, the steps for determining the physical byte offset corresponding to the data write request include:

[0145] 1. Locate a specific file in the file system based on the target channel coordinates, target core coordinates, target logical unit coordinates, and target physical plane coordinates;

[0146] 2. Initialize temporary variables ;

[0147] 3. If Then place Otherwise

[0148] ;

[0149] 4. If Then place Otherwise, place ,make from Iterate through and execute the following steps in a loop:

[0150] (1) If Then place If the loop terminates, proceed to the next step;

[0151] (2) Place ;

[0152] (3) Place Then proceed to the next cycle;

[0153] 5. Place ;

[0154] 6. Return Then end the calculation.

[0155] Specifically, in one embodiment, a historical test database is constructed to record past firmware version information and specific scenario parameters that trigger vulnerabilities, including logical address ranges, write / erase frequencies, and types of address translation errors, such as out-of-bounds errors, duplicate mappings, and pattern misjudgments. When testing new firmware, the firmware condition is analyzed, and recommendations are made based on common firmware issues in the historical test database, suggesting that users prioritize testing in those areas. By utilizing the historical test database, testing time is reduced and testing efficiency is improved.

[0156] The storage device simulation method provided in this application includes: acquiring attribute information of the storage device; determining storage structure information of the storage device based on the attribute information; creating a simulated file system for the storage device based on the storage structure information; when any data write request is received, determining the corresponding physical address information based on the logical address information of the data write request and the storage firmware of the storage device; and writing the data to be written in the data write request to the simulated file system based on the physical address information. The method provided above determines the storage structure information of the storage device based on the acquired attribute information, then creates a simulated file system for the storage device based on the storage structure information. When any data write request is received, the logical address information of the data write request is converted to physical address information through the storage firmware of the storage device, and then the data to be written in the data write request is written to both the storage device and the simulated file system based on the physical address information, thus keeping the simulated file system synchronized with the storage device. When performing read / write tests on the storage firmware, using the simulated file system instead of the storage device can achieve the same test effect as directly performing read / write tests on the storage device, avoiding the wear and tear on the storage device caused by directly writing read / write test data to the storage device, and extending the lifespan of the storage device.

[0157] Furthermore, obtaining the storage device's attribute information provides data support for determining its storage structure. The storage structure information characterizes the physical condition of the NAND flash memory, providing a data reference for subsequently creating a simulated file system for the storage device. Creating a simulated file system allows data to be written to the simulated file system during firmware testing, avoiding direct writing to the storage device. The eight-dimensional structure of physical address information characterizes the physical location corresponding to the data write request, as well as its position in the simulated file system, ensuring data can be written to the corresponding file location. The simulated file system mimics the actual situation of the storage device, preventing repeated writes and erasures caused by writing data to incorrect addresses when the storage firmware malfunctions, thus extending the storage device's lifespan. Based on the storage device's attribute information—the number of storage strings per block, the number of storage areas, the number of storage pages contained in each word line of each storage area, and the number of word line groups contained in each storage area—data support is provided for subsequent calculations of the storage structure information. This storage structure information characterizes the storage device's structure, facilitating the creation of a corresponding simulated file system based on this information. The target physical plane was determined using high-dimensional information, and the data unit corresponding to the data write request was located using low-dimensional information. By splitting the location information represented by the physical address information, the information stored in the storage device was converted into the location information stored in the simulated file system, facilitating the storage of the data to be written into the simulated file system. When the target minimum write unit is within the first type of data block region, the cumulative number of storage pages before the target data block was calculated using a formula. When the target minimum write unit is within the first type of data block region, the cumulative number of storage pages before the target word line and the storage page offset before the target storage page were calculated using a formula. When the target minimum write unit is within the first type of data block region, the physical byte offset corresponding to the data write request was calculated using a formula. In the case of the target data block being of the second type, since the number of storage pages contained in the word line varies in different storage areas, the storage areas are traversed sequentially by word line traversal coordinates, and the storage pages of the traversed storage areas are accumulated. This achieves the accumulation of the storage page count for the second type of target data block, thus providing data support for determining the physical offset of the target minimum write unit. Because the number of storage pages contained in the word lines of different storage areas within a Type II data block varies, the total number of storage pages contained in different Type II data blocks also varies. The total number of storage pages for the second type of data block is calculated separately and accumulated with the total number of storage pages for the first type of data block. This yields the total number of storage pages preceding the target data block, i.e., the cumulative number of storage pages. This narrows the range for locating the target minimum write unit to the target data block. By iterating through the loop and comparing the word line traversal coordinates with the last word line of the target storage area, the target storage area containing the target minimum write unit is further determined after the target data block is identified. This is used to calculate the physical offset of the target minimum write unit and obtain the cumulative number of storage pages preceding the target storage area. This system enables the accumulation of the total number of pages in the target memory area if the current target memory area is not the memory area containing the smallest write unit during a single traversal of the target memory area. When the storage firmware has an anomaly, logical address information is converted into different physical address information in read and write test requests. By performing a write test request first and then a read test request using the storage firmware, the consistency of the obtained data is determined, thus enabling testing for storage firmware anomalies. Furthermore, since the simulated file system can realistically simulate the physical structure of NAND, writing data to the simulated file system during the testing process can also achieve testing of the storage firmware, avoiding the damage caused by directly writing to NAND when the storage firmware has anomalies, and extending the lifespan of NAND.

[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0159] Embodiments of this application also provide a storage device simulation apparatus for executing the storage device simulation method provided in the above embodiments.

[0160] like Figure 4 The diagram shown is a structural schematic of a storage device simulation apparatus provided in an embodiment of this application. The storage device simulation apparatus 40 includes: an acquisition module 401, a first determination module 402, a creation module 403, a second determination module 404, and a writing module 405.

[0161] The system includes: an acquisition module for acquiring the attribute information of the storage device; a first determination module for determining the storage structure information of the storage device based on the attribute information; a creation module for creating a simulated file system for the storage device based on the storage structure information; a second determination module for determining the corresponding physical address information based on the storage firmware of the storage device and the logical address information of the data write request when any data write request is received; and a writing module for writing the data to be written in the data write request to the simulated file system based on the physical address information.

[0162] For a description of the features in the embodiment corresponding to the storage device simulation apparatus, please refer to the relevant description of the embodiment corresponding to the storage device simulation method, which will not be repeated here.

[0163] Embodiments of this application also provide an electronic device, such as... Figure 5 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described storage device simulation method embodiments.

[0164] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described storage device emulation method embodiments when running.

[0165] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0166] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described storage device emulation method embodiments.

[0167] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described storage device emulation method embodiments.

[0168] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0169] The foregoing has provided a detailed description of a storage device simulation method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for simulating a storage device, characterized in that, include: Retrieve the attribute information of the storage device; Based on the attribute information of the storage device, determine the storage structure information of the storage device; Based on the storage structure information of the storage device, a simulated file system for the storage device is created; When any data write request is received, the corresponding physical address information is determined based on the storage firmware of the storage device and the logical address information of the data write request. Based on the physical address information, the data to be written in the data write request is written to the simulated file system; The step of writing the data to be written in the data write request to the simulated file system according to the physical address information includes: Based on the target physical plane represented by the high-dimensional information of the physical address information, the corresponding target file is located in the simulated file system; wherein, both the target physical plane and the target file include multiple data blocks; Based on the low-dimensional information of the physical address information, the data to be written in the data write request is written to the target file; The high-dimensional information includes target channel coordinates, target core coordinates, target logical unit coordinates, and target physical plane coordinates. The step of writing the data to be written in the data write request to the target file based on the low-dimensional information of the physical address information includes: Based on the target data block coordinates in the low-dimensional information, the target data block type corresponding to the data write request is determined; wherein, the target data block type is divided into two types: a first type and a second type. In the first type of data block, the number of storage pages contained in each word line is uniform, while in the second type of data block, the number of storage pages contained in each word line is not uniform. When the target data block type is a first type, the cumulative number of storage pages before the target data block coordinates is determined based on the target data block coordinates, the total number of word lines of the first type of data block, and the number of storage pages contained in each word line of the first type of data block. The physical byte offset corresponding to the data write request is determined based on the cumulative number of storage pages before the target data block coordinates, the target word line coordinates, the target storage page coordinates, the target minimum write unit coordinates, and the physical byte size of each minimum write unit in the low-dimensional information. Based on the physical byte offset, the data to be written in the data write request is written to the target file; The low-dimensional information includes the target data block coordinates, target word line coordinates, target storage page coordinates, and target minimum write unit coordinates.

2. The storage device simulation method according to claim 1, characterized in that, The step of determining the storage structure information of the storage device based on the attribute information of the storage device includes: The storage structure information of the storage device is determined based on the number of storage strings, the number of storage areas, the number of storage pages contained in the word lines of each storage area, and the number of word line groups contained in each storage area. The attribute information of the storage device includes the number of storage strings in each storage block, the number of storage areas, the number of storage pages contained in the word line of each storage area in the storage device, and the number of word line groups contained in each storage area.

3. The storage device simulation method according to claim 2, characterized in that, The step of determining the storage structure information of the storage device based on the number of storage strings, the number of storage areas, the number of storage pages contained in the word lines of each storage area, and the number of word line groups contained in each storage area includes: For any storage block in the storage device, the number of word line groups corresponding to various numbers of storage pages in the storage block is determined based on the number of storage pages contained in each word line of each storage area and the number of word line groups contained in each storage area. The total number of word lines in the memory block is determined based on the number of word lines in each memory area and the number of memory areas. Alternatively, the total number of word lines in the memory block can be determined based on the number of word lines corresponding to the various memory page numbers. The total number of word lines in the storage block is determined based on the total number of word line groups in the storage block and the number of storage strings. The total number of storage pages in the storage block is determined based on the number of word lines corresponding to the various storage page numbers and the number of storage strings. The storage structure information of the storage device includes the total number of word line groups, the total number of word lines, and the total number of storage pages for each storage block.

4. The storage device simulation method according to claim 1, characterized in that, The step of determining the physical byte offset corresponding to the data write request based on the cumulative number of storage pages prior to the target data block coordinates, the target word line coordinates, the target storage page coordinates, the target minimum write unit coordinates, and the physical byte size of each minimum write unit in the low-dimensional information includes: The storage page offset of the data write request in the target data block is determined based on the cumulative number of storage pages before the target data block coordinates and the target word line coordinates in the low-dimensional information. The physical byte offset corresponding to the data write request is determined based on the storage page offset of the data write request in the target data block, the target storage page coordinates, the number of minimum write units contained in each storage page, the target minimum write unit coordinates, and the physical byte size of each minimum write unit.

5. The storage device simulation method according to claim 4, characterized in that, The step of determining the physical byte offset corresponding to the data write request based on the storage page offset of the data write request in the target data block, the target storage page coordinates, the number of minimum write units contained in each storage page, the coordinates of the target minimum write unit, and the physical byte size of each minimum write unit includes: The physical byte offset corresponding to the data write request is determined based on the following formula: in, This represents the physical byte offset corresponding to the data write request. This indicates the storage page offset of the data write request within the target data block. Indicates the coordinates of the target storage page. This represents the minimum number of write units contained in each memory page. This represents the coordinates of the smallest write unit of the target. This represents the physical bytes of each smallest unit of writing.

6. The storage device simulation method according to claim 4, characterized in that, The method further includes: When the target data block type is the second type, the cumulative number of storage pages before the target data block coordinates is determined based on the maximum coordinates of the first type data block, the total number of word lines of the first type data block, the target data block coordinates, and the total number of storage pages contained in the second type storage block. Traverse the target storage block and use the currently traversed storage area as the target storage area; Use the target character line coordinates as the character line traversal coordinates; Determine whether the word line traversal coordinates exceed the last word line in the target storage area; If the word line traversal coordinates do not exceed the last word line in the target storage area, the storage page offset of the data write request in the target data block is determined based on the cumulative number of storage pages before the target data block coordinates, the target word line coordinates, and the number of storage pages contained in each word line in the target storage area.

7. The storage device simulation method according to claim 6, characterized in that, When the target data block type is the second type, the cumulative number of storage pages before the target data block coordinates is determined based on the maximum coordinates of the first type of data block, the total number of word lines of the first type of data block, the target data block coordinates, and the total number of storage pages contained in the second type of storage block, including: When the target data block type is type two, the cumulative number of storage pages preceding the coordinates of the target data block is determined based on the following formula: in, This represents the cumulative number of storage pages preceding the coordinates of the target data block. This represents the maximum coordinates of the data block of the first type. This indicates the total number of word lines in the data block of the first type. Indicates the coordinates of the target data block. This indicates the total number of storage pages contained in the second type of storage block.

8. The storage device simulation method according to claim 6, characterized in that, The method further includes: If the word line traversal coordinates exceed the last word line in the target storage area, the cumulative value of the storage page count is determined based on the number of word line groups, the number of storage strings, and the number of storage pages contained in each word line in the target storage area. The accumulated value of the number of storage pages is added to the cumulative number of storage pages to update the cumulative number of storage pages; Update the word line traversal coordinates based on the number of word line groups and the number of storage strings contained in the target storage area; Continue traversing the target storage block to update the target storage area, and return to the step of determining whether the word line traversal coordinates exceed the last word line in the target storage area, until the word line traversal coordinates do not exceed the last word line in the target storage area.

9. The storage device simulation method according to claim 8, characterized in that, The step of adding the accumulated value of the storage page count to the cumulative storage page count to update the cumulative storage page count includes: The cumulative number of stored pages is updated based on the following formula: in, This indicates the updated cumulative number of storage pages. This indicates the cumulative number of stored pages before the update. This represents the accumulated value of the storage page count. This indicates the number of word line groups contained in the target storage area. Indicates the number of stored strings. This indicates the number of memory pages contained in each word line of the target memory area.

10. The storage device simulation method according to claim 8, characterized in that, The method further includes: Obtain the user's read / write test request for the storage device; In response to the read / write test request, a read / write test is performed on the simulated file system to obtain the read / write test simulation results. The read / write test simulation results are used as the read / write test results of the storage device.

11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the storage device emulation method as described in any one of claims 1 to 10 when executing the computer program.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the storage device emulation method as described in any one of claims 1 to 10.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the storage device emulation method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Address translation for a non-volatile memory storage device

    CN105745627A

  • Data writing method and storage equipment

    CN107967121A