Disclosure of Invention
Therefore, the invention aims to provide a testing method, a testing device and testing equipment for storage equipment, which can simplify the testing process of testing the storage equipment, avoid the manual automatic testing of the storage equipment, improve the testing efficiency and have high accuracy of testing results.
According to an aspect of the present invention, there is provided a method of testing a storage device, including:
acquiring equipment information of storage equipment; the device information comprises type information of the storage device and capacity information of the storage device;
setting a test target of the storage device according to the acquired device information of the storage device; wherein the test target of the storage device is the drive letter number of the storage device;
according to the set test target of the storage device, guiding and starting set test software and tools by using total software, and starting planned test items and flows;
and according to the opened planned test items and flow, testing the storage device by using a set test software and tool guided and started by a total software, and obtaining all control handles in a window of the storage device to obtain a test result of the storage device.
The obtaining the device information of the storage device includes:
acquiring an instance ID of a storage device and device path information;
acquiring a tree result of the storage device to obtain all the linked storage devices and key name information of the storage devices;
obtaining the key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and the equipment path information of the storage equipment, the obtained all-linked storage equipment and storage equipment key name information, and the obtained storage equipment key names and instance ID information of all the storage equipment in the registry, and comparing to obtain the type information of the real storage equipment;
and sending a command prompt of the storage equipment according to the type information of the real storage equipment obtained by comparison, and obtaining the capacity information of the storage equipment.
The setting a test target of the storage device according to the acquired device information of the storage device includes:
clicking a selection target button to pop up a corresponding option box window according to the acquired equipment information of the storage equipment, acquiring a window handle number by calling a function to acquire the window handle, and setting a test target, namely a drive letter number, of the storage equipment in a mode of displaying the window by all buttons and character strings in the window.
And after the set test software and tool are guided and started by one piece of total software to test the storage equipment according to the opened planned test items and flow, all control handles in the window of the storage equipment are obtained, and a test result of the storage equipment is obtained, the method further comprises the following steps:
and generating a test report for testing the storage device according to the obtained test result of the storage device.
According to another aspect of the present invention, there is provided a test apparatus for a storage device, comprising:
the device comprises an acquisition module, a setting module, an opening module and a testing module;
the acquisition module is used for acquiring 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 test target of the storage device according to the acquired device information of the storage device; wherein the test target of the storage device is the drive letter number of the storage device;
the starting module is used for starting the set test software and tool according to the set test target of the storage device by a total software guide, and starting the planned test items and flow;
and the test module is used for testing the storage device by using a set test software and tool guided and started by a total software according to the opened planned test items and flow, and obtaining all control handles in a window of the storage device to obtain a test result of the storage device.
The acquiring module is specifically configured to:
acquiring an instance ID of a storage device and device path information;
acquiring a tree result of the storage device to obtain all the linked storage devices and key name information of the storage devices;
obtaining the key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and the equipment path information of the storage equipment, the obtained all-linked storage equipment and storage equipment key name information, and the obtained storage equipment key names and instance ID information of all the storage equipment in the registry, and comparing to obtain the type information of the real storage equipment;
and sending a command prompt of the storage equipment according to the type information of the real storage equipment obtained by comparison, and obtaining the capacity information of the storage equipment.
The setting module is specifically configured to:
clicking a selection target button to pop up a corresponding option box window according to the acquired equipment information of the storage equipment, acquiring a window handle number by calling a function to acquire the window handle, and setting a test target, namely a drive letter number, of the storage equipment in a mode of displaying the window by all buttons and character strings in the window.
Wherein, the testing arrangement of storage device still includes:
and the generating module is used for generating a test report for testing the storage device according to the obtained test result of the storage device.
According to still another aspect of the present invention, there is provided a test apparatus for a storage apparatus, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of testing a memory device of any one of the preceding claims.
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 a method of testing a storage device as described in any one of the above.
The method and the device can be used for acquiring the device information of the storage device, wherein the device information comprises the type information of the storage device, the capacity information of the storage device and the like, and the test target of the storage device can be set according to the acquired device information of the storage device, wherein the test target of the storage device is a drive code of the storage device, and according to the set test target of the storage device, the set test software and tool can be guided and started by one piece of total software, the set test item and flow can be started, and according to the opened set test item and flow, the storage device can be guided and started by one piece of total software, all control handles in a window of the storage device can be acquired, so that the test result of the storage device can be obtained.
Further, according to the scheme, the tree result of the storage device can be obtained, all the linked storage devices and the storage device key name information are obtained, the storage device key names and the instance ID information of all the storage devices in the registry are obtained, the obtained instance ID and the device path information of the storage devices, the obtained all the linked storage devices and the storage device key name information, the obtained storage device key names and the instance ID information of all the storage devices in the registry are compared, the type information of the real storage devices is obtained, the command prompt of the storage devices is sent according to the obtained type information of the real storage devices, and the capacity information of the storage devices is obtained.
Further, according to the above scheme, according to the obtained device information of the storage device, the selection target button is clicked to pop up the corresponding option box window, the window handle is obtained by calling a function to obtain the window handle number, so that the mode of displaying the window by all buttons and character strings in the window is obtained, and the test target of the storage device, namely the drive letter number, is set.
Furthermore, according to the scheme, the test report for testing the storage device can be generated according to the obtained test result of the storage device, so that the method has the advantages of avoiding the manual mode of automatically generating the test report for testing the storage device, saving labor cost, shortening the period for generating the test report, improving the efficiency of generating the test report and having high test report accuracy.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is specifically noted that the following examples are only for illustrating the present invention, but do not limit the scope of the present invention. Likewise, the following examples are only some, but not all, of the examples of the present invention, and all other examples, which a person of ordinary skill in the art would obtain without making any inventive effort, are within the scope of the present invention.
The invention provides a test method of a storage device, which can simplify the test flow of testing the storage device, can avoid the manual automatic test of the storage device, improves the test efficiency and has high test result accuracy.
Referring to fig. 1, fig. 1 is a flowchart illustrating an embodiment of a method for testing a memory device according to the present invention. It should be noted that, if there are substantially the same results, the method of the present invention is not limited to the flow sequence shown in fig. 1. As shown in fig. 1, the method comprises the steps of:
s101: acquiring equipment information of storage equipment; wherein the device information includes type information of the storage device, capacity information of the storage device, and the like.
The obtaining the device information of the storage device may include:
acquiring instance ID (InstanceID) of the storage device and device path (DevicePath) information;
acquiring a tree result of the storage device to obtain all the linked storage device and storage device key name (DeviceKeyName) information;
obtaining the key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and the device path information of the storage device, the obtained all-linked storage device and storage device key name information, and the obtained storage device key names and instance ID information of all the storage devices in the registry, and comparing to obtain the type information of the real storage device;
according to the type information of the real storage device obtained by the comparison, cmd (command prompt) of the storage device is sent to acquire the capacity information of the storage device, so that the type information and the capacity information of the real storage device can be acquired.
S102: setting a test target of the storage device according to the acquired device information of the storage device; wherein the test target of the storage device is the drive number of the storage device.
Wherein, the setting the test target of the storage device according to the acquired device information of the storage device may include:
clicking a selection target button to pop up a corresponding option box window according to the acquired equipment information of the storage equipment, acquiring window handle numbers through calling a function to acquire window handles, and accordingly obtaining a mode of displaying windows by all buttons and character strings in the window.
In this embodiment, all buttons in the window may be "simple", "englist", "select target", "refresh", "all available spaces", "only", "write+verify", "verify" and "loop verify", etc., and the present invention is not limited thereto.
In this embodiment, the character string display window may be "web site www", or "target (not selected)", etc., and the present invention is not limited thereto.
S103: and according to the set test target of the storage device, guiding and enabling the set test software and tools by using total software, and starting the planned test items and flows.
In this embodiment, a dialog box may be popped up to confirm the tested folder and the root directory may be specified. Similarly, all list information in the current option frame is acquired by acquiring a window handle, when a USB flash disk word of the storage device is acquired, a checkWindowsLisk can be adopted to select the option, a FindWindowsEx click button can be called, a confirmation button is clicked, software automatically returns to a main interface, and at the moment, the test target information of the storage device is confirmed.
S104: and according to the opened planned test items and flow, testing the storage device by using a set test software and tool guided by a total software, and obtaining all control handles in a window of the storage device to obtain a test result of the storage device.
In this embodiment, sendMessage (hwnd, wm_ CLOSE, NULL, NULL) may be invoked to close the test software and the test ends.
In this embodiment, each test procedure may be a thread independently created to perform a test, and a current test thread may be created by clicking the display information sequence number display button once, and the tests of all devices are performed by the independent threads.
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 the corresponding window data or text information.
Wherein, after the set test software and tool are guided and started by a total software to test the storage device according to the opened planned test item and flow, all control handles in the window of the storage device are obtained, and after the test result of the storage device is obtained, the method further comprises the following steps:
according to the obtained test result of the storage device, the test report for testing the storage device is generated, so that the manual automatic generation of the test report for testing the storage device can be avoided, the labor cost is saved, the period for generating the test report is shortened, the efficiency of generating the test report is improved, and the test report accuracy is high.
It may be found that, in this embodiment, device information of a storage device may be obtained, where the device information includes type information of the storage device, capacity information of the storage device, and the like, and a test target of the storage device may be set according to the obtained device information of the storage device, where the test target of the storage device is a drive number of the storage device, and according to the set test target of the storage device, set test software and tools may be guided and enabled by a piece of total software, set test items and procedures may be started, and according to the set test items and procedures may be guided and enabled by the piece of total software, all controls in a window of the storage device may be tested by the set test software and tools, so as to obtain a handle test result of the storage device.
Further, in this embodiment, the tree result of the storage device may be obtained, all the linked storage devices and storage device key name information may be obtained, the storage device key names and instance ID information of all the storage devices in the registry may be obtained, and the obtained instance ID and device path information of all the storage devices, the obtained all the linked storage devices and storage device key name information, the obtained storage device key names and instance ID information of all the storage devices in the registry may be compared, the type information of the real storage device may be obtained, and the command prompt of the storage device may be sent according to the obtained type information of the real storage device, so as to obtain the capacity information of the storage device.
Further, in this embodiment, according to the obtained device information of the storage device, the selection target button may be clicked to pop up the corresponding option box window, and the window handle may be obtained by calling a function to obtain the window handle number, thereby obtaining the manner of displaying the window by all buttons and character strings in the window.
Referring to fig. 2, fig. 2 is a flowchart illustrating another embodiment of a testing method of a memory device according to the present invention. In this embodiment, the method includes the steps of:
s201: acquiring equipment information of storage equipment; wherein the device information includes type information of the storage device, capacity information of the storage device, and the like.
As described in S101, a detailed description is omitted here.
S202: setting a test target of the storage device according to the acquired device information of the storage device; wherein the test target of the storage device is the drive number of the storage device.
As described in S102, the description is omitted here.
S203: and according to the set test target of the storage device, guiding and enabling the set test software and tools by using total software, and starting the planned test items and flows.
As described in S103, a detailed description is omitted here.
S204: and according to the opened planned test items and flow, testing the storage device by using a set test software and tool guided by a total software, and obtaining all control handles in a window of the storage device to obtain a test result of the storage device.
As described in S104, a detailed description is omitted here.
S205: and generating a test report for testing the storage device according to the obtained test result of the storage device.
It can be found that in this embodiment, a test report for testing the storage device can be generated according to the obtained test result of the storage device, which has the advantages of avoiding the manual automatic generation of the test report for testing the storage device, saving labor cost, shortening the period of generating the test report, improving the efficiency of generating the test report, and having high test report accuracy.
The invention also provides a testing device of the storage equipment, which can simplify the testing process of testing the storage equipment, can avoid the manual automatic testing of the storage equipment, improves the testing efficiency and has high accuracy of the testing result.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a testing apparatus of a storage device according to an embodiment of the invention. In this embodiment, the test device 30 of the storage device includes an acquisition module 31, a setting module 32, an opening module 33, and a test module 34.
The acquiring module 31 is configured to acquire device information of a storage device; wherein 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 test target of the storage device according to the acquired device information of the storage device; wherein the test target of the storage device is the drive number of the storage device.
The opening module 33 is configured to enable the set test software and tool by a total software boot according to the set test target of the storage device, and open the planned test item and flow.
The test module 34 is configured to, according to the opened planned test item and flow, guide the set test software and tool to test the storage device by using a total software, and obtain all control handles in a window of the storage device, so as to obtain a test result of the storage device.
Alternatively, the obtaining module 31 may be specifically configured to:
acquiring an instance ID of a storage device and device path information;
acquiring a tree result of the storage device to obtain all the linked storage devices and key name information of the storage devices;
obtaining the key names and instance ID information of all storage devices in a registry;
comparing the obtained instance ID and the device path information of the storage device, the obtained all-linked storage device and storage device key name information, and the obtained storage device key names and instance ID information of all the storage devices in the registry, and comparing to obtain the type information of the real 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 obtaining the capacity information of the storage equipment.
Optionally, the setting module 32 may be specifically configured to:
clicking a selection target button to pop up a corresponding option box window according to the acquired equipment information of the storage equipment, and acquiring a window handle number by calling a function to acquire the window handle, so that a mode that all buttons and character strings in the window display the window is obtained, and setting a test target of the storage equipment, namely a drive letter number.
Referring to fig. 4, fig. 4 is a schematic structural diagram of another embodiment of a testing apparatus of a storage device according to the present invention. Unlike the previous embodiment, the testing device 40 of the storage device according to the present embodiment further includes a generating module 41.
The generating module 41 is configured to generate a test report for testing the storage device according to the obtained test result of the storage device.
The respective unit modules of the testing device 30/40 of the storage apparatus may perform the corresponding steps in the above method embodiments, so that the detailed description of the respective unit modules is omitted herein.
The present invention further provides a test apparatus for 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 memory device.
Where the memory 52 and the processor 51 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting the various circuits of the one or more processors 51 and the memory 52 together. The bus may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or may be 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 implements the above-described method embodiments when executed by a processor.
The method and the device can be used for acquiring the device information of the storage device, wherein the device information comprises the type information of the storage device, the capacity information of the storage device and the like, and the test target of the storage device can be set according to the acquired device information of the storage device, wherein the test target of the storage device is a drive code of the storage device, and according to the set test target of the storage device, the set test software and tool can be guided and started by one piece of total software, the set test item and flow can be started, and according to the opened set test item and flow, the storage device can be guided and started by one piece of total software, all control handles in a window of the storage device can be acquired, so that the test result of the storage device can be obtained.
Further, according to the scheme, the tree result of the storage device can be obtained, all the linked storage devices and the storage device key name information are obtained, the storage device key names and the instance ID information of all the storage devices in the registry are obtained, the obtained instance ID and the device path information of the storage devices, the obtained all the linked storage devices and the storage device key name information, the obtained storage device key names and the instance ID information of all the storage devices in the registry are compared, the type information of the real storage devices is obtained, the command prompt of the storage devices is sent according to the obtained type information of the real storage devices, and the capacity information of the storage devices is obtained.
Further, according to the above scheme, according to the obtained device information of the storage device, the selection target button is clicked to pop up the corresponding option box window, the window handle is obtained by calling a function to obtain the window handle number, so that the mode of displaying the window by all buttons and character strings in the window is obtained, and the test target of the storage device, namely the drive letter number, is set.
Furthermore, according to the scheme, the test report for testing the storage device can be generated according to the obtained test result of the storage device, so that the method has the advantages of avoiding the manual mode of automatically generating the test report for testing the storage device, saving labor cost, shortening the period for generating the test report, improving the efficiency of generating the test report and having high test report accuracy.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of 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, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only a partial embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes using the descriptions and the drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the present invention.