Storage device and data processing method
By using the target identifier in the storage device to confirm that the data processing is completed, the problems of low data processing efficiency and insufficient reliability in the prior art are solved, and a more flexible and reliable data processing process is achieved.
Patent Information
- Application Number
- CN202411165862.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In the prior art, the data processing process between the storage medium and the controller is low and not flexible enough, which may lead to excessive waiting time or data processing not being completed in time, affecting the reliability of data processing.
By introducing a target identifier into the storage device, the controller sends a data processing instruction to the storage medium, and the storage medium returns to the target identifier after executing the instruction. The controller confirms that the data processing is completed based on the identification, thereby avoiding waiting for a fixed time and improving data processing flexibility and reliability. The target identification includes an identification for indicating data processing instructions and fault status, allowing the controller to promptly identify faults in data processing results and processing procedures.
It improves the efficiency and reliability of the data processing process, allows the controller to promptly confirm that the data processing is completed or there is a fault, avoiding the problems of excessive waiting time or data not being processed in time, and simplifies the design complexity of the controller and storage media.
Smart Images

Figure CN119200963A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210471336.0, 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] In a computer device, data is stored in a storage medium, and data processing is performed by interacting with the storage medium through a controller included in the computer device, wherein data processing includes but is not limited to data reading and data writing.
[0004] In the related art, a controller sends a data processing instruction to a storage medium, and after waiting for a fixed period of time, it is assumed that the storage medium has executed the data processing instruction.
[0005] However, the time taken by the storage medium to execute the data processing instruction may vary. During the data processing process, if the time taken is less than the fixed time, the controller needs to wait for an extra time, which reduces the efficiency of data processing. If the time taken is greater than the fixed time, the controller assumes that the storage medium has executed the data processing instruction when the storage medium has not yet executed the data processing instruction, which reduces the reliability of data processing. In short, the data processing process of the related art is not flexible enough. Summary of the invention
[0006] The present application provides a storage device and a data processing method to solve the problem that the data processing process of the related art is low in efficiency or reliability and not flexible enough. The technical solution includes the following aspects.
[0007] In a first aspect, a storage device is provided, which includes a controller and a storage medium connected to each other. In the storage device, the controller is used to send a data processing instruction to the storage medium, and the storage medium is used to send a target identifier to the controller after executing the data processing instruction. The target identifier is at least one of a first identifier and a second identifier, the first identifier is used to indicate the data processing instruction, and the second identifier is used to indicate a fault state. In addition, the controller is also used to confirm that the storage medium has executed the data processing instruction based on the target identifier.
[0008] In the present application, after the storage medium executes the data processing instruction sent by the controller, it returns a target identifier to the controller, and the controller can confirm that the storage medium has executed the data processing instruction after receiving the target identifier. Therefore, the controller does not need to wait for a fixed period of time before assuming that the storage medium has executed the data processing instruction, thereby taking into account the efficiency and reliability of the data processing process and improving the flexibility of the data processing process.
[0009] The target identifier is at least one of a first identifier and a second identifier, the first identifier is used to indicate a data processing instruction, and the second identifier is used to indicate a fault state. When the number of data processing instructions is one, the target identifier is only the first identifier, or only the second identifier, or the first identifier and the second identifier, and the controller can identify the data processing instruction executed by the storage medium according to the target identifier. When the number of data processing instructions is at least two, the target identifier is only the first identifier, or the first identifier and the second identifier, and the controller can identify the data processing instruction executed by the storage medium according to the target identifier.
[0010] Moreover, for the first identifier, in addition to being used by the controller to confirm that the storage medium has executed the data processing instruction, it can also be used by the controller to identify the data reading instruction corresponding to the business data returned by the storage medium when the data processing instruction is a data reading instruction. Therefore, the controller does not need to plan the order in which the data reading instructions are sent, nor does it need to command the storage medium to return the business data at a specified time and in a specified order, thereby simplifying the design complexity of the controller. Moreover, since the storage medium does not need to return the business data at a specified time and in a specified order, the storage medium does not need to control the time consumption of executing each data reading instruction, and the storage medium does not need to ensure the consistency of the delay within the life cycle. For the second identifier, in addition to being used by the controller to confirm that the storage medium has executed the data processing instruction, it can also be used by the controller to promptly confirm whether there is a fault in the execution process of the data processing instruction.
[0011] The storage medium may include an instruction decoder, a row address decoder, a column address decoder, a non-volatile storage unit, a volatile storage unit, and an input / output (IO) loop interface. The instruction decoder receives a data processing instruction sent by a controller, parses the data processing instruction to obtain instructions for a row address decoder and a column address decoder, and the row address decoder and the column address decoder enable the non-volatile storage unit according to the instruction of the instruction decoder, and executes the data processing instruction through the interaction between the enabled non-volatile storage unit, the volatile storage unit and the IO loop interface. Afterwards, the IO loop interface sends the above-mentioned target identifier to the controller.
[0012] In a possible implementation manner, the controller is further configured to send a third identifier corresponding to the data processing instruction to the storage medium, and the target identifier is at least one of the third identifier and the second identifier.
[0013] The storage medium does not need to determine the first identifier for indicating the data processing instruction by itself, but can use the third identifier sent by the controller as the first identifier. For example, the instruction decoder included in the storage medium receives the third identifier and sends the third identifier to the IO cycle interface. The IO cycle interface uses the third identifier as the first identifier. When the target identifier includes the first identifier, the IO cycle interface can send the first identifier to the controller.
[0014] In a possible implementation, the first identifier includes at least one of an identifier of a storage unit and an identifier of a storage medium, the storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
[0015] That is, the storage medium determines the first identifier for indicating the data processing instruction by itself. For example, after parsing the data processing instruction, the instruction decoder determines the storage unit for executing the data processing instruction, and determines the first identifier based on the identifier of the storage unit and at least one of the identifiers of the storage medium where the instruction decoder is located. Afterwards, the instruction decoder sends the first identifier to the IO cycle interface, and when the target identifier includes the first identifier, the IO cycle interface can send the first identifier to the controller.
[0016] In a possible implementation, the storage medium is further used to obtain characteristic data during the execution of the data processing instruction, compare the characteristic data with the reference data, and generate the second identifier.
[0017] The characteristic data represents the execution process of the data processing instruction in the form of data, so by comparing the characteristic data with the reference data, it can be determined whether there is a fault in the execution process of the data processing instruction, thereby generating a second identifier for indicating the fault state. For example, the storage medium also includes a comparator, and the storage medium also stores the reference data. The comparator obtains the characteristic data and reads the stored reference data, thereby generating a second identifier by comparing the characteristic data with the reference data.
[0018] In a possible implementation, the storage medium is used to obtain characteristic data based on data generated by elements included in the storage medium during the execution of the data processing instruction.
[0019] During the execution of the data processing instruction, the components included in the storage medium respectively perform corresponding actions, such as the instruction decoder performs the parsing action, the row address decoder and the column address decoder perform the enabling action, so that the components included in the storage medium will generate data, so that the characteristic data can be obtained based on the data generated by the components included in the storage medium. For example, the storage medium includes a sensor, the sensor detects the data generated by the components included in the storage medium, and the comparator obtains the characteristic data based on the data detected by the sensor. The comparator also reads the reference data and generates a second identifier by comparing the characteristic data with the reference data.
[0020] In a possible implementation manner, the characteristic data includes at least one of current data, voltage data, temperature data, and component attribute data.
[0021] In this implementation, the feature data may include multiple types of data and has a wide range of applications.
[0022] In a possible implementation, the data processing instruction is used to instruct reading of business data; and the storage medium is used to obtain characteristic data based on the read business data during the execution of the data processing instruction.
[0023] During the data reading process, the transmission direction of the business data is: non-volatile storage unit, volatile storage unit, IO cycle interface, controller. For example, the comparator reads the business data cached by the volatile storage unit, obtains the characteristic data based on the business data, and the comparator also obtains the stored reference data. Thus, the comparator generates a second identifier by comparing the characteristic data and the reference data.
[0024] In a possible implementation, the data processing instruction is used to instruct writing of business data; and the storage medium is used to read the written business data during the execution of the data processing instruction, and to obtain the characteristic data based on the read business data.
[0025] During the data writing process, the transmission direction of the business data is: controller, IO cycle interface, volatile storage unit, non-volatile storage unit. For example, the comparator reads the written business data from the non-volatile storage unit, obtains the characteristic data based on the business data, and the comparator reads the cached business data from the volatile storage unit and uses the business data as the reference data. Afterwards, the comparator compares the characteristic data and the reference data to generate a second identifier.
[0026] In one possible implementation, in response to the difference between the characteristic data and the reference data being less than or equal to a difference threshold, the fault state indicated by the second identifier is that there is no fault; or, in response to the difference between the characteristic data and the reference data being greater than the difference threshold, the fault state indicated by the second identifier is that there is a fault.
[0027] In this implementation, if the difference between the characteristic data and the reference data is different, the fault state indicated by the second identifier is also different. The method of generating the second identifier is simple, easy and flexible.
[0028] In one possible implementation, a data processing instruction is used to instruct the writing of business data, and the data processing instruction corresponds to a first storage unit; the controller is also used to send an updated data processing instruction to the storage medium in response to a fault state indicated by a second identifier as the presence of a fault, and the updated data processing instruction is used to instruct the writing of business data to a second storage unit, and the first storage unit and the second storage unit are different storage units included in the storage medium; the storage medium is also used to execute the updated data processing instruction.
[0029] The controller confirms that there is a failure in the process of writing business data into the first storage unit based on the second identifier, so the controller rewrites the business data into another second storage unit, thereby ensuring the successful writing of the business data, avoiding the loss of business data, and improving the reliability of data processing.
[0030] In a possible implementation manner, the controller is further configured to mark the first storage unit as an unreliable storage unit.
[0031] Since there is a failure in the process of writing business data to the first storage unit, the first storage unit needs to be marked to protect or focus on the first storage unit to avoid affecting the reliability of data processing when the first storage unit is subsequently used to execute data processing instructions.
[0032] In one possible implementation, the controller is further used to, after marking the first storage unit as an unreliable storage unit, mark the first storage unit as a damaged storage unit and stop using the first storage unit in response to the number of errors occurring in the first storage unit being greater than or equal to a number threshold.
[0033] When a large number of errors occur in the first storage unit, the first storage unit is no longer used to avoid affecting the reliability of data processing.
[0034] In a possible implementation, the data processing instruction is used to instruct writing of business data, the storage medium is used to store the business data in a non-volatile manner, and the controller is further used to delete the volatile stored business data based on the target identifier.
[0035] Since the controller can confirm based on the target identifier that the storage medium has executed the data processing instruction, that is, the storage medium has stored the business data in a non-volatile manner, the controller can delete the volatile stored business data, that is, delete the cached business data, thereby freeing up volatile storage space and avoiding additional occupation of volatile storage space.
[0036] In a possible implementation, the data processing instruction is used to instruct to read the service data; the storage medium is also used to send the read service data to the controller, and the read service data has a different sending path from the first identification;
[0037] The controller is further configured to receive the read service data and the first identifier through different transmission paths, and determine the priority of the read service data based on the first identifier;
[0038] In response to the priority of the read business data being higher than the priority of other data currently being processed by the controller, the controller is further configured to interrupt the processing of the other data and process the read business data.
[0039] The controller identifies the priority of the service data according to the first identifier. When the priority of the service data is high, the service data can interrupt the controller's processing of other low-priority data. Thus, the service data with higher priority can be processed by the controller first, and the flexibility of data processing is higher.
[0040] In a possible implementation, the data processing instruction is used to instruct reading of business data, and the controller is further used to execute an error correction process in response to the fault state indicated by the second identifier indicating that a fault exists, so as to restore the business data.
[0041] The controller can promptly identify a faulty data reading process based on the second identifier, and execute an error correction process to restore the business data, thereby avoiding errors in the business data and ensuring the reliability of data processing.
[0042] In a second 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 interconnected with the controller. The method comprises:
[0043] The controller first sends a data processing instruction to the storage medium, and then receives a target identifier sent by the storage medium, where the target identifier is at least one of a first identifier and a second identifier. The first identifier is used to indicate the data processing instruction, the second identifier is used to indicate a fault state, and the second identifier is generated based on the execution process of the data processing instruction of the storage medium. Then, based on the target identifier, the controller confirms that the storage medium has executed the data processing instruction.
[0044] In a possible implementation manner, the method further includes: the controller sends a third identifier corresponding to the data processing instruction to the storage medium, and the target identifier is at least one of the third identifier and the second identifier.
[0045] In a possible implementation, the first identifier includes at least one of an identifier of a storage unit and an identifier of a storage medium, the storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
[0046] In one possible implementation, a data processing instruction is used to instruct the writing of business data, and the data processing instruction corresponds to a first storage unit. The method also includes: in response to the fault state indicated by the second identifier being a fault, the controller sends an updated data processing instruction to the storage medium, and the updated data processing instruction is used to instruct the writing of business data to a second storage unit. The first storage unit and the second storage unit are different storage units included in the storage medium.
[0047] In a possible implementation manner, the method further includes: the controller marking the first storage unit as an unreliable storage unit.
[0048] In one possible implementation, after the controller marks the first storage unit as an unreliable storage unit, the method further includes: in response to the number of errors occurring in the first storage unit being greater than or equal to a number threshold, the controller marks the first storage unit as a damaged storage unit and stops using the first storage unit.
[0049] In a possible implementation, the data processing instruction is used to instruct writing of business data, the storage medium is used to perform non-volatile storage of the business data, and the method further includes: the controller deleting the volatile stored business data based on the target identifier.
[0050] In a possible implementation, the data processing instruction is used to instruct to read the service data, and the method further includes: the controller receives the service data and the first identifier read by the storage medium through different sending paths, and determines the priority of the read service data based on the first identifier;
[0051] In response to the priority of the read service data being higher than the priority of other data currently being processed by the controller, the controller interrupts the processing of the other data and processes the read service data.
[0052] In a possible implementation, the data processing instruction is used to instruct reading of business data, and the method further includes: the controller executes an error correction process in response to the fault state indicated by the second identifier indicating that a fault exists, so as to recover the business data.
[0053] In a third aspect, a data processing method is provided. The method is applied to a storage medium included in a storage device, and the storage device also includes a controller interconnected with the storage medium. The method includes:
[0054] First, the storage medium receives a data processing instruction sent by the controller. Afterwards, the storage medium executes the data processing instruction and sends a target identifier to the controller, where the target identifier is at least one of a first identifier and a second identifier, wherein the first identifier is used to indicate the data processing instruction, the second identifier is used to indicate a fault state, and the second identifier is generated based on the execution process of the data processing instruction.
[0055] In a possible implementation manner, the method further includes: the storage medium receives a third identifier corresponding to the data processing instruction sent by the controller, and the target identifier is at least one of the third identifier and the second identifier.
[0056] In a possible implementation, the first identifier includes at least one of an identifier of a storage unit and an identifier of a storage medium, the storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
[0057] In a possible implementation, the method further includes: the storage medium acquires characteristic data during the execution of the data processing instruction, compares the characteristic data with reference data, and generates a second identifier.
[0058] In a possible implementation, the storage medium acquires characteristic data during the execution of the data processing instruction, including: the storage medium acquires the characteristic data based on data generated by elements included in the storage medium during the execution of the data processing instruction.
[0059] In a possible implementation manner, the characteristic data includes at least one of current data, voltage data, temperature data, and component attribute data.
[0060] In a possible implementation, the data processing instruction is used to instruct reading of business data, and the storage medium obtains characteristic data during the execution of the data processing instruction, including: the storage medium obtains the characteristic data based on the read business data during the execution of the data processing instruction.
[0061] In one possible implementation, a data processing instruction is used to instruct writing of business data, and a storage medium obtains characteristic data during the execution of the data processing instruction, including: during the execution of the data processing instruction, the storage medium reads the written business data and obtains the characteristic data based on the read business data.
[0062] In one possible implementation, in response to the difference between the characteristic data and the reference data being less than or equal to a difference threshold, the fault state indicated by the second identifier is that there is no fault; or, in response to the difference between the characteristic data and the reference data being greater than the difference threshold, the fault state indicated by the second identifier is that there is a fault.
[0063] In one possible implementation, the data processing instruction is used to instruct the reading of business data, and the method also includes: the storage medium sends the read business data to the controller, the sending path of the read business data is different from that of the first identifier, the controller is used to receive the read business data and the first identifier through different sending paths, determine the priority of the read business data based on the first identifier, and in response to the priority of the read business data being higher than the priority of other data currently processed by the controller, interrupt the processing of other data and process the read business data. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A schematic diagram of the structure of a storage device provided in an embodiment of the present application;
[0065] Figure 2 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0066] Figure 3 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0067] Figure 4 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0068] Figure 5 A schematic diagram of the structure of another storage device provided in an embodiment of the present application;
[0069] Figure 6 A flowchart of a data processing method provided in an embodiment of the present application;
[0070] Figure 7 A schematic diagram of a process for generating a second identifier provided in an embodiment of the present application;
[0071] Figure 8 A schematic diagram of another process for generating a second identifier provided in an embodiment of the present application;
[0072] Fig. 9 A schematic diagram of a process for generating a second identifier provided in another embodiment of the present application;
[0073] Fig.10 A schematic diagram of a data reading process in a related technology provided in an embodiment of the present application;
[0074] Fig.11 A schematic diagram of a data reading process provided in an embodiment of the present application;
[0075] Fig.12 A schematic diagram of another data reading process provided in an embodiment of the present application;
[0076] Fig.13A schematic diagram of another data reading process provided in an embodiment of the present application;
[0077] Fig.14 A schematic diagram of another data reading process provided in an embodiment of the present application;
[0078] Fig.15 A schematic diagram of another data reading process provided in an embodiment of the present application;
[0079] Fig.16 A schematic diagram of a data writing process in a related technology provided in an embodiment of the present application;
[0080] Fig.17 A schematic diagram of a data writing process provided in an embodiment of the present application. DETAILED DESCRIPTION
[0081] 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.
[0082] The present application embodiment provides a storage device, such as 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 data processing instruction to the storage medium 102. The storage medium 102 is used to execute the data processing instruction and send a target identifier to the controller 101. The controller 101 is also used to confirm that the storage medium 102 has executed the data processing instruction based on the target identifier. The target identifier is at least one of a first identifier and a second identifier. The first identifier is used to indicate the data processing instruction, the second identifier is used to indicate a fault state, and the second identifier is generated based on the execution process of the data processing instruction.
[0083] The controller 101 and the storage medium 102 are described below. Figures 6 to 9 , Figures 11 to 15 and Fig.17 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.
[0084] A storage medium 102 is a logical unit (LUN), which is also called a Die. Figure 2As shown, the storage medium 102 includes a command decoder, at least one volatile storage unit, at least one non-volatile storage unit, a row address decoder, a column address decoder, and an IO circuit interface. A non-volatile storage unit includes at least one minimum operation unit, the column address decoder is also called the address decoder of the minimum operation unit, and the IO circuit interface is also called the IO circuit.
[0085] The instruction decoder is connected to the row address decoder, the column address decoder and the IO cycle interface respectively, and the row address decoder and the column address decoder are also connected to the non-volatile storage unit respectively. The non-volatile storage unit is also connected to the volatile storage unit, and the volatile storage unit is also connected to the IO cycle interface. In addition, the instruction decoder is also connected to the controller 101 to receive the data processing instruction sent by the controller 101. The IO cycle interface is also connected to the controller 101 to exchange business data corresponding to the data processing instruction with the controller 101.
[0086] Exemplarily, the storage medium 102 further includes a multiplexer (MUX). Accordingly, the column address decoder is connected to at least one minimum operation unit of the non-volatile storage unit through the MUX. Figure 3 , Figure 3 It shows that the minimum number of operation units included in the non-volatile storage unit is at least two (that is, Figure 3 Wherein the value of N is an integer not less than 1, and the number of minimum operation units is N+1), the column address decoder is respectively connected to at least two minimum operation units through the MUX.
[0087] In some embodiments, the volatile storage unit includes at least one of a centralized volatile storage unit and a distributed volatile storage unit. A centralized volatile storage unit can be connected to all or part of the minimum operation units in the non-volatile storage unit. For example, Figure 3 The volatile storage unit shown is a centralized volatile storage unit. A distributed volatile storage unit can be connected to the minimum operation unit of a non-volatile storage unit. For example, Figure 4The volatile storage unit shown is a distributed volatile storage unit. The embodiments of the present application do not limit the centralized volatile storage unit and the distributed volatile storage unit. Exemplarily, the centralized volatile storage unit includes but is not limited to a static random access memory (RAM), i.e., SRAM. The distributed volatile storage unit includes but is not limited to a page register.
[0088] 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.
[0089] For example, see Figure 5 The storage medium 102 further includes an on-die comparator. The non-volatile storage unit, the volatile storage unit, and the IO cycle interface are respectively connected to the comparator. In some embodiments, the comparator can be integrated with the volatile storage unit.
[0090] For example, see Figure 5 The storage medium 102 further includes a sensor. The sensor is connected to the comparator, and the sensor is also connected to the instruction decoder, the row address decoder, the column address decoder and at least one element in the non-volatile storage unit. In some embodiments, the sensor is a sensing circuit.
[0091] Exemplarily, the non-volatile storage unit includes, but is not limited to: storage class memory (SCM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The flash memory is, for example, not and (NAND) flash memory.
[0092] Exemplarily, in addition to the above-mentioned page registers and SRAM, the volatile memory unit may also include, but is not limited to: 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).
[0093] 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.
[0094] It should be understood that Figures 1 to 5 The structures shown are exemplary storage devices. Figures 1 to 5 It 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.
[0095] The present application embodiment provides a data processing method. Figures 1 to 5 Taking the storage device shown in FIG. 1 as an example, the data processing method is implemented through the interaction between the controller 101 and the storage medium 102. Figure 6 As shown, the data processing method includes the following steps 601 to 604.
[0096] Step 601: The controller sends a data processing instruction to a storage medium.
[0097] The data processing instruction sent by the controller to the storage medium is used to instruct the processing of business data, where the business data is the data to be processed. Exemplarily, the data processing instruction includes a storage unit identifier and a processing method identifier. The storage unit identifier is used to indicate: the business data is processed using a non-volatile storage unit included in the storage medium. The processing method identifier is used to indicate: the processing method corresponding to the business data.
[0098] In some embodiments, the processing method includes but is not limited to reading, writing, etc., which are not limited here. When the processing method indicated by the processing method identifier is reading, the data processing instruction is used to instruct the reading of business data. In other words, the data processing instruction is a data read instruction. When the processing method indicated by the processing method identifier is writing, the data processing instruction is used to instruct the writing of business data. In other words, the data processing instruction is a data write instruction. Exemplarily, the processing method identifier is a first numerical value, which is used to indicate that the processing method is reading, and the processing method identifier is a second numerical value, which is used to indicate that the processing method is writing, and the first numerical value is different from the second numerical value. The embodiment of the present application does not limit the first numerical value and the second numerical value, and these numerical values can be set according to experience or actual needs.
[0099] In an exemplary embodiment, the data processing instruction also corresponds to an address, and the controller also sends the address to the storage medium. Among them, the address is an address for processing business data. Exemplarily, the address is the storage unit indicated by the above-mentioned storage unit identifier, that is, the address in the non-volatile storage unit. In some embodiments, the controller sends the data processing instruction and the address corresponding to the data processing instruction to the storage medium in different transmission cycles. For example, the data processing instruction is first sent to the storage medium in a transmission cycle, and then the address is sent to the storage medium in other transmission cycles after the transmission cycle. In other embodiments, the address may also be carried in the data processing instruction, and the controller sends the data processing instruction carrying the address to the storage medium in a transmission cycle. Among them, the embodiment of the present application does not limit the duration of the transmission cycle, and the duration of the transmission cycle can be set according to experience or actual needs.
[0100] For example, see Figures 2 to 5 The storage device shown in the figure has a storage medium including an instruction decoder. Then, the controller sends the above data processing instruction and the above address to the instruction decoder.
[0101] Step 602: The storage medium executes the data processing instruction.
[0102] After the controller sends the data processing instruction to the storage medium, the storage medium receives the data processing instruction and executes the data processing instruction. Exemplarily, the storage medium executes the data processing instruction, including: the storage medium parses the data processing instruction, obtains the storage unit identifier and the processing method identifier, determines the storage unit required to process the business data according to the storage unit identifier, determines the processing method according to the processing method identifier, and thereby processes the business data in the determined storage unit according to the determined processing method.
[0103] In some embodiments, in addition to receiving the data processing instruction, the storage medium also receives the address sent by the controller. In other embodiments, the data processing instruction carries the address, and the storage medium parses the data processing instruction to obtain the address. Regardless of how the storage medium obtains the address, the storage medium can process the business data in the determined storage unit according to the address and the determined processing method. In the case where the data processing instruction is a data read instruction, the storage medium reads the business data from the address in the determined storage unit. Afterwards, the storage medium sends the read business data to the controller. In the case where the data processing instruction is a data write instruction, the storage medium writes the business data to the address in the determined storage unit. Among them, the business data is sent by the controller to the storage medium.
[0104] Exemplarily, in the case where the data processing instruction is a data write instruction, the storage medium may not obtain an address, but randomly select an unoccupied address in the determined storage unit, and use the selected address to write the business data. Accordingly, the storage medium also sends the selected address to the controller so that the controller obtains the address for writing the business data.
[0105] For example, see Figures 2 to 5 The storage device shown in the figure has a storage medium including multiple elements. Next, an exemplary process of executing data processing instructions by each element included in the storage medium is described.
[0106] After the controller sends the data processing instruction and address to the instruction decoder included in the storage medium, the instruction decoder receives the data processing instruction and address, and parses the data processing instruction to obtain the storage unit identifier and the processing mode identifier. Then, the instruction decoder determines the first instruction group and the second instruction group according to the address, the storage unit identifier and the processing mode identifier. Among them, the first instruction group is used for the row address decoder and the column address decoder to enable at least one row in at least one minimum operation unit of the non-volatile storage unit to exchange business data between the non-volatile storage unit and the volatile storage unit. The non-volatile storage unit is the storage unit indicated by the storage unit identifier, and at least one row in the at least one minimum operation unit is determined based on the address. When exchanging business data, the transmission direction of the business data is determined by the processing mode indicated by the processing mode identifier. The second instruction group is used for exchanging business data between the IO cycle interface and the controller, and exchanging business data with the volatile storage unit. When exchanging business data, the transmission direction of the business data is also determined by the processing mode indicated by the processing mode identifier.
[0107] Exemplarily, the data processing instruction is a data read instruction. Then, the instruction decoder sends a first instruction group to the row address decoder and the column address decoder, so that the row address decoder and the column address decoder enable at least one row of at least one minimum operation unit in the non-volatile storage unit. Afterwards, the row in the enabled minimum operation unit sends the business data stored in itself to the corresponding volatile storage unit, and the volatile storage unit caches the business data. The instruction decoder also sends a second instruction group to the IO cycle interface, so that the IO cycle interface reads the cached business data from the volatile storage unit, and the IO cycle interface sends the business data to the controller. That is to say, during the data reading process, the transmission directions of the business data are: non-volatile storage unit, volatile storage unit, IO cycle interface and controller.
[0108] Exemplarily, the data processing instruction is a data write instruction. Then, the controller sends business data to the IO cycle interface, and the instruction decoder sends a second instruction group to the IO cycle interface, so that the IO cycle interface writes the received business data into the cache in the volatile storage unit. Afterwards, the instruction decoder sends a first instruction group to the row address decoder and the column address decoder, so that the row address decoder and the column address decoder enable at least one row of at least one minimum operation unit in the non-volatile storage unit. Then, the row of the enabled minimum operation unit reads the business data from the corresponding volatile storage unit and stores it. That is to say, during the data writing process, the transmission directions of the business data are: controller, IO cycle interface, volatile storage unit and non-volatile storage unit.
[0109] In an exemplary embodiment, the first instruction group includes at least one pair of instructions, each pair of instructions includes an instruction for a row address decoder and an instruction for a column address decoder. Each pair of instructions corresponds to an execution cycle, and the execution cycles corresponding to each pair of instructions are at different times. In some embodiments, the instruction decoder sends each pair of instructions in order from first to last in time, and the row address decoder and the column address decoder execute the instructions after receiving the instructions to enable at least one row of at least one minimum operation unit in the non-volatile storage unit, and read or write the business data after completing the enabling. In other embodiments, the instruction decoder directly sends all pairs of instructions, and the row address decoder and the column address decoder execute the instructions in order from first to last in time after receiving the instructions to enable at least one row of at least one minimum operation unit in the non-volatile storage unit, and read or write the business data after completing the enabling. Wherein, when the instruction decoder sends a pair of instructions, it sends the instructions for the row address decoder in the pair of instructions to the row address decoder, and sends the instructions for the column address decoder in the pair of instructions to the column address decoder.
[0110] In one execution cycle, the column address decoder enables at least one minimum operation unit of the non-volatile storage unit through MUX, and the row address decoder enables a row, so that through the cooperation of the column address decoder and the row address decoder, a row of at least one minimum operation unit in the non-volatile storage unit is enabled. After that, business data can be interacted between the row of the enabled minimum operation unit and the corresponding volatile storage unit. Then, the execution cycle ends and enters the next execution cycle, which will not be repeated here. Among them, the embodiment of the present application does not limit the duration of an execution cycle. The duration of an execution cycle can be flexibly determined according to the performance of the storage medium, as long as it is ensured that the above-mentioned enabling process and reading (or writing) process can be completed within the duration of an execution cycle.
[0111] For example, see Figure 3 and Figure 4 , an example is given in which the 0th and 1st rows of the minimum operation unit 0 and the 0th and 1st rows of the minimum operation unit N need to be enabled in the non-volatile storage medium.
[0112] In the first execution cycle, the instruction decoder sends the first pair of instructions to the row address decoder and the column address decoder, and the column address decoder enables the minimum operation unit 0 and the minimum operation unit N through the MUX, and the row address decoder enables the 0th row. Thus, through the cooperation of the column address decoder and the row address decoder, the 0th row of the minimum operation unit 0 and the 0th row of the minimum operation unit N are enabled, so that the business data can be exchanged between the enabled 0th row of the minimum operation unit 0 and the 0th row of the minimum operation unit N and the corresponding volatile storage unit. Figure 3 , the minimum operation unit 0 and the minimum operation unit N both correspond to volatile storage units. Figure 4 , the minimum operation unit 0 corresponds to the volatile storage unit 0, and the minimum operation unit N corresponds to the volatile storage unit N.
[0113] In the second execution cycle, the instruction decoder sends the second pair of instructions to the row address decoder and the column address decoder, and the column address decoder enables the minimum operation unit 0 and the minimum operation unit N through the MUX, and the row address decoder enables the first row. Thus, through the cooperation of the column address decoder and the row address decoder, the first row of the minimum operation unit 0 and the first row of the minimum operation unit N are enabled, so that the business data can be exchanged between the enabled first row of the minimum operation unit 0 and the first row of the minimum operation unit N and the corresponding volatile storage unit. The volatile storage units corresponding to the minimum operation unit 0 and the minimum operation unit N are described above and will not be repeated here.
[0114] Step 603: The storage medium sends a target identifier to the controller. The target identifier is at least one of a first identifier and a second identifier. The first identifier is used to indicate a data processing instruction, and the second identifier is used to indicate a fault state. The second identifier is generated based on the execution process of the data processing instruction.
[0115] Wherein, after executing the data processing instruction, or in other words, after the storage medium has completed executing the data processing instruction, the storage medium sends a target identifier to the controller, and the target identifier is at least one of the first identifier and the second identifier. The first identifier is used to indicate the data processing instruction, and the data processing instruction indicated by the first identifier is the data processing instruction that has been executed by the storage medium. The second identifier is used to indicate a fault state, and the fault state includes the presence of a fault (i.e., abnormal) or the absence of a fault (i.e., normal), and the second identifier is generated based on the execution process of the data processing instruction. Exemplarily, although the second identifier is generated based on the execution process of the data processing instruction, the second identifier itself is only used to indicate a fault state, and is not used to indicate which data processing instruction corresponds to the fault state.
[0116] In some embodiments, the data processing instruction is a data read instruction. According to the description in step 602, the storage medium needs to send the read business data to the controller. Therefore, the storage medium sends the read business data and the target identifier to the controller. Exemplarily, at least one signal line is included between the storage medium and the controller, and the business data and the target identifier can be sent through different signal lines or through the same signal line. For the case of sending through different signal lines, if the target identifier includes a first identifier and a second identifier, the business data, the first identifier, and the second identifier can be sent through three different signal lines respectively, or the business data and the first identifier can be sent through one signal line and the second identifier can be sent through another signal line, or the business data and the second identifier can be sent through one signal line and the first identifier can be sent through another signal line.
[0117] In other embodiments, the data processing instruction is a data write instruction, and the storage medium only sends the target identifier to the controller, and does not send business data to the controller. Exemplarily, at least one signal line is included between the storage medium and the controller. If the target identifier only includes the first identifier or only includes the second identifier, the target identifier can be sent through one signal line. If the target identifier includes the first identifier and the second identifier, the first identifier and the second identifier can be sent through different signal lines or through the same signal line.
[0118] Exemplarily, for the case where at least two objects among the business data, the first identifier and the second identifier are sent through the same signal line, it is necessary to specify the order of sending through the same signal line so that after the controller receives it, it can identify each object in this order. That is to say, the storage medium sends at least two objects among the business data, the first identifier and the second identifier to the controller through the same signal line in a certain sending order. Among them, the sending order can be set according to experience or according to actual needs, and is not limited here, as long as the storage medium and the controller can support the sending order. Taking the case where the business data, the first identifier and the second identifier are all sent through the same signal line, the storage medium sends the first identifier, the second identifier and the business data to the controller in sequence. Correspondingly, after the controller receives it, it identifies the first identifier, the second identifier and the business data in sequence.
[0119] Exemplarily, in the case where at least two objects among the business data, the first identifier, and the second identifier are sent through different signal lines, they need to be sent within the same transmission cycle so that the controller can identify the correspondence between different objects after receiving them. That is, the storage medium sends at least two objects among the business data, the first identifier, and the second identifier to the controller through different signal lines within the same transmission cycle, and the controller identifies the objects received within the same transmission cycle as corresponding objects. Taking the case where the business data, the first identifier, and the second identifier are sent through different signal lines respectively as an example, the storage medium sends the business data, the first identifier, and the second identifier to the controller within the same transmission cycle. Accordingly, after the controller receives the business data, the first identifier, and the second identifier within the same transmission cycle, it identifies that the business data, the first identifier, and the second identifier are corresponding to each other.
[0120] The process of the controller sending a data processing instruction to the storage medium and the controller exchanging business data with the storage medium has been described in step 602 above and will not be repeated here. Figures 2 to 5 The storage device shown in the figure, the first identifier is sent by the instruction decoder to the IO cycle interface, so that when the target identifier includes the first identifier, the IO cycle interface sends the first identifier to the controller. For the above second identifier, see Figure 5 In the storage device shown, the second identifier is generated by the comparator and sent to the IO cycle interface, so that when the target identifier includes the second identifier, the IO cycle interface sends the second identifier to the controller. In addition, the signal line in the above description is the signal line included in the IO cycle interface.
[0121] Next, the first identifier and the second identifier are described in sequence.
[0122] In an exemplary embodiment, the first identifier includes but is not limited to the following two types.
[0123] Type 1: The first identifier is a third identifier corresponding to the data processing instruction, and the third identifier is sent by the controller to the storage medium. That is, the method also includes: the controller sends the third identifier corresponding to the data processing instruction to the storage medium, the storage medium receives the third identifier corresponding to the data processing instruction, and the target identifier is at least one of the third identifier and the second identifier.
[0124] Among them, the third identifier can be generated by the controller, or the third identifier is obtained by the controller in other ways, which is not limited here. The controller stores a first correspondence between the third identifier and the data processing instruction, and the first correspondence is used for the controller to identify the corresponding data processing instruction based on the received third identifier, as described in step 604 below. Exemplarily, the controller sends the data processing instruction and the third identifier to the storage medium respectively in different transmission cycles. Alternatively, the third identifier is carried in the data processing instruction, and the controller sends the data processing instruction carrying the third identifier to the storage medium in one transmission cycle. In some embodiments, for the case where the controller sends the data processing instruction, the address and the third identifier to the storage medium, the controller can send the data processing instruction to the storage medium in one transmission cycle, and send the address and the third identifier to the storage medium in the next transmission cycle adjacent to the transmission cycle.
[0125] For example, see Figures 2 to 5 In the storage device shown, the controller sends the third identifier to the instruction decoder. After receiving the third identifier, the instruction decoder sends the third identifier to the IO cycle interface, and the third identifier is the first identifier for indicating the data processing instruction. Therefore, when the target identifier includes the first identifier, the IO cycle interface can send the third identifier to the controller.
[0126] Type two, the first identifier includes at least one of an identifier of a storage unit and an identifier of a storage medium, the storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
[0127] Different from type 1, the first identifier in type 2 is no longer sent by the controller to the storage medium, but is generated by the storage medium itself based on the execution process of the data processing instruction. The first identifier includes at least one of the identifier of the storage unit and the identifier of the storage medium. The storage unit is the storage unit used in the execution process of the data processing instruction, and the storage medium is the storage medium that receives and executes the data processing instruction.
[0128] In type 2, before sending the data processing instruction to the storage medium, the controller determines the storage medium used to execute the data processing instruction and the storage unit included in the storage medium, uses at least one of the determined identification of the storage medium and the identification of the storage unit as a reference identification, and stores a second correspondence between the reference identification and the data processing instruction, and the second correspondence is used by the controller to identify the corresponding data processing instruction based on the received first identification, as described in step 604 below. In some embodiments, the identification type included in the reference identification is the same as the identification type included in the first identification, and the identification type includes the identification of the above-mentioned storage unit and the identification of the storage medium. For example, the first identification includes the identification of the storage unit and the identification of the storage medium, and the reference identification also includes the identification of the storage unit and the identification of the storage medium. In other embodiments, the identification type included in the reference identification includes the identification type included in the first identification, and also includes the identification type not included in the first identification. For example, the first identification only includes the identification of the storage unit, and the reference identification includes the identification of the storage unit and the identification of the storage medium. In the embodiment of the present application, the identification type included in the reference identification and the identification type included in the first identification can be obtained through negotiation between the controller and the storage medium, or the reference identification can be set by default, which is not limited here.
[0129] See also Figures 2 to 5 In the storage device shown, the instruction decoder determines the storage unit used in the execution of the data processing instruction, thereby using at least one of the identification of the storage unit and the identification of the storage medium where the instruction decoder is located as the first identification. Then, the instruction decoder sends the generated first identification to the IO cycle interface. Thus, when the target identification includes the first identification, the IO cycle interface can send the first identification to the controller.
[0130] In an exemplary embodiment, the second identifier is generated by the storage medium based on the execution process of the data processing instruction. Therefore, the method further includes: the storage medium acquires characteristic data during the execution process of the data processing instruction, compares the characteristic data with the reference data, and generates the second identifier.
[0131] Among them, since the characteristic data is obtained during the execution of the data processing instruction, the characteristic data can characterize the execution process of the data processing instruction in the form of data. Therefore, by comparing the characteristic data with the reference data, it is possible to determine whether there is a fault in the execution process of the data processing instruction, thereby generating a second identifier for indicating a fault state.
[0132] In an exemplary embodiment, in response to the difference between the characteristic data and the reference data being less than or equal to a difference threshold, the fault state indicated by the second identifier is that there is no fault. Alternatively, in response to the difference between the characteristic data and the reference data being greater than the difference threshold, the fault state indicated by the second identifier is that there is a fault. In some embodiments, the difference threshold is zero. If the characteristic data is exactly the same as the reference data, the fault state indicated by the second identifier is that there is no fault; if the characteristic data is not exactly the same as the reference data, the fault state indicated by the second identifier is that there is a fault. In other embodiments, the difference threshold is not zero. If the characteristic data is close enough to the reference data, the fault state indicated by the second identifier is that there is no fault; if the characteristic data is significantly different from the reference data, the fault state indicated by the second identifier is that there is a fault. In the embodiment of the present application, the difference threshold is not limited.
[0133] In some embodiments, the storage medium acquires characteristic data only once during the execution of the data processing instruction, and if the difference between the characteristic data and the reference data is greater than the difference threshold, a second identifier for indicating the presence of a fault is directly generated. In other embodiments, the storage medium acquires characteristic data at least twice during the execution of the data processing instruction, and if the difference between the characteristic data acquired for the first time and the reference data is greater than the difference threshold, the data processing instruction is repeatedly executed at least once, and the characteristic data is reacquired during each re-execution, and the reacquired characteristic data is compared with the reference data. If the number of times the data processing instruction is repeatedly executed reaches the repetition threshold, and the difference between the characteristic data reacquired each time and the reference data is greater than the difference threshold, a second identifier for indicating the presence of a fault is generated again. If the difference between the characteristic data reacquired and the reference data is less than or equal to the difference threshold before the number of times the data processing instruction is repeatedly executed reaches the repetition threshold, a second identifier for indicating the presence of a fault is no longer generated, but a second identifier for indicating the absence of a fault is generated. The embodiment of the present application does not limit the repetition threshold, and the repetition threshold can be set according to experience or actual needs.
[0134] Exemplarily, the execution mode adopted when repeatedly executing the data processing instruction is different from the execution mode when the data processing instruction is executed for the first time. In some embodiments, if the parameters adopted when executing the data processing instruction are different, it is considered that the execution modes are different. For example, when the first time the data processing instruction is executed, the first parameter is adopted, and the second parameter can be adopted when the data processing instruction is repeatedly executed. When the number of times the data processing instruction is repeatedly executed is at least twice, the execution mode adopted each time the data processing is repeated is the same or different. For example, when the data processing instruction is executed for the first time, the first parameter is adopted, the second parameter can be adopted when the data processing instruction is repeated for the first time, and the third parameter can be adopted when the data processing is repeated for the second time. Exemplarily, the first parameter, the second parameter and the third parameter include current parameters, voltage parameters, etc., which can be determined based on experience and are not limited here.
[0135] Exemplarily, the reference data is cached in a volatile storage unit. The volatile storage unit may be a storage unit connected to a non-volatile storage unit, such as Figure 5 The volatile storage unit shown in the figure is used to cache both the reference data and the service data during the execution of the data processing instruction. Alternatively, the volatile storage unit may be another storage unit dedicated to caching the reference data, in which case the volatile storage unit is not used to cache the service data.
[0136] In an exemplary embodiment, the storage medium obtains characteristic data during the execution of the data processing instruction, including but not limited to the following three methods.
[0137] Acquisition method 1 is applicable to the case where the data processing instruction is used to instruct the reading or writing of business data, that is, to determine whether there is a fault in the data reading process or the data writing process. In the process of executing the data processing instruction, the storage medium acquires characteristic data based on the data generated by the components included in the storage medium.
[0138] According to the description of executing the data processing instruction on the storage medium in step 602, during the execution of the data processing instruction, the components included in the storage medium will perform parsing (for example, the instruction decoder parses the data processing instruction), enabling (for example, the row address decoder and the column address decoder enable the storage unit) and other processes. Therefore, the components included in the storage medium will generate data. Exemplarily, the characteristic data is the data generated by the components included in the storage medium. Alternatively, the data generated by the components included in the storage medium are processed according to the first processing method to obtain the characteristic data. In some embodiments, the first processing method includes but is not limited to screening, calculation, etc., which are not limited here.
[0139] In an exemplary embodiment, the characteristic data includes at least one of current data, voltage data, temperature data and component attribute data. Exemplarily, the current data includes but is not limited to at least one of the current magnitude (i.e., current effective value), the amplitude of the current pulse (i.e., current peak value), the pulse width of the current pulse and the leakage current. Exemplarily, the voltage data includes but is not limited to at least one of the voltage magnitude (i.e., voltage effective value), the amplitude of the voltage pulse (i.e., voltage peak value), and the pulse width of the voltage pulse. Exemplarily, the component attribute data is the attribute data of the component. If the components are different, the component attribute data may also be different, and the component attribute data is not limited here. Of course, the above characteristic data are only for example, and the embodiment of the present application does not limit the characteristic data.
[0140] It should be understood that the reference data matches the characteristic data, or in other words, the reference data and the characteristic data belong to the same type of data. For example, if the characteristic data includes leakage current and component attribute data, the reference data includes the leakage current of the reference and the component attribute data of the reference. For another example, if the characteristic data is temperature data, the reference data is the temperature data of the reference. In some embodiments, the difference threshold may be a quantity threshold. If the number of data in the characteristic data that is different from the reference data is less than or equal to the quantity threshold, a second identification is generated to indicate that there is no fault. If the number of data in the characteristic data that is different from the reference data is greater than the data threshold, a second identification is generated to indicate that there is a fault.
[0141] See also Figure 5 The storage device shown, the storage medium includes a sensor, the sensor detects the data generated by each element included in the storage medium, and sends the detected data to the comparator. Afterwards, the comparator obtains characteristic data based on the data detected by the sensor, and the comparator also obtains reference data from a volatile storage unit. Then, the comparator compares the characteristic data and the reference data, generates a second identifier and sends it to the IO cycle interface. Exemplarily, the reference data can be stored in the volatile storage unit in the form of an exception table, and the exception table can be generated during the production process of the storage medium.
[0142] For example, see Figure 7 , Figure 7 A schematic diagram of a process for generating a second identifier is shown. On the one hand, business data is exchanged between the minimum operation unit 0 of the non-volatile storage unit, the page register 0, and the IO cycle interface. On the other hand, the comparator uses the data detected by the sensor as feature data, obtains the abnormal table from the SRAM as reference data, generates a second identifier by comparing the feature data with the reference data, and sends the second identifier to the IO cycle interface.
[0143] The second acquisition method is applicable to the case where the data processing instruction is used to instruct the reading of business data, that is, to determine whether there is a fault in the data reading process. In the process of executing the data processing instruction, the storage medium acquires the characteristic data based on the read business data.
[0144] Since the data processing instruction is used to instruct to read the business data, the storage medium executes the data processing instruction to read the business data, thereby obtaining the characteristic data based on the read business data. Exemplarily, the characteristic data is the read business data. Alternatively, the read business data is processed according to the second processing method to obtain the characteristic data. In some embodiments, the second processing method includes extracting a check bit, calculating, etc., which is not limited here.
[0145] For example, when the second processing method is to extract the check bit, the characteristic data is the check bit extracted from the read business data, and the check bit is written into the storage medium together with the business data. The reference data is an odd number or an even number. In some embodiments, the difference threshold may be zero. If the number of check bits is the same as the reference data, it means that the difference between the characteristic data and the reference data is equal to the difference threshold, and a second identifier is generated to indicate that there is no fault. If the number of check bits is different from the reference data, it means that the difference between the characteristic data and the reference data is greater than the difference threshold, and a second identifier is generated to indicate that there is a fault. For example, taking the reference data as an odd number as an example, if the number of check bits is also an odd number, the number of check bits is the same as the reference data. If the number of check bits is an even number, the number of check bits is different from the reference data. This method is also called parity check.
[0146] See also Figure 5 The storage device shown, according to the description in step 602, during the data reading process, the data stored in the non-volatile storage unit will be written into the cache in the volatile storage unit. Then the comparator reads the business data from the volatile storage unit and obtains the characteristic data based on the read business data. The comparator also obtains the reference data from the volatile storage unit. Then, the comparator compares the characteristic data with the reference data, generates a second identification and sends it to the IO cycle interface.
[0147] For example, see Figure 8 , Figure 8A flow chart of generating a second identifier is shown. On the one hand, the minimum operation unit 0 of the non-volatile storage unit writes the business data into the page register 0 cache, and the IO cycle interface reads the business data from the page register 0. On the other hand, the comparator obtains the cached business data from the page register 0 and extracts the check bit, and uses the check bit as the characteristic data. The comparator also obtains an odd number or an even number from the SRAM as the reference data, compares the characteristic data and the reference data (i.e., the comparator performs a parity check) to generate a second identifier, and sends the second identifier to the IO cycle interface.
[0148] Acquisition method three is applicable to the case where the data processing instruction is used to instruct the writing of business data, that is, it is used to determine whether there is a fault in the data writing process. In the process of executing the data processing instruction, the storage medium reads the written business data and obtains the characteristic data based on the read business data.
[0149] Since the data processing instruction is used to instruct the writing of business data, the storage medium executes the data processing instruction and can write the business data into the storage medium. Afterwards, the written business data is read, so as to obtain the characteristic data based on the read business data. Exemplarily, the characteristic data is the read business data. Alternatively, the read business data is processed according to the third processing method to obtain the characteristic data. In some embodiments, the third processing method includes calculation, which is not limited here.
[0150] In addition, the reference data matches the characteristic data. Exemplarily, the reference data is data that the storage medium receives from the controller and needs to write. Exemplarily, the difference threshold can be a specified bit greater than or equal to zero. When the difference between the characteristic data and the reference data is less than or equal to the specified bit, a second identifier is generated to indicate that there is no fault. When the difference between the characteristic data and the reference data is greater than the specified bit, a second identifier is generated to indicate that there is a fault.
[0151] In some embodiments, the difference between the moment when the business data is written to the storage medium and the moment when the written business data is read should be less than or equal to the time threshold. That is, after the business data is written to the storage medium, the written business data is read in a relatively short time. Thus, the impact on the written business data caused by changes in the properties of the storage medium itself can be avoided, and the read business data is ensured to be the same as the written business data. Since the characteristic data is obtained based on the read business data, when the read business data is the same as the written business data, the use of the characteristic data to determine whether there is a fault in the data writing process has a higher accuracy. Among them, the embodiment of the present application does not limit the time threshold, and the time threshold can be set according to experience or actual needs.
[0152] See also Figure 5 The storage device shown, according to the description in step 602, during the data writing process, the IO cycle interface writes the business data into the volatile storage unit cache, and the non-volatile storage unit reads the cached business data from the volatile storage unit and stores it. The comparator then reads the stored business data from the non-volatile storage unit and obtains the characteristic data based on the read business data. The comparator also reads the cached business data from the volatile storage unit as the reference data. Afterwards, the comparator compares the characteristic data and the reference data, generates and sends a second identification to the IO cycle interface.
[0153] For example, see Fig. 9 , Fig. 9 A schematic diagram of a process for generating a second identifier is shown. On the one hand, the IO cycle interface writes the business data into the cache of page register 0, and the minimum operation unit 0 of the non-volatile storage unit reads the business data from page register 0 and stores it. On the other hand, the comparator uses the business data read from the minimum operation unit 0 of the non-volatile storage unit as feature data, and reads the cached business data from page register 0 as reference data, thereby comparing the feature data and the reference data to generate a second identifier, and sending the second identifier to the IO cycle interface.
[0154] It should be noted that the above acquisition method 1 can be combined with acquisition method 2 or acquisition method 3. For example, in the case where the data processing instruction is a data read instruction, the second identification can be generated by acquisition method 1 and acquisition method 2. For example, if the difference between the characteristic data obtained by acquisition method 1 and the reference data is less than the difference threshold, and / or the difference between the characteristic data obtained by acquisition method 2 and the reference data is less than the difference threshold, then a second identification is generated to indicate that there is no fault. For another example, in the case where the data processing instruction is a data write instruction, the second identification can be generated by acquisition method 1 and acquisition method 3. For example, if the difference between the characteristic data obtained by acquisition method 1 and the reference data is less than the difference threshold, and / or the difference between the characteristic data obtained by acquisition method 3 and the reference data is less than the difference threshold, then a second identification is generated to indicate that there is no fault.
[0155] The first identifier and the second identifier are described above. The above description is for example only and does not limit the first identifier and the second identifier. Regardless of which first identifier and second identifier the storage medium uses, the target identifier can be obtained, and the storage medium will send the target identifier to the controller after executing the data processing instruction. Among them, if the controller only sends one data processing instruction to the storage medium, the storage medium only sends one target identifier corresponding to the data processing instruction to the controller. If the controller sends more than two data processing instructions to the storage medium, the storage medium sends the target identifier corresponding to each data processing instruction to the controller respectively.
[0156] Step 604: The controller confirms, based on the target identifier, that the storage medium has executed the data processing instruction.
[0157] After the storage medium sends the target identifier to the controller, the controller receives the target identifier, which is at least one of the first identifier and the second identifier. The controller can confirm the data processing instruction corresponding to the target identifier based on the target identifier, thereby confirming that the storage medium has executed the data processing instruction corresponding to the target identifier.
[0158] Among them, when the target identifier only includes the first identifier, since the first identifier itself is used to indicate the data processing instruction, the controller can determine the data processing instruction corresponding to the first identifier. In some embodiments, the type of the first identifier is type one described in step 603 above, the first identifier is the third identifier sent by the controller to the storage medium, and the controller stores the first correspondence between the third identifier and the data processing instruction. Then, the controller queries the first correspondence based on the received first identifier to confirm the data processing instruction corresponding to the first identifier. In other embodiments, the type of the first identifier is type two described in step 603 above, the first identifier includes at least one of the identifier of the storage unit and the identifier of the storage medium, and the controller stores the second correspondence between the reference identifier and the data processing instruction. Then, the controller queries the second correspondence based on the received first identifier, and uses the data processing instruction corresponding to the hit reference identifier as the data processing instruction corresponding to the first identifier, thereby confirming the data processing instruction corresponding to the first identifier.
[0159] Alternatively, exemplarily, when the target identifier only includes the second identifier, since the second identifier itself is only used to indicate a fault state, and is not used to indicate which data processing instruction corresponds to the fault state, when the controller only sends one data processing instruction to the storage medium, that is, when the storage medium only returns one target identifier to the controller, the controller can confirm the data processing instruction corresponding to the second identifier based on the second identifier, and the data processing instruction corresponding to the second identifier is also a data processing instruction sent by the controller.
[0160] It should be understood that if it is necessary to send at least two data processing instructions to the storage medium when the controller sends at least two data processing instructions, that is, when the storage medium returns at least two target identifiers to the controller, the controller can also identify the data processing instructions corresponding to each target identifier. In this case, the target identifier can include only the first identifier, or the target identifier can include the first identifier and the second identifier. The controller can identify the data processing instructions corresponding to each target identifier based on the first identifier in accordance with the above description, and no further details will be given here.
[0161] In the related art, after the controller sends a data processing instruction to the storage medium, the controller waits for a fixed time, that is, it assumes that the storage medium has executed the data processing instruction. However, the actual time taken by the storage medium to execute the data processing instruction may be less than or greater than the fixed time. If the actual time is less than the fixed time, the controller waits for an unnecessary time, resulting in low data processing efficiency. If the actual time is greater than the fixed time, after the controller waits for a fixed time and assumes that the storage medium has executed the data processing instruction, the storage medium has not yet executed or has not yet completed executing the data processing instruction, resulting in low data processing reliability. It can be seen that the data processing process of the related art is not flexible enough.
[0162] Compared with the related art, in the embodiment of the present application, the storage medium returns a target identifier to the controller after executing the data processing instruction, and the controller confirms that the storage medium has executed the data processing instruction based on the target identifier. That is, the controller receives the target identifier and can confirm that the storage medium has completed the data processing instruction. If the actual time consumption is less than the above-mentioned fixed time length, the controller will receive the target identifier before waiting for the fixed time length, and the controller does not need to continue to wait for the extra time length, and can confirm that the storage medium has completed the data processing instruction based on the target identifier, thereby improving the data processing efficiency. If the actual time consumption is greater than the above-mentioned fixed time length, the controller will also confirm that the storage medium has completed the data processing instruction after receiving the data processing instruction, avoiding the situation where the storage medium has not yet executed or has not yet completed the data processing instruction, and improving the reliability of data processing. It can be seen that the data processing method provided in the embodiment of the present application is more flexible.
[0163] In an exemplary embodiment, a data processing instruction is used to instruct the writing of business data, and a storage medium is used to perform non-volatile storage of business data, that is, the storage medium uses a non-volatile storage unit to store business data. The method also includes: the controller deletes the volatile stored business data based on the target identifier. Among them, since the controller confirms that the storage medium has executed the data processing instruction after receiving the target identifier, the storage medium has performed non-volatile storage of the business data for the controller, and it is no longer necessary to perform volatile storage of the business data. Therefore, the controller can delete the volatile stored business data based on the target identifier, that is, the business data is no longer cached through the volatile storage unit included in the storage medium. As a result, the storage space of the volatile storage unit is released, and redundant occupation of the storage space is avoided.
[0164] It should be noted that, in addition to being used by the controller to confirm that the storage medium has executed the data processing instruction, the first identifier and the second identifier also have other functions, which are described below.
[0165] For the first identifier, when the controller sends multiple data processing instructions for indicating the reading of business data, that is, when multiple data reading instructions are sent, the storage medium can send the first identifier and the read business data corresponding to each other to the controller, and the controller can determine which data reading instruction the received business data corresponds to based on the first identifier. Therefore, no matter in what order the controller sends multiple data reading instructions, no matter when and in what order the storage medium sends the read business data to the controller, the controller can identify the data reading instruction corresponding to the received business data. Therefore, the controller does not need to plan (schedule) the order of sending multiple data reading instructions, nor does it need to command the storage medium to return the read business data at a specified time and in a specified order, thereby simplifying the design complexity of the controller. In addition, since the storage medium does not need to return the read business data at a specified time and in a specified order, the storage medium does not need to accurately control the time consumption of executing each data reading instruction, that is, the storage medium does not need to ensure the delay consistency within the life cycle. The delay consistency includes the delay consistency of a storage medium itself and the delay consistency between different storage media.
[0166] In an exemplary embodiment, the data processing instruction is used to instruct to read business data. The method also includes: the storage medium sends the read business data to the controller, and the read business data has a different sending path from the first identifier. The controller receives the read business data and the first identifier through different sending paths, and determines the priority of the read business data based on the first identifier. In response to the priority of the read business data being higher than the priority of other data currently processed by the controller, the controller is also used to interrupt the processing process of other data and process the read business data.
[0167] That is to say, the storage medium sends the read business data and the first identification to the controller respectively through different signal lines. If the storage medium also sends the second identification, the signal line used to send the second identification is not limited. After the controller receives the business data and the first identification through different signal lines, it can determine the priority of the business data based on the first identification. When the priority of the business data is higher than the priority of other data currently processed by the controller, the controller can interrupt the processing of other data and give priority to the read business data. Exemplarily, after the read business data has been processed, the controller resumes the processing of other data. For example, the controller interrupts the process of sending other data to the processor, and gives priority to sending the read business data to the processor. After the read business data has been successfully sent to the processor, the controller continues to send the other data to the processor.
[0168] In some embodiments, the type of the first identifier is type 1 described in step 603 above, the first identifier is the third identifier sent by the controller to the storage medium, and the controller stores a first correspondence between the third identifier and the data processing instruction. Then, the controller can use the priority of the data processing instruction corresponding to the first identifier as the priority of the read business data based on the first identifier, wherein the priority of the data processing instruction can be set by the controller or determined by the controller in other ways, which is not limited here.
[0169] In other embodiments, the type of the first identifier is type 2 described in step 603 above, and the first identifier includes at least one of an identifier of a storage unit and an identifier of a storage medium. Then, the controller may use at least one of the priority of the storage unit and the priority of the storage medium as the priority of the read business data. The priority of the storage unit and the priority of the storage medium may be flexibly set according to actual needs and are not limited here.
[0170] For the second identifier, since the second identifier is used to indicate a fault state, the controller can know whether the data processing instruction has a fault based on the second identifier. If the data processing instruction does not have a fault, the controller can continue to perform other operations. For example, in the case where the data processing instruction is used to indicate the writing of business data, and the storage medium is used to perform non-volatile storage of the business data, if the second identifier indicates that the data processing instruction does not have a fault, the controller can confirm that the storage medium has safely performed non-volatile storage of the business data, so that the volatile stored business data can be deleted. If the data processing instruction has a fault, the controller can take corresponding measures in a timely manner to avoid errors or losses in business data, thereby ensuring the reliability of the data processing process.
[0171] In some embodiments, the data processing instruction is used to instruct to read the business data. The method further includes: the controller executes an error correction process in response to the fault state indicated by the second identifier being a fault, so as to recover the business data. Wherein, since the fault state indicated by the second identifier is a fault, the controller can confirm that there is a fault in the reading process of the business data. Therefore, it is necessary to execute an error correction process to recover the business data. Thus, errors in the business data are avoided and the reliability of the data processing process is ensured.
[0172] Exemplarily, the error correction process includes, but is not limited to, error checking and correcting (ECC) encoding and the like. The embodiments of the present application do not limit the error correction process.
[0173] In other embodiments, the data processing instruction is used to instruct the writing of business data, and the data processing instruction corresponds to the first storage unit, or in other words, the address corresponding to the data processing instruction is the address in the first storage unit. Therefore, the storage medium writes the business data to the first storage unit according to the data processing instruction. Accordingly, the method further includes: the controller sends an updated data processing instruction to the storage medium in response to the fault state indicated by the second identifier as the presence of a fault, and the updated data processing instruction is used to instruct the writing of business data to the second storage unit, and the first storage unit and the second storage unit are different storage units included in the storage medium. The storage medium executes the updated data processing instruction.
[0174] That is to say, when the fault state indicated by the second identifier is that there is a fault, the controller can confirm that there is a fault in the data writing process. The controller does not need to wait for the next time to read the data written this time to confirm that there is a fault in the data writing process. Therefore, the controller updates the storage unit used to store business data from the first storage unit to a different second storage unit. Among them, the controller instructs the storage medium to write the business data to the second storage unit by sending an updated data processing instruction to the storage medium. As a result, the business data can be safely stored in the second storage unit, avoiding the loss of business data and ensuring the reliability of data processing. In addition, the way the controller sends the updated data processing instruction to the storage medium can refer to the description in steps 601 and 603. The way the storage medium executes the updated data processing instruction can refer to the way the storage medium executes the data processing instruction described in step 602. It will not be repeated here.
[0175] In some embodiments, the controller further updates the address mapping relationship, and the address mapping relationship includes a mapping relationship between business data and an address. Before the controller is updated, the address mapping relationship includes: a mapping relationship between business data and an address of the first storage unit. After the controller is updated, the address mapping relationship includes: a mapping relationship between business data and an address of the second storage unit.
[0176] In an exemplary embodiment, the controller is further configured to mark the first storage unit as an unreliable storage unit. It should be noted that marking the first storage unit as an unreliable storage unit does not necessarily mean that the first storage unit is no longer used, but the first storage unit can continue to be used after marking, thereby avoiding wasting storage space in the storage medium (i.e., storage space corresponding to the first storage unit).
[0177] In some embodiments, the controller stores a third correspondence between each storage unit included in the storage medium and the state. Before the controller receives the second identifier for indicating the presence of a fault, each storage unit corresponds to a reliable state. After the controller receives the second identifier for indicating the presence of a fault, in the third correspondence, the state of the storage unit used to execute the data processing instruction corresponding to the second identifier, that is, the state of the first storage unit, is updated from a reliable state to an unreliable state, thereby marking the first storage unit as an unreliable storage unit.
[0178] In addition, illustratively, the method further includes: the controller protects the first storage unit marked as an unreliable storage unit. For example, the protection method includes but is not limited to: at least one of mirror protection, enhanced ECC coding protection and multi-level ECC coding protection, and the protection method is not limited here.
[0179] In an exemplary embodiment, the method further includes: after the controller marks the first storage unit as an unreliable storage unit, in response to the number of errors occurring in the first storage unit being greater than or equal to a number threshold, the first storage unit is marked as a damaged storage unit, and the first storage unit is stopped from being used. Wherein, if the number of errors occurring in the unreliable first storage unit is large, if the first storage unit continues to be used, it may affect the security of the business data, and thus the controller stops using the first storage unit. The embodiment of the present application does not limit the number threshold.
[0180] In some embodiments, when the controller stores the above-mentioned third correspondence, in response to the number of errors occurring in the first storage unit being greater than or equal to a number threshold, the controller can update the state of the first storage unit from an unreliable state to a damaged state in the third correspondence to mark the first storage unit as a damaged storage unit.
[0181] It should be understood that the above unreliable state and damaged state are only examples. For example, the controller can also mark the first storage unit as other multiple states according to the number of errors that occur in the first storage unit, each state can correspond to different measures, and the other multiple states and corresponding measures are not limited here.
[0182] In summary, in the embodiment of the present application, after the storage medium executes the data processing instruction sent by the controller, it returns the target identifier to the controller, and the controller can confirm that the storage medium has executed the data processing instruction after receiving the target identifier. Therefore, the controller does not need to wait for a fixed period of time before assuming that the storage medium has executed the data processing instruction, thereby taking into account the efficiency and reliability of the data processing process and improving the flexibility of the data processing process.
[0183] The target identifier is at least one of a first identifier and a second identifier, the first identifier is used to indicate a data processing instruction, and the second identifier is used to indicate a fault state. When the number of data processing instructions is one, the target identifier is only the first identifier, or only the second identifier, or the first identifier and the second identifier, and the controller can identify the data processing instruction executed by the storage medium according to the target identifier. When the number of data processing instructions is at least two, the target identifier is only the first identifier, or the first identifier and the second identifier, and the controller can identify the data processing instruction executed by the storage medium according to the target identifier.
[0184] Moreover, for the first identifier, in addition to being used by the controller to confirm that the storage medium has executed the data processing instruction, it can also be used by the controller to identify the data reading instruction corresponding to the business data returned by the storage medium when the data processing instruction is a data reading instruction. Therefore, the controller does not need to plan the order in which the data reading instructions are sent, nor does it need to command the storage medium to return the business data at a specified time and in a specified order, thereby simplifying the design complexity of the controller. Moreover, since the storage medium does not need to return the business data at a specified time and in a specified order, the storage medium does not need to control the time consumption of executing each data reading instruction, that is, the storage medium does not need to ensure the consistency of the delay within the life cycle. For the second identifier, in addition to being used by the controller to confirm that the storage medium has executed the data processing instruction, it can also be used by the controller to promptly confirm whether there is a fault in the execution process of the data processing instruction.
[0185] Next, taking the target identifier including the first identifier and the second identifier as an example, the data processing method provided in the embodiment of the present application and the data processing process of the related technology are compared, and the data processing method provided in the embodiment of the present application is illustrated.
[0186] See also Fig.10 , Fig.10A schematic diagram of the data reading process in the related art is shown. Among them, the controller sends data read instruction 1, address 1 corresponding to data read instruction 1, data read instruction 2, and address 2 corresponding to data read instruction 2 to the storage medium in sequence. Afterwards, the storage medium needs to ensure its own delay consistency to return business data 1 corresponding to data read instruction 1 and business data 2 corresponding to data read instruction 2 in sequence, so as to ensure that the controller can identify which data read instruction the received business data corresponds to. Accordingly, the controller reads business data 1 and business data 2 by default and identifies them after waiting for a fixed period of time. In addition, the controller cannot determine whether the storage medium has successfully executed data read instruction 1 and data read instruction 2 before performing error correction.
[0187] When the data processing method provided in the embodiment of the present application is used to read data, see Fig.11 , Fig.11 The figure shows the situation that different minimum operation units in the non-volatile storage unit execute data read instructions in parallel. The storage medium uses the minimum operation unit 0 of the non-volatile storage unit to execute data read instruction 1, and uses the minimum operation unit N of the non-volatile storage unit to execute data read instruction 2. Fig.12 and Fig.13 The controller sends data read instruction 1, address 1 and identifier 1 (corresponding to the third identifier described above) corresponding to data read instruction 1, data read instruction 2, address 2 and identifier 2 (corresponding to the third identifier described above) corresponding to data read instruction 2 to the storage medium in sequence.
[0188] In the case where both data read instruction 1 and data read instruction 2 are successfully executed, see Fig.12 , the storage medium sends business data 1 read based on data read instruction 1, identification 1 corresponding to data read instruction 1 (corresponding to the first identification described above) and a success identification used to indicate that there is no fault (corresponding to the second identification described above) to the controller through different signal lines in one transmission cycle, and the storage medium sends business data 2 read based on data read instruction 2, identification 2 corresponding to data read instruction 2 (corresponding to the first identification described above) and a success identification used to indicate that there is no fault (corresponding to the second identification described above) to the controller through different signal lines in another transmission cycle. After receiving the business data 1, the controller confirms that the business data 1 is the business data read based on the data read instruction 1, and that the data read instruction 1 is successfully executed according to the identification 1 and the success identification. The controller also confirms that the business data 2 is the business data read based on the data read instruction 2, and that the data read instruction 2 is successfully executed according to the identification 2 and the success identification.
[0189] It should be noted that Fig.12The situation shown is that service data 1, identification 1 and success identification are sent first, and service data 2, identification 2 and success identification are sent later. In fact, service data 2, identification 2 and success identification can also be sent first, and service data 1, identification 1 and success identification are sent later. Regardless of the order, the controller can identify the data read instructions corresponding to service data 1 and service data 2.
[0190] In the case where data read instruction 1 is executed successfully and data read instruction 2 fails to execute, see Fig.13 , the business data 2 read based on the data read instruction 2 is unreliable data, and the read delay of executing the data read instruction 2 is small, then the business data 2 may be returned first. Therefore, the storage medium first sends the business data 2, the identifier 2 and the failure identifier (corresponding to the second identifier described above) to the controller through different signal lines in one transmission cycle. Then, the storage medium sends the business data 1, the identifier 1 and the success identifier to the controller through different signal lines in another transmission cycle. The controller first receives the business data 2, the identifier 2 and the failure identifier, and then determines that the business data 2 is the business data read based on the data read instruction 2 according to the identifier 2 and the failure identifier, and the data read instruction 2 fails to execute. Afterwards, the controller receives the business data 1, the identifier 1 and the success identifier again, and confirms that the business data 1 is the business data read based on the data read instruction 1 according to the identifier 1 and the success identifier, and the data read instruction 1 is successfully executed.
[0191] In addition, when using the data processing method provided in the embodiment of the present application to read data, you can also refer to Fig.14 , Fig.14 The present invention shows a situation in which different minimum operation units in a non-volatile storage unit execute data read instructions in parallel, and the same minimum operation unit executes data read instructions in series. The storage medium needs to use the minimum operation unit 0 of the non-volatile storage unit to execute data read instructions 1 and data read instructions 2, and use the minimum operation unit N of the non-volatile storage unit to execute data read instruction 3. The data read instruction 1 and the data read instruction 2 use the same minimum operation unit 0, so the data read instruction 1 and the data read instruction 2 need to be executed in series. The data read instruction 3 uses another minimum operation unit N, so the data read instruction 3 can be executed in parallel with the data processing instruction 1 (or the data processing instruction 2). The controller sends the data read instruction 1, address 1 and identification 1, as well as the data read instruction 2, address 2 and identification 2, and the data read instruction 3, address 3 and identification 3 to the storage medium in sequence.
[0192] For example, the storage medium first executes data read instruction 1 and data read instruction 3 in parallel, and then executes data read instruction 2 in series, and all three data read instructions are successfully executed. First, the storage medium can return business data 1, identification 1, and success identification to the controller, and the controller recognizes that business data 1 corresponds to data read instruction 1, and data read instruction 1 is successfully executed. After that, the storage medium returns business data 3, identification 3, and success identification to the controller, and the controller recognizes that business data 3 corresponds to data read instruction 3, and data read instruction 3 is successfully executed. Next, the storage medium returns business data 2, identification 2, and success identification to the controller, and the controller recognizes that business data 3 corresponds to data read instruction 3, and data read instruction 3 is successfully executed.
[0193] It should be noted that if Fig.14 The situation shown is applied in the related art, and the controller sends data read instruction 1 and address 1, data read instruction 2 and address 2, and data read instruction 3 and address 3 to the storage medium in sequence, and assumes that the data returned by the storage medium is business data 1, business data 2, and business data 3 in sequence, which is the same as the order of the data read instructions sent by the controller to the storage medium. However, the data returned by the storage medium is actually business data 1, business data 3, and business data 2 in sequence, which is different from the default order of the controller, resulting in the controller being unable to identify each business data. In addition, the controller cannot determine whether the storage medium has successfully executed each data read instruction 1.
[0194] In addition, when using the data processing method provided in the embodiment of the present application to read data, you can also refer to Fig.15 , Fig.15 The situation in which two non-volatile storage units coexist and share the same IO cycle interface is shown. The controller sends data read instruction 1, address 1 and identification 1 to non-volatile storage unit 0, and non-volatile storage unit 0 returns business data 1, identification 1 and success identification to the controller. The controller identifies business data 1 as the business data corresponding to data read instruction 1, and data read instruction 1 is successfully executed. The controller also sends data read instruction 2, address 2 and identification 2 to non-volatile storage unit 1, and storage medium 1 returns business data 2, identification 2 and success identification to the controller. The controller identifies business data 2 as the business data corresponding to data read instruction 2, and data read instruction 2 is successfully executed. Among them, non-volatile storage unit 0 and non-volatile storage unit 1 do not need to ensure consistent latency, and the corresponding data read instructions can be executed according to their respective latency. Regardless of whether non-volatile storage unit 0 returns service data 1 first and non-volatile storage unit 1 returns service data 2 later, or non-volatile storage unit 1 returns service data 2 first and non-volatile storage unit 0 returns service data 1 later, the controller can identify the data read instructions corresponding to service data 1 and service data 2. And, Fig.15The two nonvolatile memory cells shown are only examples, and the number of nonvolatile memory cells may be more than three.
[0195] See also Fig.16 , Fig.16 The schematic diagram of the data writing process in the related art is shown. The controller sends data writing instruction 1, address 1 corresponding to data writing instruction 1, data writing instruction 2, and address 2 corresponding to data writing instruction 2 to the storage medium in sequence. The controller also sends business data 1 and business data 2 to be written to the storage medium in sequence. After that, the controller considers that both data writing instruction 1 and data writing instruction 2 have been executed after waiting for a fixed period of time. Fig.16 The controller can determine whether the storage medium has successfully executed the data write instruction 1 until the next time the business data 1 is read (if it is successfully executed, the business data 1 can be read normally the next time; if it is not successfully executed, the business data 1 cannot be read normally the next time). The controller can determine whether the storage medium has successfully executed the data write instruction 2 until the next time the business data 2 is read.
[0196] When the data processing method provided in the embodiment of the present application is used to write data, see Fig.17 , the controller sends data write instruction 1, address 1 and identifier 1 (corresponding to the third identifier described above) corresponding to data write instruction 1, data write instruction 2, address 2 and identifier 2 (corresponding to the third identifier described above) corresponding to data write instruction 2 to the storage medium in sequence, and the controller also sends business data 1 corresponding to data write instruction 1 and business data 2 corresponding to data write instruction 2 to the storage medium in sequence. Accordingly, after successfully executing data write instruction 1, the storage medium returns identifier 1 and a success identifier indicating that there is no fault to the controller. After receiving the identifier, the controller can determine that data write instruction 1 has been successfully executed, without waiting until the next time business data 1 is read to determine whether data write instruction 1 has been successfully executed. After successfully executing data write instruction 2, the storage medium returns identifier 2 and a failure identifier indicating that there is a fault to the controller. After receiving the identifier, the controller can determine that data write instruction 2 has failed to execute, without waiting until the next time business data 2 is read to determine whether data write instruction 2 has been successfully executed.
[0197] It should be noted that Fig.17 The situation shown is that the identification 1 and the success identification are sent first, and then the identification 2 and the failure identification are sent. In fact, the identification 2 and the failure identification can also be sent first, and then the identification 1 and the success identification are sent. Regardless of the order, the controller can recognize that the data read instruction 1 is successfully executed, while the data read instruction 2 fails to execute.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] 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.
[0202] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0203] 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.
[0204] 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 includes a controller and a storage medium connected to each other; The controller is used to send a data processing instruction to the storage medium; The storage medium is used to execute the data processing instruction and send a target identifier to the controller, wherein the target identifier is at least one of a first identifier and a second identifier, wherein the first identifier is used to indicate that the data processing instruction has been completed, and the second identifier is used to indicate a fault state, and the second identifier is generated based on the execution process of the data processing instruction and is used to indicate whether the corresponding data has a fault during the execution of the data processing instruction; The controller is further configured to confirm, based on the target identifier, that the storage medium has executed the data processing instruction.
2. The storage device according to claim 1, characterized in that The controller is further configured to send a third identifier corresponding to the data processing instruction to the storage medium, and the target identifier is at least one of the third identifier and the second identifier.
3. The storage device according to claim 1, characterized in that: The first identifier includes at least one of an identifier of a storage unit and an identifier of the storage medium. The storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
4. The storage device according to any one of claims 1 to 3, characterized in that: The storage medium is also used to obtain characteristic data during the execution of the data processing instruction, compare the characteristic data with reference data, and generate the second identification.
5. The storage device according to claim 4, characterized in that: The storage medium is used to obtain the characteristic data based on the data generated by the elements included in the storage medium during the execution of the data processing instruction.
6. The storage device according to claim 5, characterized in that: The characteristic data includes at least one of current data, voltage data, temperature data and component attribute data.
7. The storage device according to claim 4, characterized in that: The data processing instruction is used to instruct reading of business data; The storage medium is used to obtain the characteristic data based on the read business data during the execution of the data processing instruction.
8. The storage device according to claim 4, characterized in that: The data processing instruction is used to instruct writing of business data; The storage medium is used to read the written business data during the execution of the data processing instruction, and obtain the characteristic data based on the read business data.
9. The storage device according to any one of claims 4 to 8, characterized in that: In response to a difference between the characteristic data and the reference data being less than or equal to a difference threshold, the fault state indicated by the second identifier is that there is no fault; Alternatively, in response to a difference between the characteristic data and the reference data being greater than the difference threshold, the fault state indicated by the second identifier is the presence of a fault.
10. The storage device according to any one of claims 1 to 6, 8 and 9, characterized in that: The data processing instruction is used to instruct writing of business data, and the data processing instruction corresponds to the first storage unit; The controller is further used for sending an updated data processing instruction to the storage medium in response to the fault state indicated by the second identifier being a fault, wherein the updated data processing instruction is used for instructing to write the service data into a second storage unit, and the first storage unit and the second storage unit are different storage units included in the storage medium; The storage medium is also used to execute the updated data processing instructions.
11. The storage device according to claim 10, characterized in that: The controller is further configured to mark the first storage unit as an unreliable storage unit.
12. The storage device according to claim 11, characterized in that: The controller is further configured to, after marking the first storage unit as an unreliable storage unit, mark the first storage unit as a damaged storage unit and stop using the first storage unit in response to a number of errors occurring in the first storage unit being greater than or equal to a number threshold.
13. The storage device according to any one of claims 1-6 and 8-12, characterized in that: The data processing instruction is used to instruct writing of business data, the storage medium is used to perform non-volatile storage of the business data, and the controller is further used to delete the volatile stored business data based on the target identifier.
14. The storage device according to any one of claims 1 to 7, characterized in that: The data processing instruction is used to instruct reading of business data; The storage medium is further used to send the read business data to the controller, where the read business data has a different sending path from the first identifier; The controller is further configured to receive the read service data and the first identifier through different transmission paths, and determine the priority of the read service data based on the first identifier; In response to the priority of the read business data being higher than the priority of other data currently being processed by the controller, the controller is further configured to interrupt the processing of the other data and process the read business data.
15. The storage device according to any one of claims 1 to 7 and 14, characterized in that: The data processing instruction is used to instruct reading of business data, and the controller is further used to execute an error correction process in response to the fault state indicated by the second identifier being a fault, so as to restore the business data.
16. A data processing method, characterized in that: The method is applied to a controller included in a storage device, the storage device also includes a storage medium interconnected with the controller, and the method includes: The controller sends a data processing instruction to the storage medium; The controller receives a target identifier sent by the storage medium, the target identifier being at least one of a first identifier and a second identifier, wherein the first identifier is used to indicate that the data processing instruction has been completed, the second identifier is used to indicate a fault state, and the second identifier is generated based on the execution process of the data processing instruction of the storage medium and is used to indicate whether corresponding data has a fault during the execution of the data processing instruction; The controller confirms, based on the target identifier, that the storage medium has executed the data processing instruction.
17. The method according to claim 16, characterized in that The method further comprises: The controller sends a third identifier corresponding to the data processing instruction to the storage medium, and the target identifier is at least one of the third identifier and the second identifier.
18. The method according to claim 16, characterized in that The first identifier includes at least one of an identifier of a storage unit and an identifier of the storage medium. The storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
19. The method according to any one of claims 16 to 18, characterized in that: The data processing instruction is used to instruct writing of business data, the data processing instruction corresponds to the first storage unit, and the method further includes: In response to the fault state indicated by the second identifier being a fault, the controller sends an updated data processing instruction to the storage medium, wherein the updated data processing instruction is used to instruct the business data to be written into a second storage unit, and the first storage unit and the second storage unit are different storage units included in the storage medium.
20. The method according to claim 19, characterized in that The method further comprises: The controller marks the first storage unit as an unreliable storage unit.
21. The method according to claim 20, characterized in that After the controller marks the first storage unit as an unreliable storage unit, the method further includes: In response to the number of errors occurring in the first storage unit being greater than or equal to a number threshold, the controller marks the first storage unit as a damaged storage unit and stops using the first storage unit.
22. The method according to any one of claims 16 to 21, characterized in that: The data processing instruction is used to instruct writing of business data, the storage medium is used to perform non-volatile storage on the business data, and the method further includes: The controller deletes the volatile stored business data based on the target identifier.
23. The method according to any one of claims 16 to 18, characterized in that: The data processing instruction is used to instruct to read business data, and the method further includes: The controller receives the service data read by the storage medium and the first identifier through different sending paths, and determines the priority of the read service data based on the first identifier; In response to the priority of the read business data being higher than the priority of other data currently being processed by the controller, the controller interrupts the processing of the other data and processes the read business data.
24. The method according to any one of claims 16 to 18 and 23, characterized in that: The data processing instruction is used to instruct to read business data, and the method further includes: In response to the fault state indicated by the second identifier being a fault, the controller performs an error correction process to restore the service data.
25. A data processing method, characterized in that: The method is applied to a storage medium included in a storage device, the storage device also includes a controller interconnected with the storage medium, and the method includes: The storage medium receives the data processing instruction sent by the controller; The storage medium executes the data processing instruction and sends a target identifier to the controller, where the target identifier is at least one of a first identifier and a second identifier, wherein the first identifier is used to indicate the data processing instruction, the second identifier is used to indicate a fault state, and the second identifier is generated based on the execution process of the data processing instruction.
26. The method according to claim 25, characterized in that The method further comprises: The storage medium receives a third identifier corresponding to the data processing instruction sent by the controller, and the target identifier is at least one of the third identifier and the second identifier.
27. The method according to claim 25, characterized in that The first identifier includes at least one of an identifier of a storage unit and an identifier of the storage medium. The storage unit is at least one of the storage units included in the storage medium, and the storage unit is used for the execution process of the data processing instruction.
28. The method according to any one of claims 25-27, characterized in that: The method further comprises: The storage medium acquires characteristic data during the execution of the data processing instruction, compares the characteristic data with reference data, and generates the second identifier.
29. The method according to claim 28, characterized in that The storage medium acquires characteristic data during the execution of the data processing instruction, including: During the execution of the data processing instruction, the storage medium acquires the characteristic data based on data generated by the elements included in the storage medium.
30. The method according to claim 29, characterized in that The characteristic data includes at least one of current data, voltage data, temperature data and component attribute data.
31. The method according to claim 28, characterized in that The data processing instruction is used to instruct to read the business data, and the storage medium obtains the characteristic data during the execution of the data processing instruction, including: During the execution of the data processing instruction, the storage medium acquires the characteristic data based on the read business data.
32. The method according to claim 28, characterized in that The data processing instruction is used to instruct writing of business data, and the storage medium obtains characteristic data during the execution of the data processing instruction, including: During the execution of the data processing instruction, the storage medium reads the written business data and obtains the feature data based on the read business data.
33. The method according to any one of claims 28 to 32, characterized in that: In response to a difference between the characteristic data and the reference data being less than or equal to a difference threshold, the fault state indicated by the second identifier is that there is no fault; Alternatively, in response to a difference between the characteristic data and the reference data being greater than the difference threshold, the fault state indicated by the second identifier is the presence of a fault.
34. The method according to any one of claims 25 to 32, characterized in that: The data processing instruction is used to instruct to read business data, and the method further includes: The storage medium sends the read business data to the controller, and the read business data has a different sending path from the first identifier. The controller is used to receive the read business data and the first identifier through different sending paths, determine the priority of the read business data based on the first identifier, and in response to the priority of the read business data being higher than the priority of other data currently being processed by the controller, interrupt the processing of the other data and process the read business data.
Citation Information
Patent Citations
Management of event order of occurrence on a network
CN101438245A
Bus system and operating method thereof
CN101739370A
Data processing method and related equipment
CN107025289A
Memory device access method, device and system
CN107783727A
Memory access technology and computer system
CN109478168A
