TWI670721B - Unusual power-off test method and device for storage device - Google Patents

Unusual power-off test method and device for storage device Download PDF

Info

Publication number
TWI670721B
TWI670721B TW108104804A TW108104804A TWI670721B TW I670721 B TWI670721 B TW I670721B TW 108104804 A TW108104804 A TW 108104804A TW 108104804 A TW108104804 A TW 108104804A TW I670721 B TWI670721 B TW I670721B
Authority
TW
Taiwan
Prior art keywords
test
power
storage device
control unit
workload
Prior art date
Application number
TW108104804A
Other languages
Chinese (zh)
Other versions
TW202030739A (en
Inventor
張柏堅
楊儒易
謝博文
Original Assignee
睿寬智能科技有限公司
江蘇芯盛智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 睿寬智能科技有限公司, 江蘇芯盛智能科技有限公司 filed Critical 睿寬智能科技有限公司
Priority to TW108104804A priority Critical patent/TWI670721B/en
Application granted granted Critical
Publication of TWI670721B publication Critical patent/TWI670721B/en
Publication of TW202030739A publication Critical patent/TW202030739A/en

Links

Abstract

本發明係揭露一種用於儲存裝置之不正常斷電測試設備包括一系統控制單元、一工作負載模擬單元、一電力控制單元、一協議控制單元及一數據暫存單元。該電力控制單元與該協議控制單元選擇性連接該儲存裝置。該測試裝置在該儲存裝置模擬至少一工作負載,並於指定時刻斷電,然後測試。如此,該測試裝置快速發現該儲存裝置之裝置韌體的潛在問題及演算法漏洞,而提升該儲存裝置之裝置韌體的穩定性與可靠度。 The invention discloses an abnormal power-off test device for a storage device, comprising a system control unit, a workload simulation unit, a power control unit, a protocol control unit and a data temporary storage unit. The power control unit and the protocol control unit selectively connect the storage device. The test device simulates at least one workload at the storage device and powers off at a specified time and then tests. In this way, the test device quickly discovers potential problems and algorithmic vulnerabilities of the device firmware of the storage device, and improves the stability and reliability of the device firmware of the storage device.

Description

用於儲存裝置之不正常斷電測試方法及設備 Unusual power-off test method and device for storage device

本發明隸屬一種儲存裝置之斷電測試技術,具體而言指一種用於儲存裝置之不正常斷電測試方法及設備,透過能可程式化測試的設計,以更快發現其裝置韌體的潛在問題及演算法的漏洞,藉此提升儲存裝置的穩定性與可靠度。 The invention belongs to a power-off test technology of a storage device, in particular to an abnormal power-off test method and device for a storage device, and the potential of the device firmware can be discovered more quickly through the design of the programmable test. Problems and algorithmic loopholes to improve the stability and reliability of the storage device.

大多數作為儲存裝置之固態硬碟(solid-state disk,SSD)係使用如SATA、SAS或光纖通道等埠與電腦埠的匯流排連接。但SATA主要作為機械硬碟機(hard disk drive:HDD)的連接埠,並隨時間推移越來越難滿足速度日益提高的SSD。因此,部分SSD已受到SATA最大吞吐量的限制。而非揮發性記憶體之控制器埠(non-volatile memory express:NVMe)一個邏輯裝置埠規範,其係一種具有優化與高性能的可擴充之主機控制器介面,該NVMe的基本概念是透過快速外部連接(peripheral component interconnect express:PCIe)匯流排連接處理器的傳輸迴路。其最大優點是可提供超低延遲與高頻寬的存取表現,且NVMe加了自動功耗狀態切換和動態能耗管理功能,使NVMe在功耗管理上擁有較大優勢。 Most solid-state disks (SSDs), which are storage devices, are connected to the busbars of a computer using SATA, SAS, or Fibre Channel. But SATA is mainly used as a hard disk drive (HDD) port, and it is increasingly difficult to meet the ever-increasing speed of SSD over time. Therefore, some SSDs have been limited by the maximum throughput of SATA. Non-volatile memory express (NVMe) is a logical device specification, which is an extensible host controller interface with optimization and high performance. The basic concept of the NVMe is through fast A peripheral component interconnect express (PCIe) bus is connected to the transmission loop of the processor. Its biggest advantage is that it provides ultra-low latency and high-bandwidth access performance, and NVMe adds automatic power state switching and dynamic energy management, which makes NVMe have a big advantage in power management.

儲存裝置在出廠時,須依消費級或企業級等進行不同等級之耐用性及工作負載(如連續讀寫、隨機讀寫、讀寫大檔案或小檔案等)的測試。因此,其測試需求及測試方法有不同 的標準規範(如JESD 218、JESD 219等),以確保儲存裝置的耐用性壽命和品質。現有儲存裝置的測試方法大都是針對特定的工作負載做重複測試或是增加系統執行的時間,並參考標準規範來瞭解測試需求和測驗環境。通常對儲存裝置的耐久度與可靠度可藉由過往經驗或是拉長測試時間來驗證出基本的問題。儲存裝置的重要之處在於保存使用者資料。一般儲存裝置的裝置韌體或許會處理正常斷電,但易忽略或未周全考慮不正常斷電而產生漏洞。若儲存裝置剛好遇上未考慮到的不正常斷電,輕則使用者的資料消失或系統崩潰,重則導致該儲存裝置之裝置韌體失效而無法存取資料。 When the storage device is shipped from the factory, it must be tested for different levels of durability and workload (such as continuous reading and writing, random reading and writing, reading and writing large files or small files, etc.) according to consumer or enterprise level. Therefore, its test requirements and test methods are different. Standard specifications (such as JESD 218, JESD 219, etc.) to ensure the durability and quality of the storage device. Most of the existing storage device testing methods are repeated tests for specific workloads or increase the system execution time, and refer to the standard specifications to understand the test requirements and test environment. The durability and reliability of the storage device can often be verified by past experience or by lengthening the test time. The important thing about storage devices is the preservation of user data. Device firmware of a typical storage device may handle normal power outages, but it is easy to ignore or not fully consider the abnormal power outage to create a loophole. If the storage device just happens to encounter an abnormal power failure that is not considered, the user's data disappears or the system collapses, and the device firmware of the storage device fails to access the data.

通常以作業系統執行一應用程式來測試現有儲存裝置。因此,測試流程的彈性及複雜度受限。另外,此種測試通常是規律性的循環斷電而無法進行可預期的不正常斷電測試。替代地,可由測試人員隨機對儲存裝置進行斷電,卻無法於儲存裝置執行不同工作負載中的指定時刻進行斷電測試,而難以發現在不同工作負載下不正常斷電時裝置韌體的問題及漏洞。另外,現有測試設備於每次測試中僅能就同一測試方式如指令斷電測試、流程斷電測試或壓力測試來執行,無法讓測試人員隨時改變測試方式。如何解決前述問題,係業界的重要課題,也是本發明所探討者。 An application is typically executed by the operating system to test existing storage devices. Therefore, the flexibility and complexity of the test process is limited. In addition, such tests are typically periodic power outages that fail to perform predictable abnormal power outage tests. Alternatively, the test device can be powered off randomly by the tester, but the power-off test cannot be performed at the specified time in the different workloads of the storage device, and it is difficult to find the problem of the device firmware when the power is abnormally interrupted under different workloads. And vulnerabilities. In addition, the existing test equipment can only be executed in the same test mode such as the instruction power-off test, the process power-off test or the stress test in each test, and the tester cannot be changed at any time. How to solve the above problems is an important issue in the industry and is also an inventor of the present invention.

緣是,本發明即基於上述需求與問題深入探討,並藉由本發明人多年從事相關開發的經驗,而積極尋求解決之道,經不斷努力之研究與發展,終於成功的發展出一種用於儲存裝置之不正常斷電測試方法及其不正常斷電測試設備,能更有效找出裝置韌體的問題及漏洞。 The reason is that the present invention is based on the above-mentioned needs and problems, and actively seeks solutions through the experience of the inventors for years of relevant development, and has continuously developed a kind of storage for continuous research and development. The abnormal power-off test method of the device and its abnormal power-off test equipment can more effectively find out the problems and loopholes of the device firmware.

因此,本發明之主要目的是提供一種用於儲存裝置之不正常斷電測試方法及其不正常斷電測試設備,藉以能可程式進行測試,供模擬在不正常斷電下執行測試,以更快發現裝置韌體潛在問題及演算法漏洞,而提升儲存裝置的裝置韌體的穩定性與可靠度。 Therefore, the main object of the present invention is to provide an abnormal power-off test method for a storage device and an abnormal power-off test device thereof, so that the test can be performed for the simulation to perform the test under abnormal power failure, to further Quickly discover potential problems with device firmware and algorithmic loopholes, and improve the stability and reliability of device firmware for storage devices.

本發明之另一目的是提供一種用於儲存裝置之不正常斷電測試方法及其不正常斷電測試設備,其可在儲存裝置執行不同工作負載中的指定點進行斷電測試,令在斷電的過程中,已發出之指令不需要等待指令的回應,而是在指令送出後的任意時刻執行斷電,透過突然斷電進行有效的測試。 Another object of the present invention is to provide an abnormal power-off test method for a storage device and an abnormal power-off test device thereof, which can perform a power-off test at a specified point in a different workload of the storage device. In the process of electricity, the issued command does not need to wait for the response of the command, but performs power-off at any time after the command is sent, and performs a valid test through a sudden power-off.

本發明之另一目的是提供一種用於儲存裝置之不正常斷電測試方法及其不正常斷電測試設備,其能依需求,隨時變換不同的測試方式、測試次數及測試循環,以增加儲存裝置錯誤測試的多樣性、錯誤模型(Error Case)、情境、樣本數或是種類。 Another object of the present invention is to provide an abnormal power-off test method for a storage device and an abnormal power-off test device thereof, which can change different test modes, test times and test cycles at any time according to requirements to increase storage. The variety of device error tests, Error Cases, Situations, Samples, or Categories.

為達成上述目的,該測試設備,依至少一測試規範,在至少一儲存裝置,模擬至少一工作負載,並於指定時刻執行至少一測試。該測試設備包括測試設備包括一系統控制單元、一工作負載模擬單元、一電力控制單元、一協議控制單元及一數據暫存單元。該系統控制單元,可運算、接受及回覆測試時傳送的指令。該工作負載模擬單元,連接該系統控制單元,並可依指令對該儲存裝置執行要測試的各種工作負載模擬。該電力控制單元連接該系統控制單元,並可選擇性連接該儲存裝置,且依指令執行該儲存裝置之斷電與上電。該協議控制單元連接該系統控制單元,並可選擇性連接該儲存裝置,且發送相關測試協定之指令。該數據暫存單元,連接該系統控制 單元,並可紀錄關鍵資料和資訊以檢查該儲存裝置儲存資料的正確性。該測試裝置是可程式化。 To achieve the above object, the test device simulates at least one workload in at least one storage device according to at least one test specification, and performs at least one test at a specified time. The test equipment includes a test equipment including a system control unit, a work load simulation unit, a power control unit, a protocol control unit, and a data temporary storage unit. The system control unit can calculate, accept and reply the instructions transmitted during the test. The workload simulation unit is connected to the system control unit, and can execute various workload simulations to be tested on the storage device according to the instruction. The power control unit is connected to the system control unit, and can selectively connect the storage device, and performs power-off and power-on of the storage device according to the instruction. The protocol control unit is coupled to the system control unit and is selectively connectable to the storage device and sends instructions related to the test protocol. The data temporary storage unit is connected to the system control Unit, and can record key information and information to check the correctness of the data stored in the storage device. The test device is programmable.

為使 貴審查委員能進一步了解本發明的構成、特徵及其他目的,以下乃舉本發明之若干較佳實施例,並配合圖式詳細說明如后,供讓熟悉該項技術領域者能夠具體實施。 The following is a description of the preferred embodiments of the present invention, and the detailed description of the present invention will be described in detail with reference to the accompanying drawings. .

10‧‧‧測試設備 10‧‧‧Test equipment

11‧‧‧系統控制單元 11‧‧‧System Control Unit

12‧‧‧工作負載模擬單元 12‧‧‧Workload Simulation Unit

13‧‧‧電力控制單元 13‧‧‧Power Control Unit

14‧‧‧協議控制單元 14‧‧‧Protocol Control Unit

15‧‧‧數據暫存單元 15‧‧‧Data temporary storage unit

20‧‧‧儲存裝置 20‧‧‧Storage device

21‧‧‧裝置控制單元 21‧‧‧Device Control Unit

22‧‧‧快閃記憶體 22‧‧‧Flash memory

第一圖:係本發明用於儲存裝置之不正常斷電測試設備的 架構示意圖,供說明其主要配置狀態。 The first figure is the abnormal power-off test device for the storage device of the present invention. Schematic diagram of the architecture to illustrate its main configuration state.

第二圖:係本發明用於儲存裝置之不正常斷電測試方法的流程圖。 Second: is a flow chart of the method for testing an abnormal power failure of the storage device of the present invention.

第三圖:係第二圖所示的方法的一部分的流程圖。 Third Figure: Flowchart of a portion of the method illustrated in the second figure.

如第一圖所示,依本發明的一實施例,一種用於儲存裝置20之不正常斷電測試設備10包含一系統控制單元(system controller unit)11、一工作負載模擬單元(workload unit)12、一電力控制單元(power control unit)13、一協議控制單元(protocol control unit)14及一數據暫存單元(data buffer unit)15。測試設備10藉電力控制單元13與協議控制單元14選擇性連接該儲存裝置20,供執行該儲存裝置20於不同工作負載(包含但不限於連續讀寫、隨機讀寫、讀寫大檔案或小檔案等)下的不正常斷電測試。儲存裝置20可以是NVMe固態硬碟,且有一系列由一NVMe裝置控制單元(Device Controller Unit)21控制之快閃記憶體(Nand Flash)22,供可程式化進行測試,讓測試設備10可模擬在不正常斷電下對儲存裝置20執行測試,以快 速發現儲存裝置20之裝置韌體所潛在問題及演算法漏洞,而提升儲存裝置20之裝置韌體的穩定性與可靠度。 As shown in the first figure, an abnormal power-off test device 10 for a storage device 20 includes a system controller unit 11 and a workload load unit. 12. A power control unit 13, a protocol control unit 14, and a data buffer unit 15. The test device 10 is selectively connected to the storage device 20 by the power control unit 13 and the protocol control unit 14 for executing the storage device 20 for different workloads (including but not limited to continuous reading and writing, random reading and writing, reading and writing large files or small Unusual power outage test under file, etc.). The storage device 20 can be an NVMe solid state drive and has a series of Nand Flash 22 controlled by an NVMe Device Controller Unit 21 for programmability testing, allowing the test device 10 to simulate Performing a test on the storage device 20 under abnormal power failure, The potential problems and algorithmic vulnerabilities of the device firmware of the storage device 20 are quickly discovered, and the stability and reliability of the device firmware of the storage device 20 are improved.

系統控制單元11用於接受及回覆測試時傳送的指令,以完成各種指令的執行,包含但不限於變換不同的斷電方式、測試次數、測試循環及測試結果運算。工作負載模擬單元12連接系統控制單元11而可依指令對儲存裝置20執行要測試的各種工作負載。工作負載模擬單元12主要用來描述NVMe之儲存裝置20在用戶端會發生的行為與指令的比例(根據測試規範JDEC 218、219),例如連續讀寫、隨機讀寫、讀寫大檔案或小檔案等。工作負載的內容取決於儲存裝置20的定位,例如文書處理、遊戲處理或郵件伺服器的工作負載等。重點是要模擬出用戶端使用環境下出現的行為。 The system control unit 11 is configured to accept and reply to the instructions transmitted during the test to complete the execution of various instructions, including but not limited to changing different power-off modes, test times, test cycles, and test result operations. The workload simulation unit 12 is coupled to the system control unit 11 to execute various workloads to be tested on the storage device 20 in accordance with instructions. The workload simulation unit 12 is mainly used to describe the ratio of behaviors and instructions that the NVMe storage device 20 can occur at the user end (according to the test specification JDEC 218, 219), such as continuous reading and writing, random reading and writing, reading and writing large files or small Files, etc. The content of the workload depends on the location of the storage device 20, such as word processing, game processing, or the workload of the mail server. The point is to simulate the behavior that occurs in the user's environment.

電力控制單元13係連接於系統控制單元11,並可選擇性連接待測之儲存裝置20,供依指令執行儲存裝置20之斷電與上電。 The power control unit 13 is connected to the system control unit 11 and can be selectively connected to the storage device 20 to be tested for performing power-off and power-on of the storage device 20 according to the command.

協議控制單元14亦連接系統控制單元11,並可選擇性連接待測之儲存裝置20。協議控制單元14可供相關指令發送相關測試協定,例如指令/流程斷電測試、初始化斷電測試、壓力測試之相關協議規範與流程,供執行儲存裝置20測試之檢查、比對及判斷測試成功與否。 The protocol control unit 14 is also coupled to the system control unit 11 and is selectively connectable to the storage device 20 to be tested. The protocol control unit 14 can be used to send relevant test protocols, such as command/process power-off test, initial power-off test, pressure test related protocol specifications and procedures, for performing the inspection, comparison and judgment test of the storage device 20 test. Whether or not.

數據暫存單元15連接系統控制單元11而可紀錄關鍵資料和資訊,以便於協議控制單元14檢查儲存裝置20儲存資料的正確性,例如斷電前寫入的N筆資料的長度和位置及其它不會被覆蓋的固定資料區域等。 The data temporary storage unit 15 is connected to the system control unit 11 to record key data and information, so that the protocol control unit 14 checks the correctness of the data stored in the storage device 20, such as the length and position of the N data written before the power failure and other A fixed data area that will not be covered, etc.

藉此,組構成一種可程式化、且模擬不正常斷電測試之用於儲存裝置之不正常斷電測試設備者。 Thereby, the group constitutes an abnormal power-off test device for a storage device that can be programmed and simulates an abnormal power-off test.

測試設備10於實際運用時依照NVMe之儲存裝置20的測試規範(如JDEC 218、219)。測試設備10之系統控制單元11會根據工作負載模擬單元12的參數來儲存裝置20作動,並用電力控制單元13來執行不正常斷電動作。工作負載模擬單元12包含模擬各種工作負載環境的所有指令與各指令發生的比例。然後,協議控制單元14對儲存裝置20執行各種測試模式,包含但不限於指令/流程斷電測試、初始化斷電測試及壓力測試。 The test equipment 10 is in accordance with the test specifications of the NVMe storage device 20 (e.g., JDEC 218, 219) in actual use. The system control unit 11 of the test equipment 10 operates the storage device 20 according to the parameters of the workload simulation unit 12, and uses the power control unit 13 to perform an abnormal power-off action. The workload simulation unit 12 contains the ratio of all instructions that simulate various workload environments to the occurrence of each instruction. The protocol control unit 14 then performs various test modes on the storage device 20, including but not limited to the command/flow power down test, the initial power down test, and the stress test.

第二、三圖所示為本發明用於儲存裝置之不正常斷電測試方法的流程圖。 The second and third figures show a flow chart of the method for testing the abnormal power failure of the storage device of the present invention.

首先,執行步驟S101,使至少一儲存裝置執行至少一模擬工作負載之運行。測試設備10之系統控制單元11依工作負載模擬單元12的設定,使儲存裝置20執行至少一模擬工作負載,例如連續讀寫、隨機讀寫、讀寫大檔案或小檔案。 First, step S101 is executed to enable at least one storage device to perform operation of at least one simulated workload. The system control unit 11 of the test device 10 causes the storage device 20 to perform at least one simulated workload, such as continuous reading and writing, random reading and writing, reading and writing large files or small files, according to the setting of the workload simulation unit 12.

接著,執行步驟S102,依設定令儲存裝置20進行包含一指定測試模式之斷電測試。電力控制單元13依設定,於儲存裝置20的模擬工作負載運行中,進行至少一指定時刻的斷電。協議控制單元14對儲存裝置20執行相對應斷電之一測試模式。測試模式可以是一指令/流程斷電測試A、一裝置初始化斷電測試B或一壓力測試C。指令/流程斷電測試A包含一個指令斷電測試、或由至少一個指令斷電測試所組成的流程斷電測試。測試模式進一步可以是重覆執行指令/流程斷電測試A或裝置初始化斷電測試B之壓力測試C。若指令/流程斷電測試A斷電後觸發裝置初始化斷電測試B,則根據裝置初始化斷電測試B的壓力測試條件,決定是否連續斷、上電。若未進入裝置初始化斷電測試B,則繼續執行步驟S103的正常上電流 程。針對不同測試模式的執行流程則如第三圖所示。 Then, in step S102, the storage device 20 performs a power-off test including a specified test mode according to the setting. The power control unit 13 performs the power-off of at least one specified time during the simulated workload operation of the storage device 20 according to the setting. The protocol control unit 14 performs a one-test mode corresponding to the power-off of the storage device 20. The test mode can be an instruction/process power down test A, a device initialization power down test B, or a stress test C. The instruction/process power-off test A includes an instruction power-off test or a process power-off test consisting of at least one command power-off test. The test mode may further be a stress test C that repeatedly executes the instruction/flow power failure test A or the device initialization power failure test B. If the trigger device initializes the power-off test B after the command/flow power-off test A is powered off, it is determined whether the power is continuously disconnected or powered according to the pressure test condition of the device initialization power-off test B. If the device initialization power-off test B is not entered, the normal upper current of step S103 is continued. Cheng. The execution flow for different test modes is shown in the third figure.

執行指令/流程斷電測試A時,係於步驟S101後,執行步驟S1022、根據設定對欲中途斷電的指令斷電。在儲存裝置20上電後至協議控制單元14可下指令的階段,工作負載模擬單元12令儲存裝置20執行模擬工作負載一段時間。然後,電力控制單元13依指令的比例斷電。為了增或減特定指令出現的頻率,在此加入協議控制單元14之可程式化參數,可複製特定的情況或任意模擬NVMe指令的行為,並對儲存裝置20的指令執行斷電。指令可包括NVMe協定所規範的指令。且在斷電的過程中,已發出之NVMe指令不必等待指令的回應,而是在指令送出後的任意時刻執行斷電,這樣的突然斷電才能有效的攻擊在裝置韌體正在搬移或寫入快閃記憶體22的動作。 When the command/flow power failure test A is executed, after step S101, step S1022 is executed, and the command to power off in the middle of the power is turned off according to the setting. At the stage after the storage device 20 is powered up to when the protocol control unit 14 can command, the workload simulation unit 12 causes the storage device 20 to execute the simulated workload for a period of time. Then, the power control unit 13 is powered off in accordance with the ratio of the command. In order to increase or decrease the frequency at which a particular instruction occurs, the programmable parameters of the protocol control unit 14 are added herein to replicate the behavior of a particular situation or any analog NVMe instruction and to power down the instructions of the storage device 20. The instructions may include instructions specified by the NVMe protocol. In the process of power failure, the issued NVMe instruction does not have to wait for the response of the instruction, but performs power-off at any time after the instruction is sent. Such a sudden power-off can effectively attack the device firmware being moved or written. The action of the flash memory 22.

接著執行步驟S1023,判斷是否執行裝置初始化斷電測試。斷電後,根據測試參數判斷是否執行裝置初始化斷電測試B。若參數設定為需要執行裝置初始化斷電測試B,則進行步驟S1026。反之,若參數設定為不需要執行裝置初始化斷電測試B,則進行步驟S103。 Next, step S1023 is executed to determine whether to perform the device initialization power-off test. After the power is turned off, it is judged according to the test parameters whether or not the device initialization power-off test B is performed. If the parameter is set to perform the device initializing power-off test B, step S1026 is performed. On the other hand, if the parameter is set to not require the device initialization power-off test B, step S103 is performed.

執行裝置初始化斷電測試B時,於步驟S1023後,執行步驟S1026,儲存裝置上電。必須在發生斷電後才能執行此流程。 When the execution device initializes the power-off test B, after step S1023, step S1026 is executed, and the storage device is powered on. This process must be performed after a power outage.

然後,執行步驟S1027,將CC.EN設為1。依NVMe協議規範,測試設備10對NVMe之儲存裝置20暫存的CC.EN設為1時,測試設備10重複讀取儲存裝置20的暫存數據中CSTS.RDY狀態,直到由0轉換成1為止。在轉換的工程中,儲存裝置20必須遵守裝置控制單元21的超時(Timeout)值。當轉換成1,儲存裝置20已經準備完成,測試設備10可進一步 對儲存裝置20下相關指令。 Then, step S1027 is executed to set CC.EN to 1. According to the NVMe protocol specification, when the test device 10 temporarily sets the CC.EN of the NVMe storage device 20 to 1, the test device 10 repeatedly reads the CSTS.RDY state in the temporary storage data of the storage device 20 until it is converted from 0 to 1. until. In the converted project, the storage device 20 must comply with the timeout value of the device control unit 21. When converted to 1, the storage device 20 is ready to be completed, the test device 10 can further The relevant instructions are stored on the storage device 20.

然後,執行步驟S1028,測試系統在平均初始化時間內斷電。在CSTS.RDY轉換的過程中,裝置韌體有可能正在處理前次尚未完成的任務(可能為GC、WL或POR等),或正在存取或搬動快閃記憶體22的資料。在此時刻加可程式化的參數並在流程中執行斷電,將會有較大概率打中裝置韌體處理各項複雜任務中的瑕疵。 Then, in step S1028, the test system is powered off during the average initialization time. During the CSTS.RDY conversion process, the device firmware may be processing the previously unfinished tasks (possibly GC, WL, or POR, etc.), or accessing or moving the data of the flash memory 22. Adding programmable parameters at this time and performing a power outage in the process will have a higher probability of hitting the device firmware to handle the complexities of various complex tasks.

接著,執行步驟S1029,判斷是否滿足裝置初始化斷電測試條件。儲存裝置20依測試規範判斷是否完成指定測試之條件。若未滿足指定的測試條件,則重新執行步驟S1026,繼續對儲存裝置20進行設定條件的測試。若已滿足指定的測試條件,則執行步驟S103。 Next, step S1029 is performed to determine whether the device initialization power-off test condition is satisfied. The storage device 20 determines whether the conditions of the specified test are completed according to the test specification. If the specified test condition is not satisfied, step S1026 is re-executed, and the test of the setting condition of the storage device 20 is continued. If the specified test condition has been met, step S103 is performed.

在壓力測試C中,將指令/流程斷電測試A和裝置初始化斷電測試B融入整體的斷電系統,並加可程式化的條件作為壓力測試停止的依據。如此,可將各種可能發生的因素組合成一個系統,以達到可連續重複觸發的目的。 In the stress test C, the command/flow power-off test A and the device initial power-off test B are integrated into the overall power-off system, and the stylized conditions are added as the basis for the pressure test stop. In this way, various possible factors can be combined into one system to achieve the purpose of continuous repeated triggering.

然後,執行步驟S103,令儲存裝置20重新上電,並檢查儲存裝置20的初始化時間是否正常。儲存裝置20在運行中指定時刻斷電後,電力控制單元13重新供電給儲存裝置20。協議控制單元14依測試規範檢查儲存裝置20之初始化時間是否正常。若正常,則執行步驟S104。若不正常,則表示測試失敗。 Then, step S103 is executed to restart the storage device 20 and check whether the initialization time of the storage device 20 is normal. After the storage device 20 is powered off at a specified time during operation, the power control unit 13 re-powers the storage device 20. The protocol control unit 14 checks whether the initialization time of the storage device 20 is normal according to the test specification. If it is normal, step S104 is performed. If it is not normal, it means the test failed.

緊接著,執行步驟S104,判斷是否滿足指定之指令斷電測試的壓力測試條件。當儲存裝置20完成指令/流程斷電測試A或裝置初始化斷電測試B之測試後,依測試規範判斷是否完成指定測試中相對應的指令斷電測試條件。若未滿足測 試條件,則再執行步驟S102,對儲存裝置20進行設定條件的測試。若已滿足指定的指令斷電測試條件,則執行步驟S105。 Next, step S104 is performed to determine whether the pressure test condition of the specified command power-off test is satisfied. After the storage device 20 completes the test of the command/flow power-off test A or the device initialization power-off test B, it is determined according to the test specification whether the corresponding command power-off test condition in the specified test is completed. If the test is not met In the test condition, step S102 is executed again, and the storage device 20 is tested for the setting conditions. If the specified command power-off test condition has been met, step S105 is performed.

之後,執行步驟S105,比對上述儲存裝置之關鍵數據是否正確。在判斷儲存裝置20重新上電運行的初始化時間正常後,系統控制單元11進一步透過數據暫存單元15比對儲存裝置20中儲存資料之關鍵數據的正確性,例如斷電前寫入的N筆資料的長度和位置及其他不會被覆蓋的固定資料區域等。若關鍵數據正確,則執行步驟S106。若關鍵數據不正確,則表示測試失敗。 Thereafter, step S105 is performed to compare whether the key data of the storage device is correct. After determining that the initialization time of the re-powering operation of the storage device 20 is normal, the system control unit 11 further compares the correctness of the key data stored in the storage device 20 through the data temporary storage unit 15, for example, the N pen written before the power failure. The length and location of the data and other fixed data areas that will not be covered. If the key data is correct, step S106 is performed. If the critical data is incorrect, the test failed.

最後,執行步驟S106,檢查儲存裝置20是否滿足測試條件。當儲存裝置20依序完成指定斷電測試模式之測試、初始化時間之檢查及儲存資料關鍵數據之比對後,進一步依據測試規範判斷是否完成指定測試方式、測試次數及測試循環之條件。若尚未滿足指定的測試條件,則再執行步驟S101,對儲存裝置20進行設定條件的測試。若已滿足指定的測試條件,則表示測試成功,並結束儲存裝置20之測試。 Finally, step S106 is performed to check whether the storage device 20 satisfies the test condition. After the storage device 20 sequentially completes the test of the specified power-off test mode, the check of the initialization time, and the comparison of the key data of the stored data, it further determines whether the specified test mode, the number of tests, and the test cycle condition are completed according to the test specification. If the specified test condition has not been met, step S101 is performed again, and the storage device 20 is tested for the set condition. If the specified test conditions have been met, the test is successful and the test of the storage device 20 is terminated.

依本發明整體斷電測試的原理描述,在斷電之後跳至下一階段,必須檢查正常上電後NVMe之儲存裝置20之CSTS.RDY的初始化時間是否都在NVMe協議規範的超時(timeout)時間內完成。若檢查失敗,則代表裝置韌體可能在前次的斷電影響下已經出現問題了,須重新檢視該斷電行為對裝置韌體所造成的危害並修復。 According to the principle description of the overall power-off test of the present invention, after jumping to the next stage after power-off, it is necessary to check whether the initialization time of the CSTS.RDY of the NVMe storage device 20 after normal power-on is in the timeout of the NVMe protocol specification (timeout) ) completed in time. If the inspection fails, the device firmware may have a problem under the influence of the previous power failure, and the damage caused by the power failure behavior to the device firmware must be re-examined and repaired.

