Data distribution statistics method, storage device, and data distribution detection apparatus
Patent Information
- Application Number
- CN202410432807.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2044-04-10
AI Technical Summary
[0003]本申请主要目的是提供一种数据分布统计方法、存储装置及数据分布检测设备,能够解决存储单元的分布状态统计占用CPU资源过多的技术问题
[0008] The beneficial effects of this application are as follows: This application enables the controller of the storage device to respond to a received data distribution acquisition request, acquire cached data corresponding to the target data, perform logical operations including XOR and AND operations on the cached data, or perform logical operations including AND operations, and then send the obtained target number to the external controller. This allows the external controller to obtain the data distribution result in the storage unit where the target data is located by solving a linear equation based on the target number. During the data distribution result acquisition process, the storage device controller utilizes its computational capabilities and resources to first perform operations on the cached data, enabling some operations to be processed within the storage device controller. The external controller only needs to further acquire the data distribution result according to the target number, reducing the computational load on the external controller, avoiding excessive consumption of the external controller's computational resources by the data distribution acquisition task, and improving the overall processing efficiency of the external controller.
Smart Images

Figure CN120803339B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage, and in particular to a data distribution statistics method, a storage device, and a data distribution detection device. Background Technology
[0002] In NAND development, the storage distribution status of NAND Flash cells has been widely used in NAND Flash read voltage optimization and error correction. However, current NAND Flash controllers generally do not support directly obtaining the distribution status statistics of NAND Flash cells, requiring the computing power of an external CPU to obtain the final cell distribution status statistics. This consumes a significant amount of CPU computing resources. For example, testing 4KB of experimental data on an ARM A53, equivalent to 32K cells, requires approximately 750,000 CPU cycles. As a crucial hardware resource, if the task of cell distribution status statistics alone consumes a large amount of CPU resources, it will severely impact the CPU's processing speed for other tasks. Summary of the Invention
[0003] The main purpose of this application is to provide a data distribution statistics method, storage device, and data distribution detection equipment, which can solve the technical problem of excessive CPU resource consumption in the distribution status statistics of storage units.
[0004] To address the aforementioned technical problems, the first technical solution adopted in this application is: providing a data distribution statistics method. This method includes: a controller responding to a received data distribution acquisition request; determining target data in a storage unit based on the data distribution acquisition request; the controller obtaining cached data corresponding to the target data in a storage cache, the cached data including at least two cache page data; the controller performing logical operations on the at least two cache page data to obtain a logical operation result, the logical operation including AND operation, or the logical operation including XOR operation and AND operation; the controller obtaining at least three target numbers based on the at least two cache page data and the result of the logical operation where the data is one; and the controller sending the at least three target numbers to an external controller so that the external controller generates the data distribution result of the corresponding storage unit based on the target numbers using a linear equation solution.
[0005] To address the aforementioned technical problems, the second technical solution adopted in this application is: providing a data distribution statistics method. This method includes an external controller, in response to receiving a data distribution acquisition instruction, sending a data distribution acquisition request to a storage device; the external controller receiving at least three target numbers sent by the storage device's controller based on the data distribution acquisition request, wherein the target numbers are obtained by the controller based on at least two pages of cache page data in the storage cache and a result where the data in the logical operation is one, the logical operation result being obtained based on at least two pages of cache page data, and the logical operation including an AND operation, or the logical operation including an XOR operation and an AND operation; and the external controller generating the data distribution result of the corresponding storage unit of the storage device based on the at least three target numbers in the form of solving a linear equation.
[0006] To address the aforementioned technical problems, the third technical solution adopted in this application is to provide a storage device. This storage device includes a controller, a storage cache, and storage units, with the controller connected to the storage cache and storage units to implement the method described in the first technical solution.
[0007] To address the aforementioned technical problems, the fourth technical solution adopted in this application is to provide a data distribution detection device. This data distribution detection device includes a storage device and an external controller. The storage device is the same as described in the third technical solution, and the external controller is connected to the storage device to implement the method described in the second technical solution.
[0008] The beneficial effects of this application are as follows: This application enables the controller of the storage device to respond to a received data distribution acquisition request, acquire cached data corresponding to the target data, perform logical operations including XOR and AND operations on the cached data, or perform logical operations including AND operations, and then send the obtained target number to the external controller. This allows the external controller to obtain the data distribution result in the storage unit where the target data is located by solving a linear equation based on the target number. During the data distribution result acquisition process, the storage device controller utilizes its computational capabilities and resources to first perform operations on the cached data, enabling some operations to be processed within the storage device controller. The external controller only needs to further acquire the data distribution result according to the target number, reducing the computational load on the external controller, avoiding excessive consumption of the external controller's computational resources by the data distribution acquisition task, and improving the overall processing efficiency of the external controller. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of an implementation scenario of the virtual wall system of this application;
[0011] Figure 2 This is a flowchart illustrating the second embodiment of the data distribution statistics method of this application;
[0012] Figure 3 This is a flowchart illustrating the third embodiment of the data distribution statistics method of this application;
[0013] Figure 4 This is a flowchart illustrating the fourth embodiment of the data distribution statistics method of this application;
[0014] Figure 5 This is a flowchart illustrating the fifth embodiment of the data distribution statistics method of this application;
[0015] Figure 6 This is a flowchart illustrating the sixth embodiment of the data distribution statistics method of this application;
[0016] Figure 7 This is a flowchart illustrating the seventh embodiment of the data distribution statistics method of this application;
[0017] Figure 8 This is a schematic diagram illustrating the source analysis of the XOR result of LP and UP;
[0018] Figure 9 This is a schematic diagram illustrating the source analysis of the XOR results of LP, MP, and UP;
[0019] Figure 10 This is a schematic diagram illustrating the source analysis of the XOR result of MP and LP;
[0020] Figure 11 This is a schematic diagram illustrating the source analysis of the XOR result of MP and UP;
[0021] Figure 12 This is a schematic diagram illustrating the source analysis of LP, MP, and UP;
[0022] Figure 13 This is a schematic diagram of the structure of an embodiment of the storage device of this application;
[0023] Figure 14 This is a schematic diagram of the structure of an embodiment of the data distribution detection device of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0025] The terms "first," "second," etc., used in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] Typically, data distribution results are obtained by an external controller retrieving all cached data corresponding to the target data, and then iterating through all this data to statistically analyze the state distribution of the data. For example, in TLC, when obtaining data distribution results, the cached data of the Lowerpage, Middlepage, and Upperpage corresponding to the target data is read, and then the CPU iterates through all this cached data, statistically analyzing the data distribution state according to its corresponding position. Each cell and each storage unit in a TLC can have eight data states (eight different storage voltages), and the data distribution result can be the quantity corresponding to these eight data states in the storage unit where the target data is located. For OLC, the cached data of Lowerpage, Middlepage, Upperpage, and Toppage can be retrieved, allowing for the acquisition of the quantity corresponding to sixteen data states.
[0028] Since the above processes are all completed in the CPU, they consume a large amount of CPU computing resources, thus affecting the CPU's processing efficiency for other tasks. Therefore, this application proposes the following embodiments to reduce the CPU computing resources consumed by data distribution acquisition tasks by utilizing the computing power of the controller in the storage device.
[0029] Reference Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the data distribution statistics method of this application. The method is applied to a storage device, which includes a controller, a storage cache, and storage units. The method includes the following steps:
[0030] S11: Upon receiving a data distribution acquisition request, the controller determines the target data in the storage unit based on the data distribution acquisition request.
[0031] In a storage device, the controller controls data to be written to or read from storage cells via a storage cache. For example, in a TLC (Thin-Level Cell) storage device, the cache consists of three cache pages: Lowerpage, Middlepage, and Upperpage; in a QLC (Quick-Level Cell) storage device, it consists of four cache pages: Lowerpage, Middlepage, Upperpage, and Toppage. The combination of data at the same bit in each cache page represents the storage state of the corresponding data. For instance, in a TLC storage device, if the first bit of each of the three cache pages is 0, 0, and 1 from low to high, then the data state to be written or read is 100 (Upper-Middle-Lower). This data state corresponds to the voltage to be written to or stored in the storage cell. The cache page data in this storage cache can also be called shared page data.
[0032] Upon receiving a data distribution acquisition request, the address of the target data is first determined based on the request, thus identifying the target data stored at that address.
[0033] S12: The controller obtains the cached data corresponding to the target data in the storage cache based on the target data. The cached data includes at least two cached page data.
[0034] The target data is read into the storage cache by generating corresponding cache data in each cache page based on the data state of the target data. The cache data generated in this application includes at least two cache pages.
[0035] S13: The controller performs logical operations on at least two cached pages to obtain the logical operation result. The logical operation includes AND operation, or the logical operation includes XOR operation and AND operation.
[0036] S14: The controller obtains at least three target numbers based on the cached page data and the result of the logical operation where the data is one.
[0037] After obtaining the cached data, the logical computing capabilities of the storage device controller are used to perform logical operations on the cached page data. The target number is obtained based on the result where the data is 1. Alternatively, the cached page data can be processed directly, and the target number is obtained based on the result where the data is 1.
[0038] The XOR and AND operations here are both bitwise operations based on cached page data.
[0039] S15: The controller sends at least three target numbers to the external controller so that the external controller generates the data distribution results of the corresponding storage units based on the target numbers in the form of solving linear equations.
[0040] The obtained target number is sent to an external controller for calculation. The external controller uses the target number and the corresponding equation to solve for the data distribution result. The data distribution result can include the quantity corresponding to each data state in the storage unit at the address corresponding to the target data.
[0041] In this embodiment, the application enables the storage device controller to respond to a received data distribution acquisition request, acquire cached data corresponding to the target data, perform logical operations including XOR and AND operations on the cached data, or perform logical operations including AND operations, and then send the obtained target number to an external controller. This allows the external controller to obtain the data distribution result in the storage unit where the target data is located based on the target number. During the data distribution result acquisition process, the storage device controller utilizes its computing power and resources to first perform operations on the cached data, enabling some operations to be processed within the storage device controller. The external controller only needs to further acquire the data distribution result according to the target number, reducing the computational load on the external controller, avoiding excessive occupation of the external controller's computing resources by the data distribution acquisition task, and improving the overall processing efficiency of the external controller for the task.
[0042] Reference Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the data distribution statistics method of this application. This method is a further extension of steps S13 and S14, and includes the following steps:
[0043] S21: The controller selects two pages of cached data, performs an XOR operation to obtain an XOR result, and selects two pages of cached data, performs an AND operation to obtain an AND result.
[0044] S22: Take the result of an XOR operation and the result of an AND operation as the result of a logical operation.
[0045] When the cached data consists of two cache pages, the storage device can be an MLC. During the logical operation of the data distribution acquisition task, the controller performs an XOR operation on the two cache pages obtained from the target data, and also performs an AND operation on them, obtaining a AND result. The XOR and AND results are then used as the logical operation result to obtain the target number.
[0046] S23: The controller obtains a target number based on the result of a single value in a cached page of data.
[0047] This cached page data belongs to one of the two cached page data mentioned above.
[0048] S24: The controller obtains a target number based on the result of an XOR operation where the data is one.
[0049] S25: The controller obtains a target number based on a result that is one with the data in the calculation result.
[0050] The target number is the number of times the result is data type 1. A target number is obtained based on the number of data type 1s in a page of cached data, the number of data type 1s in the XOR operation result, and the number of data type 1s in the AND operation result. An XOR operation result includes at least one bit of data, and the number of bits in this bit is the same as the number of bits in the read cached data. The XOR operation result contains the same number of bits as the cached data, and the AND operation follows the same logic.
[0051] Once the three target numbers are obtained, they can be sent to an external controller to calculate the data distribution results.
[0052] Reference Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the data distribution statistics method of this application. This method is a further extension of steps S13 and S14, and includes the following steps:
[0053] S31: The controller selects two pages of cached data and performs a bitwise AND operation to obtain a result.
[0054] S32: Use the result of an AND operation as the result of a logical operation.
[0055] S33: The controller obtains two target numbers based on the result that the data in the two cached pages is one, and each target number corresponds to one cached page.
[0056] S34: The controller obtains a target number based on a result where the data in the calculation result is one.
[0057] Similar to the second embodiment, but this embodiment selects to use two pages of cached page data to obtain two target numbers, and does not perform XOR logic operation, but only AND operation, and uses the AND operation result to obtain a third target number.
[0058] Reference Figure 4 , Figure 4 This is a flowchart illustrating the fourth embodiment of the data distribution statistics method of this application. The method is a further extension of step S13, and includes the following steps:
[0059] S41: The controller selects at least two cached pages from at least three cached pages and performs an XOR operation to obtain at least three XOR results, and selects all at least three cached pages and performs an AND operation to obtain one AND result.
[0060] S42: Use at least three XOR operation results and one AND operation result as the logical operation result.
[0061] When the cached data consists of at least three cached pages, the storage device can be TLC, QLC, etc. During the logical operation of the data distribution acquisition task, the controller selects at least two cached pages from the at least three cached pages and performs an XOR operation to obtain at least three XOR results. For example, for TLC, with three cached pages, XOR operations are performed on Lowerpage and Middlepage, Middlepage and Upperpage, and Lowerpage, Middlepage, and Upperpage respectively to obtain three XOR results. The XOR result of Lowerpage and Upperpage can be omitted because it can be obtained from the XOR results of Lowerpage and Middlepage, and Middlepage and Upperpage. Based on the three XOR results obtained from any two cached pages, it is determined that any two XOR results can yield a third XOR result, so this is omitted. Finally, only the two XOR results from the XOR operation of any two cached pages and one XOR result from the XOR operation of all three cached pages are retained.
[0062] For QLC, with four pages of cached data, performing an XOR operation on at least two pages yields at least ten XOR results. Selecting two pages results in six XOR results; selecting three pages results in four; similar to the previous example, there's one XOR result that can be omitted, so only three are retained; selecting all four pages results in one XOR result.
[0063] For the AND operation, all cached page data is bitwise ANDed to obtain a result.
[0064] The XOR and AND operations are used as the results of logical operations.
[0065] Reference Figure 5 , Figure 5 This is a flowchart illustrating the fifth embodiment of the data distribution statistics method of this application. This method is a further extension of the above embodiments and includes the following steps:
[0066] S51: The controller obtains at least three target numbers based on the result that is one in at least three cached page data, and each target number corresponds to one cached page data.
[0067] S52: The controller obtains at least three target numbers based on the results of at least three XOR operations where the data is one, and each target number corresponds to an XOR operation result.
[0068] S53: The controller obtains a target number based on a result where the data in the calculation result is one.
[0069] The target number is obtained based on cached page data. Since each cached page has a corresponding target number, at least two target numbers can be obtained based on at least two cached pages. The target number is the number of results where the data in the cached page is 1.
[0070] Similarly, each XOR operation result yields a corresponding target number, and at least three target numbers are obtained based on the results of at least three XOR operations.
[0071] The result of the AND operation yields a target number. Therefore, at least seven target numbers can be obtained in the end.
[0072] Reference Figure 6 , Figure 6 This is a flowchart illustrating the sixth embodiment of the data distribution statistics method of this 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: In response to the data distribution acquisition command, the external controller sends a data distribution acquisition request to the storage device.
[0074] The data distribution acquisition command can be generated by the external controller itself or received. In response to receiving the data distribution acquisition command, a data distribution acquisition request is sent to the controller of the storage device, so that the storage device controller can perform data acquisition and logical operations according to the request to obtain the target number.
[0075] S62: The external controller receives at least three target numbers from the controller of the storage device based on the data distribution request.
[0076] The target number is obtained by the controller based on at least two pages of cached data in the storage cache and the result of a logical operation where the data is one. The logical operation result is obtained based on at least two pages of cached data. The logical operation includes an AND operation, or an XOR operation and an AND operation.
[0077] The acquisition of target data is described in the above embodiments and will not be repeated here.
[0078] S63: The external controller generates the data distribution results of the storage cells of the corresponding storage device in the form of solving linear equations based on at least three target numbers.
[0079] The external controller continues to perform calculations based on the target number to obtain the data distribution result. The data distribution result may include the quantity corresponding to each data state in the memory cell at the address corresponding to the target data.
[0080] Reference Figure 7 , Figure 7 This is a flowchart illustrating the seventh embodiment of the data distribution statistics method of this application. The method is a further extension of step S63, and includes the following steps:
[0081] S71: The external controller obtains the first matrix based on at least three target numbers.
[0082] S72: The external controller performs inverse matrix solving on the preset matrix to obtain the second matrix. The preset matrix is obtained based on the data source state information of the result where the data is one.
[0083] The preset matrix can be obtained in the following ways.
[0084] In one embodiment, the external controller determines a first equation corresponding to the target number based on the data source status information of the result where the data in the cached page data is one. The external controller determines a second equation corresponding to the target number based on the data source status information of the result where the data in the XOR operation is one. The external controller determines a third process corresponding to the target number based on the data source status information of the result where the data in the AND operation is one. A preset matrix is generated based on the first equation, the second equation, and the third process.
[0085] In one specific embodiment, when only two pages of cached data exist, such as for MLC, its storage unit can have four data states. These four data states are considered as bit values of 0, 1, 2, and 3, and the corresponding number of storage units is set as x0, x1, x2, and x3. To obtain these four variables, four linearly independent equations are needed.
[0086] Assuming the total number of storage cells is b0, the first equation is: x0 + x1 + x2 + x3 = b0. The total number b0 can be calculated by an external controller, or it can be obtained as a target number by the storage device's controller and sent to the external controller.
[0087] Analyzing the source of the 1 in the XOR result of LP and UP, it originates from memory cells with bit values of 1 and 2, leading to the second equation: x1 + x2 = b1. For example... Figure 8 As shown, Figure 8 This is a schematic diagram illustrating the source analysis of the XOR result of LP and UP. The equation in question is the second equation mentioned above.
[0088] For analyzing the results where the value is 1 in the LP and UP cache page data, you can refer to... Figure 8 The 1 in LP comes from memory locations with bit values of 1 and 3; the 1 in UP comes from memory locations with bit values of 2 and 3, resulting in two equations: x1 + x3 = b2 and x2 + x3 = b2. One of these two equations is chosen as the third equation. For example, if x1 + x3 = b2 is chosen, this equation becomes the first equation mentioned above.
[0089] Analyzing the result of the AND operation between LP and UP, where the result is 1, we find that the 1 comes from a storage unit with a bit value of 3, leading to the fourth equation: x3 = b3. This equation is the third equation mentioned above.
[0090] Then, converting the first equation, the second equation, the third equation, and a total equation into matrix form, we get:
[0091] Ax = B
[0092]
[0093] Matrix A is the aforementioned preset matrix.
[0094] Then, by solving for its inverse matrix, we obtain x = A. -1 B. A -1 This is the second matrix mentioned above.
[0095] The result in matrix x corresponds to the number of data states with bit values from 1 to 3.
[0096] The forms of the total equation and the third equation are basically fixed and only depend on the number of variables. Therefore, in practice, determining the first and second equations is sufficient to obtain the preset matrix.
[0097] In the data distribution acquisition task where at least three pages of cached data exist, the presence of at least three pages of cached data reduces one equation obtained from the XOR logic operation source analysis because it is linearly correlated with other equations obtained from the XOR operation source analysis. This can be specifically described in the third embodiment of the data distribution statistical method. Therefore, when determining the second equation, it is necessary to determine which XOR logic operation second equations to retain in order to correspondingly set the XOR operation logic in the storage device controller. This allows the storage device controller to determine which cached pages of data to perform the XOR operation to obtain the target number.
[0098] In one specific embodiment, the matrix can be obtained through the following steps.
[0099] In acquiring the data distribution, each data state is treated as an unknown and equations are formulated. For TLC, there are eight data states, which are represented by bit values of 0, 1, 2, 3, 4, 5, 6, and 7. The number of corresponding storage units is set as x0, x1, x2, ..., x7. To obtain these eight variables, eight linearly independent equations are needed. These eight equations are then transformed into matrix form and solved.
[0100] Assuming the total number of storage cells is b0, the first equation is: x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 = b0. The total number b0 can be calculated by an external controller, or it can be obtained as a target number by the storage device's controller and sent to the external controller.
[0101] When at least three pages of cached data exist, the external controller determines at least three second equations corresponding to the at least three target numbers based on the data source status information of the results of at least three XOR operations where the data is 1. Three pages of cached data require the determination of three second equations, and four pages of cached data require the determination of ten second equations. Taking TLC as an example, analyzing the source of the 1 in the XOR results of LP, MP, and UP, which originates from memory cells with bit values of 1, 2, 4, and 7, yields the second equation: x1 + x2 + x4 + x7 = b1. Figure 9 As shown, Figure 9 A schematic diagram illustrating the source analysis of the XOR results of LP, MP, and UP.
[0102] Analyzing the 1 in the XOR result of MP and LP, which comes from memory cells with bit values of 1, 2, 5, and 6, we obtain the third equation: x1 + x2 + x5 + x6 = b2. For example... Figure 10 As shown, Figure 10 A schematic diagram illustrating the source analysis of the XOR result of MP and LP.
[0103] Analyzing the 1 in the XOR result of MP and UP, which comes from memory cells with bit values of 2, 3, 4, and 5, we can obtain the fourth equation: x2 + x3 + x4 + x5 = b3. For example... Figure 11 As shown, Figure 11 A schematic diagram illustrating the source analysis of the XOR result of MP and UP.
[0104] The second to fourth equations are the second equations for obtaining the preset matrix. Analyzing the results of LP, MP, and UP cache page data where the result is 1, we find that the 1 in LP comes from memory locations with bit values of 1, 3, 5, and 7; the 1 in MP comes from memory locations with bit values of 2, 3, 6, and 7; and the 1 in UP comes from memory locations with bit values of 4, 5, 6, and 7. This yields the fifth to seventh equations: x1 + x3 + x5 + x7 = b4, x2 + x3 + x6 + x7 = b5, x4 + x5 + x6 + x7 = b6. For example... Figure 12 As shown, Figure 12 This is a schematic diagram illustrating the source analysis of LP, MP, and UP. Equations five through seven are the first equations for obtaining the preset matrix.
[0105] Analyzing the result of the AND operation of LP, MP, and UP where a value of 1 is obtained, the 1 comes from a storage unit with a bit value of 7, leading to the eighth equation: x7 = b7. The eighth equation is the third-party procedure for obtaining the preset matrix.
[0106] Converting the above equation into matrix form, we get:
[0107] Ax = B
[0108]
[0109] b0, b1, b2, b3, b4, b5, b6, and b7 represent the target numbers obtainable by the storage device. Matrix B is the first matrix mentioned above, and matrix A is the preset matrix mentioned above. Matrix B is obtained based on the target numbers, and matrix A is obtained based on the cached page data and the data-source status information of the data-result in the logical operation results.
[0110] Solving the inverse matrix of the above matrix equation yields the equation for determining the number of data state distributions:
[0111] x = A -1 B
[0112]
[0113] Among them, A -1 This is the second matrix mentioned above.
[0114] S73: The external controller multiplies the first matrix and the second matrix to obtain the third matrix.
[0115] After obtaining the first and second matrices, multiplying the first and second matrices will yield the third matrix x.
[0116] S74: The external controller generates the data distribution results based on the third matrix.
[0117] In the third matrix, x0 to x7 correspond to the number of data states corresponding to bits 0 to 7.
[0118] Using the above formula, after obtaining the target numbers b0 to b7, the quantity of each data state can be obtained by solving the matrix equation. Furthermore, the equation solving operation only involves addition, subtraction, and shifting, making the operation very fast and allowing for quick results. This significantly reduces the computational burden on the external controller, providing more computational resources for other tasks.
[0119] The equations for calculating the total number of variables (the first equation above) and the equation for the AND operation (the seventh equation above) remain essentially unchanged in form across different scenarios. Only the number of variables varies depending on the type of storage unit, such as TLC or QLC (e.g., eight for TLC, sixteen for QLC). The first and second equations, however, are modified according to the type of storage unit and the pre-selected XOR operation logic, thereby altering the first and second matrices used to calculate the data distribution results and changing the solution process of the external controller. Therefore, determining the first and second equations effectively yields the preset matrices.
[0120] When there are two pages of cached data, the preset matrix can also be obtained in the following ways.
[0121] In one embodiment, the external controller determines the fourth equation corresponding to the target number based on the data source status information of the result where the data in the cache page data is one; the external controller determines the fifth equation corresponding to the target number based on the data source status information of the result where the data in the operation result is one; and a preset matrix is generated based on the fourth and fifth equations.
[0122] When only two pages of cached data exist, the storage unit can have four data states. These four data states can be represented by bit values of 0, 1, 2, and 3, with the corresponding number of storage units set as x0, x1, x2, and x3. To obtain these four variables, four linearly independent equations are needed.
[0123] Assuming the total number of storage cells is b0, the first equation is: x0 + x1 + x2 + x3 = b0. The total number b0 can be calculated by an external controller, or it can be obtained as a target number by the storage device's controller and sent to the external controller.
[0124] For analyzing the results where the LP and UP cache page data are all one, you can refer to... Figure 8 The 1 in LP comes from memory locations with bit values of 1 and 3; the 1 in UP comes from memory locations with bit values of 2 and 3, which gives us two equations: x1 + x3 = b2, x2 + x3 = b2. These two equations are the fourth equation.
[0125] Analyzing the result of the AND operation between LP and UP, where the result is 1, we find that the 1 comes from a storage unit with a bit value of 3, leading to the equation: x3 = b3. This equation is the fifth equation mentioned above.
[0126] Then, it is converted into matrix form for calculation. In this embodiment, the data distribution result can be obtained without using the XOR operation result equation. The subsequent steps are similar to those in the above embodiment and will not be repeated here.
[0127] like Figure 13 As shown, Figure 13 This is a schematic diagram of the structure of an embodiment of the storage device of this application.
[0128] The storage device includes a controller 110, a storage cache 120, and a storage unit 130.
[0129] Storage unit 130 is used to store data, and storage cache 120 is used to store cached data corresponding to the data to be read.
[0130] The controller 110 is connected to the storage cache 120 and the storage unit 130 to implement the method provided by any of the first to fourth embodiments of the data distribution statistics method described above in this application and possible combinations thereof.
[0131] The storage device can be a USB flash drive, a portable hard drive, or a memory card, or other NAND Flash-based storage device.
[0132] like Figure 14 As shown, Figure 14 This is a schematic diagram of the structure of an embodiment of the data distribution detection device of this application.
[0133] One embodiment of the data distribution detection device of this 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 may be an integrated circuit chip with signal sequence processing capabilities. The external controller 210 can also be a general-purpose processor, a digital signal sequence processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor.
[0135] The external controller 210 is connected to the storage device under test (DUT) via the test interface 220 to implement the method provided in any of the fifth to sixth embodiments of the data distribution statistics method of this application, and possible combinations thereof. The DUT is the storage device described in the storage device embodiments of this application.
[0136] In summary, this application enables the storage device controller to respond to a received data distribution acquisition request, acquire cached data corresponding to the target data, perform logical operations including XOR and AND operations on the cached data, or perform logical operations including AND operations, and then send the obtained target number to an external controller. This allows the external controller to obtain the data distribution result in the storage unit where the target data is located based on the target number. During the data distribution result acquisition process, the storage device controller utilizes its computing power and resources to first perform operations on the cached data, enabling some operations to be processed within the storage device controller. The external controller only needs to further acquire the data distribution result according to the target number, reducing the computational load on the external controller, avoiding excessive consumption of the external controller's computing resources by the data distribution acquisition task, and improving the overall processing efficiency of the external controller.
[0137] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0139] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0140] If the integrated units in the other embodiments described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0141] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A data distribution statistical method, characterized in that, Applied to a storage device, the storage device including a controller, a storage cache, and storage units, the method includes: The controller responds to receiving a data distribution acquisition request and determines the target data in the storage unit based on the data distribution acquisition request. The controller obtains cached data corresponding to the target data in the storage cache based on the target data, and the cached data includes at least two pages of cached page data; The controller performs logical operations on the at least two cached pages to obtain a logical operation result. The logical operation includes an AND operation, or the logical operation includes an XOR operation and an AND operation. The controller obtains at least three target numbers based on the cached page data and the result of the logical operation where the data is one. The controller sends the at least three target numbers to an external controller so that the external controller generates the data distribution result corresponding to the storage unit based on the target numbers in the form of solving a linear equation.
2. The method according to claim 1, characterized in that, In response to the cached data comprising two cached pages, the controller performs logical operations on the at least two cached pages to obtain a logical operation result, including: The controller selects the two cached pages of data and performs an XOR operation to obtain an XOR result, and selects the two cached pages of data and performs an AND operation to obtain an AND result; The result of the XOR operation and the result of the AND operation are used as the result of the logical operation. The controller obtains at least three target numbers based on the cached page data and the results of the logical operation where the data is one, including: The controller obtains a target number based on the result of one in one page of cached page data, where one page of cached page data belongs to the two pages of cached page data. The controller obtains a target number based on the result of an XOR operation where the data is one. The controller obtains the target number based on the result of the operation where the data is one.
3. The method according to claim 1, characterized in that, In response to the cached data comprising two cached pages, the controller performs logical operations on the at least two cached pages to obtain a logical operation result, including: The controller selects the two cached page data and performs a bitwise AND operation to obtain a bitwise AND result; The result of the AND operation is taken as the result of the logical operation. The controller obtains at least three target numbers based on the cached page data and the results of the logical operation where the data is one, including: The controller obtains two target numbers based on the result that the data in the two cached page data is one, and each target number corresponds to one cached page data; The controller obtains the target number based on the result of the operation where the data is one.
4. The method according to claim 1, characterized in that, In response to the cached data including at least three cached pages, the controller performs logical operations on the at least two cached pages to obtain a logical operation result, including: The controller selects at least two cached pages from the at least three cached pages and performs an XOR operation to obtain at least three XOR results, and selects all three cached pages and performs an AND operation to obtain a single AND result. The results of the at least three XOR operations and the result of the one AND operation are taken as the result of the logical operation.
5. The method according to claim 4, characterized in that, The controller obtains at least three target numbers based on the cached page data and the results of the logical operation where the data is one, including: The controller obtains at least three target numbers based on the result that one of the at least three cached page data is a number, and each target number corresponds to one cached page data. The controller obtains at least three target numbers based on the result of the at least three XOR operations where the data is one, and each target number corresponds to an XOR operation result; The controller obtains the target number based on the result of the operation in which the data is one.
6. A data distribution statistical method, characterized in that, The method is applied to a data distribution detection device, which includes a storage device and an external controller. The storage device includes a controller, a storage cache, and a storage unit. In response to the data distribution acquisition instruction, the external controller sends a data distribution acquisition request to the storage device; 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 are obtained by the controller based on at least two pages of cache page data in the storage cache and the result of a logical operation in which the data is one. The logical operation result is obtained based on the at least two pages of cache page data. The logical operation includes an AND operation, or the logical operation includes an XOR operation and an AND operation. The external controller generates the data distribution result of the storage cell corresponding to the storage device based on the at least three target numbers in the form of solving a linear equation.
7. The method according to claim 6, characterized in that, The external controller generates the data distribution results of the storage cells corresponding to the storage device based on the at least three target numbers in the form of solving linear equations, including: The external controller obtains a first matrix based on the at least three target numbers; The external controller performs inverse matrix solving on the preset matrix to obtain a second matrix, which is obtained based on the data source state information of the result where the data is one. The external controller multiplies the first matrix and the second matrix to obtain the third matrix; The external controller generates the data distribution result based on the third matrix.
8. The method according to claim 7, characterized in that, The acquisition of the preset matrix includes: The external controller determines the first equation corresponding to the target number based on the data source status information of the result where the data in the cached page data is one. The external controller determines the second equation corresponding to the target number based on the data source status information of the result where the data in the XOR operation is one. The external controller determines the third-party program corresponding to the target number based on the data source status information of the result that is one with the data in the calculation result. The preset matrix is generated based on the first equation, the second equation, and the third-party process. Alternatively, the external controller may determine the fourth equation corresponding to the target number based on the data source status information of the result where the data in the cached page data is one; The external controller determines the fifth equation corresponding to the target number based on the data source status information of the result that is one with the data in the calculation result; The preset matrix is generated based on 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, wherein the controller is connected to the storage cache and the storage unit to implement the method as described in any one of claims 1-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 to the storage device under test, which is the storage device as described in claim 9. The storage device under test 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