Data distribution statistical method, storage device and data distribution detection equipment
By performing logical operations in the controller of the storage device to generate the target number, the problem of excessive CPU resource occupation by the statistics of the storage unit distribution status is solved, and efficient data distribution result acquisition by the external controller is achieved.
Patent Information
- Application Number
- CN202410432807.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2025-10-17
AI Technical Summary
Existing NAND Flash controllers occupy a large amount of CPU computing resources when performing storage cell distribution statistics, affecting the CPU's processing progress on other tasks.
By performing logical operations, including XOR operations and AND operations, in the controller of the storage device, a target number is generated and sent to an external controller to solve the data distribution result, thereby reducing the calculation burden of the external controller.
The calculation amount of the external controller is reduced, the processing efficiency of other tasks is improved, and the excessive occupation of CPU resources by data distribution acquisition tasks is avoided.
Smart Images

Figure CN120803339A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of storage, and in particular to a data distribution statistical method, a storage device and a data distribution detection device. BACKGROUND
[0002] In the development process of NAND, the storage distribution state of NAND Flash cell is widely used in the process of NAND Flash read voltage optimization and NAND Flash error correction. However, the current NAND Flash controller generally does not support obtaining the distribution state statistical result of the NAND Flash cell directly, and needs to use the computing power of the external CPU to obtain the final cell distribution state statistical result. This needs to consume a large amount of CPU computing resources. For example, in the test of 4KB experimental data on ARM A53, which is equivalent to 32K cells, it needs about 750,000 CPU cycles. If the CPU as an important hardware resource is occupied by the cell distribution state statistical task, it will seriously affect the processing progress of the CPU for other tasks. SUMMARY
[0003] The main purpose of the present application is to provide a data distribution statistical method, a storage device and a data distribution detection device, which can solve the technical problem of excessive CPU resource occupation in the distribution state statistics of the storage unit.
[0004] To solve the above technical problems, the first technical solution adopted by the present application is to provide a data distribution statistical method. The method comprises: the controller responds to receiving a data distribution acquisition request, determines target data in the storage unit based on the data distribution acquisition request; the controller obtains cache data corresponding to the target data in the storage cache according to the target data, and the cache data includes at least two pages of cache page data; the controller performs logical operation on the at least two pages of cache page data to obtain a logical operation result, and the logical operation includes AND operation, or the logical operation includes XOR operation and AND operation; the controller obtains at least three target numbers based on the at least two cache page data and the result of the data being one in the logical operation result; and the controller sends the at least three target numbers to an external controller to make the external controller generate the data distribution result of the corresponding storage unit in the form of linear equation solving based on the target numbers.
[0005] To solve the above technical problems, a second technical solution adopted by the present application is to provide a data distribution statistical method. The method comprises: an external controller sending a data distribution acquisition request to a storage device in response to receiving a data distribution acquisition instruction; the external controller receiving at least three target numbers sent by a controller of the storage device based on the data distribution acquisition request, the target numbers being obtained by the controller based on at least two cache page data in a storage cache and a result of data being one in a logical operation result, the logical operation result being obtained based on the at least two cache page data, the logical operation comprising an AND operation or the logical operation comprising an XOR operation and an AND operation; and the external controller generating a data distribution result of a storage unit corresponding to the storage device in the form of a linear equation solution based on the at least three target numbers.
[0006] To solve the above technical problems, a third technical solution adopted by the present application is to provide a storage device. The storage device comprises a controller, a storage cache and a storage unit, the controller being connected with the storage cache and the storage unit to implement the method as described in the first technical solution.
[0007] To solve the above technical problems, a fourth technical solution adopted by the present application is to provide a data distribution detection device. The data distribution detection device comprises a storage device and an external controller, the storage device being the storage device as described in the third technical solution, and the external controller being connected with the storage device to implement the method as described in the second technical solution.
[0008] The present application has the following beneficial effects: the present application enables the controller of the storage device to acquire cache data corresponding to target data in response to a received data distribution acquisition request, perform logical operations on the cache data, including XOR operations and AND operations, or perform logical operations including AND operations, and then send the obtained target numbers to the external controller, so that the external controller can obtain a data distribution result in a storage unit where the target data is located by solving a linear equation based on the target numbers. In the data distribution result acquisition process, the calculation resources and the operation capability of the storage device controller are utilized to perform operations on the cache data first, so that part of the operation process is processed in the storage device controller, and the external controller only needs to further acquire the data distribution result according to the target numbers, thereby reducing the calculation amount of the external controller, avoiding excessive occupation of the calculation resources of the external controller by the data distribution acquisition task, and improving the overall processing efficiency of the external controller for the task. BRIEF DESCRIPTION OF DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0010] Figure 1 is an implementation scenario diagram of an embodiment of the virtual wall system of the present application;
[0011] Figure 2 is a flow diagram of the second embodiment of the data distribution statistical method of the present application;
[0012] Figure 3 is a flow diagram of the third embodiment of the data distribution statistical method of the present application;
[0013] Figure 4 is a flow diagram of the fourth embodiment of the data distribution statistical method of the present application;
[0014] Figure 5 is a flow diagram of the fifth embodiment of the data distribution statistical method of the present application;
[0015] Figure 6 is a flow diagram of the sixth embodiment of the data distribution statistical method of the present application;
[0016] Figure 7 is a flow diagram of the seventh embodiment of the data distribution statistical method of the present application;
[0017] Figure 8 is a diagram of the source analysis of the XOR result of LP and UP;
[0018] Figure 9 is a diagram of the source analysis of the XOR result of LP, MP and UP;
[0019] Figure 10 is a diagram of the source analysis of the XOR result of MP and LP;
[0020] Figure 11 is a diagram of the source analysis of the XOR result of MP and UP;
[0021] Figure 12 is a diagram of the source analysis of LP, MP and UP;
[0022] Figure 13 is a structural diagram of an embodiment of the storage device of the present application;
[0023] Figure 14 is a structural diagram of an embodiment of the data distribution detection device of the present application. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present application.
[0025] The terms "first", "second", and the like in the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or device.
[0026] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily mutually exclusive of other embodiments. It is explicitly and implicitly understood that the embodiments described herein can be combined with other embodiments.
[0027] Generally, data distribution result acquisition is that an external controller takes out all the cache data corresponding to the data, and then traverses all the data using the external controller to count the state distribution of the data. For example, for TLC, when data distribution result acquisition is performed, the cache data of the Lower page, Middle page and Upper page corresponding to the target data is read out, and then all the cache data is traversed using the CPU to count the data distribution state according to the corresponding position. Each cell of the TLC can have eight data states (eight different storage voltages), and the data distribution result can be the number of the eight data states corresponding to the storage unit where the target data is located. For OLC, the cache data of the Lower page, Middle page, Upper page and Top page can be acquired, and the number of sixteen data states can be acquired.
[0028] Since the above processes are all completed in the CPU, a large amount of CPU computing resources is occupied, which affects the processing efficiency of the CPU for other tasks. Therefore, the following embodiments are proposed to reduce the occupation of CPU computing resources by data distribution acquisition tasks by using the computing power of the controller in the storage device.
[0029] Referring to Figure 1 , Figure 1 is a flowchart of a first embodiment of a data distribution statistics method. The method is applied to a storage device, which includes a controller, a storage cache, and a storage unit. The method includes the following steps:
[0030] S11: The controller determines target data in the storage unit based on a data distribution acquisition request in response to receiving the data distribution acquisition request.
[0031] In the storage device, the controller controls data to be written into the storage unit via the storage cache or read out from the storage unit via the storage cache. For example, in TLC, the cache includes three cache pages, Lower page, Middle page, and Upper page, and in QLC, it includes four cache pages, Lower page, Middle page, Upper page, and Top page. The combination of data on the same bit corresponding to each cache page represents the storage state of the data corresponding to the bit. For example, in TLC, the first bit from low to high in the three cache pages is 0, 0, and 1, respectively, and the data state of the bit corresponding to the data to be written or read out is 100 (Upper-Middle-Lower), which corresponds to the voltage to be written into the storage unit or the voltage stored in the storage unit. The cache page data in the storage cache can also be referred to as shared page data.
[0032] After receiving the data distribution acquisition request, the address of the target data is determined according to the request, and then the target data stored at the address is also determined.
[0033] S12: The controller obtains cache data corresponding to the target data in the storage cache based on the target data, and the cache data includes at least two cache page data.
[0034] Reading the target data into the storage cache is based on the data state of the target data to generate cache data corresponding to the target data in each cache page. The cache data generated in this application includes at least two cache page data.
[0035] S13: The controller performs logical operations on the at least two cache page data to obtain a logical operation result, and the logical operations include AND operations, or the logical operations include XOR operations and AND operations.
[0036] S14: The controller obtains at least three target numbers based on the cache page data and the result of the data being one in the logical operation result.
[0037] After obtaining the cache data, the logic computing capability of the storage device controller is used to perform logical operation on the cache page data, and the target number is obtained based on the result that the data is one in the operation result. The cache page data is also directly processed, and the target number is obtained based on the result that the data is one in the operation result.
[0038] The exclusive OR operation and the AND operation herein are both based on the bitwise operation of the cache page data.
[0039] S15: The controller sends at least three target numbers to the external controller to enable the external controller to generate the data distribution result of the corresponding storage unit in the form of linear equation solving based on the target numbers.
[0040] The obtained target numbers are sent to the external controller for operation, and the external controller uses the target numbers and the corresponding equation to solve the data distribution result. The data distribution result can include the number of each data state in the storage unit corresponding to the target data address.
[0041] In this embodiment, the controller of the storage device responds to the received data distribution acquisition request to acquire the cache data corresponding to the target data, performs logical operation including exclusive OR operation and AND operation on the cache data, or performs logical operation including AND operation, and then sends the obtained target number to the external controller, so that the external controller can obtain the data distribution result in the storage unit where the target data is located based on the target number. In the data distribution result acquisition process, the computing capability and computing resources of the storage device controller are used to perform operation on the cache data, the partial operation process is processed in the storage device controller, and the external controller only needs to further acquire the data distribution result according to the target number, which reduces the computing amount of the external controller, avoids excessive occupation of the computing resources of the external controller by the data distribution acquisition task, and improves the overall processing efficiency of the external controller for the task.
[0042] Reference Figure 2 , Figure 2 This is a flowchart of the second embodiment of the data distribution statistical method of the application. The method is a further extension of steps S13 and S14, and includes the following steps:
[0043] S21: The controller selects two pages of cache page data to perform exclusive OR operation to obtain an exclusive OR operation result, and selects two pages of cache page data to perform AND operation to obtain an AND operation result.
[0044] S22: The exclusive OR operation result and the AND operation result are taken as the logical operation result.
[0045] When the cache data is two-page cache page data, the storage device can be MLC. When the controller performs logical operation of the data distribution acquisition task, the controller performs XOR operation on the two cache page data obtained according to the target data to obtain an XOR operation result, and performs AND operation to obtain an AND operation result. The XOR operation result and the AND operation result are taken as the logical operation result of the target number.
[0046] S23: The controller obtains a target number based on the result of one in the one-page cache page data.
[0047] The one-page cache page data belongs to one of the two-page cache page data.
[0048] S24: The controller obtains a target number based on the result of one in the XOR operation result.
[0049] S25: The controller obtains a target number based on the result of one in the AND operation result.
[0050] The target number is the number of data one. A target number is obtained according to the number of data one in the one-page cache page data, a target number is obtained according to the number of data one in the XOR operation result, and a target number is obtained according to the number of data one in the AND operation result. The XOR operation result includes at least one bit of data, and the number of bits is the same as the number of bits in the read cache page data. The more bits of data in the cache page data, the more bits of data in the obtained XOR operation result. The same applies to the AND operation.
[0051] After obtaining the three target numbers, the target numbers can be sent to an external controller for calculation of the data distribution result.
[0052] Referring to Figure 3 , Figure 3 FIG. 3 is a flowchart of a third embodiment of the data distribution statistical method. The method is a further extension of steps S13 and S14, and includes the following steps.
[0053] S31: The controller selects two-page cache page data for AND operation to obtain an AND operation result.
[0054] S32: The AND operation result is taken as the logical operation result.
[0055] S33: The controller obtains two target numbers based on the result of one in the two cache page data, and each target number corresponds to a cache page data.
[0056] S34: The controller obtains a target number based on the result of one in the AND operation result.
[0057] Similar to the second embodiment, but the embodiment selects two target numbers by using two cache page data, and does not perform XOR logical operation, but only performs AND operation, and obtains a third target number by using the AND operation result.
[0058] Referring to Figure 4 , Figure 4 is a flowchart of a fourth embodiment of the data distribution statistical method of the present application. The method is a further extension of step S13, and includes the following steps:
[0059] S41: The controller selects at least two cache page data from at least three cache page data to perform XOR operation to obtain at least three XOR operation results, and selects all the at least three cache page data to perform AND operation to obtain an AND operation result.
[0060] S42: The at least three XOR operation results and the AND operation result are taken as the logical operation result.
[0061] When the cache data is at least three cache page data, the storage device can be TLC, QLC, etc. When the controller performs logical operation of the data distribution acquisition task, at least two cache page data are selected from the at least three cache page data to perform XOR operation to obtain at least three XOR operation results. For example, for TLC, there are three cache page data, Lower page and Middle page, Middle page and Upper page, and Lower page, Middle page and Upper page are respectively subjected to XOR operation to obtain three XOR operation results. The XOR result of Lower page and Upper page can be omitted, because it can be obtained by the XOR results of Lower page and Middle page, and Middle page and Upper page. Among the three XOR results obtained by any two cache page data from the three cache page data, any two XOR results can obtain the third XOR result, so it is omitted. Finally, only two XOR operation results of any two cache page data subjected to XOR operation, and one XOR operation result of three cache page data subjected to XOR operation are reserved.
[0062] For QLC, there are four cache page data, and at least two cache page data are selected to perform XOR operation to obtain at least ten XOR operation results. When two cache page data are selected to perform XOR operation, six XOR operation results are obtained; when three cache page data are selected to perform XOR operation, four XOR operation results are obtained, similar to the above example, there is one XOR result that can be omitted, so only three XOR operation results are reserved; when four cache page data are selected to perform XOR operation, one XOR operation result is obtained.
[0063] For the AND operation, all cache page data are subjected to the AND operation bit by bit to obtain an AND operation result.
[0064] The obtained XOR operation result and AND operation result are used as the logic operation result.
[0065] Reference Figure 5 , Figure 5 This is a flowchart of the fifth embodiment of the data distribution statistics method of this application. This method is a further extension of the above embodiment and includes the following steps:
[0066] S51 : The controller obtains at least three target numbers based on a result that one of at least three pages of cache page data is one, and each target number corresponds to a cache page data.
[0067] S52: The controller obtains at least three target numbers based on the result that the data in the at least three XOR operation results is one, and each target number corresponds to an XOR operation result.
[0068] S53: The controller obtains a target number based on a result that the data in the AND operation result is one.
[0069] Based on the target number acquisition of the cache page data, a corresponding target number is obtained for each cache page data, and at least two target numbers can be obtained based on at least two pages of cache page data. The target number is the number of results where the data in the cache page data is one.
[0070] Similarly, a corresponding target number is obtained based on each XOR operation result, and at least three target numbers are obtained based on the results of at least three XOR operations.
[0071] A target number can be obtained based on the result of the AND operation, and at least seven target numbers can be obtained in the end.
[0072] Reference Figure 6 , Figure 6 This is a flow chart of the sixth embodiment of the data distribution statistics method of the present application. The method is applied to a data distribution detection device, which includes a storage device and an external controller. The method includes the following steps:
[0073] S61: The external controller sends a data distribution acquisition request to the storage device in response to the data distribution acquisition instruction.
[0074] The acquired data distribution acquisition instruction may be generated by the external controller itself or received. In response to acquiring the data distribution acquisition instruction, a data distribution acquisition request is sent to the controller of the storage device, so that the storage device controller acquires data and performs logical operations according to the request to obtain the target number.
[0075] S62: The external controller receives at least three target numbers sent by the controller of the storage device based on the data distribution acquisition request.
[0076] The target numbers are obtained by the controller based on at least two cache page data in the storage cache and the result of data being one in the logical operation result, the logical operation result is obtained based on at least two cache page data, and the logical operation includes an AND operation or an XOR operation and an AND operation.
[0077] The acquisition of the target data is described above and will not be repeated here.
[0078] S63: The external controller generates a data distribution result of the storage unit of the corresponding storage device in the form of a linear equation solution based on the at least three target numbers.
[0079] The external controller continues to obtain the data distribution result by performing operations based on the target numbers. The data distribution result can include the number of each data state in the storage unit corresponding to the target data address.
[0080] Referring to Figure 7 , Figure 7 is a flowchart of a seventh embodiment of the data distribution statistical method of the present application. The method is a further extension of step S63, which includes the following steps:
[0081] S71: The external controller obtains a first matrix based on at least three target numbers.
[0082] S72: The external controller obtains a second matrix by solving the inverse matrix of a preset matrix, and the preset matrix is obtained based on data-one source state information of the result of data being one.
[0083] The acquisition of the preset matrix can be achieved in the following way.
[0084] In an embodiment, the external controller determines a first equation corresponding to the target number based on data-one source state information of the result of data being one in the cache page data. The external controller determines a second equation corresponding to the target number based on data-one source state information of the result of data being one in the XOR operation result. The external controller determines a third equation corresponding to the target number based on data-one source state information of the result of data being one in the AND operation result. The preset matrix is generated based on the first equation, the second equation, and the third equation.
[0085] In a specific embodiment, when there are only two cache page data, the storage unit of MLC can have four data states. The four data states are regarded as bit values 0, 1, 2, and 3, and the number of corresponding storage units is set as x0, x1, x2, and x3. In order to obtain the four variables, four linearly independent equations are needed.
[0086] Assuming the total number of storage units is b0, the first equation can be obtained: x0+x1+x2+x3=b0. The total number b0may be calculated by an external controller, or can be obtained as a target number by the controller of the storage device and sent to the external controller.
[0087] The source of 1 in the XOR result of LP and UP is analyzed, which comes from the storage units with bit values of 1, 2, and 3. The second equation can be obtained: x1+x2=b1. As shown in Figure 8 , Figure 8 A schematic diagram for the source analysis of the XOR result of LP and UP. The equation is the second equation described above.
[0088] The result of 1 in the data result of the LP and UP cache page data is analyzed, which can be referred to Figure 8 . The 1 of LP comes from the storage units with bit values of 1 and 3; the 1 of UP comes from the storage units with bit values of 2 and 3. Two equations can be obtained: x1+x3=b2 and x2+x3=b2. One of the two equations is selected as the third equation, such as x1+x3=b2. The equation is the first equation described above.
[0089] The result of 1 in the data result of the AND operation of LP and UP is analyzed, which comes from the storage units with bit value of 3. The fourth equation can be obtained: x3=b3. The equation is the third equation described above.
[0090] The first equation, the second equation, the third equation, and a total number equation described above are converted into a matrix form, and the following is obtained:
[0091] Ax=B
[0092]
[0093] The matrix A is the preset matrix described above.
[0094] Then the inverse matrix is solved, and x=A -1 B. A -1 is the second matrix described above.
[0095] The result in the matrix x corresponds to the number of data states of bit values 1 to 3.
[0096] The total number equation and the third equation are basically fixed in form, and only related to the number of variables. Therefore, the first equation and the second equation are actually determined, and the preset matrix can be obtained.
[0097] In the data distribution acquisition task with at least three cache page data, since when there are at least three cache page data, one of the equations obtained by the exclusive OR logic operation source analysis is reduced, because it is linearly related to the equation obtained by the exclusive OR operation source analysis, for details, please refer to the description in the third embodiment of the data distribution statistical method. Therefore, when the second equation is determined, it is necessary to determine which second equation of the exclusive OR logic operation is retained, so as to correspond to the setting of the exclusive OR operation logic in the storage device controller, so that the storage device controller determines which cache page data to perform exclusive OR operation to obtain the target number.
[0098] Therefore, in a specific embodiment, the matrix can be obtained by the following steps.
[0099] In the process of acquiring data distribution, each data state is regarded as an unknown number for equation listing. For TLC, there are eight data states, which are regarded as bit values 0, 1, 2, 3, 4, 5, 6, 7, and the number of corresponding storage units is set as x0, x1, x2,..., x7. In order to obtain these eight variables, eight linearly independent equations are needed. According to the eight equations, the equation solving is carried out in the form of matrix.
[0100] Assuming that the total number of storage units is b0, the first equation can be obtained: x0+x1+x2+x3+x4+x5+x6+x7=b0. The total number b0 can be calculated by the external controller, or can be obtained by the controller of the storage device and sent to the external controller.
[0101] When there are at least three cache page data, the external controller determines at least three second equations corresponding to at least three target numbers according to the data one source state information of the result of data one in at least three exclusive OR operation results. Three cache page data need to determine three second equations, and four cache page data need to determine ten second equations. Taking TLC as an example, the source of 1 in the exclusive OR result of LP, MP and UP is analyzed, which comes from the storage unit with bit value 1, 2, 4 and 7, and the second equation x1+x2+x4+x7=b1 can be obtained. As shown in Figure 9 , Figure 9 is a schematic diagram of the exclusive OR result source analysis of LP, MP and UP.
[0102] The 1 in the exclusive OR result of MP and LP is analyzed, which comes from the storage unit with bit value 1, 2, 5 and 6, and the third equation x1+x2+x5+x6=b2 can be obtained. As shown in Figure 10 , Figure 10 is a schematic diagram of the exclusive OR result source analysis of MP and LP.
[0103] The 1 in the XOR result of MP and UP is analyzed, which comes from the storage unit with bit value 2, 3, 4, 5, and the fourth equation x2+x3+x4+x5=b3 is obtained. As shown in Figure 11 , Figure 11 An illustration of the source analysis of the XOR result of MP and UP is shown.
[0104] The second to fourth equations are the second equations for obtaining the preset matrix. The 1 in the data result of the cached page data of LP, MP and UP is analyzed. The 1 of LP comes from the storage unit with bit value 1, 3, 5, 7; the 1 of MP comes from the storage unit with bit value 2, 3, 6, 7; and the 1 of UP comes from the storage unit with bit value 4, 5, 6, 7, and the fifth to seventh equations x1+x3+x5+x7=b4, x2+x3+x6+x7=b5, x4+x5+x6+x7=b6 are obtained. As shown in Figure 12 , Figure 12 An illustration of the source analysis of LP, MP and UP is shown. The fifth to seventh equations are the first equations for obtaining the preset matrix.
[0105] The 1 in the data result of the AND operation of LP, MP and UP is analyzed, which comes from the storage unit with bit value 7, and the eighth equation x7=b7 is obtained. The eighth equation is the third equation for obtaining the preset matrix.
[0106] The above equations are converted into matrix form, and the following is obtained:
[0107] Ax=B
[0108]
[0109] b0, b1, b2, b3, b4, b5, b6, b7 are target numbers that can be obtained by the storage device, the matrix B is the first matrix described above, and the matrix A is the preset matrix described above. The matrix B is obtained according to the target number, and the matrix A is obtained according to the data-1 source state information of the data-1 result in the cached page data and the logical operation result.
[0110] The inverse matrix of the above matrix equation is solved, and the solving equation of the data state distribution quantity is obtained:
[0111] x=A -1 B
[0112]
[0113] wherein A -1 is the second matrix described above.
[0114] S73: The external controller multiplies the first matrix and the second matrix to obtain a third matrix.
[0115] After obtaining the first and second matrices, the first and second matrices are multiplied to obtain a third matrix.
[0116] S74: The external controller generates a data distribution result according to the third matrix.
[0117] The x0 to x7 in the third matrix correspond to the number of data states corresponding to bits 0 to bits 7.
[0118] Through the above formula, after obtaining the target numbers b0 to b7, the number of each data state can be obtained by solving the matrix equation. The equation solving operation only involves addition, subtraction, and shifting, and the operation is very fast, which can quickly obtain the result, greatly reduces the calculation burden of the external controller, and can provide more computing resources for the execution of other tasks.
[0119] The calculation equation of the total number of variables (the first equation described above) and the calculation equation of the operation (the seventh equation described above) are basically unchanged in different scenarios, only the number of variables changes for different types of storage units, such as TLC or QLC, etc. For example, TLC is eight, QLC is sixteen, etc. The first equation and the second equation will change according to the type of the storage unit and the selected exclusive-OR operation logic in advance, so as to change the first matrix and the second matrix used to calculate the data distribution result, and change the solving operation process of the external controller. Therefore, the first equation and the second equation are actually determined to obtain the preset matrix.
[0120] When there are two pages of cache page data, the preset matrix can also be obtained by the following method.
[0121] In an embodiment, the external controller determines a fourth equation corresponding to the target number according to data one source state information of a result of data being one in the cache page data; the external controller determines a fifth equation corresponding to the target number according to data one source state information of a result of data being one in the operation result; and the external controller generates a preset matrix according to the fourth equation and the fifth equation.
[0122] When there are only two pages of cache page data, the storage unit can have four data states. The four data states are regarded as bit values 0, 1, 2, and 3, and the number of corresponding storage units is set as x0, x1, x2, and x3. In order to obtain the four variables, four linearly independent equations are needed.
[0123] Suppose the total number of storage units is b0, then the first equation is x0+x1+x2+x3=b0. The total number b0 can be calculated by the external controller, or can be obtained by the controller of the storage device and sent to the external controller as a target number.
[0124] The result of one in the data result of the LP and UP cache page data is analyzed, which can be referred to Figure 8 The 1 of the LP comes from the storage unit with bit value 1, 3; the 1 of the UP comes from the storage unit with bit value 2, 3, and two equations are obtained: x1+x3=b2, x2+x3=b2. The two equations are the fourth equation.
[0125] The result of one in the data result of the AND operation of the LP and UP is analyzed, which comes from the storage unit with bit value 3, and an equation is obtained: x3=b3. The equation is the fifth equation.
[0126] Then, the equation is converted into a matrix form for operation. In the embodiment, the data distribution result can be obtained without using the equation of the XOR operation result, and the subsequent steps are similar to the above embodiment, which will not be described here.
[0127] As shown in Figure 13 , Fig. 1 is a structural schematic diagram of an embodiment of a storage device of the present application. Figure 13
[0128] The storage device includes a controller 110, a storage cache 120, and a storage unit 130.
[0129] The storage unit 130 is used for storing data, and the storage cache 120 is used for storing cache data corresponding to the data to be read.
[0130] The controller 110 is connected with the storage cache 120 and the storage unit 130 to realize the method provided by any one of the first to fourth embodiments of the data distribution statistical method and possible combinations.
[0131] The storage device can be a USB flash disk, a mobile hard disk, or a storage card, etc. based on NAND Flash.
[0132] As shown in Figure 14 , Fig. 2 is a structural schematic diagram of an embodiment of a data distribution detection device of the present application. Figure 14
[0133] An embodiment of the data distribution detection device of the present application includes an external controller 210 and a test interface 220.
[0134] The external controller 210 can be referred to as a CPU (Central Processing Unit). The external controller 210 can be an integrated circuit chip with processing capability of a signal sequence. The external controller 210 can also be a general processor, a digital signal sequence processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general processor can be a microprocessor or the processor can also be any conventional processor or the like.
[0135] The external controller 210 is connected with the storage device to be tested through the test interface 220 to implement the method provided in any one of the fifth to sixth embodiments and possible combinations of the data distribution statistical method. The storage device to be tested is the storage device described in the storage device embodiments.
[0136] In summary, the controller of the storage device acquires the cache data corresponding to the target data in response to the received data distribution acquisition request, performs the logical operation including the XOR operation and the AND operation or the logical operation including the AND operation on the cache data, and then sends the target number to the external controller, so that the external controller can obtain the data distribution result in the storage unit where the target data is located based on the target number. In the data distribution result acquisition process, the operation capability and the computing resources of the storage device controller are used to perform the operation on the cache data, the partial operation process is processed in the storage device controller, and the external controller only needs to further acquire the data distribution result according to the target number, thereby reducing the computing amount of the external controller, avoiding excessive occupation of the computing resources of the external controller by the data distribution acquisition task, and improving the overall processing efficiency of the external controller for the task.
[0137] In the several embodiments provided in the present application, it should be understood that the disclosed method and device can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules or units is only a logical function division. There can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0138] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e. they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment scheme.
[0139] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0140] The integrated unit in the other embodiments described above, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0141] The above is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent flow transformation, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. A data distribution statistics method, characterized in that: Applied to a storage device, the storage device including a controller, a storage cache, and a storage unit, the method comprising: The controller, in response to receiving a data distribution acquisition request, determines target data in the storage unit based on the data distribution acquisition request; The controller obtains cache data corresponding to the target data in the storage cache according to the target data, wherein the cache data includes at least two pages of cache page data; The controller performs a logic operation on the at least two pages of cache page data to obtain a logic operation result, where the logic operation includes an AND operation, or the logic operation includes an XOR operation and an AND operation; The controller obtains at least three target numbers based on the cache page data and a result in which the data in the logic operation result is one; The controller sends the at least three target numbers to an external controller so that the external controller generates a data distribution result corresponding to the storage unit in the form of solving a linear equation based on the target numbers.
2. The method according to claim 1, characterized in that In response to the cache data including two pages of cache page data, the controller performs a logic operation on the at least two pages of cache page data to obtain a logic operation result, including: The controller selects the two pages of cache page data to perform an XOR operation to obtain an XOR operation result, and selects the two pages of cache page data to perform an AND operation to obtain an AND operation result; Taking the one XOR operation result and the one AND operation result as the logic operation result; The controller obtains at least three target numbers based on the cache page data and a result in which the data in the logic operation result is one, including: The controller obtains the target number based on a result of one in the one-page cache page data, the one-page cache page data belonging to the two-page cache page data; The controller obtains the target number based on a result in which the data in the XOR operation result is one; The controller obtains the target number based on a result in which the data in the AND operation result is one.
3. The method according to claim 1, characterized in that In response to the cache data including two pages of cache page data, the controller performs a logic operation on the at least two pages of cache page data to obtain a logic operation result, including: The controller selects the two pages of cache page data to perform an AND operation to obtain an AND operation result; Using the AND operation result as the logic operation result; The controller obtains at least three target numbers based on the cache page data and a result in which the data in the logic operation result is one, including: The controller obtains two target numbers based on the result that the data in the two pages of cache page data is one, and each target number corresponds to one of the cache page data; The controller obtains the target number based on a result in which the data in the AND operation result is one.
4. The method according to claim 1, wherein In response to the cache data including at least three cache pages of data, the controller performs a logic operation on the at least two cache pages of data to obtain a logic operation result, including: The controller selects at least two pages of cache page data from the at least three pages of cache page data to perform an XOR operation to obtain at least three XOR operation results, and selects all of the at least three pages of cache page data to perform an AND operation to obtain one AND operation result; The at least three XOR operation results and the one AND operation result are used as the logic operation result.
5. The method according to claim 4, characterized in that The controller obtains at least three target numbers based on the cache page data and a result in which the data in the logic operation result is one, including: The controller obtains at least three target numbers based on a result that one of the at least three pages of cache page data is one, each target number corresponding to one of the cache page data; The controller obtains at least three target numbers based on the result that the data in the at least three XOR operation results is one, and each target number corresponds to an XOR operation result; The controller obtains the target number based on a result in which the data in the AND operation result is one.
6. A data distribution statistics method, characterized in that: Applied to a data distribution detection device, the data distribution detection device includes a storage device and an external controller, the storage device includes a controller, a storage cache, and a storage unit, the method includes: The external controller sends a data distribution acquisition request to the storage device in response to the data distribution acquisition instruction; The external controller receives at least three target numbers sent by the controller of the storage device based on the data distribution acquisition request, the target numbers being obtained by the controller based on at least two pages of cache page data in the storage cache and a result in which data is one in a logic operation result, the logic operation result being obtained based on the at least two pages of cache page data, the logic operation including an AND operation, or the logic operation including an XOR operation and an AND operation; The external controller generates a data distribution result corresponding to the storage unit of the storage device in the form of solving a linear equation based on the at least three target numbers.
7. The method according to claim 6, characterized in that The external controller generates a data distribution result corresponding to the storage unit of the storage device in the form of solving a linear equation based on the at least three target numbers, including: The external controller obtains a first matrix according to the at least three target numbers; The external controller performs an inverse matrix solution on a preset matrix to obtain a second matrix, wherein the preset matrix is obtained based on data one source state information of a result in which the data is one; The external controller multiplies the first matrix and the second matrix to obtain a third matrix; The external controller generates the data distribution result according to the third matrix.
8. The method according to claim 7, characterized in that The acquisition of the preset matrix includes: The external controller determines a first equation corresponding to the target number according to data one source state information of a result in which data in the cache page data is one; The external controller determines a second equation corresponding to the target number based on data one source state information of a result in which the data in the XOR operation result is one; The external controller determines a third program corresponding to the target number based on data-source status information of a result in which the data in the operation result is one; generating the preset matrix according to the first equation, the second equation, and the third equation; or the external controller determines a fourth equation corresponding to the target number according to data one source state information of a result in which data in the cache page data is one; The external controller determines a fifth equation corresponding to the target number based on data one source state information corresponding to a result in which the data in the operation result is one; The preset matrix is generated according to the fourth equation and the fifth equation.
9. A storage device, characterized in that: The storage device includes a controller, a storage cache, and a storage unit, and the controller is connected to the storage cache and the storage unit to implement the method according to any one of claims 1 to 5.
10. A data distribution detection device, characterized in that: The data distribution detection device includes an external controller and a test interface, the test interface is used to connect the storage device to be tested, the storage device to be tested is the storage device as described in claim 9, and the storage device to be tested is connected to the external controller through the test interface to implement the method as described in any one of claims 6-8.
Citation Information
Patent Citations
Cache management method, device and equipment and computer readable storage medium
CN117608481A
Dynamic memory tuning for in-memory data analytic platforms
US20170337135A1
Quasi-volatile system-level memory
US20210248094A1