經由上述的說明,本發明透過不正常斷電測試設備及其不正常斷電測試方法之設計,使其對NVMe之儲存裝置20的測試上有若干優點及實用價值。 Through the above description, the present invention has several advantages and practical values for testing the NVMe storage device 20 through the design of the abnormal power-off test device and its abnormal power-off test method.

首先,本發明可用指令斷電測試來進行指定測 試。與一般現有隨機斷電的測試方法不同,本發明可控制斷電指令,使其發生在指令送出後的某時刻上,能更滿足測試需求。 First, the present invention can be used to perform a specified test by using an instruction power-off test. test. Different from the conventional random power-off test method, the present invention can control the power-off command so that it can meet the test requirements at a certain time after the command is sent.

再者,本發明之流程斷電測試可進行可程式化的測試設計,讓測試可控制依NVMe協定的各種NVMe行為,並將其程式化控制,使斷電發生在NVMe各種行為中,來達到控制特定行為斷電的發生。 Furthermore, the process power-off test of the present invention can perform a programmable test design, allowing the test to control various NVMe behaviors according to the NVMe protocol, and programmatically control the power-off to occur in various NVMe behaviors. Control the occurrence of a specific behavioral outage.

本發明之壓力測試可運用在指令/流程斷電測試與初始化斷電測試上,增加工作負載的隨機情境模擬或測試循環次數,藉此提升錯誤種類的數量,以驗證儲存裝置20中裝置韌體對不同錯誤種類之處理的妥善率。 The stress test of the present invention can be applied to the command/flow power-off test and the initial power-off test to increase the random situation simulation or test cycle times of the workload, thereby increasing the number of error types to verify the device firmware in the storage device 20. The proper rate of handling different types of errors.

