Data writing verification method and device, electronic equipment and storage medium
By creating a target write sequence list and performing sequence verification, the problem of write operation errors in storage devices is solved, improving the correctness of data writing and the security of storage devices.
Patent Information
- Application Number
- CN202511099315.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-21
AI Technical Summary
In existing technologies, the flash translation layer of storage devices may have write operation errors when writing data, which reduces the security of the storage device.
By obtaining the attribute information of the storage device, a target write order table is created, including the write type and write position corresponding to each write sequence number. The order is verified when a write request is made to ensure that the write order meets the QLC write requirements.
It improves the correctness of data writing, avoids errors caused by incorrect write type or location, and enhances the security of storage devices.
Smart Images

Figure CN120994128A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a data write verification method and device, electronic equipment and storage medium. BACKGROUND
[0002] A solid state disk (SSD) is a storage device taking a semiconductor flash memory as a core storage medium, and the underlying storage medium has multiple write modes, and different write modes have different write requirements. Among them, the Quad Level Cell (QLC) write mode requires that the data of most word lines needs to be written twice, namely coarse writing and fine writing, and the coarse writing and fine writing need to be alternately performed, and the coarse writing and fine writing of each word line must also contain the write operation of other word lines.
[0003] In the related art, the Flash Translation Layer (FTL) of the storage device usually strictly follows the write requirements of the write mode during the process of writing data to the underlying storage medium, but there is still a possibility of write operation error, which reduces the security of the storage device. SUMMARY
[0004] The present application provides a data write verification method, device, electronic equipment and storage medium to at least solve the problem of possible write operation error of the Flash Translation Layer of the storage device when writing data in the related art.
[0005] The present application provides a data write verification method, comprising:
[0006] obtaining attribute information of a storage device;
[0007] creating a target write sequence table of the storage device according to the attribute information of the storage device; wherein the target write sequence table includes a write type and a write position corresponding to each write sequence number, the write sequence number is used to represent the sequence of write operations, the write type is divided into two types of coarse writing and fine writing, and the write position includes a target word line of the write operation;
[0008] when any data write request is obtained, determining a verification table item corresponding to a current write sequence number in the target write sequence table according to the current write sequence number of the data write request;
[0009] performing sequence verification on the data write request according to the target write type and the target write position represented by the verification table item, to obtain a sequence verification result;
[0010] in a case where the sequence verification result represents that the write sequence of the data write request is correct, responding to the data write request.
[0011] The application further provides a data write verification device, comprising:
[0012] An acquisition module is configured to acquire attribute information of the storage device.
[0013] A creation module is configured to create a target write sequence table of the storage device according to the attribute information of the storage device, wherein the target write sequence table comprises a write type and a write position corresponding to each write sequence number, the write sequence number is used to represent the sequence of write operations, the write type is divided into two types of rough write and fine write, and the write position comprises a target word line of the write operation.
[0014] A determination module is configured to determine a verification table item corresponding to a current write sequence number in the target write sequence table according to the current write sequence number of a data write request when the data write request is obtained.
[0015] A verification module is configured to perform sequence verification on the data write request according to the target write type and the target write position represented by the verification table item, and obtain a sequence verification result.
[0016] A response module is configured to respond to the data write request in a case where the sequence verification result represents that the write sequence of the data write request is correct.
[0017] The application further provides an electronic device, comprising 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 data write verification methods.
[0018] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the data write verification methods.
[0019] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any of the data write verification methods.
[0020] According to the application, a target write order table of the storage device is created according to the attribute information of the storage device, wherein the target write order table comprises a write type and a write position corresponding to each write sequence number, when any data write request is obtained, a verification table item corresponding to the current write sequence number in the target write order table is determined according to the current write sequence number of the data write request, and the order verification of the data write request is verified according to the target write type and the target write position represented by the verification table item, and a sequence verification result is obtained, when the sequence verification result represents that the write order of the data write request is correct, the data write request is responded to, so as to avoid the write type or the write position of the data write request not meeting the QLC write requirement, to ensure the correctness of data writing and improve the security of the storage device. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 The network structure based on the embodiments of the present application is shown in the figure.
[0023] Figure 2 The flowchart of the data write verification method provided by the embodiments of the present application is shown in the figure.
[0024] Figure 3 The flowchart of the exemplary write requirement provided by the embodiments of the present application is shown in the figure.
[0025] Figure 4 The flowchart of the exemplary data write verification provided by the embodiments of the present application is shown in the figure.
[0026] Figure 5 The structure diagram of the data write verification device provided by the embodiments of the present application is shown in the figure.
[0027] Figure 6 The structure diagram of the electronic device provided by the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0029] It should be noted that in the description of the present application, the term "comprising", "containing" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a list of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such process, method, article or apparatus. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0030] Solid state disk (SSD) is a storage device with semiconductor flash memory as the core storage medium, and the underlying storage medium is called Nand, which has been widely used in recent years. According to the number of data bits stored in a bottom Nand memory cell, the write mode of Nand can be divided into SLC, MLC, TLC and QLC 4 kinds, corresponding to 1, 2, 3, 4 bits of data stored in each memory cell respectively. Among them, QLC is the latest write mode developed by major Nand manufacturers. Word line (Word Line, abbreviated as: wl) is the key wire to control the read and write operation of the memory cell, and it constitutes the core connection structure of the flash memory array together with the bit line. The core function of the word line is to select the memory cell of a specific row, and by applying different voltages, it controls these cells to perform write, read or erase operations.
[0031] From the perspective of FTL layer, the main difference between QLC and SLC / MLC / TLC is that most of the data of the word line needs to be written twice to complete the continuous saving of data, which we call coarse writing and fine writing respectively. For SLC / MLC / TLC structure Nand, for any memory block (Block, abbreviated as: blk), the write operation to Nand must be performed in serial and continuous order from small to large wl coordinates, but for QLC structure Nand, since most of the wl in a blk needs to be written twice for coarse writing and fine writing, and a few wl only needs to be written once, coarse writing and fine writing need to be performed alternately, and between coarse writing and fine writing of each wl, the write of other wl must be included to meet the requirements of QLC Nand for writing.
[0032] In order to solve the above technical problems, the embodiment of the application provides a data write verification method and device, electronic equipment and a storage medium, the method comprising: obtaining attribute information of a storage device; creating a target write order table of the storage device according to the attribute information of the storage device; wherein the target write order table comprises a write type and a write position corresponding to each write serial number, the write serial number is used to represent the sequence of write operations, the write type is divided into two types of rough write and fine write, and the write position comprises a target word line of the write operation; when any data write request is obtained, a verification table item corresponding to a current write serial number of the data write request is determined in the target write order table according to the current write serial number; the data write request is sequentially verified according to the target write type and the target write position represented by the verification table item, and a sequential verification result is obtained; and in the case that the sequential verification result represents that the write sequence of the data write request is correct, the data write request is responded. The method provided by the above scheme, because the target write order table of the storage device is created according to the attribute information of the storage device, wherein the target write order table comprises a write type and a write position corresponding to each write serial number, when any data write request is obtained, a verification table item corresponding to a current write serial number of the data write request is determined in the target write order table according to the current write serial number, the sequential verification of the data write request is performed according to the target write type and the target write position represented by the verification table item, and a sequential verification result is obtained, and when the sequential verification result represents that the write sequence of the data write request is correct, the data write request is responded, so as to avoid the write type or the write position of the data write request not meeting the QLC write requirement, to ensure the correctness of data write and improve the security of the storage device.
[0033] In order to make the person skilled in the art better understand the application scheme, the application will be further described in detail below in combination with the drawings and specific embodiments.
[0034] In combination with the specific application environment architecture or the specific hardware architecture on which the execution of the data write verification method depends, the specific application environment architecture or the specific hardware architecture is described here.
[0035] Firstly, the network structure based on the application is described:
[0036] The data write verification method, device, electronic equipment and storage medium provided by the embodiment of the application are suitable for verifying data write requests, such as Figure 1As shown in the figure, the network structure based on which the embodiments of the present application are based on mainly includes a user end and a server end, the server end includes a to-be-written verification storage device, the user end is configured to initiate a data writing request to the server end, and the server end is configured to respond to the data writing request initiated by the user end. In the process of writing data to the to-be-written verification storage device, the to-be-stored data is verified based on the data writing verification method provided by the embodiments of the present application.
[0037] The embodiments of the present application provide a data writing verification method for verifying a data writing request. The execution subject of the embodiments of the present application is an electronic device, such as a server, a desktop computer, a notebook computer, a tablet computer and other electronic devices that can be used for data writing verification.
[0038] As Figure 2 shown, the figure is a flowchart of the data writing verification method provided by the embodiments of the present application. The method comprises the following steps.
[0039] In step 201, attribute information of a storage device is acquired.
[0040] Specifically, the storage device includes a plurality of storage blocks. For any storage block (blk), the storage block includes a plurality of word line groups (wl group, referred to as wlg for short), and one word line group contains a plurality of word lines. All word lines of the storage block are divided into a plurality of storage strings (String), and one storage string contains a plurality of word lines. All word line groups are divided into a plurality of writing sections as a unit, so all word lines (wl) contained therein are also divided into a plurality of writing sections (Section). The writing times of all word lines in each writing section are required to be consistent. If the word line needs to be written in two types of coarse writing and fine writing, it needs to be written twice. If the word line only needs to be written in coarse writing, it only needs to be written once. The requirement for the writing times of all word lines in each writing section is that all of them require to be written twice or all of them require to be written only once. The attribute information of the storage device is provided by the manufacturer. The attribute information of the device includes the number of storage blocks of the storage device, the number of writing sections of each storage block, the number of storage strings, the writing times of each writing section and the number of word line groups contained in each writing section.
[0041] Correspondingly, the attribute information of the storage device provides data basis for creating the target writing order table.
[0042] In step 202, a target writing order table of the storage device is created according to the attribute information of the storage device.
[0043] The target writing order table includes a writing type and a writing position corresponding to each writing sequence number. The writing sequence number is used to represent the sequence of writing operations. The writing type is divided into two types of coarse writing and fine writing. The writing position includes the target word line of the writing operation.
[0044] As shown in the flow diagram of the exemplary write requirement provided by the embodiment of the present application, most Nand manufacturers require that the write of QLC Nand meet the following requirements: all wls contained in a blk in each Nand are divided into several write partitions. Nand manufacturers require that the FTL designer must write the Nand in a zigzag write order. The diagram shows a case of 3 storage strings. Each solid grid represents a wl, which is separated by a dashed line. The left and right parts represent thick writing and thin writing, respectively. a represents the wl number, and b represents the number of times of writing (first or second). b=0 represents thick writing (first writing), and b=1 represents thin writing (second writing). Each table from left to right represents the wls contained in a storage string. The arrow indicates the mandatory write order. Figure 3
[0045] Specifically, the numbers in the middle part of the target write order table represent the write sequence numbers of different wls of a storage block. Each write sequence number includes a corresponding write type and a write position. The write type is divided into two types: thick writing and thin writing. The numbers in the corresponding cells represent the write sequence numbers, which represent the write order of thick writing or thin writing of the target word line. NA indicates that the target word line does not perform a thin writing operation, i.e., the number of write times is 1. The write sequence number starts from 0. The write position includes the target word line of the write operation, and the sequence number of the word line also starts from 0. Any storage block working in QLC mode in the Nand must be written in the above-mentioned order of wl. The target write order table is shown in Table 1.
[0046] Table 1
[0047]
[0048]
[0049] Correspondingly, the target write order table provides a standard for data write verification.
[0050] In step 203, when any data write request is obtained, the verification table item corresponding to the current write sequence number of the data write request is determined in the target write order table according to the current write sequence number of the data write request.
[0051] Specifically, when any data write request is received, since the write sequence number of the data write request is incremental, the write sequence number (current write sequence number) of the next data write request (current data write request) can be determined after the verification of the previous data write request is completed, so as to sequentially locate the verification table item corresponding to the current write sequence number in the target write order table.
[0052] Correspondingly, the data write request finds the corresponding verification standard through the determined verification entry, and the verification entry is a single cell in Table 1, representing the target write type and the target write position.
[0053] In step 204, the data write request is sequentially verified according to the target write type and the target write position represented by the verification entry, and a sequential verification result is obtained.
[0054] Specifically, the information contained in the data write request is compared with the information represented by the verification entry, and a sequential verification result is obtained. The data verification result includes two types of correct write sequence and incorrect write sequence of the data write request. According to the comparison between the write type and the write position corresponding to the write sequence number of the data input request and the target write type and the target write position represented by the verification entry, if both are the same, the sequential verification result is that the write sequence of the data write request is correct, and if there are at least one different, it represents that the write sequence of the data write request is incorrect.
[0055] Correspondingly, whether the data write request is correct or not is represented by the sequential verification result, which reduces the possibility of writing error requests and reduces the write failure.
[0056] In step 205, in the case that the sequential verification result represents that the write sequence of the data write request is correct, the data write request is responded.
[0057] Specifically, in the case that the sequential verification result represents that the write sequence of the data write request is correct, it means that the data write request meets the data write requirement of Nand, and then the data write request can be responded.
[0058] Correspondingly, only correct data write requests can be responded, reducing the write failure and prolonging the service life of the storage device.
[0059] On the basis of the above embodiment, as a kind of implementable mode, in an embodiment, according to the attribute information of storage device, the target write sequence table of storage device is created, including:
[0060] In step 2031, the write times and write sequence traversal range of each write partition are determined according to the attribute information of storage device;Wherein, the storage block of storage device includes multiple write partitions, each write partition includes at least one word line group, and the word line group includes multiple word lines;
[0061] In step 2032, the starting write sequence number is determined by arranging the position information of any write partition in the storage block.
[0062] In step 2033, the write sequence number is sequentially generated from the starting write sequence number in an increasing manner.
[0063] Step 2034, according to the write sequence number, the write times of the write partition and the write sequential traversal range, performing the write sequential traversal of the write partition for the corresponding write times to determine the write type and the write position corresponding to the write sequence number;
[0064] Step 2035, according to the write type and the write position corresponding to each write sequence number, creating a target write sequence table of the storage device.
[0065] The attribute information of the storage device includes the number of storage blocks of the storage device, the number of write partitions of each storage block, the number of storage strings, the write times of each write partition and the number of word line groups contained in each write partition.
[0066] Specifically, the write times of all word lines in each write partition are required to be consistent. According to whether the corresponding word line needs coarse writing and fine writing, it is determined that the write times of the write partition are 2, if the corresponding word line only needs coarse writing, it is determined that the write times of the write partition are 1. A write partition contains multiple word line groups. From the first word line of the first word line group of the write partition to the last word line of the last word line group of the write partition, that is, the write sequential traversal range of the write partition. Among them, O ib represents the sequence number of the next write of each blk, {O ib , ib=0, …, Nb-1} represents its value range, ib represents the number of blk (storage block); Y is represents whether all wl of each Section (write partition) needs two times of writing, 0 represents only one time of writing, 1 represents two times of writing, {Y is , is=0, …, Ns-1} represents its value range, L is represents the number of wlg contained in each Section, {L is, is = 0, …, Ns-1} represents the value range thereof, and is represents the number of Section. Taking Table 1 as an example, there are 19 wlg in total, which are divided into 5 Sections, from top to bottom, Section 0, Section 1, Section 2, Section 3 and Section 4, and the corresponding word line groups thereof are wlg 0, wlg 1-6, wlg 7-9, wlg 10-16 and wlg 17-18 respectively. Taking Table 1 as an example, Nb = 20 indicates that the total number of storage blocks is 20, Ns = 5 indicates that the number of write partitions contained in each storage block is 5, Nr = 6 indicates that the number of storage strings is 6, Y = {0, 1, 0, 1, 0} indicates that the number of writes corresponding to the five write partitions is one, twice, one, twice and one, and L = {1, 6, 3, 7, 2} indicates that the number of word line groups contained in the five write partitions is 1, 6, 3, 7 and 2 respectively.
[0067] Specifically, for any write partition, the arrangement position information is used to determine the starting write sequence number according to the number of write partitions before the write partition and the number of word line groups contained in each write partition before the write partition. Taking Table 1 as an example, the number of write partitions before Section 2 is 2, which are Section 0 and Section 1 respectively, the number of word line groups contained in Section 0 is 1, and the number of word line groups contained in Section 0 is 6, so the starting write sequence number of Section 2 is 72. Then, the write sequence numbers are generated in sequence in an increasing manner from the starting write sequence number. According to the write sequence number, the write number and the write order traversal range of the write partition, the write order traversal of the write partition is performed for the corresponding write number, and the write type and the write position corresponding to the write sequence number can be determined, i.e. whether the write sequence number corresponds to a rough write or a fine write and the target word line, and then the target write order table of the storage device is created according to the write type and the write position corresponding to each write sequence number.
[0068] Correspondingly, the starting write order is determined by the arrangement position information, and the correctness and integrity of the target write order table are guaranteed by the sequential traversal.
[0069] Specifically, in an embodiment, according to the write sequence number, the write number and the write order traversal range of the write partition, the write order traversal of the write partition is performed for the corresponding write number to determine the write type and the write position corresponding to the write sequence number, including in the case where the write number of the write partition is equal to 1, the write order traversal of the write partition is performed for the rough write according to the write sequence number and the write order traversal range of the write partition to determine the rough write and the write position corresponding to the write sequence number.
[0070] Specifically, when the write number of the write partition is equal to 1, it indicates that each word line in the write partition only needs to be coarsely written, and the write sequence of the word line in the write partition is traversed according to the order of the write sequence number and the write sequence to determine the coarse writing and the write position corresponding to the write sequence number. Wherein, represents the wl number that should be written at the ith time of writing, represents the value range thereof, represents whether it is coarse writing or fine writing at the ith time of writing, 0 represents coarse writing, and 1 represents fine writing, represents the value range thereof. For example, for the word line with the write sequence number 28 in Table 1, it indicates that the wl number that should be written at the 28th time of writing is the 20th, and since the wl number starts from 0, it is the 21st word line. it indicates that coarse writing is performed on the word line at the 28th time of writing.
[0071] Correspondingly, by traversing the write partition with the write number 1, the traversal of the word line that only needs to be coarsely written can be completed.
[0072] Specifically, in an embodiment, according to the write sequence number, the write number of the write partition, and the write sequence traversal range, the write partition is traversed according to the write sequence to determine the write type and the write position corresponding to the write sequence number, including: in the case that the write number of the write partition is equal to 2, the write partition is traversed according to the write sequence to determine the coarse writing and the write position corresponding to the write sequence number according to the write sequence number and the write sequence traversal range of the write partition; after determining the coarse writing and the write position corresponding to each write sequence number, the write sequence number is updated, and the fine writing word line of the same storage string of the previous word line group is returned according to the coarse writing word line and the number of storage strings corresponding to the write position to determine the fine writing and the write position corresponding to the write sequence number.
[0073] Specifically, when the write number of the write partition is equal to 2, it indicates that the word line in the write partition needs to be written twice by coarse writing and fine writing. First, the coarse writing order traversal of the word line in the write partition is performed according to the order of the write sequence number and the write order, and the coarse writing and write position corresponding to the write sequence number are determined. Meanwhile, whenever a coarse writing is completed, the write sequence number is updated, and the fine writing word line of the same memory string of the previous word line group is returned according to the coarse writing word line corresponding to the write position and the number of memory strings, so as to determine the fine writing and write position corresponding to the write sequence number. For example, in Table 1, it is assumed that the current write sequence number is 28, the corresponding memory string is String2, and the corresponding word line group is No. 3. Since the word line group is also numbered from 0, the corresponding is the fourth group of word line groups for the No. 3 word line group. When the coarse writing operation of the write sequence number 28 is completed, the write sequence number is updated to 29, and the write position corresponding to the write sequence number 29 is the memory string String2, the corresponding word line group is No. 2, and the fine writing operation is performed thereon. In this way, the write order is zigzag-shaped. When the last word line group of the write partition is traversed, only coarse writing is performed, and the fine writing operation of each word line in the word line group is performed by the next write partition. When the first word line group of the write partition is traversed, according to the requirement, the fine writing operation of each word line in the last word line group of the previous write partition is completed when zigzag-shaped writing is performed.
[0074] Correspondingly, by performing coarse writing first and then fine writing on the fine writing word line of the same memory string of the previous word line group, the data is written in a zigzag-shaped order, which meets the data writing requirement of QLC.
[0075] On the basis of the above-mentioned embodiments, as a kind of implementable mode, in an embodiment, the method further comprises:
[0076] Step 301, according to the number of word line groups contained in each write partition in each storage block represented by the attribute information of the storage device, determine the total number of word line groups of each storage block;
[0077] Step 302, according to the total number of word line groups of each storage block and the number of memory strings, determine the total number of word lines of each storage block;
[0078] Step 303, according to the total number of word lines of each storage block, determine the termination condition of write order traversal of each storage block;
[0079] Step 304, according to the write number of each write partition in each storage block, the number of word line groups contained in each write partition and the number of memory strings represented by the attribute information of the storage device, determine the total write number of each storage block of the storage device;
[0080] Step 305, according to the total write number, determine the maximum value of the write sequence number.
[0081] Specifically, in an embodiment, the total number of word line groups can be determined based on the following formula:
[0082]
[0083] wherein Ng represents the total number of word line groups, i.e., the total number of wlg contained in each blk, Ns represents the total number of Sections contained in each blk, since the write partition is numbered from 0, it is traversed to Ns-1, is represents the number of Section, L is represents the number of wlg contained in each Section. By traversing each write partition, the total number of word line groups of each write partition is accumulated, and the total number of word line groups can be obtained.
[0084] Specifically, in an embodiment, the total number of word lines can be determined based on the following formula:
[0085] Nw = Ng x Nr
[0086] wherein Nw represents the total number of word lines, i.e., the total number of wl contained in each blk, Ng represents the total number of wlg contained in each blk, and Nr represents the total number of String.
[0087] Specifically, in an embodiment, the total number of theoretically all write-once word line groups can be determined based on the following formula:
[0088] a =∑{L is :Y is = 0}
[0089] wherein a represents the total number of theoretically all write-once word line groups, L is represents the number of wlg contained in each Section, and Y is represents whether all wls of each Section need to be written twice. By traversing each write partition, the number of word line groups corresponding to the write partition with one write is accumulated, and the total number of theoretically all write-once word line groups is obtained.
[0090] Specifically, in an embodiment, the total number of actually all write-once word line groups can be determined based on the following formula:
[0091]
[0092] wherein b represents the total number of actually all write-once word line groups. Y ns-1indicates that the number of writes to the last write partition is twice. Since the last word line group of the actual storage block can only be coarsely written, i.e., written only once, but the manufacturer may misconfigure the number of writes to twice when the storage block is shipped, b is used to correct a to ensure that the actual number of writes to the last write partition is one when the number of writes is calculated, and the total number of all word line groups that are actually written only once is obtained.
[0093] Specifically, in an embodiment, the total number of writes can be determined based on the following formula:
[0094] No = 2Nw - bNr
[0095] where No indicates the total number of writes required for each blk, Nw indicates the total number of wls included in each blk, Nr indicates the total number of strings, and b indicates the total number of all word line groups that are actually written only once. When the total number of writes required for each storage block is calculated, all word lines are calculated as being written twice, and then all word lines that are actually written only once are subtracted.
[0096] Specifically, the termination condition of the write sequence traversal of each storage block is that all word lines of the storage block are traversed, and when any data write request is received, whether the total number of word lines is exceeded is determined according to the current write sequence number corresponding to the data write request. When the total number of word lines is exceeded, the termination is performed. Meanwhile, according to the total number of writes, the maximum value of the write sequence number can be determined.
[0097] Correspondingly, the termination condition of the write sequence traversal can be determined by calculating the total number of word line groups and the total number of word lines.
[0098] For example, taking Table 1 above as an example, Nw = 114 indicates that the total number of wls included in each blk is 114, Ng = 19 indicates that the total number of wlg included in each blk is 19, Ns = 5 indicates that the total number of Section included in each blk is 5, Nr = 6 indicates that the total number of String is 6, and No = 192 indicates that the total number of writes required for each blk is 192.
[0099] Based on the above embodiment, as a kind of implementable mode, in an embodiment, before determining the verification table item corresponding to the current write sequence number in the target write sequence table according to the current write sequence number of data write request, the method further includes:
[0100] Step 401, according to the size relationship between the current write sequence number of data write request and the maximum value of write sequence number, it is judged whether data write request exists overwriting exception;
[0101] Step 402, in the case where data write request exists overwriting exception, it is determined that the order verification result of data write request is verification failure.
[0102] Step 403, in the case that the data write request does not exist the overwriting exception, performing the step of determining the verification table item corresponding to the current write sequence number of the data write request in the target write sequence table according to the current write sequence number of the data write request.
[0103] Specifically, after obtaining any data write request, but before traversing the target write sequence table according to the current write sequence number of the data write request, it is necessary to first judge whether the data write request exists the overwriting exception, compare the current write sequence number corresponding to the data write request with the maximum value of the write sequence number, and in the case that the current write sequence number is greater than or equal to the write sequence number, the data write request exists the overwriting exception. In the case that the data write request exists the overwriting exception, it is determined that the sequence verification result of the data write request is verification failure. If the data write request does not exist the overwriting exception, further verification is performed, and the step of determining the verification table item corresponding to the current write sequence number of the data write request in the target write sequence table according to the current write sequence number of the data write request is performed.
[0104] Correspondingly, by judging whether the overwriting exception exists, the possibility of continuing to be verified even if the current write sequence number has exceeded the range of the storage block is reduced, and the system resource consumption is reduced.
[0105] On the basis of the above embodiment, as a kind of implementable mode, in an embodiment, according to the target write type and target write position represented by verification table item, the sequence verification of data write request is carried out, and the sequence verification result is obtained, including:
[0106] Step 2051, judge whether the to-be-written type of data write request is consistent with the target write type represented by verification table item;
[0107] Step 2052, judge whether the to-be-written position of data write request is consistent with the target write position represented by verification table item;
[0108] Step 2053, in the case that the to-be-written type is consistent with the target write type, and the to-be-written position is consistent with the target write position, it is determined that the sequence verification result of data write request is verification success.
[0109] Wherein, when the sequence verification result of data write request is verification success, the write sequence represented by data write request is correct.
[0110] Specifically, U w represents the to-be-written position of data write request, for example, U w =28 represents that the to-be-written position of data write request is the 28th word line, i.e. the 29th word line. O ibThis represents the sequence number of the next write operation for each blk (current write sequence number), i.e., the wl number to be written during the io-th write operation. t Indicates the type of data to be written in the write request, U t =0 indicates that the type to be written is coarse, U t =1 indicates that the type to be written is fine-write. China O ib This indicates the sequence number of the next write operation for each blk, i.e., the write type to be written during the io-th write operation. Once the verification entry corresponding to the current write sequence number is determined, it is first checked whether the write type of the data write request matches the target write type represented by the verification entry, i.e., whether both are coarse writes or both are fine writes. If the data does not match, the sequential verification result is a verification failure. If the data matches, the system further checks whether the write position of the data write request is consistent with the target write position represented by the verification entry, i.e., whether they are the same word line. If there is a discrepancy, the sequential verification result is verification failure. If the type to be written is consistent with the target type to be written, and the location to be written is consistent with the target location to be written, then the sequential verification result of the data write request is verification success.
[0111] For example, such as Figure 4 The diagram illustrates an exemplary data write verification process provided in this application embodiment. First, the Nand structure constant (attribute information of the storage device) is input. Then, the verification tool is initialized to set the generation logic of the target write sequence table. Setting the QLC target write sequence table means creating the target write sequence table for the storage device. Then, the target write sequence table can be printed for verification. Then, the blk to be verified is reset, that is, the verification table entry corresponding to the current write sequence number is determined according to the current write sequence number of the data write request. Then, the current write position is verified, that is, the verification table entry is verified. If the verification is completed and the sequential verification result is obtained, the write position is updated. If the blk is erased, the current write sequence number is reset to the initial value 0, that is, subsequent verifications start sequentially from the beginning wl.
[0112] Specifically, the initialization verification tool includes calculating Ng, Nw, and No according to formulas, while also saving {O}. ib The array} is allocated memory space of size Nb. Then, to store... The two arrays are allocated memory space, both with a size of No.
[0113] Specifically, the steps for setting the QLC target write order list include:
[0114] 1. order = 0;
[0115] 2. Settings
[0116] 3. order = order + 1, if order < Nr, repeat step 2, otherwise go to next step;
[0117] 4. sec = 0, wlstart = Nr, wlend = Nr;
[0118] 5. wlend = wlend + Lsec x Nr, where the right side of the equation wlend takes the value of Nr, Lsec represents the number of word line groups corresponding to sec = 0;
[0119] 6. If wlend >= Nw, then limit wlend = Nw;
[0120] 7. wl = wlstart;
[0121] 8. Set
[0122] 9. order = order + 1;
[0123] 10. If Y sec = 1, then perform the following steps:
[0124] (1) Set
[0125] (2) order = order + 1;
[0126] 11. wl = wl + 1, if wl < wlend, go back to step 8, otherwise go to next step;
[0127] 12. wlstart = wlend;
[0128] 13. sec = sec + 1, if sec < Ns, go back to step 5, otherwise perform end;
[0129] Wherein, order represents an incremental serial number, initially 0, and gradually increases with the flow; sec represents the current write partition number, ranging from 0 to Ns-1, a total of Ns write partitions, wlstart represents the starting wl number of the current write partition, wlstart represents the end wl number of the current write partition, Y sec represents the number of write times of the current write partition.
[0130] Specifically, when order is 0, the first word line group of the first write partition of the storage block is processed alone, and the first Nr wl is looped to assign values. When sec = 0, the second write partition is processed, and the starting wl number and the ending wl number of the current write partition are set first, wherein the ending wl number is set to be equal to the actual wl number first, and then the actual ending wl number of the current write partition is obtained through step five, and the ending wl number cannot exceed the total number of wl. Then, the current starting wl is processed, and the write partition is traversed from the current starting wl to the last wl of the write partition. Then, sec + 1, and the next write partition is processed, until all write partitions are completed.
[0131] Specifically, the step of printing the QLC target write sequence table comprises:
[0132] 1. Defining an array invot[Nw][2], wherein the [iw][j] element of the array is used to record the content in the ithwl in Table 1, the coarse writing (j = 0) and the fine writing (j = 1) grid;
[0133] 2. All elements of the array invot[Nw][2] are initialized to -1, that is, the NA value in Table 1;
[0134] 3. The subscript io traverses 0, …, No-1, and the following assignments are made:
[0135]
[0136] 4. Let ig traverse 0, …, Ng-1, and ir traverse 0, …, Nr-1. Set iw = ig x nr + ir, and let j traverse 0, 1. Ig represents the number of wlg, ir represents the number of String, and ig is the row number starting from 0, and 2iw+j is the column number starting from 0. The invot[iw][j] can be printed in a user-friendly format. The row and column numbers here omit the two rows and the two columns on the left side of the table header, and only refer to the content part of the table, that is, the sequential numbering part.
[0137] For resetting the blk with the number ib to verify from the first wl, only the following operation is needed: ib = 0.
[0138] Specifically, the data of the target write sequence table is stored through a two-dimensional array, then the relationship between the array and the write sequence number is established through io, and then the data is printed through the traversal of ig and ir.
[0139] Specifically, to verify whether the one-time write of the blk with the number ib conforms to the sequence rule, the following steps need to be performed:
[0140] 1. Obtain the write wl number U to be verified by the userw i.e. the to-be-written position of the data write request, the to-be-verified write coarse-fine flag U t represents the to-be-written type of the data write request, U t = 0 indicates that the to-be-written type is coarse writing, U t = 1 indicates that the to-be-written type is fine writing.
[0141] 2. If O ib ≥ No, an error of exceeding the upper limit of the write number is reported, i.e. there is an overwriting exception, and the verification fails.
[0142] 3. If an error of the current to-be-written wl number not meeting the QLC write sequence requirement is reported, and the verification ends in failure.
[0143] 4. If an error of the current to-be-written coarse-fine flag not meeting the QLC write sequence requirement is reported, and the verification ends in failure.
[0144] 5. Set O ib = O ib + 1, and the verification succeeds.
[0145] Correspondingly, the verification of the data write request is realized through whether the conditions are consistent, and the quantification of the target write sequence table is realized through the array.
[0146] Specifically, in an embodiment, a sequence verification failure number statistics mechanism can also be added in the FTL, a continuous failure counter and a time window counter are set for each storage block. For any storage block, if the continuous occurrence number of sequence verification failures reaches a preset upper limit of failure number, or the cumulative failures in a preset time window reach a preset upper limit of failure frequency, the storage block is regarded as an abnormal storage block, an abnormal alarm of the storage device is triggered to remind the relevant technical personnel to timely perform abnormal processing on the abnormal storage block in the storage device, so as to ensure the safety of the storage device.
[0147] The data write verification method provided by the embodiment of the application comprises the following steps: obtaining attribute information of a storage device; creating a target write sequence table of the storage device according to the attribute information of the storage device; wherein the target write sequence table comprises a write type and a write position corresponding to each write sequence number, the write sequence number is used to represent the sequence of write operations, the write type is divided into two types, namely coarse write and fine write, and the write position comprises a target word line of the write operation; when any data write request is obtained, a verification table item corresponding to a current write sequence number of the data write request is determined in the target write sequence table according to the current write sequence number; the data write request is sequentially verified according to the target write type and the target write position represented by the verification table item, and a sequential verification result is obtained; and the data write request is responded to in the case that the sequential verification result represents that the write sequence of the data write request is correct. The method provided by the above scheme can avoid the case that the write type or the write position of the data write request does not meet the QLC write requirement, thereby ensuring the correctness of data write and improving the security of the storage device. Furthermore, the attribute information of the storage device is obtained to provide data basis for creating the target write sequence table. The target write sequence table is created to provide a standard for data write verification. The verification table item is determined to enable the data write request to find the corresponding verification standard. The sequential verification result represents whether the data write request is incorrect, thereby reducing the possibility of incorrect requests being written and reducing write failures. Only correct data write requests can be responded to, thereby reducing write failures and prolonging the service life of the storage device. The start write sequence is determined by arranging the position information, and the target write sequence table is sequentially traversed, thereby ensuring the correctness and integrity of the target write sequence table. The write partition with the write number being 1 is traversed, thereby completing the traversal of the word line that only needs to be coarsely written. The coarse write is performed first, and then the fine write operation is performed on the fine write word line of the same storage string of the previous word line group, thereby realizing the data write in the zigzag sequence and meeting the QLC data write requirement. The termination condition of the write sequence traversal is determined by calculating the total number of word line groups and the total number of word lines. The verification failure is determined by judging whether there is an overwriting exception, thereby reducing the possibility that the current write sequence number still continues to be verified even if it has exceeded the range of the storage block, and reducing the consumption of system resources.The consistency of the conditions is used to verify the data write request, and the array is used to quantify the target write sequence table.
[0148] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment.
[0149] The embodiment of the present application also provides a data write verification device for executing the data write verification method provided by the above embodiment.
[0150] As shown in Figure 5 , it is a structure schematic diagram of the data write verification device provided by the embodiment of the present application. The data write verification device 50 comprises an acquisition module 501, a creation module 502, a determination module 503, a verification module 504 and a response module 505.
[0151] The acquisition module is used to acquire attribute information of a storage device; the creation module is used to create a target write sequence table of the storage device according to the attribute information of the storage device; the target write sequence table comprises a write type and a write position corresponding to each write sequence number, the write sequence number is used to represent the sequence of write operations, the write type is divided into two types of rough write and fine write, and the write position comprises a target word line of the write operation; the determination module is used to determine a verification table item corresponding to a current write sequence number in the target write sequence table according to the current write sequence number of a data write request when the data write request is obtained; the verification module is used to perform sequence verification on the data write request according to the target write type and the target write position represented by the verification table item, and obtain a sequence verification result; and the response module is used to respond to the data write request in the case that the sequence verification result represents that the write sequence of the data write request is correct.
[0152] The features of the embodiment corresponding to the data write verification device can be referred to the related description of the embodiment corresponding to the data write verification method, which will not be repeated here.
[0153] The embodiment of the present application also provides an electronic device, as shown in Figure 6 , it is a structure schematic diagram of the electronic device provided by the embodiment of the present application, comprising 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 one of the above data write verification method embodiments.
[0154] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the data write verification method embodiments when running.
[0155] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0156] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any of the data write verification method embodiments.
[0157] The embodiment of the present application further provides another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any of the data write verification method embodiments.
[0158] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0159] The above describes in detail the data write verification method, device, electronic equipment and storage medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples in this paper, and the above example descriptions are only used to help understand the method and core idea of the present application. It should be pointed out that, for ordinary skilled person in the technical field, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A data write verification method, characterized in that, include: Retrieve the attribute information of the storage device; Based on the attribute information of the storage device, a target write order table for the storage device is created; wherein, the target write order table includes the write type and write position corresponding to each write sequence number, the write sequence number is used to characterize the order of write operations, the write type is divided into two types: coarse write and fine write, and the write position includes the target word line of the write operation; When any data write request is received, the verification entry corresponding to the current write sequence number is determined in the target write order table based on the current write sequence number of the data write request. Based on the target write type and target write location represented by the verification table entries, the data write request is sequentially verified to obtain the sequential verification result; If the sequence verification result indicates that the write order of the data write request is correct, then the data write request is responded to.
2. The data writing verification method according to claim 1, characterized in that, The step of creating a target write order table for the storage device based on the attribute information of the storage device includes: Based on the attribute information of the storage device, the number of writes and the write order traversal range for each write partition are determined; wherein, the storage block of the storage device includes multiple write partitions, each write partition includes at least one word line group, and the word line group includes multiple word lines; For each of the write partitions, determine the starting write sequence number based on the arrangement position information within the storage block; Starting from the initial write sequence number, write sequence numbers are generated sequentially in an incremental manner. Based on the write sequence number, the number of writes to the write partition, and the write order traversal range, the write partition is traversed in the write order for the corresponding number of writes to determine the write type and write position corresponding to the write sequence number. Based on the write type and write location corresponding to each write sequence number, a target write sequence table for the storage device is created; The attribute information of the storage device includes the number of storage blocks, the number of write partitions per storage block, the number of storage strings, the number of writes per write partition, and the number of word line groups contained in each write partition.
3. The data writing verification method according to claim 2, characterized in that, The step of performing a write order traversal on the write partition according to the write sequence number, the number of writes to the write partition, and the write order traversal range to determine the write type and write position corresponding to the write sequence number includes: When the number of writes to the write partition is equal to 1, the write partition is traversed in a coarse order according to the write sequence number and the write order traversal range of the write partition to determine the coarse write and write position corresponding to the write sequence number.
4. The data writing verification method according to claim 2, characterized in that, The step of performing a write order traversal on the write partition according to the write sequence number, the number of writes to the write partition, and the write order traversal range to determine the write type and write position corresponding to the write sequence number includes: When the number of writes to the write partition is equal to 2, the write partition is traversed in a coarse order according to the write sequence number and the write order traversal range of the write partition to determine the coarse writing and write position corresponding to the write sequence number. After determining the coarse and write position corresponding to each write sequence number, the write sequence number is updated, and the fine word line of the same storage string in the previous word line group is returned according to the coarse word line and the number of storage strings corresponding to the write position, so as to determine the fine and write position corresponding to the write sequence number.
5. The data writing verification method according to claim 2, characterized in that, The method further includes: The total number of word lines in each storage block is determined based on the number of word lines contained in each write partition in each storage block as characterized by the attribute information of the storage device. The total number of word lines for each memory block is determined based on the total number of word line groups and the number of memory strings for each memory block. The write order traversal termination condition for each memory block is determined based on the total number of word lines in each memory block. Based on the write count of each write partition in each storage block characterized by the attribute information of the storage device, the number of word line groups and the number of storage strings contained in each write partition, the total number of write counts for each storage block of the storage device is determined; The maximum value of the write sequence number is determined based on the total number of writes.
6. The data writing verification method according to claim 5, characterized in that, Before determining the verification entry corresponding to the current write sequence number in the target write order table based on the current write sequence number of the data write request, the method further includes: Based on the relationship between the current write sequence number of the data write request and the maximum value of the write sequence number, determine whether the data write request has an overwrite exception; If an overwrite exception occurs in the data write request, the result of the sequence verification of the data write request is determined to be a verification failure. If there is no overwrite exception in the data write request, the step of determining the verification entry corresponding to the current write sequence number in the target write order table based on the current write sequence number of the data write request is executed.
7. The data writing verification method according to claim 1, characterized in that, The step of performing sequential verification on the data write request based on the target write type and target write location represented by the verification table entry to obtain a sequential verification result includes: Determine whether the type of data to be written in the data write request is consistent with the target write type represented by the verification table entry; Determine whether the location to be written in the data write request is consistent with the target write location represented by the verification entry; If the type to be written is consistent with the target type to be written, and the location to be written is consistent with the target location to be written, then the order verification result of the data writing request is determined to be successful. Specifically, when the verification result of the data write request order is successful, it indicates that the write order of the data write request is correct.
8. A data writing verification device, characterized in that, include: The acquisition module is used to obtain the attribute information of the storage device; A creation module is used to create a target write order table for the storage device based on the attribute information of the storage device; wherein, the target write order table includes the write type and write position corresponding to each write sequence number, the write sequence number is used to characterize the order of write operations, the write type is divided into two types: coarse write and fine write, and the write position includes the target word line of the write operation; The determination module is used to determine the verification entry corresponding to the current write sequence number in the target write sequence table when any data write request is received, based on the current write sequence number of the data write request. The verification module is used to perform sequential verification on the data write request based on the target write type and target write position represented by the verification table entry, and obtain the sequential verification result; A response module is configured to respond to the data write request if the sequence verification result indicates that the write order of the data write request is correct.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data write verification method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data write verification method as described in any one of claims 1 to 7.