Storage device and data processing method
By using the first identification to indicate that the volatile storage unit is used in the storage medium, the problem of time-consuming data processing process in the computer device is solved, efficiency is improved and the life of the non-volatile storage unit is extended.
Patent Information
- Application Number
- CN202411165899.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-12-27
AI Technical Summary
The data processing process in computer equipment takes a long time and is less efficient, mainly due to the need to use both volatile and nonvolatile storage units.
By introducing a first identifier into the storage medium, the controller sends a data processing instruction to the storage medium instructing the use of a volatile storage unit to process the data, thereby avoiding the use of a non-volatile storage unit, shortening the data processing time and improving efficiency.
It reduces the time-consuming process of data processing, improves data processing efficiency, and extends the service life of non-volatile memory units.
Smart Images

Figure CN119200964A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210471323.3, and the original application date is April 28, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a storage device and a data processing method. Background Art
[0003] Computer equipment includes multiple components, and storage media and controllers are one of the multiple components. The controller in the computer equipment implements data processing such as data reading and data writing by interacting with the storage media.
[0004] In the related art, the controller sends a data processing instruction to the storage medium, and when the storage medium executes the data processing instruction, it needs to use both volatile storage units and non-volatile storage units. Therefore, the data processing process in the related art is time-consuming and the data processing efficiency is low. Summary of the invention
[0005] The present application provides a storage device and a data processing method to solve the problem that the data processing process in the related art is time-consuming and the data processing efficiency is low. The technical solution provided by the present application includes the following aspects.
[0006] In a first aspect, a storage device is provided, the storage device comprising a controller and a storage medium connected to each other. The controller is used to send a first data processing instruction to the storage medium. The first data processing instruction comprises a first identifier, the first identifier is used to indicate that a volatile storage unit is used to process first data. The storage medium is used to receive the first data processing instruction and process the first data using the volatile storage unit based on the first identifier.
[0007] In the present application, the storage medium can use a volatile storage unit to process the first data based on the first identifier included in the first data processing instruction. Therefore, there is no need to use a non-volatile storage unit in the processing of the first data, and thus the time consumed in the processing of the first data only includes the processing delay of the volatile storage unit, but does not include the processing delay of the non-volatile storage unit. As a result, the time consumed in the data processing process is shortened and the data processing efficiency is improved. In addition, since there is no need to use a non-volatile storage unit, the service life of the non-volatile storage unit is also extended.
[0008] In a possible implementation, the storage medium includes at least one first storage unit with volatility and at least one second storage unit with non-volatility. The controller is further used to send a first address corresponding to the first data to the storage medium. The storage medium is further used to receive the first address. The storage medium is used to process the first data using a first target storage unit in the at least one first storage unit based on the first identifier and the first address.
[0009] The storage medium determines a first target storage unit for processing the first data in at least one first storage unit based on the first identifier and the first address sent by the controller. After that, the first target storage unit included in the storage medium can be used to process the first data. This processing method is simple and easy to implement, and has strong practicality.
[0010] In addition to the first storage unit and the second storage unit, the storage medium further includes: an instruction decoder, a row address decoder, a column address decoder and an IO cycle interface. The instruction decoder receives the first data processing instruction and the first address, parses the first data processing instruction to obtain a first identifier, and can use the first target storage unit to process the first data based on the first identifier and the first address. For example, the first data is read from the first target storage unit, or the first data is written to the first target storage unit.
[0011] In a possible implementation, the controller is configured to send a first data processing instruction to a storage medium when a processing frequency corresponding to the first data is greater than a frequency threshold.
[0012] When the processing frequency corresponding to the first data is greater than the frequency threshold, the first data is hot data. Since the storage medium takes a short time to process data based on the first data processing instruction, it is suitable for processing hot data and can accelerate the access speed of hot data.
[0013] In one possible implementation, the storage medium includes at least two first storage units; the controller is further used to select a first target storage unit from at least two first storage units based on a processing frequency corresponding to the first data and a processing delay of each first storage unit, wherein the higher the processing frequency corresponding to the first data, the smaller the processing delay of the first target storage unit.
[0014] In this implementation, the higher the processing frequency corresponding to the first data, the smaller the processing delay of the first target storage unit used to process the first data, which further speeds up the access speed to the hot data and makes the data processing process more flexible.
[0015] In a possible implementation, the controller is configured to send a first data processing instruction to a storage medium when a fault occurs in the second storage unit.
[0016] The controller can sense the fault of the second storage unit in the storage medium, and send the first data processing instruction to the storage medium when the second storage unit fails. Thus, the volatile first storage unit can be used to complete the processing of the first data without using the faulty second storage unit to process the first data. In other words, even if the second storage unit fails, the processing of the first data can be achieved, thereby ensuring the reliability of data processing.
[0017] In a possible implementation, the first data processing instruction is a data read instruction, the first address is an address located in a second storage unit; the storage medium is used to query an address table based on the first identifier and the first address to obtain a query result, the address table records a second address located in the second storage unit, the data corresponding to the second address is stored in the first storage unit, and the query result is used to indicate whether the first address hits the second address. The storage medium is used to read the first data from the first target storage unit based on the query result.
[0018] By querying the address table, errors can be avoided during the data reading process, or in other words, it can be ensured that the first data read from the first storage unit is indeed the data corresponding to the first address, rather than the data corresponding to other addresses in the second storage unit except the first address. Thus, the reliability of the data processing process is guaranteed.
[0019] Wherein, the storage medium includes a comparator. The instruction decoder parses the first data processing instruction to obtain a first identifier, and instructs the comparator to query according to the first identifier. Wherein, the comparator obtains the first address received by the instruction decoder from the instruction decoder, and the comparator also obtains the address table from the volatile storage unit, thereby querying the address table to obtain the query result, and then returns the query result to the instruction decoder. Afterwards, the instruction decoder reads the first data from the first target storage unit based on the query result. The volatile storage unit can be the first storage unit, or it can be another volatile storage unit other than the first storage unit.
[0020] In a possible implementation, the query result is used to indicate that the first address hits the second address. The storage medium is used to determine a first corresponding address of the first address in a first target storage unit, read the first data according to the first corresponding address, and send the first data to the controller.
[0021] In the case of a hit, it indicates that the data corresponding to the first address in the second storage unit is indeed stored in the first storage unit, and thus the first data can be read. The instruction decoder determines the first corresponding address, and controls the IO cycle interface to read the first data from the first target storage unit according to the first corresponding address, and the IO cycle interface also sends the first data to the controller.
[0022] In a possible implementation, the query result is used to indicate that the first address does not hit the second address. The storage medium is used to read the first data according to the first address, determine the first corresponding address of the first address in the first target storage unit, and write the first data to the first corresponding address. The storage medium is used to read the first data according to the first corresponding address and send the first data to the controller.
[0023] In the case of a miss, it means that the data corresponding to the first address in the second storage unit is not stored in the first storage unit. Therefore, the first data is not read from the first storage unit first, but is read from the second storage unit and written into the first corresponding address in the first target storage unit, and then the first data is read according to the first corresponding address. Among them, the instruction decoder controls the row address decoder and the column address decoder to enable the second storage unit so that the data stored in the second storage unit is written into the first corresponding address. Afterwards, the instruction decoder controls the IO cycle interface to read the first data from the first corresponding address, and the IO cycle interface also sends the first data to the controller.
[0024] In a possible implementation, the query result is used to indicate that the first address does not hit the second address. The storage medium is also used to send an error message to the controller, and the error message is used to indicate that there is an error in the process of reading the first data from the first target storage unit. After receiving the query result sent by the comparator, the instruction decoder sends the error message to the controller.
[0025] In a possible implementation, the first data processing instruction is a data write instruction, and the first address is an address located in the second storage unit. The controller is further used to send the first data to the storage medium. The storage medium is further used to receive the first data. The storage medium is used to determine a first corresponding address of the first address in the first target storage unit based on the first identifier, and write the first data to the first corresponding address. The storage medium is further used to record the first address in an address table, the address table records a second address located in the second storage unit, and the data corresponding to the second address is stored in the first storage unit.
[0026] After the data is written based on the first data processing instruction, the address table needs to be updated to record the first address in the address table. Thus, when the data is subsequently read, the updated address table can be queried to avoid errors. The IO cycle interface receives the first data, and after writing the first data to the first corresponding address in the first target storage unit according to the control of the instruction decoder, the first target storage unit updates the address table.
[0027] In a possible implementation, the first address is an address located in a first target storage unit; and the storage medium is used to process the first data according to the first address based on the first identifier.
[0028] Since the first identifier indicates that a volatile storage unit is used to process the first data, and the first target storage unit where the first address is located happens to be a volatile storage unit, the storage medium can directly process the first data in the first target storage unit according to the first address.
[0029] In a second aspect, a storage device is provided, the storage device comprising a controller and a storage medium connected to each other. The controller is used to send a second data processing instruction to the storage medium, the second data processing instruction comprising a second identifier, the second identifier being used to indicate that a non-volatile storage unit is used to process the second data. The storage medium is used to receive the second data processing instruction, and in the case that the non-volatile storage unit fails to process the second data based on the second identifier, the volatile storage unit is used to process the second data.
[0030] The controller is not aware of the situation that the storage medium fails to process the second data using the non-volatile storage unit, for example, the controller is not aware of the situation that the non-volatile second storage unit is faulty, nor is it aware of the situation that the second storage unit fails to process the second data due to the fault of the second storage unit. The storage medium has the function of processing the second data using a volatile storage unit, so when the storage medium fails to process the second data using a non-volatile storage unit, the storage medium can automatically convert the storage unit used to process the second data from a non-volatile storage unit to a volatile storage unit, so as to give priority to the processing of the second data, thereby improving the reliability of data processing.
[0031] In a third aspect, a data processing method is provided, the method being applied to a controller included in a storage device, the storage device also including a storage medium connected to the controller;
[0032] The controller sends a first data processing instruction to the storage medium, where the first data processing instruction includes a first identifier, and the first identifier is used to indicate that a volatile storage unit is used to process the first data.
[0033] In a possible implementation, the storage medium includes at least one first storage unit with volatility and at least one second storage unit with non-volatility, and the method further includes:
[0034] The controller sends a first address corresponding to the first data to the storage medium.
[0035] In a possible implementation, the controller sends a first data processing instruction to a storage medium, including:
[0036] The controller sends a first data processing instruction to the storage medium when a processing frequency corresponding to the first data is greater than a frequency threshold.
[0037] In a possible implementation manner, the storage medium includes at least two first storage units, and the method further includes:
[0038] The controller selects a first target storage unit from at least two first storage units based on a processing frequency corresponding to the first data and a processing delay of each first storage unit. The first target storage unit is used for the storage medium to process the first data. The higher the processing frequency corresponding to the first data, the smaller the processing delay of the first target storage unit.
[0039] In a possible implementation, the controller sends a first data processing instruction to a storage medium, including:
[0040] When a fault occurs in the second storage unit, the controller sends a first data processing instruction to the storage medium.
[0041] In a possible implementation, the first data processing instruction is a data read instruction, the first address is an address located in the second storage unit, and the method further includes:
[0042] The controller receives an error message sent by the storage medium, where the error message is used to indicate that an error occurs in a process in which the storage medium reads first data from a first target storage unit, where the first target storage unit is used for the storage medium to process the first data.
[0043] In a fourth aspect, a data processing method is provided, the method comprising:
[0044] The controller sends a second data processing instruction to the storage medium, the second data processing instruction includes a second identifier, the second identifier is used to indicate the use of a non-volatile storage unit to process the second data, and the second data processing instruction is used for the storage medium to use a volatile storage unit to process the second data if the non-volatile storage unit fails to process the second data based on the second identifier.
[0045] In a fifth aspect, a data processing method is provided, the method being applied to a storage medium included in a storage device, the storage device also including a controller connected to the storage medium;
[0046] The storage medium receives a first data processing instruction sent by the controller, and processes the first data using a volatile storage unit based on the first identifier.
[0047] In a possible implementation, the storage medium includes at least one first storage unit having volatility and at least one second storage unit having non-volatility;
[0048] The method further includes: the storage medium receives a first address corresponding to the first data sent by the controller;
[0049] Processing first data using a volatile storage unit based on a first identifier includes: a storage medium using a first target storage unit in at least one first storage unit to process the first data based on the first identifier and a first address.
[0050] In a possible implementation, the first data processing instruction is a data read instruction, the first address is an address located in the second storage unit, and the storage medium processes the first data using a first target storage unit in at least one first storage unit based on the first identifier and the first address, including:
[0051] The storage medium queries the address table based on the first identifier and the first address to obtain a query result, the address table records the second address located in the second storage unit, the data corresponding to the second address is stored in the first storage unit, and the query result is used to indicate whether the first address hits the second address;
[0052] The storage medium reads the first data from the first target storage unit based on the query result.
[0053] In a possible implementation, the query result is used to indicate that the first address hits the second address, and the storage medium reads the first data from the first target storage unit based on the query result, including:
[0054] The storage medium determines a first corresponding address of the first address in the first target storage unit, reads first data according to the first corresponding address, and sends the first data to the controller.
[0055] In a possible implementation, the query result is used to indicate that the first address does not hit the second address, and the storage medium reads the first data from the first target storage unit based on the query result, including:
[0056] The storage medium reads the first data according to the first address, determines a first corresponding address of the first address in the first target storage unit, writes the first data to the first corresponding address, reads the first data according to the first corresponding address, and sends the first data to the controller.
[0057] In a possible implementation, the query result is used to indicate that the first address does not hit the second address, and the method further includes:
[0058] The storage medium sends an error message to the controller, where the error message is used to indicate that an error occurs in a process of reading the first data from the first target storage unit.
[0059] In a possible implementation, the first data processing instruction is a data write instruction, and the first address is an address located in the second storage unit;
[0060] The method further includes: the storage medium receiving the first data sent by the storage medium;
[0061] The storage medium processes the first data using a first target storage unit in at least one first storage unit based on the first identifier and the first address, including: the storage medium determines a first corresponding address of the first address in the first target storage unit based on the first identifier, and writes the first data into the first corresponding address;
[0062] The method also includes: the storage medium records the first address in an address table, the address table records a second address located in the second storage unit, and data corresponding to the second address is stored in the first storage unit.
[0063] In a possible implementation, the first address is an address located in a first target storage unit, and the storage medium processes the first data using a first target storage unit in at least one first storage unit based on the first identifier and the first address, including:
[0064] The storage medium processes the first data according to the first address based on the first identifier.
[0065] In a sixth aspect, a data processing method is provided, the method comprising:
[0066] The storage medium receives a second data processing instruction sent by the controller, where the second data processing instruction includes a second identifier, and the second identifier is used to indicate that the second data is processed using a non-volatile storage unit;
[0067] When the storage medium fails to process the second data using the non-volatile storage unit based on the second identifier, the storage medium uses the volatile storage unit to process the second data. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of the structure of a storage device provided in an embodiment of the present application;
[0069] Figure 2 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0070] Figure 3 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0071] Figure 4 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0072] Figure 5 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0073] Figure 6A flowchart of a data processing method provided in an embodiment of the present application;
[0074] Figure 7 A schematic diagram of an update address table provided in an embodiment of the present application;
[0075] Figure 8 A schematic diagram of another updating address table provided in an embodiment of the present application;
[0076] Fig. 9 A schematic diagram of a data reading process provided in an embodiment of the present application;
[0077] Fig.10 A schematic diagram of a data writing process provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0079] The present application embodiment provides a storage device. Figure 1 As shown, the storage device includes a controller 101 and a storage medium 102, and the controller 101 and the storage medium 102 are connected to each other. The controller 101 is used to send a first data processing instruction to the storage medium 102. The first data processing instruction includes a first identifier, and the first identifier is used to indicate that a volatile storage unit is used to process the first data. The storage medium 102 is used to receive the first data processing instruction and process the first data using a volatile storage unit based on the first identifier.
[0080] The controller 101 and the storage medium 102 are described below. Figures 6 to 10 The corresponding method embodiments will be described in detail. Next, the multiple components included in the storage medium 102 and the connection relationship between some of the multiple components and the controller 101 are described.
[0081] A storage medium 102 is also called a logical unit (logical unit, LUN), and LUN is also called Die. Figure 2As shown, the storage medium 102 includes a command decoder, at least one volatile first storage unit, at least one non-volatile second storage unit, a row address decoder, a column address decoder, and an input / output (IO) circuit interface. A non-volatile second storage unit includes at least one minimum operation unit, and accordingly, the column address decoder is also called an address decoder of the minimum operation unit, and the IO circuit interface is also called an IO circuit.
[0082] In the storage medium 102, the instruction decoder is connected to the row address decoder, the column address decoder and the IO cycle interface respectively. The second storage unit is connected to the row address decoder, the column address decoder and the first storage unit respectively. The first storage unit is also connected to the IO cycle interface. Between the storage medium 102 and the controller 101, the instruction decoder is connected to the controller 101 to receive the data processing instruction sent by the controller 101. The IO cycle interface is connected to the controller 101 to exchange data corresponding to the data processing instruction with the controller 101, and the data is, for example, business data.
[0083] Exemplarily, the storage medium 102 further includes a multiplexer (MUX). Accordingly, the column address decoder is connected to at least one minimum operation unit via the MUX. Figure 3 , Figure 3 It is shown that the minimum number of operation units included in the second storage unit is at least two (ie, Figure 3 Wherein the value of N is an integer not less than 1, and the total number of minimum operation units is N+1), the MUX is connected to at least two minimum operation units respectively.
[0084] In some embodiments, the first storage unit with volatility includes at least one of a centralized volatile storage unit and a distributed volatile storage unit. Wherein, a centralized volatile storage unit can be connected to at least two minimum operation units included in the second storage unit. For example, Figure 3 The first storage unit shown is a centralized volatile storage unit. A distributed volatile storage unit can be connected to a minimum operation unit included in the second storage unit. For example, Figure 4The first storage unit 0 to the first storage unit N shown are distributed volatile storage units. The embodiments of the present application do not limit the centralized volatile storage unit and the distributed volatile storage unit. For example, the centralized volatile storage unit is a static random access memory (RAM), i.e., SRAM. The distributed volatile storage unit is a page register.
[0085] It should be noted that the number of the first storage units may be at least two, and the second storage unit may be connected to at least two first storage units respectively. For example, each minimum operation unit in the second storage unit may be connected to both a page register and an SRAM. For another example, each minimum operation unit in the second storage unit may be connected to two different SRAMs respectively.
[0086] Exemplarily, at least two decoders among the instruction decoder, the row address decoder and the address decoder of the minimum operation unit can be integrated into one decoder. For example, the instruction decoder and the address decoder of the minimum operation unit are integrated into one decoder, and the decoder obtained by integration is the instruction and address decoder of the minimum operation unit.
[0087] For example, see Figure 5 The storage medium 102 further includes an on-die comparator. The instruction decoder and the first storage unit are respectively connected to the comparator. In some embodiments, the comparator can be integrated with the first storage unit.
[0088] In an exemplary embodiment, the second storage unit with non-volatility includes, but is not limited to: a storage class memory (SCM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The flash memory is, for example, a not and (NAND) flash memory.
[0089] In an exemplary embodiment, in addition to the above-mentioned page register and SRAM, the first storage unit with volatility can also be: dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).
[0090] Above, combined Figures 2 to 5 The multiple elements included in the storage medium 102 and the connection relationship between some of the multiple elements and the controller 101 are explained.
[0091] It should be understood that Figures 1 to 5 The structures shown are exemplary storage devices. Figures 1 to 5 This does not constitute a limitation on the structure of the storage device. Storage devices with other structures, if applicable to the embodiments of the present application, should also be included in the protection scope of the embodiments of the present application.
[0092] In the related art, the controller sends a data processing instruction to the storage medium. When executing the data processing instruction, the storage medium needs to use both a volatile storage unit and a non-volatile storage unit. For example, when the storage medium reads data, it reads data from a non-volatile storage unit and writes the read data into a volatile storage unit cache. Then, the cached data is read from the volatile storage unit and returned to the controller. For another example, when the storage medium writes data, the data received from the controller is written into the volatile storage unit cache, and then the cached data is read from the volatile storage unit and written into the non-volatile storage unit for storage.
[0093] Because the storage medium needs to use volatile storage units and non-volatile storage units when executing data processing instructions, the time consumption of the data processing process in the related art includes: the sum of the delay caused by using volatile storage units (i.e., the inherent processing delay of volatile storage units) and the delay caused by using non-volatile storage units (i.e., the inherent processing delay of non-volatile storage units). As a result, the data processing process consumes a long time and the data processing efficiency is low.
[0094] In this regard, the present application provides a data processing method to solve the problems existing in the related art. Figures 1 to 5 Taking the storage device shown in the figure as an example, the data processing method is executed by a controller and a storage medium. Figure 6 As shown, the method includes the following steps 601 and 602.
[0095] Step 601: A controller sends a first data processing instruction to a storage medium. The first data processing instruction includes a first identifier, and the first identifier is used to indicate that a volatile storage unit is used to process first data.
[0096] Among them, the first data processing instruction sent by the controller to the storage medium includes a first identifier, and the first identifier is used to indicate that a volatile storage unit is used to process the first data. The first data processing instruction is also called a volatile data processing instruction. Exemplarily, the processing method of the first data includes but is not limited to reading or writing. In some embodiments, the first data processing instruction also includes a processing method identifier, and the processing method identifier is used to indicate the above-mentioned processing method. For example, when the value of the processing method identifier is a first numerical value, it is used to indicate that the processing method is reading. When the value of the processing method identifier is a second numerical value, it is used to indicate that the processing method is writing. Among them, the first numerical value is different from the second numerical value, and the embodiment of the present application does not limit the first numerical value and the second numerical value.
[0097] Exemplarily, using a volatile storage unit to process the first data means that only a volatile storage unit is used to process the first data, and a non-volatile storage unit is not used to process the first data. According to the above description of the related art, the related art uses a volatile storage unit and a non-volatile storage unit in sequence when writing data. However, when writing data, the embodiment of the present application only writes the data to a volatile storage unit for caching, and no longer reads the cached data from the volatile storage unit and writes it to the non-volatile storage unit for storage, and it can be considered that the writing is completed. When reading data, the related art uses a non-volatile storage unit and a volatile storage unit in sequence. However, when reading data, the embodiment of the present application no longer reads data from a non-volatile storage unit and writes the read data to a volatile storage unit cache, but directly reads the cached data from the volatile storage unit, and it can be considered that the reading is completed.
[0098] For example, see Figures 2 to 5In the storage device shown, the storage medium includes a first storage unit with volatility and a second storage unit with non-volatility, the volatile storage unit is referred to as the first storage unit, and the non-volatile storage unit is referred to as the second storage unit. The storage medium also includes an instruction decoder, and the controller sends a first data processing instruction to the storage medium, including: the controller sends the first data processing instruction to the instruction decoder.
[0099] In an exemplary embodiment, the method further includes: the controller sends a first address corresponding to the first data to the storage medium. In some embodiments, the controller may send the first data processing instruction and the first address to the storage medium in different transmission cycles. In other embodiments, the first address may be carried in the first data processing instruction, and the controller sends the first data processing instruction carrying the first address to the storage medium in one transmission cycle. The transmission cycle is a time unit for interaction between the controller and the storage medium, and the embodiment of the present application does not limit the duration of the transmission cycle.
[0100] For example, see Figures 2 to 5 In the storage device shown, the controller sends a first address to the storage medium, including: the controller sends the first address to the instruction decoder of the storage medium.
[0101] Exemplarily, the first address is an address located in a volatile first storage unit. Alternatively, the first address is an address located in a non-volatile second storage unit. In some embodiments, the controller needs to obtain the first address according to a command of the processor. The processor sends a logical address to the controller, and the controller determines the first address based on the logical address, and the first address belongs to a physical address. In an exemplary embodiment, the controller determines the first address in the following two ways, but is not limited to.
[0102] Determination method 1: the first address is an address located in a volatile first storage unit. The controller queries a first address mapping relationship based on the logical address, and the first address mapping relationship includes a correspondence between an address in the first storage unit and a logical address. Through this query process, the controller can obtain an address corresponding to the logical address in the first storage unit.
[0103] If the second storage unit corresponds to only one first storage unit, the controller only queries and obtains the address corresponding to the logical address in one first storage unit. Then, the controller uses this one first storage unit as the first target storage unit for processing the first data, uses the address corresponding to the logical address in one first storage unit as the above-mentioned first address, and sends the first data processing instruction and the first address to the storage medium. Alternatively, if the second storage unit corresponds to at least two first storage units, the controller queries and obtains the address of the logical address in each first storage unit, and obtains at least two addresses of the logical address in the first storage unit. Afterwards, the controller needs to select the first target storage unit for processing the first data from at least two first storage units, uses the address corresponding to the logical address in the selected first target storage unit as the above-mentioned first address, and then sends the first data processing instruction and the first address to the storage medium.
[0104] When the controller selects a first target storage unit from at least two first storage units, the controller may randomly select a first storage unit as the first target storage unit. Alternatively, in an exemplary embodiment, the controller selects a first target storage unit from at least two first storage units based on a processing frequency corresponding to the first data and a processing delay of each first storage unit. The higher the processing frequency corresponding to the first data, the smaller the processing delay of the selected first target storage unit. In other words, the higher the processing frequency corresponding to the first data, the smaller the processing delay of the volatile storage unit (i.e., the selected first target storage unit) used to process the first data. The subsequent storage medium will use the first target storage unit to process the first data according to the first address in the first target storage unit, thereby realizing rapid processing of the first data with a higher processing frequency.
[0105] For example, at least two first storage units are SRAM 0 and SRAM 1, and the processing delay of SRAM 0 is less than the processing delay of SRAM 1. The controller determines the logical address located in the second storage unit based on the logical address sent by the processor. The logical address corresponds to address A0 in SRAM 0 and to address A1 in SRAM 1. Then, when the processing frequency corresponding to the first data is high, the controller selects address A0 as the above-mentioned first address, and sends the first data processing instruction and address A0 to the storage medium. When the processing frequency corresponding to the first data is low, the controller selects address A1 as the above-mentioned first address, and sends the first data processing instruction and address A1 to the storage medium, which will not be repeated here.
[0106] Determination method 2: the first address is an address located in a non-volatile second storage unit. Then, the controller queries a second address mapping relationship based on the logical address, and the second address mapping relationship includes a correspondence between an address in the second storage unit and a logical address. By querying, the controller can obtain an address corresponding to the logical address in the second storage unit.
[0107] If the second storage unit corresponds to only one first storage unit, the controller can directly send the first data processing instruction and the first address to the storage medium. Alternatively, if the second storage unit corresponds to at least two first storage units, the controller can refer to the description in the determination method 1, and select the first target storage unit from at least two first storage units according to the processing frequency corresponding to the first data and the processing delay of each first storage unit. When the controller sends the first data processing instruction and the first address to the storage medium, it also sends the identifier of the first target storage unit to the storage medium. Thus, the higher the processing frequency corresponding to the first data, the smaller the processing delay of the volatile storage unit (i.e., the selected first target storage unit) used to process the first data. The subsequent storage medium will use the first target storage unit to process the first data according to the identifier of the first target storage unit, thereby realizing the rapid processing of the first data with a higher processing frequency.
[0108] For example, at least two first storage units are SRAM 0 and SRAM 1, respectively, the processing delay of SRAM 0 is less than the processing delay of SRAM 1, the identifier of SRAM 0 is B0, and the identifier of SRAM 1 is B1. When the processing frequency corresponding to the first data is high, the controller sends the first data processing instruction, the first address, and the identifier B0 of SRAM 0 to the storage medium. When the processing frequency corresponding to the first data is low, the controller sends the first data processing instruction, the first address, and the identifier B1 of SRAM 1 to the storage medium.
[0109] Exemplarily, when the first data processing instruction is a data write instruction, the controller may not send the first address to the storage medium, and the storage medium may randomly select an address in an unoccupied first storage unit and use the selected address to write the first data, thereby completing the first data processing instruction. In some embodiments, the storage medium also sends the selected address to the controller so that the controller obtains the address to write the first data.
[0110] In an exemplary embodiment, the controller sends the first data processing instruction to the storage medium, including but not limited to the following three sending methods.
[0111] In the first sending mode, for any first data, the controller sends a first data processing instruction to the storage medium.
[0112] In the first sending mode, the controller uses the volatile storage unit to process the first data by default. Therefore, for any first data, the controller can send the first data processing instruction.
[0113] In a second sending mode, when a processing frequency corresponding to the first data is greater than a frequency threshold, the controller sends a first data processing instruction to the storage medium.
[0114] The controller may statistically obtain the processing frequency corresponding to the first data by itself, or determine the processing frequency corresponding to the first data by other means. The embodiment of the present application does not limit the manner in which the controller determines the processing frequency corresponding to the first data, nor does it limit the above-mentioned frequency threshold. The frequency threshold may be set based on experience, or may be flexibly set based on actual needs.
[0115] Exemplarily, the processing frequency corresponding to the first data is the total number of times the first data needs to be processed within a period of time. The more the total number of times the first data needs to be processed within a period of time, the higher the processing frequency corresponding to the first data. When the processing frequency corresponding to the first data is greater than the frequency threshold, the first data can be regarded as data that needs to be processed frequently, such as data that needs to be read and written frequently. Alternatively, the processing frequency corresponding to the first data is the difference between the moment when the first data is processed this time and the moment when the first data needs to be processed next time. The shorter the difference, the higher the processing frequency corresponding to the first data. When the processing frequency corresponding to the first data is greater than the frequency threshold, the first data can be regarded as data that needs to be processed again soon, such as data that needs to be read again soon. Of course, the embodiment of the present application does not limit the processing frequency corresponding to the first data. In short, when the processing frequency corresponding to the first data is greater than the frequency threshold, the first data can be regarded as hot data, so the controller sends a first data processing instruction to the storage medium.
[0116] In a third sending mode, when a fault occurs in the second storage unit, the controller sends a first data processing instruction to the storage medium.
[0117] Since the non-volatile second storage unit has a fault, if the second storage unit is used to process the first data, the first data processing may fail, thereby reducing the reliability of the data processing process. Therefore, the controller no longer instructs the storage medium to use the second storage unit to process the first data, but sends a first data processing instruction to the storage medium, so that the storage medium uses the volatile first storage unit to process the first data.
[0118] In the third transmission mode, the controller needs to have a fault confirmation function, which is used by the controller to confirm whether the second storage unit included in the storage medium has a fault. Among them, the embodiment of the present application does not limit the implementation method of the fault confirmation function. For example, the controller can instruct the storage medium to return the fault status of the second storage unit at regular intervals, and confirm whether the second storage unit has a fault based on the received fault status.
[0119] In some embodiments, in the case where the first data processing instruction is generated by the controller according to the command of the processor, the processor sends a logical address to the controller, and the controller converts the logical address into an address located in the second storage unit, so as to confirm whether the second storage unit where the address is located has a fault. The embodiment of the present application does not limit the conversion method. For example, the controller can perform conversion based on the second address mapping relationship in the above description to obtain an address located in the second storage unit.
[0120] In the normal case where there is no fault in the second storage unit, the controller can send a data processing instruction in the relevant technology to the storage medium to instruct the storage medium to use the physical address located in the second storage unit to process the first data. However, in the case where the second storage unit is faulty, after receiving the instruction of the processor, the controller will not send the data processing instruction in the relevant technology to the storage medium, but will send the first data processing instruction to the storage medium, and the subsequent storage medium will use the first storage unit to process the first data. That is to say, in the case where the second storage unit is faulty, the controller converts the data processing instruction in the relevant technology into the first data processing instruction. As a result, the actual processing process of the first data (processed using the first storage unit) is different from the processing process indicated by the processor (processed using the second storage unit), which may cause errors. Taking the processing mode as writing as an example, the first data is actually written into the first storage unit, which is inconsistent with the writing of the second storage unit indicated by the processor, which is equivalent to the controller modifying the address used to write the first data (that is, the address in the second storage unit is modified to the address in the first storage unit), which may cause errors. Therefore, illustratively, the controller reports the actual processing process of the first data to the processor so that the processor knows the actual processing process of the first data, thereby avoiding errors.
[0121] In some embodiments, after the processor learns the actual processing process of the first data, it can send a corresponding instruction to the controller. For example, the processor sends a new logical address to the controller, and the controller processes the first data again based on the new logical address, so that the actual processing process of the first data is consistent with the processing process indicated by the processor. In some embodiments, after sending the first data processing instruction, the controller suspends sending other data processing instructions to the storage medium to avoid continuous errors.
[0122] Step 602: The storage medium receives the first data processing instruction and processes the first data using a volatile storage unit based on the first identifier.
[0123] After the controller sends the first data processing instruction to the storage medium, the storage medium receives the first data processing instruction and parses the first data processing instruction to obtain a first identifier. Since the first identifier is used to indicate the use of a volatile storage unit to process the first data, the storage medium uses a volatile storage unit, that is, the first storage unit included in the storage medium, to process the first data based on the first identifier. In some embodiments, the first data processing instruction also includes a processing method identifier, and the storage medium can also obtain a processing method identifier by parsing the first data processing instruction, and the processing method identifier is used to indicate reading or writing. Therefore, the storage medium determines that the first data needs to be read from the first storage unit, or determines that the first data needs to be written to the first storage unit based on the processing method identifier.
[0124] In an exemplary embodiment, the controller further sends a first address corresponding to the first data to the storage medium, and the storage medium further receives the first address. Accordingly, the storage medium performs volatile processing on the first data based on the first identifier, including: the storage medium processes the first data using a first target storage unit in at least one first storage unit based on the first identifier and the first address.
[0125] When the first address is different, the way of processing the first data is also different. In an exemplary embodiment, the way of processing the first data includes but is not limited to the following two.
[0126] Processing method 1, the first address is an address located in the first target storage unit. The storage medium uses the first target storage unit in at least one first storage unit to process the first data based on the first identifier and the first address, including: the storage medium processes the first data according to the first address based on the first identifier. Among them, since the first identifier indicates that a volatile storage unit is used to process the first data, and the first address happens to be located in the volatile first storage unit, the storage medium can directly process the first data according to the first address based on the instruction of the first identifier.
[0127] In some embodiments, the storage medium includes only one first storage unit, and the first target storage unit is the first storage unit. In other embodiments, the storage medium includes at least two first storage units, and the first target storage unit is one of the at least two first storage units. Since the first address is sent by the controller to the storage medium, the first target storage unit is selected by the controller from the at least two first storage units. The way in which the controller selects the first target storage unit is described in the first determination method in step 601 above, and will not be repeated here.
[0128] Processing method 2, the first address is an address located in the second storage unit. Among them, since the first identifier indicates that the volatile storage unit is used to process the first data, and the first address is an address located in the volatile first storage unit, the storage medium cannot directly use the first address, but needs to determine the first corresponding address of the first address in the non-volatile second storage unit based on the indication of the first identifier, so as to process the first data according to the first corresponding address.
[0129] In the second processing method, the case where the first data processing instruction is a data read instruction and the case where the first data processing instruction is a data write instruction are respectively described.
[0130] In some embodiments, in the case where the first data processing instruction is a data read instruction, the storage medium processes the first data using a first target storage unit in at least one first storage unit based on the first identifier and the first address, including: the storage medium queries an address table based on the first identifier and the first address to obtain a query result, the address table records a second address located in a second storage unit, the data corresponding to the second address is stored in the first storage unit, and the query result is used to indicate whether the first address hits the second address. Based on the query result, the storage medium reads the first data from the first target storage unit.
[0131] Among them, since the address table records the second address located in the second storage unit, and the data corresponding to the second address is stored in the first storage unit, the address table records: which data corresponding to the second address in the second storage unit is cached in the first storage unit. By querying the address table, the storage medium can determine whether the data corresponding to the first address is indeed cached in the first storage unit. If the query result is used to indicate that the first address hits the second address, it means that the data corresponding to the first address is indeed cached in the first storage unit. If the query result is used to indicate that the first address does not hit the second address, it means that the data corresponding to the first address is not cached in the first storage unit.
[0132] For example, see Figure 5After receiving the first data processing instruction, the instruction decoder parses the first data processing instruction to obtain the first address, or the instruction decoder can also directly receive the first address. Regardless of the method used to obtain the first address, the instruction decoder can send the first address to the comparator. The comparator also obtains the above-mentioned address table from the first storage unit. The first storage unit can be a volatile storage unit used to cache data during the data processing process, or it can be a volatile storage unit dedicated to caching the address table. The comparator queries whether the first address hits the second address recorded in the address table, obtains the query result, and returns the query result to the instruction decoder. Afterwards, the instruction decoder reads the first data from the first target storage unit according to the query result.
[0133] The address table may record one or more second addresses, each second address is an address of minimum granularity for data processing in the second storage unit, and an address of minimum granularity may be part or all of a row of a minimum operation unit included in the second storage unit. For example, the address of minimum granularity is an address corresponding to a row of a minimum operation unit. For another example, the address of minimum granularity is an address corresponding to a half row of a minimum operation unit. The address of minimum granularity is not limited here.
[0134] It should be noted that the purpose of the storage medium query address table is to avoid errors in the data reading process. When the minimum operation unit of a second storage unit includes multiple rows, the multiple rows all correspond to the same first storage unit, and the data corresponding to the multiple rows can be cached in the same first storage unit. If the address table is not queried, it may not be possible to confirm which row of the minimum operation unit in the first storage unit corresponds to the data cached, thereby causing errors.
[0135] For example, see Figure 4 , the first storage unit 0 corresponds to the minimum operation unit 0 of the second storage unit, and each row in the minimum operation unit 0 corresponds to the first storage unit 0. Among them, the data corresponding to the 0th row of the minimum operation unit 0 is cached in the first storage unit 0, and the data corresponding to other rows of the minimum operation unit 0 are not cached in the first storage unit 0. Therefore, in the address table, only the address of the 0th row of the minimum operation unit 0 is recorded as a second address, and the addresses of other rows of the minimum operation unit 0 are not recorded as second addresses.
[0136] When the first address is the address of the first row of the minimum operation unit 0, if the address table is not queried but the data cached in the first storage unit 0 is directly read, the data corresponding to the 0th row of the minimum operation unit 0 is erroneously used as the data corresponding to the 1st row of the minimum operation unit 0. If the address table is queried, it is determined that the data corresponding to the 1st row of the minimum operation unit 0 is not cached in the first storage unit 0 because the address of the 1st row of the minimum operation unit 0 does not hit the second address recorded in the address table (i.e., the address of the 0th row of the minimum operation unit 0), thereby avoiding the data corresponding to the 0th row of the minimum operation unit 0 from being erroneously used as the data corresponding to the 1st row of the minimum operation unit 0.
[0137] Of course, the storage medium may also not query the address table and directly read the first data according to the first data processing instruction. Exemplarily, in this case, the controller may verify whether the first data read by the storage medium is correct to avoid errors in the data reading process.
[0138] Exemplarily, the address table is also used to record and update the state of the data corresponding to the second address. The state of the data can be flexibly set according to actual needs and is not limited here. For example, the state of the data includes but is not limited to a dirty state.
[0139] After the storage medium obtains the query result through query, the first data is read from the first target storage unit based on the query result. The reading methods include but are not limited to the following three methods.
[0140] Reading method 1, the query result is used to indicate that the first address hits the second address. Based on the query result, the storage medium reads the first data from the first target storage unit, including: the storage medium determines the first corresponding address of the first address in the first target storage unit, and reads the first data according to the first corresponding address. The storage medium also sends the first data to the controller.
[0141] Since the query result indicates that the first address hits the second address, it means that the data corresponding to the first address is indeed stored in the first storage unit. Therefore, the storage medium determines the first corresponding address of the first address in the first target storage unit, reads the first data according to the first corresponding address, and sends the first data to the controller.
[0142] When the storage medium includes only one first storage unit, the first storage unit is the first target storage unit. In some embodiments, the storage space of the first storage unit is large and can cache multiple sets of data (for example, it can cache both the first data to be read and other data), then the storage medium may also store a third address mapping relationship between the address in the first storage unit and the address in the second storage unit, so that the first corresponding address of the first address in the first target storage unit can be determined based on the third address mapping relationship. Exemplarily, the third address mapping relationship can be recorded in an address table or in other tables other than the address table. In other embodiments, the storage space of the first storage unit is large and can cache multiple sets of data, and the first storage unit adopts a first-in-first-out method. Accordingly, the storage medium may not store the third address mapping relationship, as long as the first storage unit corresponding to the second storage unit where the first address is located is determined and read from the first storage unit. Since the first storage unit adopts a first-in-first-out method, other data cached in the first storage unit before the first data will be read out of the first storage unit before the first data. That is to say, before the storage medium reads the first data according to the first data processing instruction, it will first read other data from the first storage unit according to other data processing instructions. Therefore, when the storage medium executes the first data processing instruction, it can directly read from the first storage unit, and the read data is the first data. In some other embodiments, the storage space of the first storage unit is small and can only cache one set of data (for example, it can only cache the first data that needs to be read), then the storage medium may not store the third address mapping relationship, as long as the first storage unit corresponding to the second storage unit where the first address is located is determined, the data can be directly read from the first storage unit.
[0143] When the storage medium includes at least two first storage units, the storage medium may randomly select one of the at least two first storage units as the first target storage unit. Alternatively, corresponding to the second determination method in step 601, when the controller selects the first target storage unit from the at least two first storage units and sends the identifier of the first target storage unit to the storage medium, the storage medium uses the first storage unit indicated by the identifier as the first target storage unit.
[0144] For example, see Figure 5 After the instruction decoder receives the query result in the read mode 1 from the comparator, it determines the first corresponding address of the first address in the first target storage unit. Then, the instruction decoder controls the IO cycle interface to read the first data from the first target storage unit in the first storage unit according to the first corresponding address, and controls the IO cycle interface to send the first data to the controller.
[0145] Reading method 2, the query result is used to indicate that the first address does not hit the second address. Based on the query result, the storage medium reads the first data from the first target storage unit, including: the storage medium reads the first data according to the first address, determines the first corresponding address of the first address in the first target storage unit, and writes the first data to the first corresponding address; reads the first data according to the first corresponding address, and sends the first data to the controller.
[0146] Since the query result indicates that the first address does not hit the second address, it means that the data corresponding to the first address is not stored in the first storage unit. If you read directly from the first storage unit, you may not read the data, or read wrong data. Therefore, the storage medium needs to read the first data from the second storage unit. Since the first address is an address located in the second storage unit, the storage medium directly reads from the second storage unit according to the first address, and the first data can be read. After that, the storage medium determines the first corresponding address of the first address in the first target storage unit, writes the first data read from the second storage unit to the first corresponding address, and then reads the cached first data according to the first corresponding address, thereby sending the first data to the controller. Among them, the method for determining the first corresponding address refers to the description in the reading method one, which will not be repeated here.
[0147] For example, see Figure 5 In the storage device shown, after receiving the query result in the second reading mode from the comparator, the instruction decoder controls the row address decoder and the column address decoder to enable the second storage unit, and determines the first corresponding address of the first address in the first target storage unit, so that the enabled second storage unit writes the first data into the first corresponding address in the first target storage unit. Then, the instruction decoder controls the IO cycle interface to read the first data according to the first corresponding address, and controls the IO cycle interface to send the first data to the controller.
[0148] Reading mode three, the query result is used to indicate that the first address does not hit the second address. The method also includes: the storage medium sends an error message to the controller, the error message is used to indicate that there is an error in the process of reading the first data from the first target storage unit.
[0149] Since the query result indicates that the first address does not hit the second address, it means that the data corresponding to the first address is not stored in the first storage unit. In this case, the storage medium may no longer execute the reading process of the first data, but directly send an error message to the controller, so that the controller can promptly know that there is an error in the process of reading the first data and give corresponding instructions. Of course, the storage medium can also try to execute the reading process of the first data, and send an error message to the controller after the attempt fails (that is, no data is read, or wrong data is read).
[0150] For example, see Figure 5 In the storage device shown, after the instruction decoder receives the query result in the reading mode three from the comparator, it generates the error message and sends it to the controller.
[0151] In some implementations, when the query result indicates that the first address does not hit the second address, only the read method may be executed, or only the read method 3 may be executed, or both the read method 2 and the read method 3 may be executed. This is not limited here.
[0152] In some other embodiments, for the case where the first data processing instruction is a data write instruction. The method also includes: the controller sends the first data to the storage medium, and the storage medium receives the first data. Wherein, the storage medium processes the first data using a first target storage unit in at least one first storage unit based on the first identifier and the first address, including: the storage medium determines the first corresponding address of the first address in the first target storage unit based on the first identifier, and writes the first data to the first corresponding address. The method also includes: the storage medium records the first address in an address table, the address table records the second address located in the second storage unit, and the data corresponding to the second address is stored in the first storage unit.
[0153] After writing the first data into the first corresponding address, the storage medium also needs to record the first address in the address table so that when reading data later, the address table can be queried to avoid errors in the data reading process.
[0154] For example, see Figure 5 , the controller sends the first data to be written to the IO cycle interface. The instruction decoder determines the first corresponding address and controls the IO cycle interface to write the first data to the first corresponding address. Afterwards, the first target storage unit where the first corresponding address is located updates the address table to record the first address in the address table.
[0155] For example, see Figure 7 , Figure 7 An exemplary situation of updating the address table is shown. The first address is the address in the minimum operation unit 0 of the second storage unit, and the first storage unit corresponding to the minimum operation unit 0 is the page register 0. After the IO cycle interface writes the first data into the page register 0, the page register 0 updates the address table cached in the SRAM. Figure 8 , Figure 8Another exemplary case of updating the address table is shown, wherein the first address is an address in the minimum operation unit 0 of the second storage unit, and the first storage unit corresponding to the minimum operation unit 0 is SRAM 0. After the IO cycle interface writes the first data into SRAM 0, SRAM 0 updates the address table cached in SRAM 1.
[0156] In the above, the process in which the controller sends the first data processing instruction to the storage medium and the storage medium performs data processing based on the first data processing instruction is described.
[0157] In addition, in an exemplary embodiment, the method further includes: the controller sends a second data processing instruction to the storage medium, the second data processing instruction includes a second identifier, and the second identifier is used to indicate that the second data is processed using a non-volatile storage unit. Accordingly, the storage medium receives the second data processing instruction, and in the case that the processing of the second data using the non-volatile storage unit fails based on the second identifier, the second data is processed using a volatile storage unit.
[0158] Among them, the second data processing instruction can be a data processing instruction in the relevant technology, and the second identifier is a different identifier from the above-mentioned first identifier, so that the storage medium can distinguish it. Exemplarily, the second data processing instruction can also include a processing method identifier, and the processing method identifier is described in step 601. The controller can also send a third address corresponding to the second data processing instruction to the storage medium, and the third address is an address located in a non-volatile storage unit. As a result, the storage medium uses a non-volatile storage unit (i.e., the second storage unit included in the storage medium) to process the second data based on the second identifier and the third address.
[0159] In the case where the storage medium fails to process the second data using the non-volatile storage unit, for example, due to a fault in the second storage unit, the storage medium uses the volatile storage unit to process the second data. The manner in which the storage medium processes the second data using the volatile storage unit can refer to the manner in which the storage medium processes the first data using the volatile storage unit described in step 602 above, and will not be described in detail here.
[0160] Exemplarily, since the controller instructs the storage medium to use a non-volatile storage unit to process the second data, but the storage medium actually uses a volatile storage unit to process the second data, the actual processing method of the second data is different from the processing method instructed by the controller. Accordingly, the storage medium can report the actual processing method of the second data to the controller so that the controller can give corresponding instructions. In some embodiments, the storage medium can also report to the controller the reason for the failure to process the second data using the non-volatile storage unit so that the controller can make timely adjustments to avoid the situation where data processing fails again due to the same reason during subsequent data processing.
[0161] It should be noted that, when the controller sends the second data processing instruction to the storage medium, the controller does not need to sense whether the second storage unit in the storage medium has a fault, but only receives information reported after the storage medium fails to execute the second data processing instruction, and then learns that the second storage unit in the storage medium has a fault. This is different from the third sending method described above. In the third sending method, the controller needs to sense whether the second storage unit in the storage medium has a fault, and send the above-mentioned first data processing instruction to the storage medium if there is a fault.
[0162] See also Fig. 9 , Fig. 9 A schematic diagram of a data reading process is shown, where the controller sequentially sends a data reading instruction 1 including a first identifier, an address 1, a data reading instruction 2 including a first identifier, and an address 2 to the storage medium. Accordingly, the storage medium reads data 1 and data 2 from a volatile storage unit based on the first identifier, and returns the read data 1 and data 2 to the controller, thereby completing the data reading process with a shorter reading delay.
[0163] See also Fig.10 , Fig.10 A schematic diagram of a data writing process is shown, where the controller sequentially sends a data writing instruction 1 including a first identifier, an address 1, a data writing instruction 2 including a first identifier, and an address 2 to the storage medium. The controller also sends data 1 and data 2 to be written to the storage medium. Accordingly, the storage medium writes data 1 and data 2 to a volatile storage unit based on the first identifier, thereby completing the data writing process with a shorter write delay.
[0164] In summary, in the embodiment of the present application, the storage medium can use a volatile storage unit to process the first data based on the first identifier included in the first data processing instruction. Therefore, there is no need to use a non-volatile storage unit in the processing of the first data, and thus the time consumed in the processing of the first data only includes the processing delay of the volatile storage unit, but does not include the processing delay of the non-volatile storage unit. As a result, the time consumed in the data processing process is shortened and the data processing efficiency is improved. In addition, since there is no need to use a non-volatile storage unit, the service life of the non-volatile storage unit is also extended.
[0165] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limit on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element.
[0166] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0167] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, a plurality of data processing instructions means two or more data processing instructions.
[0168] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0169] It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrases "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.
[0170] The above description is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A storage device, characterized in that: The storage device comprises a controller and a storage medium connected to each other, wherein the storage medium comprises at least one first volatile storage unit; The controller is used to send a first data processing instruction to the storage medium, where the first data processing instruction includes a first identifier, and the first identifier is used to instruct the storage medium to use the first storage unit to process the first data; The storage medium is used to receive the first data processing instruction and use the first storage unit to process the first data according to the first identifier.
2. The storage device according to claim 1, characterized in that The storage medium further includes at least one second non-volatile storage unit; The controller is further configured to send a first address corresponding to the first data to the storage medium; The storage medium is further used to receive the first address; The storage medium is used to process the first data using a first target storage unit in the at least one first storage unit based on the first identifier and the first address.
3. The storage device according to claim 2, characterized in that: The controller is configured to send the first data processing instruction to the storage medium when a processing frequency corresponding to the first data is greater than a frequency threshold.
4. The storage device according to claim 2 or 3, characterized in that: The number of the first storage units included in the storage medium is at least two; The controller is also used to select the first target storage unit from the at least two first storage units based on the processing frequency corresponding to the first data and the processing delay of each first storage unit. The higher the processing frequency corresponding to the first data, the smaller the processing delay of the first target storage unit.
5. The storage device according to claim 2, characterized in that: The controller is used to send the first data processing instruction to the storage medium when a fault occurs in the second storage unit.
6. The storage device according to any one of claims 2 to 5, characterized in that: The first data processing instruction is a data read instruction, and the first address is an address located in the second storage unit; The storage medium is used to query an address table based on the first identifier and the first address to obtain a query result, the address table records a second address located in the second storage unit, data corresponding to the second address is stored in the first storage unit, and the query result is used to indicate whether the first address hits the second address; The storage medium is used to read the first data from the first target storage unit based on the query result.
7. The storage device according to claim 6, characterized in that: The query result is used to indicate that the first address hits the second address; The storage medium is used to determine a first corresponding address of the first address in the first target storage unit, read the first data according to the first corresponding address, and send the first data to the controller.
8. The storage device according to claim 6, characterized in that: The query result is used to indicate that the first address does not hit the second address; the storage medium is used to read the first data according to the first address, determine a first corresponding address of the first address in the first target storage unit, and write the first data into the first corresponding address; The storage medium is used to read the first data according to the first corresponding address and send the first data to the controller.
9. The storage device according to claim 6 or 8, characterized in that: The query result is used to indicate that the first address does not hit the second address; The storage medium is further used to send an error message to the controller, where the error message is used to indicate that an error occurs in a process of reading the first data from the first target storage unit.
10. The storage device according to any one of claims 2 to 5, characterized in that: The first data processing instruction is a data writing instruction, and the first address is an address located in the second storage unit; The controller is further configured to send the first data to the storage medium; The storage medium is further used to receive the first data; the storage medium being configured to determine, based on the first identifier, a first corresponding address of the first address in the first target storage unit, and write the first data into the first corresponding address; The storage medium is further used to record the first address in an address table, the address table records a second address located in the second storage unit, and data corresponding to the second address is stored in the first storage unit.
11. The storage device according to any one of claims 2 to 4, characterized in that: The first address is an address located in the first target storage unit; The storage medium is used to process the first data according to the first address based on the first identifier.
12. The storage device according to any one of claims 1 to 11, characterized in that: The controller is further used to send a second data processing instruction to the storage medium, where the second data processing instruction includes a second identifier, and the second identifier is used to indicate that a non-volatile storage unit is used to process the second data; The storage medium is further used to receive the second data processing instruction, and to use a volatile storage unit to process the second data when processing the second data using a non-volatile storage unit fails based on the second identifier.
13. A data processing method, characterized in that: The method is applied to a controller included in a storage device, and the storage device also includes a storage medium connected to the controller; The controller sends a first data processing instruction to the storage medium, where the first data processing instruction includes a first identifier, and the first identifier is used to instruct the storage medium to use at least one first volatile storage unit in the storage medium to process first data.
14. The method according to claim 13, characterized in that The storage medium further includes at least one second storage unit having non-volatility, and the method further includes: The controller sends a first address corresponding to the first data to the storage medium.
15. The method according to claim 14, characterized in that The controller sends a first data processing instruction to the storage medium, including: The controller sends the first data processing instruction to the storage medium when the processing frequency corresponding to the first data is greater than a frequency threshold.
16. The method according to claim 14 or 15, characterized in that The number of the first storage units included in the storage medium is at least two, and the method further includes: The controller selects the first target storage unit from the at least two first storage units based on the processing frequency corresponding to the first data and the processing delay of each first storage unit. The first target storage unit is used by the storage medium to process the first data. The higher the processing frequency corresponding to the first data, the smaller the processing delay of the first target storage unit.
17. The method according to claim 14, characterized in that The controller sends a first data processing instruction to the storage medium, including: When the second storage unit fails, the controller sends the first data processing instruction to the storage medium.
18. The method according to any one of claims 14 to 17, characterized in that: The first data processing instruction is a data read instruction, the first address is an address located in the second storage unit, and the method further includes: The controller receives an error message sent by the storage medium, where the error message is used to indicate that an error occurs in a process in which the storage medium reads the first data from the first target storage unit, where the first target storage unit is used for the storage medium to process the first data.
19. The method according to any one of claims 13 to 18, characterized in that: The method further comprises: The controller sends a second data processing instruction to the storage medium, the second data processing instruction includes a second identifier, the second identifier is used to indicate the use of a non-volatile storage unit to process the second data, and the second data processing instruction is used for the storage medium to use a volatile storage unit to process the second data if the non-volatile storage unit fails to process the second data based on the second identifier.
20. A data processing method, characterized in that: The method is applied to a storage medium included in a storage device, the storage medium includes at least one volatile first storage unit, and the storage device also includes a controller connected to the storage medium; The storage medium receives a first data processing instruction sent by the controller, and processes the first data using the first storage unit based on the first identifier.
21. The method according to claim 20, characterized in that The storage medium further includes at least one second storage unit having non-volatility; The method further includes: receiving, by the storage medium, a first address corresponding to the first data sent by the controller; The processing of the first data using a volatile storage unit based on the first identifier includes: the storage medium processing the first data using a first target storage unit in the at least one first storage unit based on the first identifier and the first address.
22. The method according to claim 21, characterized in that The first data processing instruction is a data read instruction, the first address is an address located in the second storage unit, and the storage medium processes the first data using a first target storage unit in the at least one first storage unit based on the first identifier and the first address, including: The storage medium queries an address table based on the first identifier and the first address to obtain a query result, the address table records a second address located in the second storage unit, data corresponding to the second address is stored in the first storage unit, and the query result is used to indicate whether the first address hits the second address; The storage medium reads the first data from the first target storage unit based on the query result.
23. The method according to claim 22, characterized in that The query result is used to indicate that the first address hits the second address, and the storage medium reads the first data from the first target storage unit based on the query result, including: The storage medium determines a first corresponding address of the first address in the first target storage unit, reads the first data according to the first corresponding address, and sends the first data to the controller.
24. The method according to claim 22, characterized in that The query result is used to indicate that the first address does not hit the second address, and the storage medium reads the first data from the first target storage unit based on the query result, including: The storage medium reads the first data according to the first address, determines a first corresponding address of the first address in the first target storage unit, writes the first data to the first corresponding address, reads the first data according to the first corresponding address, and sends the first data to the controller.
25. The method according to claim 22 or 24, characterized in that The query result is used to indicate that the first address does not hit the second address, and the method further includes: The storage medium sends an error message to the controller, where the error message is used to indicate that an error occurs in a process of reading the first data from the first target storage unit.
26. The method according to claim 21, characterized in that The first data processing instruction is a data writing instruction, and the first address is an address located in the second storage unit; The method further includes: the storage medium receiving first data sent by the storage medium; The storage medium processes the first data using a first target storage unit in the at least one first storage unit based on the first identifier and the first address, including: the storage medium determines a first corresponding address of the first address in the first target storage unit based on the first identifier, and writes the first data into the first corresponding address; The method further includes: the storage medium records the first address in an address table, the address table records a second address located in the second storage unit, and data corresponding to the second address is stored in the first storage unit.
27. The method according to claim 21, characterized in that The first address is an address located in the first target storage unit, and the storage medium processes the first data using a first target storage unit in the at least one first storage unit based on the first identifier and the first address, including: The storage medium processes the first data according to the first address based on the first identifier.
28. The method according to any one of claims 20 to 27, characterized in that: The method further comprises: The storage medium receives a second data processing instruction sent by the controller, where the second data processing instruction includes a second identifier, and the second identifier is used to indicate that a non-volatile storage unit is used to process second data; When the storage medium fails to process the second data using the non-volatile storage unit based on the second identifier, the storage medium uses a volatile storage unit to process the second data.
Citation Information
Patent Citations
Data arrangement method, storage apparatus, storage controller and storage array
CN105723320A
Data transmission control method, device and equipment and readable storage medium
CN113157611A
Intelligent cache allocation method and control component
CN113867615A
Data storage method and device for solid state disk and solid state disk (SSD)
CN114303123A