另外,本發明藉可程式化的測試設計進行測試,供模擬在不正常斷電下執行測試,以快速發現裝置韌體潛在問題及演算法漏洞,而提升儲存裝置的裝置韌體的穩定性與可靠度。 In addition, the present invention is tested by a programmable test design, and the simulation is performed under abnormal power failure to quickly discover potential problems of the device firmware and algorithmic loopholes, and improve the stability of the device firmware of the storage device. Reliability.

綜上所述,可理解本發明具極佳創意,有效解決現有問題,大幅增進功效,且在相同的技術領域中未見相同或近似的產品創作或公開使用。故本發明符合發明專利有關「新穎性」與「進步性」的要件,乃依法提出發明專利之申請。 In summary, it can be understood that the present invention has excellent creativity, effectively solves existing problems, greatly enhances efficacy, and does not see the same or similar product creation or public use in the same technical field. Therefore, the present invention meets the requirements for "novelty" and "progressiveness" of the invention patent, and is an application for filing an invention patent according to law.

Claims (7)

一種測試設備,依至少一測試規範,在至少一儲存裝置,模擬至少一工作負載,並於指定時刻執行至少一測試,該測試設備包括:一系統控制單元,可運算、接受及回覆測試時傳送的指令;一工作負載模擬單元,連接該系統控制單元,並可依指令對該儲存裝置執行要測試的各種工作負載模擬;一電力控制單元,連接該系統控制單元,並可選擇性連接該儲存裝置,且依指令執行該儲存裝置之斷電與上電;一協議控制單元,連接該系統控制單元,並可選擇性連接該儲存裝置,且發送相關測試協定之指令;一數據暫存單元,連接該系統控制單元,並可紀錄關鍵資料和資訊以檢查該儲存裝置儲存資料的正確性,其中該測試裝置是可程式化。 A test device, according to at least one test specification, simulating at least one workload in at least one storage device, and performing at least one test at a specified time, the test device comprising: a system control unit capable of transmitting, receiving, and responding to a test a work load simulation unit connected to the system control unit and capable of performing various workload simulations to be tested on the storage device according to the instruction; a power control unit connected to the system control unit and selectively connecting the storage a device, and performing power-off and power-on of the storage device according to an instruction; a protocol control unit, connecting the system control unit, and selectively connecting the storage device, and transmitting an instruction of a relevant test protocol; a data temporary storage unit, The system control unit is connected, and key data and information can be recorded to check the correctness of the stored data of the storage device, wherein the test device is programmable. 如申請專利範圍第1項所述之測試設備,其中該儲存裝置可以是NVMe之儲存裝置。 The test device of claim 1, wherein the storage device is a storage device of NVMe. 一種測試方法,依至少一測試規範,於至少一儲存裝置,模擬至少一工作負載,並於指定時刻執行至少一測試,該測試方法包括以下步驟:步驟(S101)、使至少一儲存裝置執行至少一模擬工作負載之運行,之後執行步驟(S102); 該步驟(S102)、根據設定令上述儲存裝置進行至少一斷電測試,該斷電測試模式至少包含一指令/流程斷電測試、一裝置初始化斷電測試或一壓力測試,之後執行步驟(S103);該步驟(S103)、令上述儲存裝置重新上電,並檢查該儲存裝置的初始化時間是否正常,如果正常則執行步驟(S104),若不正常則測試失敗;該步驟(S104)、是否滿足指定之指令斷電測試的壓力測試條件,當尚未滿足測試條件,則重新執行該步驟(S102),如果已滿足指定的指令斷電測試條件則繼續執行步驟(S105);該步驟(S105)、比對上述儲存裝置之關鍵數據是否正確,如果正確則執行步驟(S106),若不正常則測試失敗;及該步驟(S106)、檢查上述儲存裝置是否滿足測試條件,若尚未滿足測試條件,則回到執行該步驟(S101)繼續測試,如果滿足條件測試條件,則測試成功並結束測試。 A test method for simulating at least one workload in at least one storage device according to at least one test specification, and performing at least one test at a specified time, the test method comprising the steps of: (S101), causing at least one storage device to perform at least one Simulating the operation of the workload, and then performing the step (S102); In the step (S102), the storage device performs at least one power-off test according to the setting, the power-off test mode includes at least one command/flow power-off test, one device initial power-off test or a stress test, and then the step is performed (S103) The step (S103), re-powering the storage device, and checking whether the initialization time of the storage device is normal, if it is normal, executing the step (S104), if not, the test fails; the step (S104), whether Satisfying the stress test condition of the specified command power-off test, when the test condition has not been met, the step is re-executed (S102), and if the specified command power-off test condition has been met, the step (S105) is continued; the step (S105) Whether the key data of the storage device is correct, if yes, the step (S106) is performed, if not, the test fails; and the step (S106), checking whether the storage device meets the test condition, and if the test condition is not met, Then return to the execution of this step (S101) to continue the test, if the conditional test condition is met, the test is successful and the test is ended. 如申請專利範圍第3項所述之測試方法,其中該指令/流程斷電測試可以是一個指令斷電測試、或由至少一個指令斷電測試所組成的流程斷電測試。 The test method of claim 3, wherein the command/process power-off test can be an instruction power-off test or a process power-off test consisting of at least one command power-off test. 如申請專利範圍第3或4項所述之測試方法,其中該測試模式可以是重覆執行指令/流程斷電測試或裝置初始化斷電測試之壓力測試。 The test method of claim 3 or 4, wherein the test mode may be a stress test of repeatedly executing the instruction/flow power failure test or the device initial power failure test. 如申請專利範圍第3項所述之測試方法,其中該步驟(S102)中,於斷電後,有機率觸發初始化斷電測試模組,並根據 初始化斷電的壓力測試條件,決定是否連續斷上電,若未進入初始化斷電測試,則繼續執行該步驟(S103)的正常上電流程。 The test method of claim 3, wherein in the step (S102), after the power is cut off, the organic rate triggers the initial power-off test module, and according to Initialize the power failure test condition to determine whether to continuously power off. If the initial power failure test is not entered, continue the normal power-on process of this step (S103). 如申請專利範圍第3項所述之測試方法,其中該儲存裝置可以是NVMe之儲存裝置。 The test method of claim 3, wherein the storage device is a storage device of NVMe.
TW108104804A 2019-02-13 2019-02-13 Unusual power-off test method and device for storage device TWI670721B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108104804A TWI670721B (en) 2019-02-13 2019-02-13 Unusual power-off test method and device for storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108104804A TWI670721B (en) 2019-02-13 2019-02-13 Unusual power-off test method and device for storage device

