Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, and a device for testing a storage device, which can simplify a testing process for testing the storage device, avoid testing the storage device automatically in a manual manner, improve testing efficiency, and have high accuracy of a testing result.
According to an aspect of the present invention, there is provided a method of testing a memory device, including:
acquiring equipment information of a storage device; the device information comprises type information of the storage device and capacity information of the storage device;
setting a target for testing the storage equipment according to the acquired equipment information of the storage equipment; wherein, the target of testing the storage device is the disk symbol number of the storage device;
according to the set target for testing the storage equipment, a general software is used for guiding and starting the set testing software and tools, and starting planned testing items and processes;
according to the started planned test items and processes, a main software guides and starts set test software and tools to test the storage equipment, and all control handles in a window of the storage equipment are obtained to obtain a result of testing the storage equipment;
and generating a test report for testing the storage equipment according to the obtained test result of the storage equipment.
Wherein, the acquiring the device information of the storage device includes:
acquiring instance ID and equipment path information of the storage equipment;
acquiring a tree result of the storage equipment to obtain all linked storage equipment and key name information of the storage equipment;
acquiring storage device key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and device path information of the storage device, the obtained key name information of all the linked storage devices and storage devices, the obtained key names and instance ID information of all the storage devices in the registry, and obtaining the real type information of the storage device;
and sending a command prompt of the storage equipment according to the real type information of the storage equipment obtained by comparison, and acquiring the capacity information of the storage equipment.
Wherein, the setting of the target for testing the storage device according to the acquired device information of the storage device includes:
and according to the acquired equipment information of the storage equipment, clicking a selection target button to pop up a corresponding option frame window, acquiring a window handle number by calling a function, thereby acquiring the modes of all buttons and character string display windows in the window, and setting the number of a target, namely a disc character, for testing the storage equipment.
After generating a test report for testing the storage device according to the obtained test result of the storage device, the method further includes:
and automatically repairing the abnormity of the storage equipment prompted in the test report according to the generated test report for testing the storage equipment.
According to another aspect of the present invention, there is provided an apparatus for testing a memory device, including:
the device comprises an acquisition module, a setting module, a starting module, a testing module and a generating module;
the acquisition module is used for acquiring the equipment information of the storage equipment; the device information comprises type information of the storage device and capacity information of the storage device;
the setting module is used for setting a target for testing the storage equipment according to the acquired equipment information of the storage equipment; wherein, the target of testing the storage device is the disk symbol number of the storage device;
the starting module is used for starting the set testing software and tools under the guidance of a general software according to the set target for testing the storage equipment, and starting the planned testing items and processes;
the testing module is used for starting set testing software and tools to test the storage equipment under the guidance of a general software according to the started test items and processes of the plan, and acquiring all control handles in a window of the storage equipment to obtain a result of testing the storage equipment;
and the generating module is used for generating a test report for testing the storage equipment according to the obtained test result of the storage equipment.
The obtaining module is specifically configured to:
acquiring instance ID and equipment path information of the storage equipment;
acquiring a tree result of the storage equipment to obtain all linked storage equipment and key name information of the storage equipment;
acquiring storage device key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and device path information of the storage device, the obtained key name information of all the linked storage devices and storage devices, the obtained key names and instance ID information of all the storage devices in the registry, and obtaining the real type information of the storage device;
and sending a command prompt of the storage equipment according to the real type information of the storage equipment obtained by comparison, and acquiring the capacity information of the storage equipment.
Wherein, the setting module is specifically configured to:
and according to the acquired equipment information of the storage equipment, clicking a selection target button to pop up a corresponding option frame window, acquiring a window handle number by calling a function, thereby acquiring the modes of all buttons and character string display windows in the window, and setting the number of a target, namely a disc character, for testing the storage equipment.
The apparatus for testing a storage device further includes:
and the repairing module is used for automatically repairing the abnormity of the storage equipment prompted in the test report according to the generated test report for testing the storage equipment.
According to still another aspect of the present invention, there is provided an apparatus for testing a memory device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the above methods of testing a storage device.
According to a further aspect of the present invention, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements any of the above-described methods of testing a storage device.
It can be found that, with the above solution, the device information of the storage device can be obtained, wherein the device information includes type information of the storage device, capacity information of the storage device, etc., and the target for testing the storage device can be set according to the obtained device information of the storage device, wherein the target for testing the storage device is the drive letter number of the storage device, and the target for testing the storage device according to the setting can be used for enabling the set testing software and tool by a master software boot, starting the planned testing items and processes, and the testing software and tool set by a master software boot according to the started planned testing items and processes can be used for testing the storage device, obtaining all control handles in the window of the storage device, obtaining the result of testing the storage device, and obtaining the testing result of the storage device according to the obtained result, the test report for testing the storage equipment is generated, the set test software and tools can be started under the guidance of a total software, the planned test items and processes can be started, the corresponding test results for testing the storage equipment can be obtained, the test processes for testing the storage equipment can be simplified, the storage equipment can be automatically tested in a manual mode, the test efficiency is improved, and the test result accuracy is high.
Further, the above solution may obtain the tree result of the storage device, obtain the key name information of all linked storage devices and storage devices, obtain the key name information and instance ID information of all storage devices in the registry, compare the obtained instance ID and device path information of all linked storage devices, the obtained key name information of all linked storage devices and storage devices, the obtained key name information of all storage devices and storage devices in the registry, obtain the type information of the real storage device, and send the command prompt of the storage device according to the obtained type information of the real storage device, and obtain the capacity information of the storage device.
Further, according to the above scheme, according to the obtained device information of the storage device, the user can click and select the target button to pop up the corresponding option frame window, and obtain the window handle by calling the function to obtain the window handle number, so as to obtain the mode of displaying the window by all the buttons and the character strings in the window, and set the target for testing the storage device, i.e. the drive number.
Furthermore, according to the scheme, the abnormity of the storage device prompted in the test report can be automatically repaired according to the generated test report for testing the storage device, so that the abnormity of the storage device can be prevented from being automatically repaired in a manual mode, the labor cost is saved, the factory-leaving period of the storage device is shortened, and the factory-leaving efficiency of the storage device is improved.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be noted that the following examples are only illustrative of the present invention, and do not limit the scope of the present invention. Similarly, the following examples are only some but not all examples of the present invention, and all other examples obtained by those skilled in the art without any inventive work are within the scope of the present invention.
The invention provides a method for testing storage equipment, which can simplify the testing process of testing the storage equipment, avoid the manual mode from automatically testing the storage equipment, improve the testing efficiency and have high accuracy of the testing result.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for testing a memory device according to an embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 1 if the results are substantially the same. As shown in fig. 1, the method comprises the steps of:
s101: acquiring equipment information of a storage device; the device information includes type information of the storage device, capacity information of the storage device, and the like.
The obtaining of the device information of the storage device may include:
acquiring instance ID (instanceID) and device path (DevicePath) information of the storage device;
acquiring a tree result of the storage device to obtain all linked storage devices and key name (DeviceKeyName) information of the storage devices;
acquiring storage device key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and device path information of the storage device, the obtained key name information of all the linked storage devices and storage devices, the obtained key names of all the storage devices in the registry and the instance ID information to obtain the real type information of the storage device;
the advantage of sending the cmd (command indicator) of the storage device according to the type information of the real storage device obtained by the comparison to obtain the capacity information of the storage device is that the type information and the capacity information of the real storage device can be obtained.
S102: setting a target for testing the storage equipment according to the acquired equipment information of the storage equipment; wherein the target of the test of the storage device is the drive letter number of the storage device.
The setting of the target for testing the storage device according to the acquired device information of the storage device may include:
according to the acquired device information of the storage device, clicking a selection target button to pop up a corresponding option box window, acquiring a window handle number by calling a function to acquire the window handle, thereby acquiring the mode of all buttons and character string display windows in the window, and setting the disk symbol number as a target for testing the storage device.
In this embodiment, all the buttons in the window may be "simplified," "English," "select target," "refresh," "all available spaces," "only," "write + verify," "verify," and "cyclic verify," and the present invention is not limited thereto.
In this embodiment, the character string display window may be "web site www", a "target (unselected)" or the like, and the present invention is not limited thereto.
S103: and according to the set target for testing the storage equipment, starting the set testing software and tools by guiding the general software, and starting the planned testing items and processes.
In this embodiment, a dialog box may pop up to perform a folder for the validation test, and the root directory may be specified. Similarly, all list information in the current option box is acquired by acquiring a window handle, when the storage device U disk typeface is acquired, the option can be selected by adopting checkwindows task, a findwindowsEx click button can be called, a confirmation button is clicked, the software can automatically return to the main interface, and at the moment, the target information for testing the storage device is confirmed.
S104: and according to the started planned test items and processes, a general software guides and starts the set test software and tools to test the storage equipment, and obtains all control handles in the window of the storage equipment to obtain the result of testing the storage equipment.
In this embodiment, SendMessage (hwnd, WM _ CLOSE, NULL) may be called to turn off the test software, and the test is ended.
In this embodiment, each test flow may be a thread created independently for testing, a current test thread may be created by clicking a display information sequence number display button once, and tests of all devices are performed by independent threads, which is not limited in the present invention.
In this embodiment, the test progress may be fed back to the designated window of the software interface device in real time, and the current test progress is displayed by corresponding window data or text information, which is not limited in the present invention.
S105: and generating a test report for testing the storage equipment according to the obtained test result of the storage equipment.
After generating a test report for testing the storage device according to the obtained test result of the storage device, the method may further include:
according to the generated test report for testing the storage equipment, the abnormity of the storage equipment prompted in the test report is automatically repaired, so that the abnormity of the storage equipment can be prevented from being automatically repaired in a manual mode, the labor cost is saved, the factory leaving period of the storage equipment is shortened, and the factory leaving efficiency of the storage equipment is improved.
It can be found that, in this embodiment, device information of the storage device may be acquired, where the device information includes type information of the storage device, capacity information of the storage device, and the like, and a target for testing the storage device may be set according to the acquired device information of the storage device, where the target for testing the storage device is a drive letter number of the storage device, and the target for testing the storage device according to the setting may be used, a master software boot enables the set test software and tools, starts a planned test item and flow, and according to the started planned test item and flow, the master software boot enables the set test software and tools to test the storage device, acquires all control handles in a window of the storage device, obtains a result of testing the storage device, and according to the obtained test result of the storage device, the test report for testing the storage equipment is generated, the set test software and tools can be started under the guidance of a total software, the planned test items and processes can be started, the corresponding test results for testing the storage equipment can be obtained, the test processes for testing the storage equipment can be simplified, the storage equipment can be automatically tested in a manual mode, the test efficiency is improved, and the test result accuracy is high.
Further, in this embodiment, it may be possible to obtain a tree result of the storage device, obtain all linked storage devices and storage device key name information, obtain storage device key names and instance ID information of all storage devices in the registry, compare the obtained instance ID and device path information of all storage devices, the obtained storage device and storage device key name information of all linked storage devices, the obtained storage device key names and instance ID information of all storage devices in the registry, obtain type information of the real storage device, and send a command indicator of the storage device according to the obtained type information of the real storage device, to obtain capacity information of the storage device.
Further, in this embodiment, according to the obtained device information of the storage device, a user may click a selection target button to pop up a corresponding option box window, and call a function to obtain a window handle number to obtain a window handle, thereby obtaining a manner of displaying windows of all buttons and character strings in the window, and set a disc character number, which is a target for testing the storage device.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a method for testing a memory device according to another embodiment of the present invention. In this embodiment, the method includes the steps of:
s201: acquiring equipment information of a storage device; the device information includes type information of the storage device, capacity information of the storage device, and the like.
As described above in S101, further description is omitted here.
S202: setting a target for testing the storage equipment according to the acquired equipment information of the storage equipment; wherein the target of the test of the storage device is the drive letter number of the storage device.
As described above in S102, further description is omitted here.
S203: and according to the set target for testing the storage equipment, starting the set testing software and tools by guiding the general software, and starting the planned testing items and processes.
As described above in S103, which is not described herein.
S204: and according to the started planned test items and processes, a general software guides and starts the set test software and tools to test the storage equipment, and obtains all control handles in the window of the storage equipment to obtain the result of testing the storage equipment.
As described above in S104, and will not be described herein.
S205: and generating a test report for testing the storage equipment according to the obtained test result of the storage equipment.
S206: and automatically repairing the abnormity of the storage equipment prompted in the test report according to the generated test report for testing the storage equipment.
It can be found that, in this embodiment, the exception of the storage device prompted in the test report can be automatically repaired according to the generated test report for testing the storage device, which can avoid automatically repairing the exception of the storage device in a manual manner, save labor cost, shorten the period of leaving the factory of the storage device, and improve the efficiency of leaving the factory of the storage device.
The invention also provides a device for testing the storage equipment, which can simplify the testing process of testing the storage equipment, avoid the manual mode from automatically testing the storage equipment, improve the testing efficiency and have high accuracy of the testing result.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an apparatus for testing a memory device according to an embodiment of the present invention. In this embodiment, the apparatus 30 for testing a storage device includes an obtaining module 31, a setting module 32, an opening module 33, a testing module 34, and a generating module 35.
The obtaining module 31 is configured to obtain device information of the storage device; the device information includes type information of the storage device, capacity information of the storage device, and the like.
The setting module 32 is configured to set a target for testing the storage device according to the acquired device information of the storage device; wherein the target of the test of the storage device is the drive letter number of the storage device.
The starting module 33 is configured to start the set testing software and tools under the guidance of a general software according to the set target for testing the storage device, and start the planned testing items and processes.
The test module 34 is configured to boot, by a general software, the set test software and tool to test the storage device according to the started test items and flow of the plan, and obtain all control handles in the window of the storage device to obtain a result of testing the storage device.
The generating module 35 is configured to generate a test report for testing the storage device according to the obtained test result of the storage device.
Optionally, the obtaining module 31 may be specifically configured to:
acquiring instance ID and equipment path information of the storage equipment;
acquiring a tree result of the storage equipment to obtain all linked storage equipment and key name information of the storage equipment;
acquiring storage device key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and device path information of the storage device, the obtained key name information of all the linked storage devices and storage devices, the obtained key names of all the storage devices in the registry and the instance ID information to obtain the real type information of the storage device;
and sending a command prompt of the storage equipment according to the real type information of the storage equipment obtained by the comparison, and acquiring the capacity information of the storage equipment.
Optionally, the setting module 32 may be specifically configured to:
and according to the acquired equipment information of the storage equipment, clicking a selection target button to pop up a corresponding option frame window, acquiring a window handle number by calling a function, thereby acquiring the modes of all buttons and character string display windows in the window, and setting the number of a target, namely a disc character, for testing the storage equipment.
Referring to fig. 4, fig. 4 is a schematic structural diagram of another embodiment of an apparatus for testing a memory device according to the present invention. Different from the previous embodiment, the apparatus 40 for testing a storage device according to the present embodiment further includes a repair module 41.
The repair module 41 is configured to automatically repair the abnormality of the storage device, which is prompted in the test report, according to the generated test report for testing the storage device.
Each unit module of the apparatus 30/40 for testing a storage device can respectively perform the corresponding steps in the above method embodiments, and therefore, the description of each unit module is omitted here, and please refer to the description of the corresponding steps above in detail.
The present invention further provides a device for testing a memory device, as shown in fig. 5, including: at least one processor 51; and a memory 52 communicatively coupled to the at least one processor 51; the memory 52 stores instructions executable by the at least one processor 51, and the instructions are executed by the at least one processor 51 to enable the at least one processor 51 to perform the method for testing a storage device.
Wherein the memory 52 and the processor 51 are coupled in a bus, which may comprise any number of interconnected buses and bridges, which couple one or more of the various circuits of the processor 51 and the memory 52 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 51 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 51.
The processor 51 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory 52 may be used to store data used by the processor 51 in performing operations.
The present invention further provides a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
It can be found that, with the above solution, the device information of the storage device can be obtained, wherein the device information includes type information of the storage device, capacity information of the storage device, etc., and the target for testing the storage device can be set according to the obtained device information of the storage device, wherein the target for testing the storage device is the drive letter number of the storage device, and the target for testing the storage device according to the setting can be used for enabling the set testing software and tool by a master software boot, starting the planned testing items and processes, and the testing software and tool set by a master software boot according to the started planned testing items and processes can be used for testing the storage device, obtaining all control handles in the window of the storage device, obtaining the result of testing the storage device, and obtaining the testing result of the storage device according to the obtained result, the test report for testing the storage equipment is generated, the set test software and tools can be started under the guidance of a total software, the planned test items and processes can be started, the corresponding test results for testing the storage equipment can be obtained, the test processes for testing the storage equipment can be simplified, the storage equipment can be automatically tested in a manual mode, the test efficiency is improved, and the test result accuracy is high.
Further, the above solution may obtain the tree result of the storage device, obtain the key name information of all linked storage devices and storage devices, obtain the key name information and instance ID information of all storage devices in the registry, compare the obtained instance ID and device path information of all linked storage devices, the obtained key name information of all linked storage devices and storage devices, the obtained key name information of all storage devices and storage devices in the registry, obtain the type information of the real storage device, and send the command prompt of the storage device according to the obtained type information of the real storage device, and obtain the capacity information of the storage device.
Further, according to the above scheme, according to the obtained device information of the storage device, the user can click and select the target button to pop up the corresponding option frame window, and obtain the window handle by calling the function to obtain the window handle number, so as to obtain the mode of displaying the window by all the buttons and the character strings in the window, and set the target for testing the storage device, i.e. the drive number.
Furthermore, according to the scheme, the abnormity of the storage device prompted in the test report can be automatically repaired according to the generated test report for testing the storage device, so that the abnormity of the storage device can be prevented from being automatically repaired in a manual mode, the labor cost is saved, the factory-leaving period of the storage device is shortened, and the factory-leaving efficiency of the storage device is improved.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a part of the embodiments of the present invention, and not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes performed by the present invention through the contents of the specification and the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.