A test unit, method, system, controller, and storage device
By building a test unit in the storage device, testing and data acquisition are performed directly in the solid-state drive, the problems of long cycles and high costs of traditional methods are solved, and the effect of rapid development and cost reduction is achieved.
Patent Information
- Application Number
- CN201910932737.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-29
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2039-09-29
AI Technical Summary
Traditional methods require the development of specialized software and hardware or purchase of off-the-shelf equipment for storage media testing in SSD development, resulting in long cycles and high costs, making it difficult to meet the needs of rapid application and updates.
The built-in test unit is in the storage device, and the testing functions are implemented through the test unit, including a command parser, a task manager and a cache, and the test and data collection are performed directly on the solid-state drive.
It reduces development costs, shortens development cycles, realizes rapid progress of storage media testing and modeling, and adapts to the demand for the rapid introduction of new technologies to the market.
Smart Images

Figure CN110610740B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the application field of storage devices, and in particular to a test unit, method, system, controller and storage device. Background Art
[0002] Solid State Drives (SSDs) are hard disks made of solid-state electronic storage chip arrays. SSDs include control units and storage units (FLASH storage chips and DRAM storage chips). In SSDs, the storage medium NAND particles used have life and performance problems due to erase and write wear. Therefore, it is necessary to design a good algorithm to balance the erase and write of NAND particles during data storage. Before designing such an algorithm, it is necessary to study and model the storage medium, that is, the characteristics of NAND particles.
[0003] In the development of traditional solid-state hard drives, if you want to model the solid-state storage media, you need to develop special software and hardware, cooperate with the corresponding host computer function software to perform erase, write and read operations, and at the same time collect relevant characteristic data of the solid-state storage media in this process for background analysis, processing and modeling.
[0004] However, the traditional method process requires the development of specialized software and hardware, or the purchase of ready-made equipment for testing and collecting relevant data for modeling and analysis, which has the disadvantages of long cycles and high costs. With the continuous innovation of technology, the urgency of quickly applying new technologies to new products, accelerating product upgrades, and quickly bringing new technologies to market is becoming more and more important. The shortcomings of traditional methods have increasingly severely restricted product development and become unacceptable.
[0005] Based on this, the existing technology needs to be improved urgently. Summary of the invention
[0006] The embodiments of the present invention aim to provide a test unit, method, system, controller, and storage device, which can embed a test unit in the storage device and implement a test function through the test unit, thereby reducing development costs and shortening the development cycle.
[0007] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:
[0008] In a first aspect, an embodiment of the present invention provides a test unit, which is applied to a test system, wherein the test system includes: a host, a host interface, a storage medium, and a storage medium controller, and the test unit includes: a command parser, a task manager, and a cache, wherein:
[0009] The command parser is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager;
[0010] The task manager is connected to the command parser and the storage medium controller, and is used to receive the parsed test command sent by the command parser, and send the parsed test command to the storage medium controller, so that the storage medium controller tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager;
[0011] The buffer is connected to the host interface and the task manager, and is used for caching the test result returned by the storage medium controller, and returning the test result to the host through the host interface.
[0012] In some embodiments, the testing unit further comprises:
[0013] A data generator is connected to the task manager and is used to generate I / O data to be tested according to the test command sent by the host, and send the I / O data to be tested to the task manager, so that the task manager sends the I / O data to be tested to the storage medium controller.
[0014] In a second aspect, an embodiment of the present invention provides a controller, comprising: a host interface, a processor, a storage medium controller and the above-mentioned test unit, wherein:
[0015] The host interface is connected to the host, the processor and the buffer of the test unit, and is used to receive the test command sent by the host and forward the test command to the processor. The host interface is also used to receive the test result sent by the buffer;
[0016] The processor is connected to the host interface and the command parser, and is used to drive the controller;
[0017] The storage medium controller is connected to the task manager and at least one storage medium, and is used to receive the parsed test command sent by the task manager and test the at least one storage medium.
[0018] In some embodiments, the processor stores firmware, and the firmware is used to drive the controller to perform signal processing.
[0019] In some embodiments, the storage medium is a Flash flash memory chip, and the storage medium controller is a Flash controller.
[0020] In a third aspect, an embodiment of the present invention provides a storage device, including:
[0021] The controller described above;
[0022] at least one storage medium for storing data;
[0023] The storage medium includes a flash memory chip, the flash memory chip includes a plurality of wafers, each of the wafers includes a plurality of groups, each of the groups includes a plurality of physical blocks, and each of the physical blocks includes a plurality of physical pages.
[0024] In a fourth aspect, an embodiment of the present invention provides a test system, including:
[0025] The storage device mentioned above;
[0026] The host is communicatively connected to the storage device and is used to send a test command to the storage device and receive a test result returned by the storage device.
[0027] In a fifth aspect, an embodiment of the present invention provides a testing method, which is applied to the above-mentioned testing system, and the method includes:
[0028] Get the test command sent by the host;
[0029] According to the test command, performing an operation corresponding to the test command on the storage medium, the operation including an erase, write and / or read operation;
[0030] Repeating the operation corresponding to the test command until the storage medium is damaged;
[0031] The test result is obtained and returned to the host.
[0032] In some embodiments, the test command carries a storage medium identifier, and the storage medium identifier is used to specify the storage medium to be tested.
[0033] In some embodiments, the storage medium identification is a physical address of the storage medium.
[0034] In some embodiments, the test system includes a first host and a second host, and obtaining the test command sent by the host includes obtaining the test command sent by the first host. The method further includes:
[0035] The test result corresponding to the test command sent by the first host is sent to the second host.
[0036] In a sixth aspect, an embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a storage device to execute the test method described above.
[0037] The beneficial effects of the embodiments of the present invention are as follows: Different from the prior art, the embodiments of the present invention provide a test unit, which is applied to a test system, wherein the test system includes a host, a host interface, a storage medium and a storage medium controller, and the test unit includes a command parser, a task manager and a buffer, wherein the command parser is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager; the task manager is connected to the command parser and the storage medium controller, and is used to receive the parsed test command sent by the command parser, and send the parsed test command to the storage medium controller, so that the storage medium controller tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager; the buffer is connected to the host interface and the task manager, and is used to cache the test result returned by the storage medium controller, and returns the test result to the host through the host interface. By implementing the test function by building a test unit in a storage device, the present invention can reduce development costs and shorten development cycles. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0039] Figure 1 It is a flow chart of the testing process of the prior art;
[0040] Figure 2 It is a schematic flow chart of the testing process in the present invention;
[0041] Figure 3 is a schematic diagram of the hardware structure of a storage device provided by an embodiment of the present invention;
[0042] Figure 4 is a structural schematic diagram of a test unit provided by an embodiment of the present invention;
[0043] Figure 5 is an architecture diagram of a test system provided by an embodiment of the present invention;
[0044] Figure 6 is a schematic diagram of the structure of a controller provided by an embodiment of the present invention;
[0045] Figure 7 is a structural schematic diagram of a storage device provided by an embodiment of the present invention;
[0046] Figure 8 is a structural schematic diagram of a test system provided by an embodiment of the present invention;
[0047] Fig. 9 It is a flow chart of a testing method provided by an embodiment of the present invention;
[0048] Fig.10 is another flow chart of a testing method provided by an embodiment of the present invention;
[0049] Fig.11 It is a structural schematic diagram of a testing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0052] Embodiment 1
[0053] In the embodiment of the present invention, the storage device includes a non-volatile storage device. Non-volatile memory (NVM) is a general term for all forms of solid-state (no moving parts) memory, which does not need to refresh the memory content periodically. This includes all forms of read-only memory (ROM), such as programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), flash memory, and battery-powered random access memory (RAM).
[0054] Specifically, the embodiment of the present invention is described by taking a solid-state hard disk as an example. In a solid-state hard disk, the storage medium NAND particles used have life and performance problems due to erase and write wear. Therefore, it is necessary to design a good algorithm to balance the erase and write of NAND particles during data storage. Before designing such an algorithm, it is necessary to study and model the storage medium, that is, the characteristics of NAND particles.
[0055] In SSD solid state drives, storage media has different restrictions due to different operation types. For read and write operations, the minimum operation unit is a page, and the minimum unit of erase operations is a block. A block consists of several pages, and a page consists of several bytes. Generally speaking, a solid state drive consists of several storage particles, and each storage particle contains several blocks. When the number of erases and writes of a block exceeds a certain limit, the data of this storage block cannot be guaranteed to be correct, even through a certain redundancy algorithm. In other words, the life span has come to an end.
[0056] With the development of technology, new technologies are constantly being developed and promoted. 3D FLASH is the most popular one at present. The storage capacity has been greatly improved, and the cost has also dropped rapidly. However, the storage medium life problem brought about by it is more urgent. If there is no good erase wear leveling algorithm, the performance, life and stability of solid state drive products will be greatly reduced. The development of the erase wear leveling algorithm is based on the modeling and analysis of NAND storage media.
[0057] In the modeling and analysis of NAND storage media, we mainly focus on the delay indicators and failure characteristics of various operations in various application scenarios, as well as the changing trends and characteristics of these indicators and characteristics as the number of erase and write times increases.
[0058] In the traditional method process, it is necessary to develop special software and hardware, or purchase ready-made equipment to test and collect relevant data for modeling analysis, which has the disadvantages of long cycle and high cost. With the continuous innovation of technology, the urgency of quickly applying new technologies to new products, accelerating product upgrades, and quickly bringing new technologies to market is becoming more and more important. The shortcomings of traditional methods have increasingly severely restricted product development and become unacceptable.
[0059] See also Figure 1 , Figure 1 It is a flow chart of the testing process of the prior art;
[0060] like Figure 1 As shown, the test process of the prior art includes:
[0061] (1) Develop modeling software and hardware for specialized storage media;
[0062] (2) Test the storage media and collect data for modeling;
[0063] (3) Obtaining storage medium model parameters;
[0064] (4) Solid-state drive hardware development;
[0065] (5) Solid-state drive driver and platform development;
[0066] (6) Development, optimization and iteration of SSD algorithms;
[0067] (7) Mass production and shipment of solid-state hard disk products;
[0068] Among them, the existing technology requires that after the development of the SSD driver and platform, the storage medium model parameters are obtained, and the SSD algorithm development is optimized and iterated before the SSD product can be mass-produced and shipped. Since special software and hardware need to be developed, tested and modeled for analysis, the existing SSD testing has the disadvantages of long cycle and high cost, and cannot meet the needs of rapid application of new storage devices.
[0069] In view of this, please refer to Figure 2 , Figure 2 It is a schematic flow chart of the testing process in the present invention;
[0070] like Figure 2 As shown, the present invention embeds a test unit with a test function in a solid-state drive, and uses a high-speed interface between the solid-state drive and the host to control the test process of the storage medium, collect characteristic data, etc., thereby achieving synchronization between modeling and product development, avoiding the development of specialized software and hardware, thereby saving costs, and also shortening the product development cycle.
[0071] The method will be further described below with reference to the accompanying drawings.
[0072] See also Figure 3 , Figure 3 is a schematic diagram of the hardware structure of a storage device provided by an embodiment of the present invention;
[0073] like Figure 3 As shown, the storage device 300 includes: a controller 100 and a flash memory chip 200, wherein the controller 100 is connected to the flash memory chip 200;
[0074] Specifically, the controller 100 includes: one or more test units 10, a host interface 20, a processor 30, and a storage medium controller 40. Figure 3 A processor 30 is taken as an example.
[0075] The test unit 10, the host interface 20, the processor 30 and the storage medium controller 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0076] The test unit 10 includes a buffer, which is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 30 executes various functional applications and data processing of the block-level-based garbage collection method of the embodiment of the present invention by running the non-volatile software programs, instructions and modules stored in the buffer.
[0077] The cache may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the cache may optionally include a memory remotely arranged relative to the processor 30, and these remote memories may be connected to the processor 30 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The module is stored in the cache, and when executed by the one or more processors 30, the test method in the embodiment of the present invention is executed.
[0078] Specifically, the flash memory chip 200 includes multiple wafers (die), each wafer is composed of multiple groups (planes), each group is composed of multiple blocks (blocks), namely the physical block (block) described in the present invention, wherein the block is the basic unit of erasing the flash memory chip 200, each block has multiple pages (pages), namely physical pages, and the physical page (page) is the basic unit of reading and writing the flash memory chip 200.
[0079] Please refer to Figure 4 , Figure 4 is a structural schematic diagram of a test unit provided by an embodiment of the present invention;
[0080] like Figure 4 As shown, the test unit 10 is applied to a test system, and the test system includes: a host, a host interface, a storage medium and a storage medium controller, and the test unit 10 includes: a command parser 11, a task manager 12, a cache 13 and a data generator 14, wherein the command parser 11 is connected to the task manager 12, and the task manager 12 is connected to the cache 13 and the data generator 14.
[0081] Specifically, the command parser 11 is used to obtain the test command sent by the host and parse the test command so that other modules such as the task manager 12 and the data generator 14 can understand the test command sent by the host.
[0082] Specifically, the task manager 12 is connected to the command parser 11 and the data generator 14, and is used to receive the parsed test command issued by the command parser 11. If the test command is a write test command, the write test command is sent to the data generator 14, so that the data generator 14 automatically generates the I / O data to be tested in the storage device according to the write test command, and sends the I / O data to be tested to the task manager 12. The register of the task manager 12 saves the I / O data to be tested.
[0083] In an embodiment of the present invention, the task manager 12 is also connected to a storage medium controller for receiving a parsed test command sent by the command parser 11, and sending the parsed test command to the storage medium controller, so that the storage medium controller tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager, wherein, when the test command is a write test command, the task manager 12 sends the I / O data to be tested generated by the data generator 14 to the storage medium controller, and the storage medium controller writes the I / O data to be tested into the storage space of the storage device, wherein the storage device is a solid state drive, and the storage space of the storage device includes flash memory particles, that is, the I / O data to be tested is written into the flash memory particles of the solid state drive.
[0084] Specifically, the buffer 13 is connected to the task manager 12, the host interface and the task manager, and is used to cache the test result returned by the storage medium controller, and return the test result to the host through the host interface. When the task manager receives the test result sent by the storage medium controller, it sends the test result to the buffer 13, the buffer 13 stores the test result, and the buffer 13 further sends the test result to the host through the host interface.
[0085] Specifically, the data generator 14 is connected to the task manager 12, and is used to receive a test command sent by the task manager 12, specifically, to receive a write test command sent by the task manager 12, and generate I / O data to be tested according to the write test command, and send the I / O data to be tested to the task manager 12, so that the register of the task manager 12 saves the I / O data to be tested, and sends the I / O data to be tested to the storage medium controller.
[0086] In the present invention, by implementing the test function by building a test unit in the solid state drive, most of the underlying data receiving and sending processing interfaces of the solid state drive are reused to implement the erase and write read operations of the solid state storage medium and the collection of related data, thus avoiding the development of separate software and hardware, thereby saving costs and shortening the product development cycle.
[0087] Please refer to Figure 5 , Figure 5 is an architecture diagram of a test system provided by an embodiment of the present invention;
[0088] like Figure 5 As shown, the test unit 10 is connected to a host interface 20, a processor 30 and a storage medium controller 40, wherein the host interface 20 is connected to a host 400, the storage medium controller 40 is connected to a storage medium 200, and the storage medium includes multiple storage media, for example: a first storage medium, a second storage medium, ..., an Nth storage medium.
[0089] In an embodiment of the present invention, a test unit is provided, which is applied to a test system, wherein the test system includes: a host, a host interface, a storage medium and a storage medium controller, and the test unit includes: a command parser, a task manager and a buffer, wherein the command parser is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager; the task manager is connected to the command parser and the storage medium controller, and is used to receive the parsed test command sent by the command parser, and send the parsed test command to the storage medium controller, so that the storage medium controller tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager; the buffer is connected to the host interface and the task manager, and is used to cache the test result returned by the storage medium controller, and returns the test result to the host through the host interface. By implementing the test function by embedding the test unit in the storage device, the present invention can reduce development costs and shorten the development cycle.
[0090] Embodiment 2
[0091] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a controller provided by an embodiment of the present invention;
[0092] like Figure 6 As shown, the controller 100 includes: the test unit 10, the host interface 20, the processor 30 and the storage medium controller 40 in the above-mentioned embodiment 1, wherein the test unit 10 is connected to the host interface 20, the processor 30 and the storage medium controller 40, and the host interface 20 is connected to the host.
[0093] Specifically, the test unit 10 includes: a command parser 11, a task manager 12, a cache 13 and a data generator 14, wherein:
[0094] The command parser 11 is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager 12;
[0095] The task manager 12 is connected to the command parser 11 and the storage medium controller 40, and is used to receive the parsed test command sent by the command parser 11, and send the parsed test command to the storage medium controller 40, so that the storage medium controller 40 tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager 12;
[0096] The task manager includes a register, and the register is used to receive and hold the I / O data to be tested generated by the data generator, or the register is used to cache the parsed test command sent by the command parser 11 .
[0097] The buffer 13 is connected to the host interface 20 and the task manager 12 , and is used for caching the test result returned by the storage medium controller 40 , and returning the test result to the host through the host interface 20 .
[0098] The data generator 14 is connected to the task manager 12 and is used to receive a test command sent by the task manager 12. Specifically, it receives a write test command sent by the task manager 12, and generates I / O data to be tested according to the write test command, and sends the I / O data to be tested to the task manager 12, so that the register of the task manager 12 saves the I / O data to be tested, and sends the I / O data to be tested to the storage medium controller.
[0099] Preferably, the data generator 14 is also connected to the storage medium controller 40, and is used to directly send the I / O data to be tested generated by it to the storage medium controller 40, so that the storage medium controller 40 writes the I / O data to be tested into the storage medium corresponding to the test command.
[0100] Specifically, the host interface 20 is connected to the buffer 13 and the processor 30, and is used to forward the test command sent by the host to the processor 30, so that the processor 30 forwards the test command to the command parser 11, and the host interface 20 is used to receive the test result sent by the buffer 13 and send the test result to the host.
[0101] Specifically, the processor 30 is connected to the host interface 20 and the command parser 11. The processor 30 stores firmware, which includes firmware algorithms, such as wear leveling algorithm, error correction code ECC and bad block management algorithm, FTL algorithm, garbage collection algorithm GC. The firmware is used to drive the controller so that the controller uses the control program of the firmware algorithm to automatically perform signal processing to ensure the performance of the solid state drive.
[0102] Specifically, the storage medium controller 40 is connected to at least one storage medium and the task manager 12, and is used to receive the parsed test command sent by the task manager 12, execute the test command to the storage medium, and test the at least one storage medium. For example, if the test command is a write test command, the storage medium controller 40 writes the I / O data to be tested to the storage medium; if the test command is a read test command, the storage medium controller 40 reads data from the storage medium; if the test command is an erase test command, the storage medium controller 40 erases data from the storage medium. In an embodiment of the present invention, the storage medium is a flash memory chip, and the storage medium controller is a flash memory chip controller, for example, a Flash controller, which is used for IO scheduling of NAND chips and NAND interface protocol conversion.
[0103] In an embodiment of the present invention, a controller is provided, including: a host interface, a processor storage medium controller and the above-mentioned test unit, wherein the host interface is connected to the host, the processor and the buffer of the test unit, and is used to receive a test command sent by the host and forward the test command to the processor, and the host interface is also used to receive a test result sent by the buffer; the processor is connected to the host interface and the storage medium controller, and is used to drive the storage medium controller; the storage medium controller is used to control at least one storage medium, and test the at least one storage medium according to the test command sent by the host. The task manager sends a test command to the storage medium controller, so that the storage medium controller performs a corresponding erase, read or write operation on the storage medium according to the test command. The present invention can reduce development costs and shorten development cycles.
[0104] Embodiment 3
[0105] See also Figure 7 , Figure 7 is a structural schematic diagram of a storage device provided by an embodiment of the present invention;
[0106] like Figure 7 As shown, the storage device 300 includes: the controller 100 of the second embodiment and a storage medium 200 , wherein the controller 100 is connected to the storage medium 200 .
[0107] Specifically, the controller 100 includes: a test unit 10, a host interface 20, a processor 30 and a storage medium controller 40, wherein the test unit 10 is connected to the host interface 20, the processor 30 and the storage medium controller 40, and the host interface 20 is connected to the host.
[0108] Specifically, the test unit 10 includes: a command parser 11, a task manager 12, a cache 13 and a data generator 14, wherein:
[0109] The command parser 11 is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager 12;
[0110] The task manager 12 is connected to the command parser 11 and the storage medium controller 40, and is used to receive the parsed test command sent by the command parser 11, and send the parsed test command to the storage medium controller 40, so that the storage medium controller 40 tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager 12;
[0111] The buffer 13 is connected to the host interface 20 and the task manager 12 , and is used for caching the test result returned by the storage medium controller 40 , and returning the test result to the host through the host interface 20 .
[0112] Specifically, the host interface 20 is connected to the buffer 13 and the processor 30, and is used to forward the test command sent by the host to the processor 30, so that the processor 30 forwards the test command to the command parser 11, and the host interface 20 is used to receive the test result sent by the buffer 13 and send the test result to the host.
[0113] Specifically, the processor 30 is connected to the host interface 20 and the command parser 11. The processor 30 stores firmware, which includes firmware algorithms, such as wear leveling algorithm, error correction code ECC and bad block management algorithm, FTL algorithm, garbage collection algorithm GC. The firmware is used to drive the controller so that the controller uses the control program of the firmware algorithm to automatically perform signal processing to ensure the performance of the solid state drive.
[0114] Specifically, the storage medium controller 40 is connected to the storage medium and the task manager 12, and is used to receive the test command sent by the task manager 12, and execute the test command to the storage medium. For example, if the test command is a write test command, the storage medium controller 40 writes the I / O data to be tested to the storage medium. If the test command is a read test command, the storage medium controller 40 reads the data from the storage medium. If the test command is an erase test command, the storage medium controller 40 erases the data from the storage medium. In an embodiment of the present invention, the storage medium is a flash memory chip, and the storage medium controller is a flash memory chip controller, such as a Flash controller.
[0115] Specifically, the storage medium is a flash memory chip, wherein Figure 3 As shown, the flash memory chip includes multiple wafers (die), each wafer is composed of multiple groups (planes), each group is composed of multiple blocks (blocks), namely the physical block (block) described in the present invention, wherein the block is the basic unit of erasing the flash memory chip 200, each block has multiple pages (pages), namely physical pages, and the physical page (page) is the basic unit of reading and writing the flash memory chip.
[0116] Among them, Figure 5As shown, the storage medium may be multiple, for example: a first storage medium, a second storage medium, ..., an Nth storage medium, wherein each of the storage media corresponds to a corresponding storage medium identifier, and the storage medium identifier is used to uniquely identify each of the storage medium. The storage medium identifier may be a physical address of the storage medium. After the storage medium controller 40 sends a test command to the storage medium for testing, the storage medium feeds back the test result to the storage medium controller 40, and the storage medium controller 40 sends the test result to the task manager 12, and the task manager 12 sends the test result to the cache 13 so that the cache 13 saves the test result, and the cache 13 returns the test result to the host through the host interface 20.
[0117] In an embodiment of the present invention, a storage device is provided, including a controller and a storage medium, wherein the controller includes: a host interface, a processor, a storage medium controller and a test unit, the storage medium includes a flash memory chip, the flash memory chip includes a plurality of wafers, each of the wafers includes a plurality of groups, each of the groups includes a plurality of physical blocks, each of the physical blocks includes a plurality of physical pages, and a test command is forwarded to the storage medium controller so that the storage medium controller executes the test command to the storage medium, obtains the test result, and feeds the test result back to the host. The present invention can reduce development costs and shorten the development cycle.
[0118] Embodiment 4
[0119] Please refer to Figure 8 , Figure 8 is a structural schematic diagram of a test system provided by an embodiment of the present invention;
[0120] like Figure 8 As shown, the test system 500 includes: a host 400 and the storage device 300 of the third embodiment, wherein the host 400 is connected to the storage device 300 , and the storage device 300 includes a storage medium 200 and a controller 100 .
[0121] Specifically, the host 400 is used to send a test command to the storage device 300, receive the test result fed back by the storage device, and process and analyze according to the test result. In an embodiment of the present invention, the host 400 is installed with a test script or a test application, and sends a test command to the storage device 300 through the test script or the test application, such as a read test command, a write test command, an erase test command, etc. Among them, the test command carries a storage medium identifier, and the storage medium identifier is used to mark the serial number or position of the storage medium, for example: the storage medium identifier is the physical address of the storage medium, such as: the address of the physical page, so as to better specify the storage medium to be operated.
[0122] In an embodiment of the present invention, the host 400 includes a first host and a second host, the first host is used to send a test command to the storage device 300, and the first host and the second host can both be used to receive the test results fed back by the storage device 300. Specifically, the first host and the second host are communicatively connected via the host interface 20. Preferably, the first host is used to receive the test results fed back by the storage device 300, and the first host can send the test results to the second host through the host interface 20, so that the second host can perform analysis based on the test results, and further determine whether the first host fails to ensure the normal operation of the host.
[0123] Specifically, the storage device 300 includes: a controller 100 and a storage medium 200 , and the controller 100 is connected to the storage medium 200 .
[0124] Specifically, the controller 100 includes: a test unit 10, a host interface 20, a processor 30 and a storage medium controller 40, wherein the test unit 10 is connected to the host interface 20, the processor 30 and the storage medium controller 40, and the host interface 20 is connected to the host.
[0125] Specifically, the test unit 10 includes: a command parser 11, a task manager 12, a cache 13 and a data generator 14, wherein:
[0126] The command parser 11 is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager 12;
[0127] The task manager 12 is connected to the command parser 11 and the storage medium controller 40, and is used to receive the parsed test command sent by the command parser 11, and send the parsed test command to the storage medium controller 40, so that the storage medium controller 40 tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager 12;
[0128] The buffer 13 is connected to the host interface 20 and the task manager 12 , and is used for caching the test result returned by the storage medium controller 40 , and returning the test result to the host through the host interface 20 .
[0129] Specifically, the host interface 20 is connected to the buffer 13 and the processor 30, and is used to forward the test command sent by the host to the processor 30, so that the processor 30 forwards the test command to the command parser 11, and the host interface 20 is used to receive the test result sent by the buffer 13 and send the test result to the host.
[0130] Specifically, the processor 30 is connected to the host interface 20 and the command parser 11. The processor 30 stores firmware, which includes firmware algorithms, such as wear leveling algorithm, error correction code ECC and bad block management algorithm, FTL algorithm, garbage collection algorithm GC. The firmware is used to drive the controller so that the controller uses the control program of the firmware algorithm to automatically perform signal processing to ensure the performance of the solid state drive.
[0131] Specifically, the storage medium controller 40 is connected to at least one storage medium and the task manager 12, and is used to receive the test command sent by the task manager 12, and execute the test command to the storage medium. For example, if the test command is a write test command, the storage medium controller 40 writes the I / O data to be tested to the storage medium; if the test command is a read test command, the storage medium controller 40 reads the data from the storage medium; if the test command is an erase test command, the storage medium controller 40 erases the data from the storage medium. In an embodiment of the present invention, the storage medium is a flash memory chip, and the storage medium controller is a flash memory chip controller, such as a Flash controller.
[0132] Specifically, the storage medium is a flash memory chip, wherein Figure 3As shown, the flash memory chip includes multiple wafers (die), each wafer is composed of multiple groups (planes), each group is composed of multiple blocks (blocks), namely the physical block (block) described in the present invention, wherein the block is the basic unit of erasing the flash memory chip 200, each block has multiple pages (pages), namely physical pages, and the physical page (page) is the basic unit of reading and writing the flash memory chip.
[0133] Among them, Figure 5 As shown, the storage medium may be multiple, for example: a first storage medium, a second storage medium, ..., an Nth storage medium, wherein each of the storage media corresponds to a corresponding storage medium identifier, and the storage medium identifier is used to uniquely identify each of the storage medium. The storage medium identifier may be a physical address of the storage medium. After the storage medium controller 40 sends a test command to the storage medium for testing, the storage medium feeds back the test result to the storage medium controller 40, and the storage medium controller 40 sends the test result to the task manager 12, and the task manager 12 sends the test result to the cache 13 so that the cache 13 saves the test result, and the cache 13 returns the test result to the host through the host interface 20.
[0134] It can be understood that the test command sent by the host in the embodiment of the present invention can carry at least one storage medium identifier for testing at least one storage medium. For example, the test command carries multiple storage medium identifiers so that after the storage medium controller receives the test command, it tests the storage media corresponding to the multiple storage medium identifiers according to the storage medium identifiers carried in the test command, for example, performing a read operation, a write operation and / or an erase operation.
[0135] In an embodiment of the present invention, a test system is provided, including: a storage device and a host, wherein the host is communicatively connected to the storage device, and is used to send test commands to the storage device and receive test results returned by the storage device. Through the above method, the embodiment of the present invention can reduce development costs and shorten the development cycle.
[0136] Embodiment 5
[0137] See also Fig. 9 , Fig. 9 It is a flow chart of a testing method provided by an embodiment of the present invention;
[0138] Among them, the testing method is applied to the testing system of the above-mentioned embodiment, and the testing system includes: a host and a storage device, the storage device includes: a storage medium and a controller, the controller includes: a testing unit, a host interface, a processor and a storage medium controller, and the testing unit includes a command parser, a task manager, a cache and a data generator.
[0139] like Fig. 9 As shown, the method includes:
[0140] Step S10: Obtain the test command sent by the host;
[0141] Specifically, the host is installed with a test script or a test application, and a user sends a test command to the storage device through the test script or the test application, and the storage device receives the test command through a host interface.
[0142] Step S20: According to the test command, performing an operation corresponding to the test command on the storage medium, the operation including erasing, writing and / or reading operations;
[0143] Specifically, after the storage device receives the test command, the processor of the storage device performs protocol conversion on the test command and sends the test command to the command parser. The command parser parses the test command and sends the parsed test command to the task manager. The task manager determines the operation corresponding to the test command based on the test command. For example, if the test command is a read test command, a read operation is performed on the storage medium. If the test command is a write test command, a write operation is performed on the storage medium. If the test command is an erase test command, an erase operation is performed on the storage medium.
[0144] It can be understood that the test command includes a storage medium identifier, and the storage medium identifier is used to mark the storage medium and specify the storage medium to be tested. Preferably, the storage medium identifier is the physical address of the storage medium. For example, if the storage medium is a flash memory chip, the storage medium identifier is the flash memory particle address. By carrying the storage medium identifier in the test command, the storage medium to be operated can be specified in more detail, which is conducive to better determining the test results.
[0145] Step S30: Repeat the operation corresponding to the test command until the storage medium is damaged;
[0146] Specifically, by repeating the operation corresponding to the test command, for example, a read operation, a write operation, or an erase operation, a read operation, a write operation, or an erase operation is performed on the storage medium, and the cycle is repeated a certain number of times until the storage medium is damaged.
[0147] Step S40: Obtain the test result, and return the test result to the host.
[0148] Specifically, by performing erase, write, and read operations on the storage medium, recording the bad block table, delay, and bit error rate during the operation, and looping a preset number of times until the storage medium is unavailable, the bad block table, delay, and bit error rate during the operation are analyzed to obtain the test result. After the storage medium controller obtains the test result of the storage medium, the test result is sent to the task manager, and the task manager sends the test result to the cache for caching, and the cache sends the test result to the host through the host interface.
[0149] Please refer to Fig.10 , Fig.10 is another flow chart of a testing method provided by an embodiment of the present invention;
[0150] The test method is applied to the test system of the above embodiment, the test system includes a host and a storage device, the host includes a first host and a second host;
[0151] like Fig.10 As shown, the test method includes:
[0152] Step S101: obtaining a test command sent by a first host;
[0153] Step S102: According to the test command, perform an operation corresponding to the test command on the storage medium, the operation including erasing, writing and / or reading operations;
[0154] Step S103: determining whether the storage medium is damaged;
[0155] Specifically, by judging whether the storage medium has reached the end of its life and has become unusable and scrapped, it is determined whether the storage medium is damaged. If the storage medium is damaged, the process proceeds to step S104; if the storage medium is not damaged, the process returns to step S102.
[0156] Step S104: setting different environmental parameters;
[0157] Specifically, different temperatures, humidity, and power-on and power-off states are selected to repeatedly test the storage medium, such as read operations, write operations, and erase operations, so as to record parameters such as a bad block table, delay, and bit error rate during the operation.
[0158] Step S105: Collect data and analyze to obtain test results;
[0159] Specifically, by sorting and analyzing the data collected during the operation, such as bad block table, delay, bit error rate and other parameters, the test result is analyzed based on the data.
[0160] Step S106: sending the test result to the second host;
[0161] Specifically, the test result is sent to the second host so that the host can further analyze the test result. By setting the first host and the second host, the host sending the test result and the host receiving the test result are separated. Therefore, when the first host sending the test command crashes, the second host can also receive the test result and analyze the test result. At the same time, by analyzing the test result, the reason for the crash of the first host can be obtained, which is beneficial to maintaining the stability of the test system.
[0162] In an embodiment of the present invention, a test method is provided, which is applied to a test system, and the method includes: obtaining a test command sent by a host; performing an operation corresponding to the test command on the storage medium according to the test command, the operation including erasing, writing and / or reading operations; repeating the operation corresponding to the test command until the storage medium is damaged; obtaining a test result, and returning the test result to the host. By testing the storage medium with a built-in test unit in the storage device, the embodiment of the present invention can reduce development costs and shorten the development cycle.
[0163] Embodiment 6
[0164] Please refer to Fig.11 , Fig.11 It is a structural schematic diagram of a test device provided in an embodiment of the present invention; wherein the test device is applied to the test system of the above embodiment.
[0165] like Fig.11 As shown, the testing device 110 comprises:
[0166] The test command acquisition module 111 is used to acquire the test command sent by the host;
[0167] In the embodiment of the present invention, the host is installed with a test script or a test application, a user sends a test command to the storage device through the test script or the test application, and the storage device receives the test command through the host interface.
[0168] A test command execution module 112, configured to perform an operation corresponding to the test command on the storage medium according to the test command, wherein the operation includes an erase, write and / or read operation;
[0169] In an embodiment of the present invention, after the storage device receives the test command, the processor of the storage device performs protocol conversion on the test command and sends the test command to the command parser. The command parser parses the test command and sends the parsed test command to the task manager. The task manager determines the operation corresponding to the test command based on the test command. For example, if the test command is a read test command, a read operation is performed on the storage medium. If the test command is a write test command, a write operation is performed on the storage medium. If the test command is an erase test command, an erase operation is performed on the storage medium.
[0170] It can be understood that the test command includes a storage medium identifier, and the storage medium identifier is used to mark the storage medium and specify the storage medium to be tested. Preferably, the storage medium identifier is the physical address of the storage medium. For example, if the storage medium is a flash memory chip, the storage medium identifier is the flash memory particle address. By carrying the storage medium identifier in the test command, the storage medium to be operated can be specified in more detail, which is conducive to better determining the test results.
[0171] A repeating operation module 113, used for repeating the operation corresponding to the test command until the storage medium is damaged;
[0172] In an embodiment of the present invention, by repeating the operation corresponding to the test command, for example, a read operation, a write operation, or an erase operation, a read operation, a write operation, or an erase operation is performed on the storage medium, and the cycle is repeated a certain number of times until the storage medium is damaged.
[0173] The test result module 114 is used to obtain the test result and return the test result to the host.
[0174] In an embodiment of the present invention, erasing, writing, and reading operations are performed on a storage medium, a bad block table, delay, and bit error rate during the operation are recorded, and a preset number of cycles are performed until the storage medium is unavailable. The bad block table, delay, and bit error rate during the operation are analyzed to obtain a test result. After the storage medium controller obtains the test result of the storage medium, the test result is sent to the task manager, and the task manager sends the test result to the cache for caching. The cache sends the test result to the host through the host interface.
[0175] In an embodiment of the present invention, a test device is provided, including: a test command acquisition module, a test command execution module, a repeated operation module and a test result module, wherein the test command acquisition module is used to acquire the test command sent by the host; the test command execution module is used to perform the operation corresponding to the test command on the storage medium according to the test command, and the operation includes erasing, writing and / or reading operations; the repeated operation module is used to repeat the operation corresponding to the test command until the storage medium is damaged; the test result module is used to acquire the test result and return the test result to the host. By testing the storage medium with a built-in test unit in the storage device, the embodiment of the present invention can reduce development costs and shorten the development cycle.
[0176] An embodiment of the present invention further provides a non-volatile computer storage medium, which stores computer executable instructions. The computer executable instructions are executed by one or more processors, so that the one or more processors can execute the test method in any of the above method embodiments.
[0177] The above described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0178] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A test unit, characterized in that: Applied to a test system, the test system comprises: a host, a host interface, a storage medium and a storage medium controller, the test unit comprises: a command parser, a task manager and a cache, wherein: The command parser is used to receive and parse the test command sent by the host, and forward the parsed test command to the task manager; The task manager is connected to the command parser and the storage medium controller, and is used to receive the parsed test command sent by the command parser, and send the parsed test command to the storage medium controller, so that the storage medium controller tests the storage medium based on the parsed test command to generate a test result, and returns the test result to the task manager; The buffer is connected to the host interface and the task manager, and is used to cache the test result returned by the storage medium controller, and return the test result to the host through the host interface; The testing unit also includes: a data generator, connected to the task manager, for generating I / O data to be tested according to the test command sent by the host, and sending the I / O data to be tested to the task manager, so that the task manager sends the I / O data to be tested to the storage medium controller; The data generator is also connected to the storage medium controller, and is used to directly send the I / O data to be tested generated by it to the storage medium controller, so that the storage medium controller writes the I / O data to be tested into the storage medium corresponding to the test command.
2. A controller, characterized in that: include: A host interface, a processor, a storage medium controller, and a test unit as claimed in claim 1, wherein: The host interface is connected to the host, the processor and the buffer of the test unit, and is used to receive the test command sent by the host and forward the test command to the processor. The host interface is also used to receive the test result sent by the buffer; The processor is connected to the host interface and the command parser and is used to drive the controller; The storage medium controller is connected to the task manager and at least one storage medium, and is used to receive the parsed test command sent by the task manager and test the at least one storage medium.
3. The controller according to claim 2, characterized in that: The processor stores firmware, and the firmware is used to drive the controller to perform signal processing.
4. The controller according to claim 2 or 3, characterized in that: The storage medium includes a flash memory chip, and the storage medium controller includes a flash memory chip controller.
5. A storage device, characterized in that: include: A controller as claimed in any one of claims 2 to 4; at least one storage medium for storing data; The storage medium includes a flash memory chip, the flash memory chip includes a plurality of wafers, each of the wafers includes a plurality of groups, each of the groups includes a plurality of physical blocks, and each of the physical blocks includes a plurality of physical pages.
6. A testing system, characterized in that: include: The storage device as claimed in claim 5; The host is communicatively connected to the storage device and is used to send a test command to the storage device and receive a test result returned by the storage device.
7. A testing method, characterized in that: Applied to the test system as claimed in claim 6, the method comprises: Get the test command sent by the host; According to the test command, performing an operation corresponding to the test command on the storage medium, the operation including an erase, write and / or read operation; Repeating the operation corresponding to the test command until the storage medium is damaged; The test result is obtained and returned to the host.
8. The method according to claim 7, characterized in that The test command carries a storage medium identifier, and the storage medium identifier is used to specify the storage medium to be tested.
9. The method according to claim 7, characterized in that: The test system includes a first host and a second host, and obtaining the test command sent by the host includes obtaining the test command sent by the first host. The method further includes: The test result corresponding to the test command sent by the first host is sent to the second host.
Citation Information
Patent Citations
Controller with flash memory test function, and storage system and test method thereof
CN101853692A
Test unit and system, controller and storage device
CN210984287U