Publications (2)

Publication Number Publication Date
TWI670721B true TWI670721B (en) 2019-09-01
TW202030739A TW202030739A (en) 2020-08-16

Family

ID=68619199

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108104804A TWI670721B (en) 2019-02-13 2019-02-13 Unusual power-off test method and device for storage device

Country Status (1)

Country Link
TW (1) TWI670721B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8676560B2 (en) * 2008-06-09 2014-03-18 International Business Machines Corporation Simulation method, system and program for simulating physical unit controlled by electronic control unit
TW201738758A (en) * 2013-12-21 2017-11-01 英特爾股份有限公司 Instructions and logic to provide base register swap status verification functionality
TW201741872A (en) * 2016-04-02 2017-12-01 英特爾股份有限公司 Processors, methods, and systems to allocate load and store buffers based on instruction type
TW201839713A (en) * 2017-04-24 2018-11-01 美商英特爾股份有限公司 Compute optimization mechanism

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8676560B2 (en) * 2008-06-09 2014-03-18 International Business Machines Corporation Simulation method, system and program for simulating physical unit controlled by electronic control unit
TW201738758A (en) * 2013-12-21 2017-11-01 英特爾股份有限公司 Instructions and logic to provide base register swap status verification functionality
TW201741872A (en) * 2016-04-02 2017-12-01 英特爾股份有限公司 Processors, methods, and systems to allocate load and store buffers based on instruction type
TW201839713A (en) * 2017-04-24 2018-11-01 美商英特爾股份有限公司 Compute optimization mechanism

