Storage device and method for processing data
By introducing an instruction decoder into the storage device, the controller sends only one instruction to process data from multiple storage units, solving the problems of resource waste and inefficiency in the prior art and achieving more efficient data processing.
Patent Information
- Application Number
- CN202411165656.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-04-07
- Filing Date
- 2021-04-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-04-30
AI Technical Summary
In the prior art, the controller of a computer device needs to send multiple processing instructions to the storage medium to process data from multiple storage units, resulting in resource waste and low processing efficiency.
By introducing an instruction decoder into the storage device, the controller sends only one processing instruction, which contains information indicating the processing method and data length. Based on this instruction, the instruction decoder determines the target storage unit from multiple storage units and performs data processing.
This reduces the number of processing instructions sent by the controller, lowers resource consumption, and improves data processing efficiency.
Smart Images

Figure CN119252304B_ABST
Abstract
Description
[0001] This application is a divisional application. The original application has the application number 202110485385.5 and the original application date is April 30, 2021. The entire contents of the original application are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, and in particular to storage devices and methods for processing data. Background Technology
[0003] Computer devices comprise various components, and storage media is one of them. In storage media, data is stored in the form of multiple storage units, which are the smallest operational units for data processing.
[0004] In related technologies, a controller in a computer device sends instructions to a storage medium, with each instruction targeting a single storage unit. Therefore, when data processing is required across multiple storage units, the controller needs to send multiple processing instructions to the storage medium. This method consumes significant processing resources from the controller, leading to resource waste and low data processing efficiency. Summary of the Invention
[0005] This application provides a storage device and a method for processing data to solve the problems provided by related technologies. The technical solution is as follows:
[0006] In a first aspect, a storage device is provided, comprising a controller and a storage medium. The storage medium includes an instruction decoder and a plurality of storage cells, and the controller and the instruction decoder of the storage medium are connected. The controller is configured to send a first processing instruction to the instruction decoder of the storage medium. The first processing instruction includes first information and second information, wherein the first information indicates a processing method, and the second information indicates the data length of the data to be processed. Correspondingly, the instruction decoder of the storage medium is configured to receive the first processing instruction sent by the controller. Based on the data length indicated by the second information in the first processing instruction, at least two target storage cells are determined from the plurality of storage cells of the storage medium. Subsequently, based on the at least two target storage cells, data processing is performed according to the processing method indicated by the first information in the first processing instruction.
[0007] It can be seen that the controller only needs to send one processing instruction to enable the instruction decoder of the storage medium to perform continuous data processing based on at least two storage units. Compared to the case where each processing instruction can only instruct the instruction decoder to perform data processing based on one storage unit, the storage device provided in this embodiment can reduce the number of processing instructions that the controller needs to send. Therefore, it not only reduces the processing resources consumed by the controller during data processing and avoids resource waste, but also improves the efficiency of data processing.
[0008] In one possible implementation, multiple storage cells of the storage medium are located in at least one storage row. The instruction decoder of the storage medium determines the starting address of the data to be processed. Based on second information, the length of the multiple storage cells, the length of the at least one storage row, and the starting address of the data to be processed, it determines at least two target storage cells from the multiple storage cells of the storage medium. An exemplary implementation for determining at least two target storage cells is provided, thereby enabling the instruction decoder of the storage medium to perform data processing based on the determined at least two target storage cells.
[0009] In one possible implementation, the first processing instruction further includes third information, which indicates an address. The instruction decoder of the storage medium determines the address indicated by the third information as the starting address of the data to be processed, and at least two target storage units have contiguous addresses. Specifically, when the first processing instruction carries the third information, the instruction decoder of the storage medium directly uses the address indicated by the third information as the starting address of the data to be processed. Therefore, in subsequent processes, the storage unit containing the starting address of the data to be processed can be used as the first target storage unit, and contiguous storage units, including the first target storage unit, can be determined as at least two target storage units.
[0010] In one possible implementation, the instruction decoder of the storage medium is used to determine the starting address of the data to be processed based on multiple storage units of the storage medium, wherein the addresses of at least two target storage units may be contiguous or non-contiguous. Accordingly, the instruction decoder of the storage medium is also used to encapsulate the instruction identifier of the first processing instruction and the addresses of at least two target storage units to obtain a response message, and send the response message to the controller; the controller is further used to receive the response message. In this implementation, the instruction decoder of the storage medium randomly determines the starting address of the data to be processed from multiple storage units, and randomly determines at least two target storage units, which may be contiguous or non-contiguous. Since the at least two target storage units are randomly determined, the instruction decoder also needs to return the addresses of the at least two target storage units to the controller so that the controller can determine which target storage units the instruction decoder is based on for data processing.
[0011] In one possible implementation, the processing method for the first information indication includes a first processing method, which includes storing data in a storage unit. The controller is also used to send data. Accordingly, the instruction decoder of the storage medium is used to store the data sent by the controller in at least two target storage units according to the first processing method. The first processing method may be, for example, writing or overwriting. The data processing performed by the instruction decoder refers to the data storage process.
[0012] In one possible implementation, the processing method of the first information indication includes a second processing method, which includes a data processing method based on the storage units containing stored data. An instruction decoder for the storage medium is used to process the data stored in at least two target storage units according to the second processing method. The second processing method may include, for example, reading or erasing. The data processing performed by the instruction decoder refers to the processing of the stored data.
[0013] In one possible implementation, the instruction decoder of the storage medium is further configured to send data stored in at least two target storage units to the controller according to the address order of at least two target storage units. The controller is further configured to receive the data stored in the at least two target storage units sent by the instruction decoder of the storage medium. For example, when the processing mode is read, the instruction decoder of the storage medium needs to return the read data to the controller. The instruction decoder completes the data transmission through multiple transmission processes, and the length of the data transmitted in each transmission process depends on the bit width of the transmission interface.
[0014] In one possible implementation, the first processing instruction further includes fourth information indicating data grouping requirements. These requirements may include grouping at least two target storage units by storage row or by storage column. The instruction decoder of the storage medium is configured to group the at least two target storage units according to the data grouping requirements indicated by the fourth information, obtaining at least one group. Based on the target storage units in each group, data processing is performed according to the processing method indicated by the first information. In this implementation, according to the fourth information, the instruction decoder of the storage medium can perform data processing by storage row, that is, after completing the data processing of each target storage unit in one storage row, it switches to other storage rows to process the target storage units in those other storage rows. Alternatively, it can perform data processing by storage column, switching to other storage columns after completing the data processing of each target storage unit in one storage column. This fourth information makes the data processing process of the instruction decoder more flexible.
[0015] In one possible implementation, the instruction decoder of the storage medium is configured to, for any given group and to enable target storage units within that group, perform data processing on the concurrently enabled target storage units in that group according to the processing method indicated by the first information, such that the difference in processing time between the concurrently enabled target storage units in any given group is less than a threshold. Performing concurrent enabling and data processing on target storage units within the same group reduces the time required for enabling and data processing, thereby shortening the total time required for data processing.
[0016] In one possible implementation, at least two target storage units are located in the same logical unit number, where the target storage unit is the smallest unit for data processing. In this embodiment, one storage medium is equivalent to one logical unit number, therefore, at least two target storage units determined from multiple storage units of the storage medium are located in the same logical unit number.
[0017] In one possible implementation, the instruction decoder of the storage medium is further used to parse the first processing instruction to obtain first information and second information. The instruction decoder obtains the first information and second information by parsing the first processing instruction.
[0018] In one possible implementation, the sum of the lengths of at least two target storage units is not less than the data length indicated by the second information. Since the target storage unit is the smallest unit for data processing, the sum of the lengths of at least two target storage units may be equal to or greater than the data length indicated by the second information. For example, when the data length is not divisible by the length of the storage unit, the sum of the lengths of at least two target storage units is greater than the data length indicated by the second information.
[0019] In one possible implementation, there are multiple storage media. The controller receives a storage media identifier and sends a first processing instruction to the instruction decoder of the storage media indicated by the storage media identifier. When there are multiple storage media, the controller determines which storage media's instruction decoder to send the first processing instruction to based on the storage media identifier. For example, if the storage media identifier is a logical address sent by the processor, the controller uses the instruction decoder indicated by the physical address corresponding to that logical address as the instruction decoder for receiving the first processing instruction.
[0020] Secondly, a method for processing data is provided, the method being applied to a storage device, the storage device including a controller and a storage medium, the storage medium including an instruction decoder and multiple storage units, the method comprising:
[0021] The instruction decoder of the storage medium receives a first processing instruction sent by the controller. The first processing instruction includes first information and second information. The first information is used to indicate the processing method, and the second information is used to indicate the data length of the data to be processed.
[0022] The instruction decoder of the storage medium determines at least two target storage cells from a plurality of storage cells of the storage medium based on the data length indicated by the second information.
[0023] The instruction decoder of the storage medium processes data based on at least two target storage units in accordance with the processing method indicated by the first information.
[0024] In one possible implementation, the plurality of storage cells of the storage medium are located in at least one storage row, and the instruction decoder of the storage medium determines at least two target storage cells from the plurality of storage cells of the storage medium based on the data length indicated by the second information, including: the instruction decoder of the storage medium determines the starting address of the data to be processed; the instruction decoder of the storage medium determines at least two target storage cells from the plurality of storage cells of the storage medium based on the second information, the length of the plurality of storage cells, the length of at least one storage row and the starting address of the data to be processed.
[0025] In one possible implementation, the first processing instruction further includes third information, which is used to indicate an address. The instruction decoder of the storage medium determines the starting address of the data to be processed, including: the instruction decoder of the storage medium determines the address indicated by the third information as the starting address of the data to be processed, and the addresses of at least two target storage units are consecutive.
[0026] In one possible implementation, the instruction decoder of the storage medium determines the starting address of the data to be processed, including: determining the starting address of the data to be processed based on multiple storage cells of the storage medium, wherein the addresses of at least two target storage cells are contiguous or non-contiguous. After the instruction decoder of the storage medium processes the data according to the processing method indicated by the first information based on at least two target storage cells, the method further includes: the instruction decoder of the storage medium encapsulates the instruction identifier of the first processing instruction and the addresses of at least two target storage cells to obtain a response message, and sends the response message to the controller.
[0027] In one possible implementation, the processing method of the first information indication includes a first processing method, which includes a processing method of storing data in a storage unit. The instruction decoder of the storage medium performs data processing based on at least two target storage units according to the processing method of the first information indication, including: the instruction decoder of the storage medium stores the data sent by the controller in at least two target storage units according to the method indicated by the first information indication.
[0028] In one possible implementation, the processing method indicated by the first information includes a second processing method, which includes a data processing method based on the storage unit of the stored data. The instruction decoder of the storage medium performs data processing based on at least two target storage units according to the processing method indicated by the first information, including: the instruction decoder of the storage medium processes the data stored in at least two target storage units according to the second processing method.
[0029] In one possible implementation, after the instruction decoder of the storage medium processes data based on at least two target storage units according to the processing method indicated by the first information, the method further includes: the instruction decoder of the storage medium sending the data stored in at least two target storage units to the controller according to the address order of the at least two target storage units.
[0030] In one possible implementation, the first processing instruction further includes fourth information indicating a data grouping requirement. This fourth information may include grouping at least two target storage units by storage row or by storage column. The instruction decoder of the storage medium processes the data based on the at least two target storage units according to the processing method indicated by the first information. This includes: the instruction decoder of the storage medium groups the at least two target storage units according to the data grouping requirement indicated by the fourth information, resulting in at least one group. The instruction decoder of the storage medium then processes the data based on the target storage units within each group, according to the processing method indicated by the first information.
[0031] In one possible implementation, the instruction decoder of the storage medium performs data processing based on the target storage units in each group, according to the processing method indicated by the first information, including: the instruction decoder of the storage medium enables the target storage units in any group for any group; the instruction decoder of the storage medium performs data processing on the concurrently enabled target storage units in any group according to the processing method indicated by the first information, such that the difference between the processing times of the concurrently enabled target storage units in any group is less than a threshold.
[0032] In one possible implementation, at least two target storage units are located in the same logical unit number, and the target storage unit is the smallest unit for data processing.
[0033] In one possible implementation, before the instruction decoder of the storage medium processes data according to the processing method indicated by the first information based on the target storage units in each group, the method further includes: the instruction decoder of the storage medium parses the first processing instruction to obtain the first information and the second information.
[0034] In one possible implementation, the sum of the lengths of at least two target storage units is not less than the data length indicated by the second information.
[0035] Thirdly, a method for processing data is provided, the method being applied to a storage device, the storage device including a controller and a storage medium, the storage medium including an instruction decoder and multiple storage units, the method including:
[0036] The controller determines first information and second information. The first information is used to indicate the processing method, and the second information is used to indicate the data length of the data to be processed. The data length is used to determine at least two target storage units from multiple storage units of the storage medium. The at least two target storage units are used for data processing.
[0037] The controller encapsulates the first information and the second information to obtain the first processing instruction;
[0038] The controller sends the first processing instruction to the instruction decoder of the storage medium.
[0039] In one possible implementation, the controller determines the first information and the second information by: receiving a second processing instruction, the second processing instruction including first reference information and second reference information, the first reference information indicating a processing method, and the second reference information indicating the data length of the data to be processed. The first reference information is determined as the first information, and the second information is determined based on the second reference information.
[0040] In one possible implementation, the controller determines the first information and the second information by: the number of second processing instructions includes at least two; determining the second information based on second reference information includes: in response to the second reference information indicating that the data length is less than the lower limit of the reference range, the controller merges the second reference information of the at least two second processing instructions to obtain the second information, and the data length indicated by the second information is within the reference range.
[0041] In one possible implementation, the controller determines the first information and the second information, including: in response to a second processing instruction, the data length indicated by the second reference information is greater than the upper limit of the reference range, the controller divides the second reference information to obtain at least two pieces of second information, wherein the data length indicated by either second information is within the reference range.
[0042] In one possible implementation, the controller determines the first information and the second information by: in response to a second processing instruction, the data length indicated by the second reference information being within a reference range, and using the second reference information as the second information.
[0043] In one possible implementation, before the controller sends the first processing instruction to the instruction decoder of the storage medium, the method further includes: the controller acquiring third information, which is used to indicate an address, and encapsulating the third information in the first processing instruction.
[0044] In one possible implementation, after the controller sends a first processing instruction to the instruction decoder of the storage medium, the method further includes: receiving a response message sent by the instruction decoder of the storage medium, the response message including an instruction identifier of the first processing instruction and addresses of at least two target storage units.
[0045] In one possible implementation, after the controller sends a first processing instruction to the instruction decoder of the storage medium, the method further includes: sending data for the instruction decoder of the storage medium to be stored in at least two target storage units.
[0046] In one possible implementation, after the controller sends a first processing instruction to the instruction decoder of the storage medium, the method further includes: receiving data stored in at least two target storage units sent by the instruction decoder of the storage medium in the address order of at least two target storage units.
[0047] In one possible implementation, before the controller sends a first processing instruction to the instruction decoder of the storage medium, the method further includes: the controller determining fourth information, the fourth information indicating a data grouping requirement, the data grouping requirement including grouping at least two target storage units by storage row or by storage column, and encapsulating the fourth information in the first processing instruction.
[0048] In one possible implementation, at least two target storage units are located in the same logical unit number, and the target storage unit is the smallest unit for data processing.
[0049] In one possible implementation, the sum of the lengths of at least two target storage units is not less than the data length indicated by the second information.
[0050] In one possible implementation, there are multiple storage devices, and the controller sends a first processing instruction to the instruction decoder of the storage medium, including: the controller receiving a storage medium identifier and sending the first processing instruction to the instruction decoder of the storage medium indicated by the storage medium identifier. Attached Figure Description
[0051] Figure 1 This is a schematic diagram of the structure of a storage device provided in an embodiment of this application;
[0052] Figure 2 This is a schematic diagram of the structure of a storage device provided in an embodiment of this application;
[0053] Figure 3 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0054] Figure 4 This is a schematic diagram of the structure of a storage device provided in an embodiment of this application;
[0055] Figure 5 This application provides a schematic diagram of a data processing flow in a related art.
[0056] Figure 6 This application provides a schematic diagram of a data processing flow.
[0057] Figure 7 This is a schematic diagram illustrating data processing as provided in an embodiment of this application.
[0058] Figure 8 This is a schematic diagram illustrating data processing as provided in an embodiment of this application.
[0059] Figure 9 This is a schematic diagram illustrating a data processing method provided in an embodiment of this application. Detailed Implementation
[0060] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.
[0061] This application provides a storage device, see [link to relevant documentation] Figure 1 The storage device includes a controller and a storage medium. The storage medium includes a command decoder and multiple storage cells, with the controller and the command decoder of the storage medium connected together. Thus, the command decoder of the storage medium can receive processing instructions sent by the controller and perform data processing based on the received instructions. Each storage cell is a logical unit number (LUN), also known as a die. Multiple storage cells in the storage medium form an array, also known as a bank. This array includes M rows and N columns, where M and N are integers not less than 1. Each storage cell is uniquely identified by one row and one column. Additionally, the storage medium includes an input / output (I / O) interface, which is connected to the controller to return data processing results to the controller as needed.
[0062] For example, see Figure 2The storage device includes multiple storage media. Each of the multiple storage media includes the aforementioned instruction decoder and multiple storage units, which will not be described in detail here. The controller within the storage media is connected to the instruction controllers of each of the multiple storage media.
[0063] For example, see Figure 1 For any storage medium, in addition to the aforementioned controller and multiple storage units, it also includes a row address decoder and a column address decoder, each corresponding to a multiplexer (MUX). The instruction decoder sends instructions to the row address decoder, which then enables one or more rows in the array according to these instructions. The instruction decoder also sends instructions to the column address decoder, which then enables one or more columns in the array according to these instructions. Since storage units are uniquely identified by their rows and columns, enabling one or more storage units in the array allows for the enabling of the rows and columns respectively. In this embodiment, the enabled storage units can be used for data processing.
[0064] See Figure 1 Each storage medium also includes a data processing unit connected to an instruction decoder. This data processing unit, under the control of the instruction decoder, works in conjunction with the instruction decoder to complete the data processing process. Specifically, the instruction decoder first enables the storage cells in the array by controlling the row address decoder and column address decoder, and then controls the data processing unit to perform data processing based on the enabled storage cells. For example, the data processing unit performs read and erase operations on the enabled storage cells according to the control of the instruction decoder. Alternatively, the data processing unit may also be connected to a controller to receive data sent by the controller and write the received data into the enabled storage cells according to the control of the instruction decoder.
[0065] Based on the above Figure 1 and Figure 2 The storage device shown in this application provides a method for processing data, which is applied to the interaction process between a controller and an instruction decoder of the storage medium. See also... Figure 3 The method includes the following:
[0066] 301, The controller sends the first processing instruction to the instruction decoder of the storage medium.
[0067] The first processing instruction includes first information and second information. The first information indicates the processing method, and the second information indicates the data length of the data to be processed. The processing method indicated by the first information includes, but is not limited to, reading, writing, erasing, and overwriting. Reading refers to retrieving data already stored in a storage unit and returning it to the controller; writing refers to storing data in a storage unit that has not yet stored data; erasing refers to deleting data already stored in a storage unit; and overwriting refers to storing data in a storage unit that already contains stored data. These are just examples and are not intended to limit the processing method indicated by the first information. The data length of the data to be processed indicated by the second information is determined according to actual needs. In this embodiment, the second information can indicate the data length in various ways. For example, the second information includes a length value, and the data length is equal to this length value. Another example is that the second information is the number of storage units, and the data length is equal to the product of the number of storage units and the length of each storage unit. Yet another example is that the second information includes a first address and a second address following the first address, in which case the data length is equal to the difference between the second address and the first address.
[0068] For the controller, it first determines the first information and the second information. Then, by encapsulating the first information and the second information, the aforementioned first processing instruction is obtained, which is then sent to the instruction decoder of the storage medium. For example, the controller determines the first information and the second information by: receiving a second processing instruction, the second processing instruction including first reference information and second reference information, the first reference information indicating the processing method, and the second reference information indicating the data length of the data to be processed. The first reference information is determined as the first information, and the second information is determined based on the second reference information.
[0069] The second processing instruction includes instructions sent by the processor to the controller. The processor is a component located outside the storage device. The processor and the storage device can be integrated into the same computer device or located in different computer devices. The processing method indicated by the first reference information includes, but is not limited to, reading, writing, erasing, overwriting, etc. In this embodiment, the first reference information is used as the first information, so that the processing methods indicated by the first processing instruction and the second processing instruction are the same. For example, determining the second information based on the second reference information includes the following three cases A1-A3.
[0070] In case A1, the number of second processing instructions includes at least two, and the second information is determined based on the second reference information, including: in response to the data length indicated by the second reference information of at least two second processing instructions being less than the lower limit of the reference range, the controller merges the second reference information of at least two second processing instructions to obtain the second information, and the data length indicated by the second information is within the reference range.
[0071] The reference range refers to the range of data length values. This embodiment does not limit the lower or upper limit of the reference range. "The data length indicated by the second information is within the reference range" means that the data length indicated by the second information is not less than the lower limit of the reference range and not greater than the upper limit of the reference range. For example, the lower and upper limits of the reference range are determined based on the processing efficiency of the storage medium when processing data. For instance, the processing efficiency of the storage medium when processing data of different lengths is obtained, and the lower and upper limits of the reference range are determined based on the data length corresponding to processing efficiency higher than a threshold. This ensures that the storage medium can achieve high processing efficiency when processing data within the reference range.
[0072] Taking a reference range with a lower limit of 128 bytes (B) and an upper limit of 1 megabyte (MB) as an example, the process of the controller merging the second reference information is explained:
[0073] In the two second processing instructions received by the controller, the processing mode of the first reference information indication is write. One second reference information indication has a data length of 64B, and the other has a data length of 96B. Both data lengths of the second reference information indication are less than the lower limit of the reference range of 128B. Therefore, the controller merges the data lengths of the two second reference information indications, that is, it uses the sum of 64B and 96B, 160B, as the second information. This second information indication data length of 160B is within the reference range of 128B-1MB. For the controller, it only needs to send one first processing instruction to the instruction decoder of the storage medium. The first information indication of this first processing instruction is processed as write, and the data length of the second information indication of this first processing instruction is 160B.
[0074] If the controller does not merge the second reference information of at least two second processing instructions, then for each second processing instruction, the controller needs to send a first processing instruction to the instruction decoder of the storage medium. In other words, the controller needs to send at least two first processing instructions to the instruction decoder of the storage medium. In case A1, because the controller merges the second reference information of at least two second processing instructions, the number of first processing instructions sent by the controller to the instruction decoder of the storage medium is reduced. This reduces the processing resources consumed by the controller during data processing and improves data processing efficiency.
[0075] For example, in this embodiment, when the processing methods indicated by the first reference information of at least two second processing instructions are the same, the second reference information of the at least two second processing instructions is merged. For example, if the processing methods indicated by the first reference information of two second processing instructions are both write, then the second reference information of these two second processing instructions is merged. However, if the processing method indicated by the first reference information of one second processing instruction is write, and the processing method indicated by the first reference information of the other second processing instruction is read, then these two second processing instructions are not merged.
[0076] In case A2, in response to the second processing instruction, the data length indicated by the second reference information is greater than the upper limit of the reference range. The controller divides the second reference information to obtain at least two second information, and the data length indicated by either second information is within the reference range.
[0077] The method for determining the upper limit of the reference range is explained in Case A1 and will not be repeated here. During the process of the controller dividing the second reference information to obtain the second information, the data lengths indicated by different second information can be the same or different, as long as the data lengths indicated by each second information are within the reference range.
[0078] Taking a reference range with a lower limit of 128 bytes and an upper limit of 1 MB as an example, the process of the controller dividing the second reference information is explained:
[0079] The controller receives a second processing instruction. The first reference information of this second processing instruction indicates that the processing mode is read. The data length indicated by the second reference information is 4MB, which is greater than the upper limit of the reference range of 1MB. Therefore, the controller divides the second reference information into multiple second pieces of information, for example, dividing the second reference information into four equal parts, thus obtaining four pieces of second information. The data length indicated by each piece of second information is 1MB, which is within the reference range of 128B-1MB. Subsequently, the controller sends four first processing instructions to the decoder of the storage medium. The first information of each first processing instruction indicates that the processing mode is read, and the data length indicated by the second information is 1MB.
[0080] If the controller does not partition the second reference information of the second processing instruction, it sends only a first processing instruction to the instruction decoder of the storage medium. According to this first processing instruction, the storage medium needs to process a relatively long amount of data (e.g., 4MB in the example above) in a single data processing operation, thus requiring a long processing time. In some scenarios, after completing a data processing operation, the storage medium needs to return information to the controller. Because the processing time is long, the controller needs to wait a considerable amount of time to receive the returned information. For example, in a data reading scenario, after the storage medium completes data reading according to the first processing instruction, it needs to return the read data to the controller. The controller then needs to wait a considerable amount of time to receive the data read by the storage medium.
[0081] In scenario A2, because the controller divides the second reference information of the second processing instruction, it obtains at least two first processing instructions. Based on each first processing instruction, the length of data that the storage medium needs to process in a single data processing operation is reduced (e.g., from 4MB to 1MB in the example above), thereby shortening the time required for the storage medium to complete a single data processing operation. In scenarios where the storage medium needs to return information to the controller, the controller only needs to wait a short time to receive the information returned by the storage medium.
[0082] In case A3, in response to the second processing instruction, the data length indicated by the second reference information is within the reference range, and the second reference information is used as the second information.
[0083] If the data length indicated by the second reference information in the second processing instruction is within the reference range, the second reference information can be directly used as the second information. In case A3, the second processing instruction sent by the processor to the controller is the same as the first processing instruction sent by the controller to the instruction decoder of the storage medium; that is, the second processing instruction is the same as the first processing instruction.
[0084] The above explains how the controller generates the first processing instruction. When the controller is connected to the instruction decoder of a storage medium, the controller simply sends the first processing instruction to the instruction decoder of that storage medium. It should be noted that the storage medium has a corresponding chip-enable (CE) pin. The controller enables the storage medium through the CE pin, obtains the enabled storage medium, and then sends the first processing instruction to the enabled storage medium.
[0085] When the controller is connected to the instruction decoders of multiple storage media, the controller also needs to determine which storage media's instruction decoder to send the first processing instruction to. For example, the controller receives a storage media identifier and sends the first processing instruction to the instruction decoder of the storage media indicated by the storage media identifier. The storage media identifier is carried in a second processing instruction sent by the processor to the controller; the storage media identifier is, for example, a logical address. The controller stores a mapping relationship between logical addresses and physical addresses. Based on this mapping relationship, the controller can determine the physical address corresponding to the logical address. Among the multiple storage media, the storage media indicated by the physical address corresponding to the logical address is identified as the target storage media. The instruction decoder of the target storage media is used to receive the first processing instruction. Therefore, the controller enables the target storage media through the CE pin of the target storage media and sends the first processing instruction to the enabled target storage media.
[0086] 302, The instruction decoder of the storage medium receives the first processing instruction sent by the controller.
[0087] Since the instruction decoder of the storage medium is connected to the controller, the instruction decoder of the storage medium receives the first processing instruction after the controller sends it.
[0088] 303, The instruction decoder of the storage medium determines at least two target storage cells from a plurality of storage cells of the storage medium based on the data length indicated by the second information.
[0089] As described in 301, the first processing instruction includes first information and second information. To obtain the first information and second information in the first processing instruction, the method, exemplarily, further includes: an instruction decoder of the storage medium parsing the first processing instruction to obtain the first information and the second information. After obtaining the first information and the second information, the instruction decoder of the storage medium can determine the data length indicated by the second information, thereby enabling it to determine at least two target storage cells from a plurality of storage cells of the storage medium based on the data length.
[0090] It should be noted that since a storage medium is equivalent to a LUN, at least two target storage units identified from the multiple storage cells of the storage medium are also located in the same LUN. Furthermore, the target storage unit is the smallest unit for data processing. In other words, data processing is performed based on an integer number of target storage units. For any given target storage unit, data processing is not performed based on only a portion of that target storage unit. Therefore, the sum of the lengths of at least two target storage units is not less than the data length. For example, if the data length is divisible by the length of the target storage unit, the sum of the lengths of at least two target storage units is equal to the data length. Conversely, if the data length is not divisible by the length of the target storage unit, the sum of the lengths of at least two target storage units is greater than the data length.
[0091] In an exemplary embodiment, the instruction decoder of the storage medium determines at least two target storage cells from a plurality of storage cells of the storage medium based on the data length indicated by the second information, including 3031 and 3032 as follows.
[0092] 3031, The instruction decoder of the storage medium determines the starting address of the data to be processed.
[0093] The starting address of the data to be processed affects the number of target storage units. Even when the data length indicated by the second information and the length of the storage units are the same, different starting addresses of the data to be processed may result in different numbers of target storage units. For example, if the data length indicated by the second information is 32 bytes and the length of the storage unit is 16 bytes, see [link to example]. Figure 4 If the starting address of the data to be processed is the first digit of the address of storage unit 0 in row 0, then the target storage units are storage units 0 and 1 in row 0, and the number of target storage units is 2. If the starting address of the data to be processed is between the first and last digits of the address of storage unit 0 in row 0, then the target storage units are storage units 0, 1, and 3 in row 0, and the number of target storage units is 3. Therefore, this embodiment needs to determine the starting address of the data to be processed in order to subsequently determine the number of target storage units. For example, the determination of the starting address of the data to be processed includes the following two cases.
[0094] In scenario B1, the first processing instruction further includes third information, which indicates an address. The instruction decoder of the storage medium determines the address indicated by the third information as the starting address of the data to be processed. As explained above, the first processing instruction is obtained by the controller encapsulating the first and second information. When the first processing instruction further includes third information, before sending the encapsulated first processing instruction, the method further includes: the controller obtaining the third information indicating the address and encapsulating the third information in the first processing instruction. For example, the processor sends a second processing instruction to the controller, which includes information indicating the address. The controller parses the second processing instruction to obtain the information indicating the address, and then uses this information as the third information.
[0095] In case B2, the instruction decoder of the storage medium determines the starting address of the data to be processed based on multiple storage cells of the storage medium.
[0096] For example, the instruction decoder of the storage medium randomly selects a storage unit from among multiple storage units of the storage medium, and uses the first digit of the address of the randomly selected storage unit as the starting address of the data to be processed. Further, in some embodiments, the instruction decoder of the storage medium obtains the storage unit corresponding to the processing method indicated by the first information of the first processing instruction from among the multiple storage units of the storage medium, randomly determines a storage unit from among the storage units corresponding to the processing method indicated by the first information, and uses the first digit of the address of the randomly determined storage unit as the starting address of the data to be processed. Taking the processing method indicated by the first information as writing as an example, since writing refers to storing data in a storage unit where no data is stored, the storage unit corresponding to the processing method indicated by the first information refers to a storage unit where no data is stored. Therefore, the instruction decoder of the storage medium randomly determines a storage unit from among the storage units where no data is stored, and uses the first digit of the address of the randomly determined storage unit as the starting address of the data to be processed.
[0097] 3032, the instruction decoder of the storage medium determines at least two target storage units from the multiple storage units of the storage medium based on second information, the length of multiple storage units, the length of at least one storage line, and the starting address of the data to be processed.
[0098] For example, in this embodiment, the first target storage unit is determined based on the starting address of the data to be processed, and the total number of target storage units is determined based on the data length indicated by the second information, the length of the storage unit, and the starting address of the data to be processed. For ease of description, the total number of target storage units is denoted as the first number. In this embodiment, the first number of storage units, including the first target storage unit, are considered as at least two target storage units.
[0099] In an exemplary embodiment, in response to determining the starting address of the data to be processed according to case B1 above, a first number of storage units, including the first target storage unit, are designated as at least two target storage units. This includes designating a first number of consecutive storage units, starting from the first target storage unit, as at least two target storage units. This ensures that the addresses of the at least two target storage units are consecutive. For example, see... Figure 4 The first target storage unit is storage unit 0 in row 0, and the total number of target storage units is 4. Therefore, the target storage units are: storage unit 0, storage unit 1, storage unit 2 and storage unit 3 in row 0.
[0100] It is understood that multiple storage cells of a storage medium are located in at least one storage row, and the number of storage cells included in a storage row is finite. Therefore, the aforementioned at least two target storage cells may cover at least one storage row. This embodiment needs to determine the storage row covered by the at least two target storage cells based on the length of the storage row. The length of the storage row is equal to the sum of the lengths of the individual storage cells included in the storage row. For example, if a storage row includes 16 storage cells with a length of 16 bytes, then the length of the storage row is 256 bytes.
[0101] For example, the first storage row can be determined based on the starting address of the data to be processed, and the total number of storage rows can be determined based on the data length indicated by the second information, the length of the storage row, and the starting address of the data to be processed. This total number of storage rows is denoted as the second number. Therefore, the overwritten storage row refers to the second number of consecutive storage rows, including the first storage row. See, for example, [link to relevant documentation]. Figure 4 Given that the data length indicated by the second information is 512B, the length of the storage line is 256B, and the starting address of the data to be processed is the first address of storage unit 8 in line 0, the first storage line is line 0, and the total number of overwritten storage lines is 3. Thus, it can be determined that the overwritten storage lines are line 0, line 1, and line 2 in the storage medium.
[0102] Alternatively, in response to determining the starting address of the data to be processed according to situation B2 above, a reference number of storage units, including the first target storage unit, are designated as at least two target storage units. This includes: randomly determining storage units after the first target storage unit, and using the first target storage unit and the randomly determined storage unit as at least two target storage units. In this case, the addresses of the at least two target storage units may be consecutive or non-consecutive. For the case where the addresses of the at least two target storage units are consecutive, please refer to the example above; it will not be repeated here. For the case where the addresses of the at least two target storage units are non-consecutive, please refer to... Figure 4Taking the example where the first target storage unit is storage unit 0 in row 0, and the total number of target storage units is 4, the target storage units can be: storage unit 0, storage unit 2, storage unit 3, and storage unit 4 in row 0, where the addresses of storage unit 0 and storage unit 2 are not contiguous. In this case, at least two target storage units also cover at least one storage row, and the covered storage row can be determined based on the addresses of the randomly determined target storage units.
[0103] It should be noted that, since the target storage unit is randomly determined by the instruction decoder of the storage medium in case B2, the instruction decoder of the storage medium needs to return the address of the target storage unit to the controller so that the controller can know which target storage units the instruction decoder of the storage medium is based on for data processing. Therefore, in the exemplary embodiment, after the instruction decoder of the storage medium determines at least two target storage units, the method further includes: the instruction decoder of the storage medium encapsulates the instruction identifier of the first processing instruction and the addresses of at least two target storage units to obtain a response message, and sends the response message to the controller. The controller can determine the addresses of at least two target storage units by receiving the response message. The instruction identifier of the first processing instruction in the response message is used by the controller to distinguish different first processing instructions. If the controller sends multiple first processing instructions to the instruction decoder of the storage medium, the controller can determine which first processing instruction the instruction decoder of the storage medium determined the target storage unit based on.
[0104] In the above description, the instruction decoder of the storage medium parses the first processing instruction to obtain first information and second information (and possibly third information). Based on the second information, the instruction decoder determines at least two target storage units, which cover at least one storage row. The instruction decoder can send the covered storage rows to the row address decoder and the target storage units in each storage row to the column address decoder, enabling the row and column address decoders. Exemplarily, in this embodiment, the instruction decoder of the storage medium can also parse only the first processing instruction, sending the obtained second information (and possibly third information) to the row and column address decoders respectively. The row address decoder then determines the covered storage rows according to the received information, and the column address decoder determines the target storage units in each storage row according to the received information, enabling the row and column address decoders. The enabling process of the row and column address decoders is described in section 304 below.
[0105] 304, The instruction decoder of the storage medium performs data processing based on at least two target storage units, in accordance with the processing method indicated by the first information.
[0106] It can be seen that the instruction decoder can perform data processing based on at least two target storage units according to a first processing instruction sent by the controller. This data processing method is also called concurrent (burst) processing.
[0107] In an exemplary embodiment, the first processing instruction further includes fourth information indicating a data grouping requirement. This data grouping requirement includes grouping at least two target storage units by storage row or by storage column. Accordingly, the instruction decoder of the storage medium groups the at least two target storage units according to the data grouping requirement indicated by the fourth information, obtaining at least one group. Based on the target storage units in each group, data processing is performed according to the processing method indicated by the first information. Exemplarily, this fourth information can be obtained by the controller from a second processing instruction, which the controller encapsulates in the first processing instruction before sending it to the instruction decoder of the storage medium.
[0108] For example, the fourth information is represented as a numerical value, and different values of the fourth information are used to indicate different data grouping requirements. For instance, if the fourth information is a first numerical value, it indicates that the data grouping requirement is to group at least two target storage units by storage row. If the fourth information is a second numerical value, it indicates that the data grouping requirement is to group at least two target storage units by storage column, and the first and second numerical values are different values.
[0109] In response to the data grouping requirement, which includes grouping at least two target storage units by storage row, the instruction decoder processes data by storage row. That is, for a storage row containing target storage units, the instruction decoder first processes data based on the target storage units in one storage row, then switches to another storage row and processes data based on the target storage units in that row, and so on, until all storage rows containing target storage units have been traversed, at which point the data processing process ends. For example, see [link to documentation]. Figure 4 Taking the target storage unit as an example, which includes storage unit 0-15 in row 0 and storage unit 0-15 in row 1, the instruction decoder first performs data processing based on storage unit 0-15 in row 0, and then switches to row 1 to perform data processing based on storage unit 0-15 in row 1, thereby completing the data processing process.
[0110] Alternatively, in response to a data grouping requirement that includes grouping at least two target memory units by storage column, the instruction decoder processes data by storage column. For a storage column containing target memory units, the instruction decoder first processes data based on each target memory unit in one storage column, then switches to another storage column and processes data based on each target memory unit in that column, and so on, until all storage columns containing target memory units have been traversed, at which point the data processing process ends. For example, if the target memory units include memory units 0-15 in row 0 and memory units 0-15 in row 1, the instruction decoder first processes data based on memory units 0 in rows 0 and 1, then switches to memory unit 1 and processes data based on memory units 1 in rows 0 and 1. This process continues until data processing is completed based on memory units 15 in rows 0 and 1, thus completing the data processing process.
[0111] It is understood that the embodiments of this application do not limit the processing order of the target storage units in each group. For example, if the data grouping requirement includes grouping at least two target storage units by storage row, and the instruction decoder processes data based on the storage units in row 0 and row 1 respectively, then the instruction decoder processes data based on row 0 first and then on row 1, or the instruction decoder processes data based on row 1 first and then on row 0.
[0112] Furthermore, for any given memory cell, the process by which the instruction decoder performs data processing based on that memory cell includes: enabling the memory cell and performing data processing based on the enabled memory cell. Therefore, when performing data processing based on target memory cells in each group, the instruction decoder also needs to enable the target memory cells in each group so that data processing can be performed based on the enabled target memory cells within that group.
[0113] For example, in this embodiment, target storage units in any group are enabled concurrently to shorten the time required for data processing and improve data processing efficiency. For example, the instruction decoder of the storage medium performs data processing based on the target storage units in each group, according to the processing method indicated by the first information, including: the instruction decoder of the storage medium enables target storage units in any group concurrently. Data processing is performed on the concurrently enabled target storage units in any group according to the processing method indicated by the first information, such that the difference in processing time between the concurrently enabled target storage units in any group is less than a threshold.
[0114] In response to grouping by storage row, during a single concurrent enabling process, the instruction decoder sends a first instruction to the row address decoder. The row address decoder, based on this first instruction, controls its corresponding MUX to enable a storage row containing a target storage unit. Correspondingly, the instruction decoder sends a second instruction corresponding to the first instruction to the column address decoder. The column address decoder, based on this second instruction, controls its corresponding MUX to concurrently enable one or more storage columns corresponding to the storage row, thereby concurrently enabling the target storage unit within that storage row. Subsequently, data processing is performed on the concurrently enabled target storage units in the storage row according to the processing method indicated by the first information. By concurrently enabling target storage units within the same storage row, the difference in processing time between concurrently enabled target storage units is less than a threshold. In other words, the data processing of target storage units within the same storage row can be considered synchronous.
[0115] It should be noted that a target duration is set in the storage medium. This target duration is the time required for enabling and processing data for a single storage cell. In other words, timing begins when the instruction decoder sends an instruction to the row address decoder and column address decoder. After the target duration has elapsed, the enabling and data processing of a storage cell is considered complete. In this embodiment, since the data processing of each target storage cell within the same storage row is performed synchronously, timing begins when the instruction decoder sends an instruction. After one target duration has elapsed, the enabling and data processing of each target storage cell within that storage row is considered complete. Therefore, the instruction decoder can send new instructions to the row address decoder and column address decoder to instruct the concurrent enabling and data processing of target storage cells in other storage rows.
[0116] Taking the target storage units as including storage units 0-15 in row 0 and storage units 0-15 in row 1 as an example, let the target duration be T, and the time when the instruction decoder first sends the instruction be 0. Then: At time 0, the instruction decoder sends a first instruction to the row address decoder and a second instruction corresponding to the first instruction to the column address decoder. The row address decoder controls the MUX corresponding to the row address decoder to enable row 0 according to the first instruction, and the column address decoder controls the MUX corresponding to the column address decoder to enable columns 0-15 according to the first instruction, thereby enabling storage units 0-15 in row 0. After enabling, data processing is performed. At time T, the data processing based on storage units 0-15 in row 0 is considered complete. Therefore, the instruction decoder sends a new first instruction to the row address decoder and a new second instruction to the column address decoder to enable storage units 0-15 in row 1. After enabling, data processing is performed. At time 2T, the data processing based on storage units 0-15 in row 1 is considered complete, thus ending the data processing process.
[0117] Alternatively, in response to grouping by storage column, during a single parallel enabling process, the instruction decoder sends a first instruction to the column address decoder. The column address decoder, based on this first instruction, controls its corresponding MUX to enable a storage column containing a target storage unit. Correspondingly, the instruction decoder sends a second instruction corresponding to the first instruction to the row address decoder. The row address decoder, based on this second instruction, controls its corresponding MUX to enable one or more storage rows corresponding to that storage column, thereby enabling the target storage units included in that storage column in parallel. Subsequently, data processing is performed on the concurrently enabled target storage units in the storage column according to the processing method indicated by the first information, such that the difference in processing time between the concurrently enabled target storage units in the storage column is less than a threshold.
[0118] In the case of parallel operation, the time required for data processing in this embodiment is less than the time required for data processing in related technologies. See also Figure 5 , Figure 5The data processing process in related technologies is illustrated. In these technologies, the storage medium enables and processes data for each storage cell upon receiving a processing instruction from the controller. After completing the enabling and data processing for one storage cell, it waits for the next processing instruction from the controller and then enables and processes data for the next storage cell according to that instruction. For example, if a storage cell is 16 bytes long, and 64 bytes of data are to be processed according to these technologies, the controller needs to send four processing instructions. Based on this, the time required for the storage medium to complete the enabling and data processing for one storage cell is denoted as P, and the time required for the storage medium to wait for instructions is denoted as Q. Figure 5 It can be seen that the total time required to process 64B data according to the relevant technology is 4P+3Q.
[0119] In this embodiment, see Figure 6 Each time the storage medium receives a concurrent processing instruction from the controller, it can process data from at least two target storage units, reducing the number of processing instructions the controller needs to send, and the storage medium does not need to wait to receive other processing instructions. Furthermore, since the enabling process for each target storage unit is parallel, the data processing of each target storage unit is synchronous. In the same amount of time, related technologies can only complete data processing for one storage unit, while this embodiment can complete data processing for at least two target storage units, thereby shortening the time required for data processing. Figure 6 As shown, the time required to enable and process data for a storage unit is still denoted as P. Then, according to the method provided in this embodiment, when processing 64B data, the controller only needs to send one processing instruction, and the total time required to process 64B data is P, which is a reduction of (3P+3Q) time compared to related technologies.
[0120] Of course, the method provided in this embodiment is not limited to the case of parallel enabling. For example, for any group, this embodiment can also serially enable the target storage units in that group according to actual needs. The difference between serial enabling and parallel enabling is that parallel enabling synchronously enables each target storage unit within the same group, while serial enabling enables each target storage unit within the same group sequentially. For example, the serial enabling process is illustrated as follows: When grouping by storage row, and the target storage units include storage units 0-2 in row 0, let T be the time required for enabling and processing data for one storage unit, and let 0 be the time when the instruction decoder starts sending instructions. At time 0, the instruction decoder instructs the row address decoder to enable row 0 and the column address decoder to enable column 0, thereby enabling storage unit 0 in row 0. At time T, the instruction decoder instructs the row address decoder to enable row 0 and the column address decoder to enable column 1, thereby enabling storage unit 1 in row 0. At time 2T, the instruction decoder instructs the row address decoder to enable row 0 and the column address decoder to enable column 2, thereby enabling memory cell 2 in row 0. At time 3T, the data processing based on memory cells 0-2 in row 0 is considered complete, thus ending the data processing process.
[0121] Furthermore, as can be seen from the above explanation, the first information can be used to indicate multiple processing methods. When the processing method indicated by the first information differs, the process by which the instruction decoder of the storage medium completes data processing according to the processing method indicated by the first information also differs, as shown in cases C1 and C2 below.
[0122] In case C1, the processing method indicated by the first information includes a first processing method, which includes storing data in a storage unit. For example, the first processing method includes, but is not limited to, writing and overwriting. The instruction decoder of the storage medium also needs to acquire data to store it according to the first processing method. Therefore, the method provided in this embodiment further includes: the controller sending data. For example, the data sent by the controller is data received by the controller from the processor. Accordingly, the instruction decoder of the storage medium processes data based on at least two target storage units according to the processing method indicated by the first information, including: storing the data sent by the controller in at least two target storage units according to the first processing method. For example, after sending a first processing instruction to the instruction decoder of the storage medium, the controller continues to send data to the instruction decoder of the storage medium, so that the instruction decoder stores the data in the target storage units. Alternatively, after sending a first processing instruction to the instruction decoder of the storage medium, the controller sends data to the data processing unit in the storage medium, and after determining that the target storage unit is enabled, the instruction decoder controls the data processing unit to store the data in the target storage unit.
[0123] In scenario C2, the processing method indicated by the first information includes a second processing method, which includes a method of data processing based on storage units containing stored data. For example, the second processing method includes, but is not limited to, reading and erasing. The instruction decoder of the storage medium processes data based on at least two target storage units according to the processing method indicated by the first information, including: the instruction decoder of the storage medium processes the data already stored in the at least two target storage units according to the second processing method.
[0124] In an exemplary embodiment, after the instruction decoder of the storage medium processes the data stored in at least two target storage units according to the second processing method, the method further includes: the instruction decoder of the storage medium sending the data stored in the at least two target storage units to the controller according to the address order of the at least two target storage units. Correspondingly, the controller also receives the data stored in the at least two target storage units sent by the instruction decoder of the storage medium. Exemplarily, the instruction decoder of the storage medium transmits data through multiple transmission processes, where the length of data transmitted in each transmission process is determined based on the bit width of the I / O interface; that is, the length of data transmitted in each transmission process is no greater than the bit width of the I / O interface. Therefore, the instruction decoder of the storage medium first divides the data stored in the first target storage unit into multiple parts according to the bit width of the I / O interface, and sends each part to the controller in order of address from first to last. After all parts in the first target storage unit have been transmitted, the data stored in the second target storage unit is divided and transmitted in the same manner. This process continues until all data stored in each target storage unit has been transmitted.
[0125] For example, if there are two target memory units, each 16 bytes long, and the I / O interface has a bit width of 1 byte, then the data already stored in the first target memory unit is first divided into 16 parts, each 1 byte long. These parts are then sent sequentially from first to last according to their addresses, from first to last, resulting in 16 transmissions to send the data from the first target memory unit to the controller. Then, the data already stored in the second target memory unit is also divided into 16 parts, each 1 byte long, and sent to the controller in 16 transmissions.
[0126] The above describes the data processing method provided in the embodiments of this application. Next, taking a storage unit with a length of 16 bytes and a reading processing method as an example, the application process of the data processing method provided in the embodiments of this application will be illustrated through the following three examples.
[0127] Example 1, see Figure 7 , Figure 7 The process of reading 64 bytes of data is illustrated. The instruction decoder of the storage medium controls the row address decoder and the corresponding MUX to enable row 0, and controls the column address decoder and the corresponding MUX to enable columns 0-3, thereby enabling memory cells 0-3 in row 0. Then, the data stored in memory cells 0-3 in row 0 is read, for a total of 64 bytes of data.
[0128] Example 2, see Figure 8 , Figure 8The process of reading 256B of data is illustrated. Specifically, the instruction decoder of the storage medium controls the row address decoder and the corresponding MUX to enable row 0, and controls the column address decoder and the corresponding MUX to enable columns 0-15, thereby enabling memory cells 0-15 in row 0. Then, the data stored in memory cells 0-15 in row 0 is read, for a total of 256B of data.
[0129] Example 3, see Figure 9 , Figure 9 This illustrates the process of reading 4KB (4096B) of data. The instruction decoder of the storage medium controls the row address decoder and its corresponding MUX to enable row 0, and controls the column address decoder and its corresponding MUX to enable columns 0-15, thus enabling memory cells 0-15 in row 0 and reading 256B of data. Next, the instruction decoder controls the row address decoder and its corresponding MUX to enable row 1, and controls the column address decoder and its corresponding MUX to enable columns 0-15, thus enabling memory cells 0-15 in row 1 and continuing to read 256B of data. This continues until the instruction decoder controls the row address decoder and its corresponding MUX to enable row 15, and controls the column address decoder and its corresponding MUX to enable columns 0-15, thus enabling memory cells 0-15 in row 15 and reading 256B of data. In total, 4KB of data is read across 16 rows.
[0130] In summary, the controller only needs to send a single processing instruction to enable the instruction decoder of the storage medium to perform continuous data processing based on at least two storage units. Compared to a scenario where each processing instruction can only instruct the instruction decoder to perform data processing based on one storage unit, the data processing method provided in this embodiment reduces the number of processing instructions that the controller needs to send. This not only reduces the processing resources consumed by the controller during data processing and avoids resource waste, but also improves the efficiency of data processing.
[0131] It should be understood that the aforementioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.
[0132] Furthermore, in an optional embodiment, the storage medium may include a read-only storage medium and a random access storage medium, providing instructions and data to the processor. The storage medium may also include a non-volatile random access storage medium. For example, the storage medium may also store device type information.
[0133] The storage medium can be volatile or non-volatile, or a combination of both. The non-volatile storage medium can be phase-change memory (PCM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile storage medium can be random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0134] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).
[0135] The above description is merely an embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A storage device, characterized in that, The storage device includes a controller and a storage medium, the storage medium including an instruction decoder and a plurality of storage units, and the controller and the instruction decoder of the storage medium are connected; The controller is configured to determine first information and second information based on the received second processing instruction, and send the first processing instruction to the instruction decoder of the storage medium. The first processing instruction includes the first information and the second information. The first information is used to indicate the processing method of the data to be processed, and the second information is used to indicate the data length of the data to be processed. The instruction decoder is configured to receive the first processing instruction, determine at least two target storage units from a plurality of storage units of the storage medium based on the data length indicated by the second information, and process the data to be processed using the at least two target storage units in accordance with the processing method indicated by the first information.
2. The storage device according to claim 1, characterized in that, The number of the second processing instructions is at least two, and the second processing instructions include second reference information. The controller is configured to determine the second information based on the sum of the data lengths indicated by the second reference information of the at least two second processing instructions, in response to the data lengths indicated by the second reference information of the at least two second processing instructions being less than the lower limit of the reference range. The data lengths indicated by the second information are within the reference range.
3. The storage device according to claim 1, characterized in that, The second processing instruction includes second reference information. The controller is configured to, in response to the second processing instruction indicating that the data length is greater than the upper limit of the reference range, segment the data length indicated by the second reference information to obtain the second information, wherein the data length indicated by the second information is within the reference range.
4. The storage device according to any one of claims 1-3, characterized in that, The storage medium has multiple storage cells located in at least one storage row. The instruction decoder of the storage medium is used to determine the starting address of the data to be processed. Based on the second information, the length of the multiple storage cells, the length of the at least one storage row, and the starting address of the data to be processed, the at least two target storage cells are determined from the multiple storage cells of the storage medium.
5. The storage device according to claim 4, characterized in that, The first processing instruction further includes third information, which is used to indicate an address. The instruction decoder of the storage medium is used to determine the address indicated by the third information as the starting address of the data to be processed, and the addresses of the at least two target storage units are consecutive.
6. The storage device according to claim 4, characterized in that, The instruction decoder of the storage medium is used to determine the starting address of the data to be processed based on multiple storage cells of the storage medium, wherein the addresses of the at least two target storage cells are consecutive or non-consecutive. The instruction decoder of the storage medium is further configured to encapsulate the instruction identifier of the first processing instruction and the addresses of the at least two target storage units to obtain a response message and send the response message to the controller; The controller is also configured to receive the response message.
7. The storage device according to any one of claims 1-6, characterized in that, The processing method indicated by the first information includes a first processing method, which includes a processing method of storing data in a storage unit. The controller is also used to send data. The instruction decoder of the storage medium is used to store the data sent by the controller into the at least two target storage units according to the first processing method.
8. The storage device according to any one of claims 1-6, characterized in that, The processing method indicated by the first information includes a second processing method, which includes a data processing method based on the storage unit of the stored data. The instruction decoder of the storage medium is used to process the data stored in the at least two target storage units according to the second processing method.
9. The storage device according to claim 8, characterized in that, The instruction decoder of the storage medium is also used to send the data stored in the at least two target storage units to the controller according to the address order of the at least two target storage units; The controller is also configured to receive data stored in the at least two target storage units sent by the instruction decoder of the storage medium.
10. The storage device according to any one of claims 1-6, characterized in that, The first processing instruction further includes fourth information, which is used to indicate data grouping requirements. The data grouping requirements include grouping the at least two target storage units by storage row or by storage column. The instruction decoder of the storage medium is used to group the at least two target storage units according to the data grouping requirements indicated by the fourth information to obtain at least one group, and to perform data processing based on the target storage units in each group according to the processing method indicated by the first information.
11. The storage device according to claim 10, characterized in that, The instruction decoder of the storage medium is configured to, for any group and to enable the target storage unit in the any group, perform data processing on the target storage unit in the any group according to the processing method indicated by the first information, such that the difference between the processing times of the target storage units in the any group is less than a threshold.
12. The storage device according to any one of claims 1-11, characterized in that, The at least two target storage units are located in the same logical unit number, and the target storage unit is the smallest unit for data processing.
13. The storage device according to any one of claims 1-12, characterized in that, The instruction decoder of the storage medium is further used to parse the first processing instruction to obtain the first information and the second information.
14. The storage device according to any one of claims 1-13, characterized in that, The sum of the lengths of the at least two target storage units is not less than the data length indicated by the second information.
15. The storage device according to any one of claims 1-14, characterized in that, The number of storage media is multiple, and the controller is used to receive the storage media identifier and send the first processing instruction to the instruction decoder of the storage media indicated by the storage media identifier.
16. A method for processing data, characterized in that, The method is applied to a storage medium in a storage device, and the method includes: The instruction decoder of the storage medium receives a first processing instruction sent by the controller in the storage device. The first processing instruction includes first information and second information. The first information is used to indicate the processing method of the data to be processed, and the second information is used to indicate the data length of the data to be processed. The first information and the second information are determined according to the second processing instruction received by the controller. The instruction decoder of the storage medium determines at least two target storage cells from a plurality of storage cells of the storage medium based on the data length indicated by the second information. The instruction decoder of the storage medium processes the data to be processed using the at least two target storage units in accordance with the processing method indicated by the first information.
17. The method according to claim 16, characterized in that, The number of the second processing instructions is at least two, and the second processing instructions include second reference information. When the data length indicated by the second reference information of the at least two second processing instructions is less than the lower limit of the reference range, the second information is determined according to the sum of the data lengths indicated by the second reference information of the at least two second processing instructions, and the data length indicated by the second information is within the reference range.
18. The method according to claim 16, characterized in that, The second processing instruction includes second reference information. When the data length indicated by the second reference information of the second processing instruction is greater than the upper limit of the reference range, the second information is obtained by segmenting the data length indicated by the second reference information of the second processing instruction. The data length indicated by the second information is within the reference range.
19. The method according to any one of claims 16-18, characterized in that, The storage medium has multiple storage cells located in at least one storage row. The instruction decoder of the storage medium determines at least two target storage cells from the multiple storage cells of the storage medium based on the data length indicated by the second information, including: The instruction decoder of the storage medium determines the starting address of the data to be processed; The instruction decoder of the storage medium determines the at least two target storage cells from the plurality of storage cells of the storage medium based on the second information, the length of the plurality of storage cells, the length of the at least one storage line, and the starting address of the data to be processed.
20. The method according to claim 19, characterized in that, The first processing instruction further includes third information, which is used to indicate an address. The instruction decoder of the storage medium determines the starting address of the data to be processed, including: The instruction decoder of the storage medium determines the address indicated by the third information as the starting address of the data to be processed, and the addresses of the at least two target storage units are consecutive.
21. The method according to any one of claims 16-20, characterized in that, The first processing instruction further includes fourth information, which indicates a data grouping requirement. The data grouping requirement includes grouping the at least two target storage units by storage row or by storage column. The instruction decoder of the storage medium processes the data to be processed using the at least two target storage units according to the processing method indicated by the first information, including: The instruction decoder of the storage medium groups the at least two target storage units according to the data grouping requirements indicated by the fourth information, thereby obtaining at least one group. The instruction decoder of the storage medium processes data based on the target storage units in each group, according to the processing method indicated by the first information.
22. The method according to claim 21, characterized in that, The instruction decoder of the storage medium performs data processing based on the target storage units in each group, according to the processing method indicated by the first information, including: The instruction decoder of the storage medium is capable of executing the target storage unit in any given packet; The instruction decoder of the storage medium performs data processing on the target storage units that are enabled in parallel in any of the groups according to the processing method indicated by the first information, such that the difference between the processing times of the target storage units that are enabled in parallel in any of the groups is less than a threshold.
23. A method for processing data, characterized in that, The method is applied to a storage device, the storage device including a controller and a storage medium, the storage medium including an instruction decoder and a plurality of storage cells, the method comprising: The controller determines first information and second information based on the received second processing instruction. The first information is used to indicate the processing method, and the second information is used to indicate the data length of the data to be processed. The data length is used to determine at least two target storage units from a plurality of storage units of the storage medium. The at least two target storage units are used for data processing. The controller encapsulates the first information and the second information to obtain a first processing instruction; The controller sends the first processing instruction to the instruction decoder of the storage medium.
24. The method according to claim 23, characterized in that, The number of the second processing instructions is at least two, and the second processing instructions include second reference information. When the data length indicated by the second reference information of the at least two second processing instructions is less than the lower limit of the reference range, the second information is determined according to the sum of the data lengths indicated by the second reference information of the at least two second processing instructions, and the data length indicated by the second information is within the reference range.
25. The method according to claim 23, characterized in that, The second processing instruction includes second reference information. When the data length indicated by the second reference information of the second processing instruction is greater than the upper limit of the reference range, the second information is obtained by segmenting the data length indicated by the second reference information of the second processing instruction. The data length indicated by the second information is within the reference range.
Citation Information
Patent Citations
Storage medium and access system
CN103680577A