Test method of storage device, electronic device and storage medium
By storing historical test data in the shared space of the storage device, the problem of repeated test data caused by switching of storage units is solved, the accumulation and merging of test data is realized, the difficulty of planning and storage of memory space is reduced, and the testing efficiency is improved.
Patent Information
- Application Number
- CN202410184324.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-18
- Publication Date
- 2025-08-19
AI Technical Summary
The test data is repeated due to switching of storage units in the storage device, and the amount of data is huge, which is inconvenient for memory space planning and storage.
By storing historical test data in the shared space of the storage device, avoiding the output of test data during the test process, the accumulation and merging of test data is realized, and the shared space is used as a transit station to circumvent the encryption step of the test software.
It reduces the amount of duplicate data of the test data, reduces the difficulty of planning and storage of memory space, and improves testing efficiency.
Smart Images

Figure CN120508457A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a storage device testing method, electronic device, and storage medium. Background Art
[0002] In storage devices, in order to solve the problem of insufficient memory capacity, static memory is usually divided into multiple different storage units (called banks, overlays, etc.), allowing programs to switch from one storage unit to another while running.
[0003] Although the division of storage units solves the problem of insufficient memory capacity, it also brings great difficulties to the testing of storage devices. Because the storage devices are running, the storage units are constantly switching. To ensure the accuracy and completeness of the test data, the test data of the previous storage unit must be output before each storage unit switch. Since the test software defaults to encrypted data output, the data cannot be accumulated and merged.
[0004] This results in a lot of duplicate data, huge data volume, and inconvenience in memory space planning and storage. Summary of the Invention
[0005] The main technical problem solved by this application is to provide a storage device testing method, electronic device and storage medium to solve the problem that when testing the storage device, the test data of each storage unit has a lot of duplicate data, the data volume is huge, and it is inconvenient for memory space planning and storage.
[0006] In order to solve the above problems, the present application provides a testing method for a storage device, including determining whether historical test data of the current storage unit is stored in the shared space of the storage device; if historical test data of the current storage unit is stored, obtaining the historical test data, and when testing the current storage unit of the storage device, adding the current test data of the current storage unit to the historical test data to obtain total test data of the current storage unit; storing the total test data of the current storage unit in the shared space of the storage device; and obtaining test data of the storage device based on the total test data of each storage unit in the shared space.
[0007] Among them, the step of judging whether the historical test data of the current storage unit is stored in the shared space of the storage device includes: dividing the memory space of the storage device to obtain multiple storage units; and dividing the shared associated space corresponding to each storage unit in the shared space of the storage device; the step of judging whether the historical test data of the current storage unit is stored in the shared space of the storage device includes: judging whether the historical test data of the current storage unit is stored in the shared associated space corresponding to the current storage unit in the shared space of the storage device; the step of obtaining the historical test data includes: obtaining the historical test data of the current storage unit from the shared associated space corresponding to the current storage unit; the step of storing the total test data of the current storage unit in the shared space of the storage device includes: moving the total test data of the current storage unit into the corresponding shared associated space in the shared space.
[0008] Among them, the step of dividing the memory space of the storage device to obtain multiple storage units includes: dividing the memory space of the storage device to obtain multiple storage units and the memory associated space corresponding to each storage unit; obtaining historical test data, and when testing the current storage unit of the storage device, accumulating the current test data of the current storage unit on the historical test data to obtain the total test data of the current storage unit includes: moving the historical test data in the shared associated space corresponding to the current storage unit to the memory associated space corresponding to the current storage unit; testing the current storage unit of the storage device to obtain the current test data of the current storage unit; accumulating the current test data of the current storage unit on the historical test data in the memory associated space corresponding to the current storage unit to obtain the total test data.
[0009] Among them, before the step of determining whether the shared space of the storage device stores historical test data of the current storage unit, the step also includes: dividing the memory space of the storage device to obtain a public associated space corresponding to the public unit; and dividing the shared address space and test list space corresponding to the public unit in the shared space of the storage device; when testing the current storage unit of the storage device, accumulating the current test data of the current storage unit on the historical test data to obtain the total test data of the current storage unit, the step also includes: storing the memory address of the total test data of the current storage unit in the public associated space corresponding to the public unit, and updating the memory address list in the test list space based on the memory address of the total test data of the current storage unit; based on the total test data of each storage unit in the shared space, the step of obtaining the test data of the storage device includes: storing the memory address of the total test data of each storage unit in the public associated space corresponding to the public unit into the corresponding shared address space in the shared space; based on the total test data in the corresponding multiple shared associated spaces in the shared space, the memory address in the shared address space and the memory address list in the test list space, the test data of the storage device is obtained.
[0010] The step of obtaining the test data of the storage device based on the total test data of each storage unit in the shared space further includes: storing the test data of the storage device in a target storage page of the storage device.
[0011] Among them, the step of obtaining the test data of the storage device based on the total test data of each storage unit in the shared space also includes: responding to a private call instruction of the test data of the storage device; obtaining a memory address list from the target storage page; based on the memory address list, obtaining the total test data and memory address of each storage unit of the storage device from the target storage page; encrypting and outputting the total test data and memory address of each storage unit to complete the private call.
[0012] Among them, the testing method of the storage device also includes: in response to testing the storage device again, obtaining the test data of the storage device from the target storage page; moving the total test data of each storage unit in the test data of the storage device, the memory address of the total test data of each storage unit, and the memory address list into the multiple shared associated spaces, shared address space and test list space of the shared space respectively; and storing the memory address of each storage unit in the shared address space in the public associated space corresponding to the public unit.
[0013] Among them, the step of determining whether historical test data of the current storage unit is stored in the shared space of the storage device also includes: if historical test data of the current storage unit is not stored in the shared space, testing the current storage unit of the storage device to obtain current test data of the current storage unit; and using the current test data of the current storage unit as total test data.
[0014] Among them, before obtaining the test data of the storage device based on the total test data of each storage unit in the shared space, it also includes: taking the next storage unit to be tested as the new current storage unit, and re-executing the step of determining whether the historical test data of the current storage unit is stored in the shared space of the storage device and subsequent steps until the multiple storage units of the storage device are tested.
[0015] To solve the above technical problems, the present invention further provides an electronic device, comprising a memory and a processor coupled to each other, wherein the processor is configured to execute program instructions stored in the memory to implement any of the above storage device testing methods.
[0016] To solve the above technical problems, the present invention further provides a computer-readable storage medium having program instructions stored thereon, which implements any of the above storage device testing methods when the program instructions are executed by a processor.
[0017] The present invention has the beneficial effect of using the shared space of a storage device as a transfer station to store historical test data from each storage unit, thereby avoiding the output of test data during the test process, thereby circumventing the encryption step of the test software, and enabling the accumulation and merging of test data from the same storage unit during the test process. Furthermore, because test data can be directly accumulated and merged, repeated accumulation of identical test data is avoided, thereby reducing duplication of total test data and the amount of test data, thereby facilitating memory space planning and storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart of an embodiment of a method for testing a storage device of the present application;
[0019] Figure 2 This is a flow chart of another embodiment of the method for testing a storage device of the present application;
[0020] Figure 3 is a schematic diagram of the division of a related storage space of a storage device in an implementation manner;
[0021] Figure 4 is a schematic diagram of an implementation method for obtaining historical test data;
[0022] Figure 5 is a schematic diagram of an implementation method for moving total test data;
[0023] Figure 6 is a schematic diagram of an implementation method of storing test data of a storage device into a target storage page;
[0024] Figure 7 is a schematic diagram of an implementation method for restoring test data of a storage device;
[0025] Figure 8 This is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0026] Figure 9 This is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0027] The following describes the embodiments of the present application in detail with reference to the accompanying drawings.
[0028] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0029] The terms "system" and "network" are often used interchangeably in this document. The term "and / or" is simply a description of an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " generally indicates that the related objects are in an "or" relationship. Furthermore, "multiple" in this document refers to two or more than two.
[0030] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for testing a storage device of the present application. The method for testing a storage device in this embodiment specifically includes the following steps:
[0031] Step S11: determining whether the shared space of the storage device stores historical test data of the current storage unit.
[0032] Storage devices may include, but are not limited to, hard disks, solid-state drives, mobile hard disks, USB flash drives, memory cards, non-volatile memories (NAND FLASH), optical disks, and cloud storage.
[0033] The memory device includes a plurality of memory cells (banks). The test of the memory device in this embodiment is essentially a test of each memory cell in the memory device in sequence. The current memory cell is the memory cell currently being tested.
[0034] The shared space is the DMA Buff of the storage device. The DMA Buff is a buffer space that allows multiple parties to share.
[0035] The test of the storage device in this embodiment may include but is not limited to various tests performed by the firmware on each storage unit of the storage device, such as coverage test, reliability test or capacity test.
[0036] Before testing the current storage unit of the storage device, it is first determined whether historical test data for the current storage unit is stored in the shared space of the storage device. During testing, the firmware may switch storage units multiple times, and a storage unit may be tested multiple times. In this embodiment, the current test data of the tested storage unit is stored in the shared space of the storage device. Therefore, when testing the current storage unit, it is first determined whether the storage unit has been tested before. If historical test data exists in the shared space of the storage device, it indicates that the storage unit has been tested before. If not, it indicates that the storage unit has not been tested before.
[0037] Step S12: If historical test data of the current storage unit is stored, obtain the historical test data, and when testing the current storage unit of the storage device, add the current test data of the current storage unit to the historical test data to obtain total test data of the current storage unit.
[0038] Because historical test data is stored in the shared space of the storage device and does not involve data output from the storage device, it is not encrypted by the test software. Therefore, historical test data is the original test data. Accumulating the current test data of the current storage unit on the original historical test data can simply achieve test data accumulation and merging.
[0039] Specifically, this embodiment uses the shared space of the storage device as a transfer station to store historical test data from each storage unit. This prevents test data from being output during the test process, thereby circumventing the encryption steps of the test software and enabling the accumulation and merging of test data. Furthermore, because test data can be directly accumulated and merged, repeated accumulation of identical test data is avoided, thereby reducing duplicate data in the total test data and reducing the test data volume, facilitating memory space planning and storage.
[0040] Step S13: storing the total test data of the current storage unit into the shared space of the storage device.
[0041] After the test of the current storage unit is completed, the total test data of the current storage unit is stored in the shared space of the storage device. The stored total test data is the new historical test data of the corresponding storage unit.
[0042] Step S14: obtaining test data of the storage device based on the total test data of each storage unit in the shared space.
[0043] The total test data of each storage unit in the shared space is aggregated to obtain the test data of the storage device.
[0044] After obtaining the test data of the storage device, the data output of the test data of the storage device can be determined based on actual needs.
[0045] Through the above steps, the storage device testing method of this embodiment determines whether the shared space of the storage device stores historical test data of the current storage unit; if the historical test data of the current storage unit is stored, the historical test data is obtained, and when testing the current storage unit of the storage device, the current test data of the current storage unit is accumulated on the historical test data to obtain the total test data of the current storage unit; the total test data of the current storage unit is stored in the shared space of the storage device; the next storage unit to be tested is used as the new current storage unit, and the step of determining whether the shared space of the storage device stores historical test data of the current storage unit and subsequent steps are performed again until multiple storage units of the storage device are tested; based on the total test data of each storage unit in the shared space, the test data of the storage device is obtained, so that the shared space of the storage device is used as a transfer station to store the historical test data of each storage unit, thereby avoiding the output of test data during the test process, thereby circumventing the encryption step of the test software, and realizing the accumulation and merging of test data of the same storage unit during the test process. Moreover, since the test data can be directly accumulated and merged, the repeated accumulation of the same test data is avoided, thereby reducing the duplication of the total test data and reducing the amount of test data, which facilitates memory space planning and storage.
[0046] In some embodiments, before step S14, it also includes: taking the next storage unit to be tested as the new current storage unit, and again executing the step of determining whether the shared space of the storage device stores historical test data of the current storage unit and subsequent steps until multiple storage units of the storage device are tested.
[0047] Based on steps S11 to S13 , multiple storage units of the storage device that need to be tested are iteratively tested in sequence until all the storage units of the storage device are tested.
[0048] In a specific application scenario, if the storage device needs to test multiple storage units including a first storage unit, a second storage unit, a third storage unit...a tenth storage unit, the first storage unit is first tested based on steps S11-S13 to obtain the corresponding total test data; then the second storage unit is tested based on steps S11-S13 to obtain the corresponding total test data, and so on, until the tenth storage unit is tested to obtain the corresponding total test data, thereby completing the test of multiple storage units. In this embodiment, "sequentially" does not mean that each storage unit is tested only once, but rather that multiple storage units are tested individually in sequence based on an actual order. The number of times each storage unit is tested during the test process of the storage device is not limited and is determined based on actual conditions.
[0049] The storage units to be tested in the storage device may be selected arbitrarily, for example, all storage units in the storage device may be tested sequentially in the order in which they are arranged, or may be tested based on manual selection, etc., which is not limited here.
[0050] See also Figure 2 , Figure 2 1 is a flow chart of an embodiment of a method for testing a storage device of the present application. The method for testing a storage device in this embodiment specifically includes the following steps:
[0051] Step S21: dividing the memory space of the storage device to obtain a plurality of storage units; and dividing the shared space of the storage device to obtain a shared associated space corresponding to each storage unit.
[0052] Before testing a storage device, the relevant storage space of the storage device is partitioned. In a specific application scenario, the partitioning steps may include: partitioning the memory space of the storage device to obtain multiple storage units (banks); and partitioning the shared space of the storage device to obtain a shared associated space (DMAbuff bank Xcov) corresponding to each storage unit. Each shared associated space within the shared space is used to store historical test data for the corresponding storage unit.
[0053] The memory space is the RAM (random access memory) memory space of the storage device. The shared space is the DMA Buff of the storage device. The DMA Buff is a buffer space that allows multiple parties to share.
[0054] In a specific application scenario, the partitioning step may also include: partitioning the memory space of the storage device to obtain multiple storage units (banks) and a memory associated space (RAM bank Xcov) corresponding to each storage unit; and partitioning the shared space of the storage device to obtain a shared associated space (DMA buff bank Xcov) corresponding to each storage unit. Each memory associated space is used to store current test data of the corresponding storage unit in real time during the test process.
[0055] In a specific application scenario, the division step can also be: dividing the memory space of the storage device to obtain multiple storage units (banks), memory associated spaces (RAM bank Xcov) corresponding to each storage unit, common units (RAMCommon), and common associated spaces (RAM Common Xcov) corresponding to the common units; and dividing the shared space of the storage device to obtain shared associated spaces (DMA buff bank Xcov) corresponding to each storage unit, shared address spaces (DMA buff Common Xcov) corresponding to the common units, and test list spaces (CovFilelist). The common unit (RAMCommon) refers to a common storage area used to transfer data between independent program units. In this embodiment, the common associated space corresponding to the common unit is used to store the memory address of the total test data of each storage unit, so as to obtain the corresponding complete test data based on the memory address. The test list space (CovFilelist) is used to generate a directory list of each memory address, so as to obtain the memory addresses of all storage units.
[0056] The division of the relevant storage space of the storage device in this step is specifically set based on actual needs and is not limited here.
[0057] See also Figure 3 , Figure 3 It is a schematic diagram of the division of the relevant storage space of the storage device in one embodiment.
[0058] In this embodiment, after being divided, memory space 35 includes storage units 33, memory association space 34, public units 31, and public association space 32. Public units 31 and public association space 32 have a corresponding relationship. Storage units 33 and memory association space 34 have a corresponding relationship. Storage units 33 may include multiple units, such as a first storage unit, a second storage unit, etc., and memory association space 34 may include multiple spaces, such as a first memory association space, a second memory association space, etc., wherein a first storage unit corresponds to a first memory association space; a second storage unit corresponds to a second memory association space, and so on.
[0059] After being divided, shared space 39 includes a shared address space 36, a test list space 38, and a shared association space 37. There are multiple shared association spaces 37, such as a first shared association space, a second shared association space, and so on. Shared association space 37 corresponds to storage unit 33, and since storage unit 33 corresponds to memory association space 34, shared association space 37 also corresponds to memory association space 34. For example, the first shared association space corresponds to the first storage unit and the first memory association space, respectively; the second shared association space corresponds to the second storage unit and the second memory association space, respectively; and so on.
[0060] Among them, this step is the division done in advance before the test. It only needs to be completed before the test, and there is no need to divide it separately for each test.
[0061] Step S22: determining whether the shared associated space corresponding to the current storage unit in the shared space of the storage device stores historical test data of the current storage unit.
[0062] After the test begins, each storage unit of the storage device will be tested. The test of each storage unit begins by first determining whether there is corresponding historical test data.
[0063] Specifically, it is determined whether the shared associated space corresponding to the current storage unit in the shared space of the storage device stores historical test data of the current storage unit.
[0064] In a specific application scenario, if the current storage unit is the first storage unit, it is determined whether the historical test data corresponding to the first storage unit exists in the first shared association space. Since each shared association space has a corresponding relationship with each storage unit, the historical test data of the storage unit will only be stored in the corresponding shared association space.
[0065] Step S23: If the historical test data of the current storage unit is stored, the historical test data of the current storage unit is obtained from the shared association space corresponding to the current storage unit.
[0066] If the shared associated space corresponding to the current storage unit in the shared space stores historical test data of the current storage unit, the historical test data of the current storage unit is acquired from the shared associated space corresponding to the current storage unit.
[0067] In a specific application scenario, the historical test data in the shared association space corresponding to the current storage unit can be moved to the memory association space corresponding to the current storage unit, so that the corresponding memory association space obtains the historical test data of the current storage unit.
[0068] Since the current test data during the test will be saved in the corresponding memory association space in real time, the historical test data is moved to the corresponding memory association space so that the test data can be directly accumulated and merged in the memory association space.
[0069] See also Figure 4 , Figure 4 It is a schematic diagram of an implementation method for obtaining historical test data.
[0070] In a specific application scenario, if the current storage unit is the first storage unit 41, and it is determined that the first shared association space 42 contains historical test data corresponding to the first storage unit 41, the historical test data in the first shared association space 42 is moved back to the first memory association space 43. After the historical test data in the first shared association space 42 is moved, the first shared association space 42 is cleared to avoid duplicate storage of subsequent test data.
[0071] Step S24: when testing the current storage unit of the storage device, the current test data of the current storage unit is added to the historical test data to obtain the total test data of the current storage unit.
[0072] The current storage unit of the storage device is tested to obtain current test data of the current storage unit; in the memory association space corresponding to the current storage unit, the current test data of the current storage unit is accumulated on the historical test data to obtain total test data.
[0073] In a specific application scenario, the current storage unit of the storage device is tested, and the current test data of the current storage unit is saved in real time in the corresponding memory-associated space. In the memory-associated space corresponding to the current storage unit, the current test data of the current storage unit is accumulated on the historical test data to obtain the total test data.
[0074] In a specific application scenario, if the current storage unit is the first storage unit, the first storage unit is tested, and the current test data of the first storage unit is saved in real time in the corresponding first memory associated space, and in the first memory associated space, the current test data of the current storage unit is accumulated on the historical test data to obtain the total test data of the first storage unit.
[0075] In a specific application scenario, each byte of test data represents a judgment point for test data insertion. When the firmware runs through this judgment point, the current BYTE changes from 0 to 1, and this process is one-way. Each BYTE will not change from 1 to 0, that is, the data saved in the shared association space is the current most complete historical test data; during testing, the original historical test data saved in the shared association space is moved back to the memory association space corresponding to the current storage unit to achieve accurate accumulation of test data.
[0076] In other embodiments, if the shared space does not store historical test data of the current storage unit, it means that the current storage unit is tested for the first time and there is no historical test data. In this case, the current storage unit of the storage device is tested to obtain the current test data of the current storage unit; the current test data of the current storage unit can be used as the total test data.
[0077] In a specific application scenario, after obtaining the total test data of the current storage unit, the memory address of the total test data of the current storage unit is also stored in the public association space corresponding to the public unit, and the memory address list in the test list space is updated based on the memory address of the total test data of the current storage unit, so that the test data can be addressed based on the memory address later. Among them, when updating the memory address list, there is a problem that the same .c file memory address is recorded multiple times. In order to improve data encryption efficiency, duplicate data in the memory address list can be eliminated to avoid data duplication and redundancy.
[0078] Step S25: Move the total test data of the current storage unit into the corresponding shared associated space in the shared space.
[0079] Move the total test data of the current storage unit into the corresponding shared associated space in the shared space. After the move, the total test data in the corresponding memory associated space is cleared to avoid repeated accumulation of subsequent test data.
[0080] See also Figure 5 , Figure 5 It is a schematic diagram of an implementation method of moving total test data.
[0081] In a specific application scenario, if the first storage unit 51 is the current storage unit, after the test is completed, the total test data of the first storage unit 51 in the first memory association space 53 is moved into the first shared association space 52, and the test data in the first memory association space 53 is cleared.
[0082] The improvement of storing the test data in the shared space in this embodiment does not require corresponding modifications to the compiler and linker, and can be directly stored, thereby reducing the requirements for testers and improving the portability of the test method of the storage device.
[0083] Step S26: The next storage unit to be tested is used as the new current storage unit, and the step of determining whether the shared space of the storage device stores historical test data of the current storage unit and subsequent steps are executed again until multiple storage units of the storage device are tested.
[0084] The next storage unit to be tested is used as a new current storage unit, and steps S22 to S26 are performed again until all storage units of the storage device are tested.
[0085] Step S27: Based on the total test data of each storage unit in the shared space, the test data of the storage device is obtained.
[0086] After the test of the entire storage device is completed, the storage device enters hibernation. Before hibernation, the test data of the storage device is obtained based on the total test data of each storage unit in the shared space.
[0087] Specifically, the memory addresses of the total test data of each storage unit in the public association space corresponding to the public unit in the memory space are stored in the corresponding shared address space in the shared space; based on the total test data in the corresponding multiple shared association spaces in the shared space, the memory addresses in the shared address space and the memory address list in the test list space, the test data of the storage device is obtained.
[0088] Step S28: storing the test data of the storage device into the target storage page of the storage device.
[0089] The target storage page is a page in the flash of the storage device, which can be specified based on actual conditions. The storage capacity of each page is generally 16k, and after actual measurement, the test data of the storage device of this embodiment is less than 16K, so the test data of the entire storage device can be stored through the target storage page. That is, the total test data in the corresponding multiple shared associated spaces in the shared space, the memory addresses in the shared address space, and the memory address list in the test list space are stored in the target storage page of the storage device. The test data of the storage device of this embodiment can be completely stored by the target storage page, so that the test of the entire storage device does not need to be divided into multiple batches, which reduces the number of repeated tests, improves test efficiency, and saves manpower and material resources.
[0090] See also Figure 6 , Figure 6 The present invention is a schematic diagram of an implementation method of storing test data of a storage device into a target storage page.
[0091] Specifically, the total test data in the corresponding multiple shared association spaces 63 in the shared space 65 , the memory addresses in the shared address space 62 , and the memory address list in the test list space 64 are stored in the first storage page 61 .
[0092] After the test data of the storage device is stored in the target storage page of the storage device, the shared space is cleared so that other sharing operations can be performed after the shared space is freed.
[0093] In a specific application scenario, after a storage device goes into hibernation, in response to testing the storage device again, test data for the storage device is retrieved from a target storage page; the total test data for each storage unit, the memory address of the total test data for each storage unit, and the memory address list in the test data of the storage device are moved to corresponding multiple shared association spaces, a shared address space, and a test list space in the shared space; and the memory address of each storage unit in the shared address space is stored in the public association space corresponding to the public unit. After completing the above operations, the determination step of retesting can begin.
[0094] See also Figure 7 , Figure 7 It is a schematic diagram of an implementation method of restoring test data of a storage device.
[0095] In this embodiment, in response to testing the storage device again, the test data of the storage device is obtained from the first storage page 71; the total test data of each storage unit in the test data of the storage device is moved into the corresponding multiple shared associated spaces 72 in the shared space, the memory address of the total test data of each storage unit in the test data of the storage device is moved into the shared address space 73 in the shared space, and the memory address list in the test data of the storage device is moved into the test list space 74; finally, the memory address of each storage unit in the shared address space 73 is stored in the public associated space 75 corresponding to the public unit, completing the preparation work before retesting.
[0096] By restoring the test data of the storage device to the shared space, the test data of the retest can be accumulated on the basis of the test data of the current storage device. The steps of the retest are the same as those of the present embodiment and will not be described in detail.
[0097] In a specific application scenario, after the test is completed, in response to receiving a private call instruction (0XD3) for test data from the storage device, a memory address list is obtained from the target storage page; based on the memory address list, the total test data and memory address of each storage unit of the storage device are obtained from the target storage page; the total test data and memory address of each storage unit are encrypted and output to complete the private call. The encrypted output can be output to an external host for testers to view. Exporting test data through private call instructions can ensure the integrity of the test data while eliminating the need for serial port tools, reducing the complexity of data output and facilitating large-scale application.
[0098] Through the above steps, the test method of the storage device of this embodiment uses the shared space of the storage device as a transfer station to store the historical test data of each storage unit, thereby avoiding the output of test data during the test process, and thus circumventing the encryption step of the test software, and realizing the accumulation and merging of test data of the same storage unit during the test process. And because the test data can be directly accumulated and merged, the repeated accumulation of the same test data is avoided, thereby reducing the duplication of the total test data and reducing the amount of test data to facilitate memory space planning and storage. And the improvement of storing the test data in the shared space does not require corresponding modifications to the compiler and linker, and can be directly stored, thereby reducing the requirements for testers and improving the portability of the test method of the storage device. The test data of the storage device of the present application can be completely stored by the target storage page, so that the test of the entire storage device does not need to be divided into multiple batches, reducing the number of repeated tests, improving test efficiency, and saving manpower and material resources.
[0099] See also Figure 8 , Figure 8 8 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. Electronic device 800 includes a memory 801 and a processor 802 coupled to each other. Processor 802 is configured to execute program instructions stored in memory 801 to implement the steps of the above-described method embodiment. In a specific implementation scenario, electronic device 800 may include, but is not limited to, a microcomputer and a server. Furthermore, electronic device 800 may also include a laptop, a tablet computer, a Nand Flash, etc., without limitation herein.
[0100] Specifically, the processor 802 is used to control itself and the memory 801 to implement the steps of any of the above method embodiments. The processor 802 can also be called a CPU (Central Processing Unit). The processor 802 may be an integrated circuit chip with signal processing capabilities. The processor 802 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 802 can be implemented by an integrated circuit chip.
[0101] The above solution can realize the accumulation and merging of test data of the same storage unit during the test process, avoid repeated accumulation of the same test data, and thus reduce the duplication of total test data and the amount of test data for memory space planning and storage.
[0102] See also Figure 9 , Figure 9 This is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 900 stores program instructions 901 that can be executed by a processor, and the program instructions 901 are used to implement the steps of any of the above method embodiments.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0104] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0105] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0107] The above description is only an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for testing a storage device, characterized in that: The storage device testing method includes: Determine whether the shared space of the storage device stores historical test data of the current storage unit; If historical test data of the current storage unit is stored, obtaining the historical test data, and when testing the current storage unit of the storage device, adding the current test data of the current storage unit to the historical test data to obtain total test data of the current storage unit; storing the total test data of the current storage unit into the shared space of the storage device; The test data of the storage device is obtained based on the total test data of each storage unit in the shared space.
2. The storage device testing method according to claim 1, wherein: The step of determining whether the shared space of the storage device stores historical test data of the current storage unit includes: Dividing the memory space of the storage device to obtain a plurality of storage units; and dividing the shared space of the storage device to obtain a shared associated space corresponding to each of the storage units; The step of determining whether the shared space of the storage device stores historical test data of the current storage unit includes: Determining whether historical test data of the current storage unit is stored in the shared associated space corresponding to the current storage unit in the shared space of the storage device; The step of obtaining the historical test data includes: Acquire historical test data of the current storage unit from the shared association space corresponding to the current storage unit; The step of storing the total test data of the current storage unit into the shared space of the storage device comprises: The total test data of the current storage unit is moved into the corresponding shared associated space in the shared space.
3. The storage device testing method according to claim 2, wherein: The step of dividing the memory space of the storage device into a plurality of storage units includes: Dividing the memory space of the storage device into a plurality of storage units and a memory associated space corresponding to each storage unit; The step of acquiring the historical test data and, when testing the current storage unit of the storage device, accumulating the current test data of the current storage unit onto the historical test data to obtain the total test data of the current storage unit includes: Moving the historical test data in the shared association space corresponding to the current storage unit to the memory association space corresponding to the current storage unit; Testing a current storage unit of a storage device to obtain current test data of the current storage unit; In the memory association space corresponding to the current storage unit, the current test data of the current storage unit is accumulated on the historical test data to obtain the total test data.
4. The storage device testing method according to claim 2 or 3, characterized in that: Before the step of determining whether the shared space of the storage device stores historical test data of the current storage unit, the following steps are also included: Dividing the memory space of the storage device to obtain a public association space corresponding to the public unit; and dividing the shared space of the storage device to obtain a shared address space and a test list space corresponding to the public unit; When testing the current storage unit of the storage device, the step of accumulating the current test data of the current storage unit onto the historical test data to obtain the total test data of the current storage unit further includes: Storing the memory address of the total test data of the current storage unit in the public association space corresponding to the public unit, and updating the memory address list in the test list space based on the memory address of the total test data of the current storage unit; The step of obtaining the test data of the storage device based on the total test data of each storage unit in the shared space includes: Storing the memory addresses of the total test data of each of the storage units in the public associated space in the memory space into the corresponding shared address space in the shared space; The test data of the storage device is obtained based on the total test data in the corresponding multiple shared association spaces in the shared space, the memory addresses in the shared address space, and the memory address list in the test list space.
5. The storage device testing method according to claim 4, wherein: The step of obtaining the test data of the storage device based on the total test data of each storage unit in the shared space further includes: The test data of the storage device is stored in a target storage page of the storage device.
6. The storage device testing method according to claim 5, wherein: After the step of obtaining the test data of the storage device based on the total test data of each storage unit in the shared space, the step further includes: In response to receiving a private call instruction of test data of the storage device; Obtain the memory address list from the target storage page; Based on the memory address list, obtaining total test data and memory addresses of each storage unit of the storage device from the target storage page; The total test data of each storage unit and the memory address are encrypted and output to complete the private call.
7. The storage device testing method according to claim 5, wherein: The storage device testing method further includes: In response to testing the storage device again, acquiring test data of the storage device from the target storage page; Move the total test data of each storage unit, the memory address of the total test data of each storage unit, and the memory address list in the test data of the storage device into the multiple shared association spaces, the shared address space, and the test list space of the shared space respectively; The memory address of each storage unit in the shared address space is stored in the public association space corresponding to the public unit.
8. The storage device testing method according to claim 1, wherein: The step of determining whether the shared space of the storage device stores historical test data of the current storage unit also includes: If the shared space does not store historical test data of the current storage unit, testing the current storage unit of the storage device to obtain current test data of the current storage unit; The current test data of the current storage unit is used as the total test data.
9. The storage device testing method according to claim 1, wherein: Before obtaining the test data of the storage device based on the total test data of each storage unit in the shared space, the method further includes: The next storage unit to be tested is used as the new current storage unit, and the step of determining whether the shared space of the storage device stores historical test data of the current storage unit and subsequent steps are performed again until multiple storage units of the storage device are tested.
10. An electronic device, characterized in that: The device comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the storage device testing method according to any one of claims 1 to 9.
11. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the storage device testing method according to any one of claims 1 to 9 is implemented.