Also Published As

Publication number Publication date
TW202030739A (en) 2020-08-16

Similar Documents

Publication Publication Date Title
KR102259249B1 (en) Method for read latency bound in ssd storage systems
US9378846B2 (en) Non-mounted storage test device based on FPGA
KR101561854B1 (en) Non-mounted storage test device based on fpga
TWI479309B (en) Apparatus and method for controlling a solid state disk
US10235278B2 (en) Software testing using statistical error injection
CN113778822B (en) Error correction capability test method and device, readable storage medium and electronic equipment
CN109684150B (en) Performance test system, test method and simulation platform of storage particle controller
US9037910B2 (en) SAS self-test operations
US11205496B2 (en) Apparatus and method for testing storage device in power interruptions
CN101883019A (en) Test method for verifying video application of storage server
US9449176B1 (en) Computer system vulnerability analysis apparatus and method
TWI670721B (en) Unusual power-off test method and device for storage device
US10445218B2 (en) Execution of graphic workloads on a simulated hardware environment
US9442831B1 (en) Automated testing of program code for processing a simple boot flag data structure
US11763913B2 (en) Automated testing of functionality of multiple NVRAM cards
CN111581035A (en) Abnormal power-off test method and equipment for storage device
US20130054218A1 (en) Method and Software Tool for Automatically Testing a Circuit Design
TWI715162B (en) Memory verifying method and memory verifying system
KR101300443B1 (en) Flash memory device capable of verifying reliability using bypass path, and system and method of verifying reliability using that device
TWI398656B (en) Device for use in inspecting a cpu and method thereof
US20170108546A1 (en) Testing electronic devices
TWI793774B (en) Method and apparatus and computer program product for debugging solid state disk devices
TWI793759B (en) System and method for testing read/write and upgrading on hard disk
US20240012651A1 (en) Enhanced service operating system capabilities through embedded controller system health state tracking
CN114333960A (en) Flash memory physical layer test method and flash memory device