Method for testing formatting of mobile disks and related products

CN115938452BActive Publication Date: 2026-10-09SHENZHEN XFANIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211595352.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2026-10-09
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

显然在可移动存储设备量产的过程中有三个不足,效率偏低,防呆性不够,每个磁盘初始化和格式化的数据不能形成日志(或者数据库记录)

Benefits of technology

[0020]As can be seen, the mobile disk formatting test method and related products described in this application embodiment are applied to electronic devices. They obtain the first attribute information of the mobile disk to be tested, determine the first configuration information corresponding to the first attribute information, listen for interface insertion behavior through a specified USB interface, and when interface insertion behavior occurs at the specified USB interface, detect whether the insertion object of the specified USB interface is the mobile disk to be tested. When the insertion object of the specified USB interface is the mobile disk to be tested, call the first configuration information and perform formatting processing on the mobile disk to be tested according to the first configuration information. On the one hand, software memory is used to remember different chips required by different manufacturers, as well as different initialization and formatting requirements, reducing a large amount of manual operation and setting parameters with software, avoiding errors and low efficiency in manual operation. On the other hand, since the first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk to be tested, and the formatting processing is performed on the mobile disk to be tested according to the first configuration information, thereby improving the efficiency of mobile disk formatting tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115938452B_ABST
    Figure CN115938452B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a mobile disk formatting test method and related products, applied to an electronic device, the method comprising: obtaining first attribute information of a mobile disk to be tested; determining first configuration information corresponding to the first attribute information; listening to whether there is an interface insertion behavior through a specified USB interface; when the interface insertion behavior exists in the specified USB interface, detecting whether an insertion object of the specified USB interface is the mobile disk to be tested; when the insertion object of the specified USB interface is the mobile disk to be tested, calling the first configuration information, and performing formatting processing on the mobile disk to be tested according to the first configuration information. The embodiments of the present application can improve the formatting test efficiency of the mobile disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology or the field of mobile hard disk formatting testing technology, specifically to a mobile hard disk formatting testing method and related products. Background Technology

[0002] When a portable storage device (such as a removable hard drive) is first attached to the PCBA, Windows cannot recognize it. Users must right-click "This PC," select "Manage," then "Disk Management," initialize the new hard drive, select the partition format, choose the hard drive name, drive letter, and file system format, and then format it. This process takes approximately two minutes, and human error is possible. Clearly, there are three shortcomings in the mass production of removable storage devices: low efficiency, insufficient error prevention, and the inability to log (or record in a database) the data from each disk initialization and formatting. Therefore, improving the efficiency of formatting tests for removable hard drives is an urgent issue that needs to be addressed. Summary of the Invention

[0003] This application provides a method and related products for formatting testing of mobile hard disks, which can improve the efficiency of formatting testing of mobile hard disks.

[0004] In a first aspect, embodiments of this application provide a method for formatting a portable hard disk, applied to an electronic device, the method comprising:

[0005] Obtain the first attribute information of the removable disk to be tested;

[0006] Determine the first configuration information corresponding to the first attribute information;

[0007] Listen for interface insertion behavior by specifying a USB interface;

[0008] When the specified USB interface is used for insertion, it is detected whether the insertion object of the specified USB interface is the removable disk to be tested.

[0009] When the object inserted into the specified USB interface is the mobile disk to be tested, the first configuration information is invoked, and the mobile disk to be tested is formatted according to the first configuration information.

[0010] Secondly, embodiments of this application provide a formatting test device for a mobile hard disk, applied to an electronic device. The device includes: an acquisition unit, a determination unit, a monitoring unit, a detection unit, and a formatting processing unit, wherein...

[0011] The acquisition unit is used to acquire the first attribute information of the removable disk to be tested;

[0012] The determining unit is used to determine the first configuration information corresponding to the first attribute information;

[0013] The monitoring unit is used to monitor whether there is an interface insertion behavior through a specified USB interface;

[0014] The detection unit is used to detect whether the object inserted into the specified USB interface is the removable disk to be tested when the interface insertion behavior exists in the specified USB interface.

[0015] The formatting processing unit is used to call the first configuration information and format the mobile disk to be tested according to the first configuration information when the insertion object of the specified USB interface is the mobile disk to be tested.

[0016] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first aspect of embodiments of this application.

[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of embodiments of this application.

[0018] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.

[0019] Implementing the embodiments of this application has the following beneficial effects:

[0020] As can be seen, the mobile disk formatting test method and related products described in this application embodiment are applied to electronic devices. They obtain the first attribute information of the mobile disk to be tested, determine the first configuration information corresponding to the first attribute information, listen for interface insertion behavior through a specified USB interface, and when interface insertion behavior occurs at the specified USB interface, detect whether the insertion object of the specified USB interface is the mobile disk to be tested. When the insertion object of the specified USB interface is the mobile disk to be tested, call the first configuration information and perform formatting processing on the mobile disk to be tested according to the first configuration information. On the one hand, software memory is used to remember different chips required by different manufacturers, as well as different initialization and formatting requirements, reducing a large amount of manual operation and setting parameters with software, avoiding errors and low efficiency in manual operation. On the other hand, since the first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk to be tested, and the formatting processing is performed on the mobile disk to be tested according to the first configuration information, thereby improving the efficiency of mobile disk formatting tests. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1A This is a flowchart illustrating a method for formatting a removable hard drive according to an embodiment of this application.

[0023] Figure 1B This is a flowchart illustrating another method for formatting and testing a removable disk provided in an embodiment of this application.

[0024] Figure 2 This is a flowchart illustrating another method for formatting and testing a removable disk provided in an embodiment of this application.

[0025] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0026] Figure 4 This is a block diagram of the functional units of a formatting test device for a mobile hard disk provided in an embodiment of this application. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.

[0028] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0030] The electronic devices involved in the embodiments of this application may include various handheld devices, vehicle-mounted devices, wearable devices (smartwatches, smart bracelets, wireless headphones, augmented reality / virtual reality devices, smart glasses), computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile station (MS), terminal device, etc. The electronic devices may also be servers, host computers, smart home devices, and smart home devices. Smart home devices may be at least one of the following: smart cameras, smart refrigerators, smart washing machines, smart furniture, smart switch panels, etc., without limitation.

[0031] In this embodiment, Windows provides an internal command called diskpart, which, in the DOS environment, can perform operations such as disk partitioning and formatting by combining various parameters. C#'s System.Diagnostics.Process can start internal or external Windows commands as a new process and obtain the return results of the process execution. WinForms can act as a client to carry out the above functions and send data to the server of the Production Process Control (MES) system by writing data to a database or sending HTTP requests, thus saving test operation data and recording the process.

[0032] In this embodiment, different brand manufacturers may have different requirements for the storage chip, disk name, disk partition format, disk file system, and drive letter naming of the mobile hard drive. Furthermore, even within the same manufacturer, consistent requirements may be necessary, or consistency may be required for a specific batch. To address this, a WinForms application is developed to pre-configure these parameters for different manufacturers and their batch requirements, and saves these settings to a WinForms configuration file or a corresponding form in the database. During mass production, selecting the appropriate configuration file or form ensures efficient and accurate production.

[0033] Please see Figure 1A , Figure 1A This is a flowchart illustrating a formatting test method for a portable hard drive provided in an embodiment of this application. As shown in the figure, it is applied to electronic devices. The formatting test method for this portable hard drive includes:

[0034] 101. Obtain the first attribute information of the removable disk to be tested.

[0035] In this embodiment of the application, considering that different manufacturers have different chips, disk names, disk partition formats, disk file systems, drive letters, etc. of their corresponding mobile disks, it is convenient to set the corresponding configuration information based on the attribute information of the mobile disk to be tested. In specific implementation, the first attribute information of the mobile disk to be tested can be obtained first.

[0036] The electronic device may include a host computer. The removable disk to be tested may include one or a type of removable disk.

[0037] In this embodiment of the application, the first attribute information may include at least one of the following: the chip of the mobile disk, the disk name, the disk partition format, the disk file system, the drive letter name, etc., which are not limited here.

[0038] 102. Determine the first configuration information corresponding to the first attribute information.

[0039] In this embodiment of the application, a pre-stored mapping relationship between preset attribute information and configuration information can be used to determine the first configuration information corresponding to the first attribute information based on the mapping relationship.

[0040] The first configuration information may include at least one of the following: process file, command parameters, format file location information, format ratio coefficient, format rate, etc., which are not limited here.

[0041] Of course, the test environment can also be configured based on the first configuration information to make the test environment more suitable for the removable disk to be tested.

[0042] In practice, the host computer software configures the chip, disk name, disk partition format, disk file system, and drive letter name of the removable disk according to different manufacturers, and saves these settings as files in the host computer configuration file (written into the database as form data). The software remembers the different chips required by different manufacturers, as well as the different initialization and formatting requirements, reducing a large amount of manual operation and avoiding errors and inefficiencies caused by manual operation.

[0043] 103. Listen for interface insertion behavior by specifying a USB interface.

[0044] In this embodiment, the WndProc method can be overridden to monitor the insertion and removal of the host computer's USB interface. When the host computer's USB interface is inserted, it checks whether the inserted device has a removable disk and whether the virtual installation disk VID of the removable disk chip meets preset conditions. These preset conditions can be pre-set or system defaults. For example, the preset condition can be that the VID is a specified VID, which can be pre-set or system defaults.

[0045] In practice, the USB interface can be specified to listen for interface insertion behavior, thereby enabling real-time monitoring of the removable disk under test.

[0046] 104. When the specified USB interface has an insertion behavior, detect whether the insertion object of the specified USB interface is the mobile disk to be tested.

[0047] In this embodiment of the application, the specified USB interface can be preset or set by the system default, and the specified USB interface may include one or more USB interfaces.

[0048] In the specific implementation, when there is an interface insertion behavior on the specified USB interface, it can detect whether the inserted object of the specified USB interface is the mobile disk to be tested. If so, step 105 is executed; otherwise, step 105 and its subsequent steps are not executed.

[0049] 105. When the object inserted into the specified USB interface is the mobile disk to be tested, the first configuration information is invoked, and the mobile disk to be tested is formatted according to the first configuration information.

[0050] In this embodiment, when the USB interface is inserted into a mobile disk under test, the first configuration information can be invoked. Since this first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk under test. The mobile disk under test is then formatted according to the first configuration information, thereby improving formatting efficiency. In practical applications, this significantly improves the efficiency of mass-produced disk initialization and formatting; manual operation takes 2 minutes, while the above-mentioned host computer operation only takes 5 seconds.

[0051] Specifically, the process of formatting the mobile disk to be tested according to the first configuration information can be: initializing and formatting the mobile disk to be tested according to the first configuration information.

[0052] In the specific implementation, the parameters in the first configuration file can be read, the System.Diagnostics.Process starts the process, loads the parameters in the first configuration file read by the dsikpart command that correspond to the parameters after diskpart, performs disk initialization and formatting, and obtains the formatting result.

[0053] Optionally, step 105 above, which involves formatting the removable disk to be tested according to the first configuration information, may include the following steps:

[0054] 51. Obtain the target test environment parameters;

[0055] 52. Determine the target adjustment parameters corresponding to the target test environment parameters;

[0056] 53. Adjust the first configuration information according to the target adjustment parameters to obtain the target first configuration information;

[0057] 54. Format the disk to be tested according to the target first configuration information.

[0058] In this embodiment, the test environment parameters may include hardware test environment parameters and / or software test environment parameters. Hardware test environment parameters may include at least one of the following: hardware name, hardware configuration information, hardware lifespan, hardware maintenance status, etc., which are not limited herein. Software test environment parameters may include at least one of the following: software system parameters, software test scores, etc., which are not limited herein.

[0059] In practice, different test environment parameters can correspond to different adjustment parameters, and thus, a pre-set mapping relationship between test environment parameters and adjustment parameters can be established.

[0060] Specifically, the target test environment parameters can be obtained, and the target adjustment parameters corresponding to the target test environment parameters can be determined by the mapping relationship between the preset test environment parameters and adjustment parameters. Then, the first configuration information can be adjusted according to the target adjustment parameters to obtain the target first configuration information. In specific implementation, some or all of the configuration information of the first configuration information can be adjusted to obtain the target first configuration information. Then, the disk to be tested can be formatted according to the target first configuration information. Thus, the configuration information can be adapted to the test environment, which helps to improve the formatting efficiency.

[0061] In this embodiment, an automated, foolproof disk initialization and formatting method replaces the manual method. The software can actively memorize and quickly initialize and format the disk according to the different batch requirements of different manufacturers.

[0062] Optionally, the following steps may also be included:

[0063] A1. After the removable disk under test is formatted, obtain the second attribute information of the removable disk under test;

[0064] A2. Determine the second configuration information corresponding to the second attribute information;

[0065] A3. Check whether the first configuration information and the second configuration information are consistent;

[0066] A4. When the first configuration information and the second configuration information are inconsistent, perform the first abnormality reminder operation.

[0067] In this embodiment of the application, the second attribute information may include at least one of the following: the chip of the mobile disk, the disk name, the disk partition format, the disk file system, the drive letter name, etc., which are not limited here.

[0068] The first abnormality alert operation may include at least one of the following: display prompts, voice prompts, incoming call prompts, etc., without limitation.

[0069] The second configuration information may include at least one of the following: process file, command parameters, format file location information, format ratio coefficient, format rate, etc., which are not limited here.

[0070] In this embodiment, after the mobile disk to be tested is formatted, the second attribute information of the mobile disk to be tested can be obtained. Then, according to the preset mapping relationship between attribute information and configuration information, the second configuration information corresponding to the second attribute information can be determined. Next, it is checked whether the first configuration information and the second configuration information are consistent. If the first configuration information and the second configuration information are inconsistent, a first abnormal reminder operation is performed, that is, the formatting fails. Conversely, if the first configuration information and the second configuration information are consistent, it means that the formatting is successful.

[0071] For example, after disk formatting is complete, the host computer retrieves information such as disk partition format, disk file system, drive letter, drive name, storage chip VID, and disk name. This information is then compared to the initially set parameters. If they match perfectly, the next step is performed. If they do not match, the operator is notified in red.

[0072] Optionally, the following steps may also be included:

[0073] B1. When the first configuration information is consistent with the second configuration information, obtain the specified type rate of the mobile disk to be tested, wherein the specified type rate includes at least one of the following: read rate and write rate;

[0074] B2. Compare the specified type rate with the preset rate;

[0075] B3. When the specified type rate fails to match the preset rate, a second abnormality alert operation is performed.

[0076] The second anomaly alert operation may include at least one of the following: display prompts, voice prompts, incoming call prompts, etc., without limitation. The second anomaly alert operation may be the same as or different from the first anomaly alert operation.

[0077] The specified type of the specified rate can be preset or defaulted to by the system. The specified rate type can include at least one of the following: read rate and write rate.

[0078] In this embodiment of the application, when the first configuration information is consistent with the second configuration information, it indicates that the formatting is successful. The specified type speed of the mobile disk to be tested is obtained. The specified type speed includes at least one of the following: read speed and write speed. The specified type speed is compared with the preset speed. When the comparison between the specified type speed and the preset speed fails, a second abnormality reminder operation is performed. In this way, test abnormalities can be detected in time and test efficiency can be improved.

[0079] In practice, after a successful comparison, the host computer starts a process to test the read and write speeds of the target disk and obtain the values. These values ​​are then compared with the values ​​we set. If the values ​​are greater than the set values, the host computer displays "OK"; otherwise, it displays "NG" in highlighted red text to alert the operator.

[0080] Optionally, the following steps may also be included:

[0081] When the specified type rate and the preset rate are successfully matched, the processing result of the formatting process and the comparison result between the specified type rate and the preset rate are sent to the server.

[0082] In this embodiment, when the specified type rate successfully matches the preset rate, the processing result of the formatting process and the comparison result between the specified type rate and the preset rate are sent to the server. Since the data is uploaded to the MES system, the process is traceable.

[0083] In practice, the host computer sends an HTTP request to the MES (Manufacturing Process Control System) server to initialize and format the disk, as well as send the speed measurement data to the server, and obtains the return result from the server to indicate to the user whether the data has been uploaded successfully.

[0084] For example, in practical applications, the formatting test method for the removable disk in this embodiment can also be implemented as follows, including the following steps:

[0085] 1. The host computer software configures the chip, disk name, disk partition format, disk file system, drive letter name, and other information of the mobile disk according to different manufacturers. That is, it sets the corresponding parameter file and saves it in the host computer configuration file in the form of a file (written into the database as form data).

[0086] 2. Override the WndProc method to listen for the insertion and removal of the host computer's USB interface. When the host computer's USB interface is plugged in, check if the inserted device has a removable disk and whether the VID of the removable disk chip matches the target.

[0087] 3. If both of the above are true, the corresponding configuration file set in step 1 will be invoked. The parameters in the configuration file will be read, the System.Diagnostics.Process process will be started, the parameters in the configuration file read by the dsikpart command will correspond to the parameters after diskpart, and disk initialization and formatting will be performed.

[0088] 4. After disk formatting is complete, the host computer retrieves information such as disk partition format, disk file system, drive letter, drive name, storage chip VID, and disk name. This information is then compared to the parameters set initially. If they match completely, the next step is performed. If they do not match, the operator is notified in red.

[0089] 5. After the comparison in step 4 is successful, the host computer starts the process to test the read speed and write speed of the target disk and obtain the values. The values ​​are then compared with the values ​​we set. If the values ​​are greater than the set values, the host computer displays "OK"; otherwise, it displays "NG" in highlighted red text to prompt the operator.

[0090] 6. The host computer sends an HTTP request to the MES (Manufacturing Process Control System) server to initialize and format the disk, as well as send the speed measurement data to the server, and obtains the return result from the server to indicate to the user whether the data has been uploaded successfully.

[0091] That is, in specific implementations, such as Figure 1B As shown, after starting, the host computer checks whether the corresponding parameter file has been selected; if not, it sets or selects the target parameter file and then listens to the USB interface; if yes, it listens to the USB interface, finds the target disk according to the set VID, calls the target file to read parameters, initializes and formats the target disk according to the corresponding parameters, checks whether the formatting is successful, if not, continues to call the target file to read parameters; if yes, it tests the target disk read / write speed, uploads the test data and results to EMS, and ends.

[0092] As can be seen, the mobile disk formatting test method described in this application embodiment is applied to an electronic device. It obtains the first attribute information of the mobile disk to be tested, determines the first configuration information corresponding to the first attribute information, listens for interface insertion behavior through a specified USB interface, and when interface insertion behavior occurs at the specified USB interface, detects whether the insertion object of the specified USB interface is the mobile disk to be tested. When the insertion object of the specified USB interface is the mobile disk to be tested, it calls the first configuration information and formats the mobile disk to be tested according to the first configuration information. On the one hand, it uses software to remember different chips required by different manufacturers, as well as different initialization and formatting requirements, reducing a large amount of manual operation and setting parameters with software, avoiding errors and low efficiency in manual operation. On the other hand, since the first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk to be tested, and the formatting process is performed on the mobile disk to be tested according to the first configuration information, thereby improving the efficiency of mobile disk formatting tests.

[0093] With the above Figure 1A The illustrated embodiments are consistent with those shown in the example. Please refer to [link / reference]. Figure 2 , Figure 2 This is a flowchart illustrating a formatting test method for a portable hard drive provided in an embodiment of this application. As shown in the figure, it is applied to electronic devices. The formatting test method for this portable hard drive includes:

[0094] 201. Obtain the first attribute information of the removable disk to be tested.

[0095] 202. Determine the first configuration information corresponding to the first attribute information.

[0096] 203. Listen for interface insertion behavior by specifying a USB interface.

[0097] 204. When the specified USB interface has an insertion behavior, detect whether the insertion object of the specified USB interface is the mobile disk to be tested.

[0098] 205. When the object inserted into the specified USB interface is the mobile disk to be tested, the first configuration information is invoked, and the mobile disk to be tested is formatted according to the first configuration information.

[0099] 206. After the removable disk to be tested is formatted, obtain the second attribute information of the removable disk to be tested.

[0100] 207. Determine the second configuration information corresponding to the second attribute information.

[0101] 208. Check whether the first configuration information and the second configuration information are consistent.

[0102] 209. When the first configuration information is inconsistent with the second configuration information, perform the first abnormality reminder operation.

[0103] 210. When the first configuration information is consistent with the second configuration information, obtain the specified type rate of the mobile disk to be tested, wherein the specified type rate includes at least one of the following: read rate and write rate.

[0104] 211. Compare the specified type rate with the preset rate.

[0105] 212. When the specified type rate fails to match the preset rate, a second abnormality alert operation is performed.

[0106] 213. When the specified type rate and the preset rate are successfully matched, the processing result of the formatting process and the comparison result between the specified type rate and the preset rate are sent to the server.

[0107] The specific descriptions of steps 201-213 above can be found in the above descriptions. Figure 1A The steps of the described method for formatting and testing removable disks will not be repeated here.

[0108] As can be seen, the mobile disk formatting test method described in this application embodiment is applied to an electronic device. It obtains the first attribute information of the mobile disk to be tested, determines the first configuration information corresponding to the first attribute information, listens for interface insertion behavior through a specified USB interface, and when interface insertion behavior occurs at the specified USB interface, detects whether the insertion object of the specified USB interface is the mobile disk to be tested. When the insertion object of the specified USB interface is the mobile disk to be tested, it calls the first configuration information and formats the mobile disk to be tested according to the first configuration information. On the one hand, it uses software to remember different chips required by different manufacturers, as well as different initialization and formatting requirements, reducing a large amount of manual operation and setting parameters with software, avoiding errors and low efficiency in manual operation. On the other hand, since the first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk to be tested, and the formatting process is performed on the mobile disk to be tested according to the first configuration information, thereby improving the efficiency of mobile disk formatting tests.

[0109] Consistent with the above embodiments, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. As shown in the figure, the electronic device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. In this embodiment, the programs include instructions for performing the following steps:

[0110] Obtain the first attribute information of the removable disk to be tested;

[0111] Determine the first configuration information corresponding to the first attribute information;

[0112] Listen for interface insertion behavior by specifying a USB interface;

[0113] When the specified USB interface is used for insertion, it is detected whether the insertion object of the specified USB interface is the removable disk to be tested.

[0114] When the object inserted into the specified USB interface is the mobile disk to be tested, the first configuration information is invoked, and the mobile disk to be tested is formatted according to the first configuration information.

[0115] Optionally, the above procedure may also include instructions for performing the following steps:

[0116] After the removable disk under test is formatted, the second attribute information of the removable disk under test is obtained;

[0117] Determine the second configuration information corresponding to the second attribute information;

[0118] Detect whether the first configuration information and the second configuration information are consistent;

[0119] When the first configuration information is inconsistent with the second configuration information, a first abnormality alert operation is performed.

[0120] Optionally, the above procedure may also include instructions for performing the following steps:

[0121] When the first configuration information is consistent with the second configuration information, the specified type rate of the mobile disk to be tested is obtained, and the specified type rate includes at least one of the following: read rate and write rate;

[0122] Compare the specified rate type with the preset rate;

[0123] When the specified type rate fails to match the preset rate, a second abnormality alert is triggered.

[0124] Optionally, the above procedure may also include instructions for performing the following steps:

[0125] When the specified type rate and the preset rate are successfully matched, the processing result of the formatting process and the comparison result between the specified type rate and the preset rate are sent to the server.

[0126] Optionally, in the step of formatting the removable disk to be tested according to the first configuration information, the above procedure includes instructions for performing the following steps:

[0127] Obtain the target test environment parameters;

[0128] Determine the target adjustment parameters corresponding to the target test environment parameters;

[0129] The first configuration information is adjusted according to the target adjustment parameters to obtain the target first configuration information;

[0130] The disk to be tested is formatted according to the target first configuration information.

[0131] As can be seen, the electronic device described in this application embodiment has several advantages. First, it uses software to memorize different chips required by different manufacturers, as well as different initialization and formatting requirements, reducing a lot of manual operation and setting parameters with software, thus avoiding errors and low efficiency in manual operation. Second, since the first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk under test and formats the mobile disk under test according to the first configuration information, thereby improving the efficiency of mobile disk formatting test. Third, it can also realize read and write speed test. Fourth, since the data is uploaded to the MES system, the process is traceable.

[0132] Figure 4 This is a functional unit block diagram of a formatting test device 400 for a portable hard disk according to an embodiment of this application. The portable hard disk formatting test device 400 is applied to an electronic device, and the device 400 includes: an acquisition unit 401, a determination unit 402, a monitoring unit 403, a detection unit 404, and a formatting processing unit 405, wherein...

[0133] The acquisition unit 401 is used to acquire the first attribute information of the mobile disk to be tested.

[0134] The determining unit 402 is used to determine the first configuration information corresponding to the first attribute information;

[0135] The monitoring unit 403 is used to monitor whether there is an interface insertion behavior through a specified USB interface;

[0136] The detection unit 404 is used to detect whether the object inserted into the specified USB interface is the removable disk to be tested when the interface insertion behavior exists in the specified USB interface.

[0137] The formatting processing unit 405 is used to call the first configuration information and format the mobile disk to be tested according to the first configuration information when the insertion object of the specified USB interface is the mobile disk to be tested.

[0138] Optionally, the device 400 is further specifically used for:

[0139] After the removable disk under test is formatted, the second attribute information of the removable disk under test is obtained;

[0140] Determine the second configuration information corresponding to the second attribute information;

[0141] Detect whether the first configuration information and the second configuration information are consistent;

[0142] When the first configuration information is inconsistent with the second configuration information, a first abnormality alert operation is performed.

[0143] Optionally, the device 400 is further specifically used for:

[0144] When the first configuration information is consistent with the second configuration information, the specified type rate of the mobile disk to be tested is obtained, and the specified type rate includes at least one of the following: read rate and write rate;

[0145] Compare the specified rate type with the preset rate;

[0146] When the specified type rate fails to match the preset rate, a second abnormality alert is triggered.

[0147] Optionally, the device 400 is further specifically used for:

[0148] When the specified type rate and the preset rate are successfully matched, the processing result of the formatting process and the comparison result between the specified type rate and the preset rate are sent to the server.

[0149] Optionally, in the step of formatting the removable disk to be tested according to the first configuration information, the formatting unit 405 is specifically used for:

[0150] Obtain the target test environment parameters;

[0151] Determine the target adjustment parameters corresponding to the target test environment parameters;

[0152] The first configuration information is adjusted according to the target adjustment parameters to obtain the target first configuration information;

[0153] The disk to be tested is formatted according to the target first configuration information.

[0154] As can be seen, the mobile disk formatting test device described in this application embodiment is applied to an electronic device. It obtains the first attribute information of the mobile disk to be tested, determines the first configuration information corresponding to the first attribute information, listens for interface insertion behavior through a specified USB interface, and when interface insertion behavior exists on the specified USB interface, detects whether the insertion object of the specified USB interface is the mobile disk to be tested. When the insertion object of the specified USB interface is the mobile disk to be tested, it calls the first configuration information and performs formatting processing on the mobile disk to be tested according to the first configuration information. On the one hand, it uses software to remember different chips required by different manufacturers, as well as different initialization and formatting requirements, reducing a lot of manual operation processes and setting parameters with software, avoiding errors and low efficiency in manual operation. On the other hand, since the first configuration information corresponds to the first attribute information, it is deeply adapted to the mobile disk to be tested, and performs formatting processing on the mobile disk to be tested according to the first configuration information, thereby improving the formatting test efficiency of the mobile disk.

[0155] It is understood that the functions of each program module of the mobile disk formatting test device in this embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, and will not be repeated here.

[0156] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.

[0157] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.

[0158] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0159] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0160] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0161] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0162] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0163] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0164] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0165] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for formatting and testing a removable hard disk, characterized in that, Applied to electronic devices, the method includes: Obtain the first attribute information of the removable disk to be tested; Determine the first configuration information corresponding to the first attribute information; The system listens for USB interface insertion behavior by specifying a USB interface; specifically, it listens for the insertion and removal of the host computer's USB interface by overriding the WndProc method. When the specified USB interface is used for insertion, it is detected whether the insertion object of the specified USB interface is the removable disk to be tested. When the inserted object of the specified USB interface is the mobile disk to be tested, the first configuration information is called, and the mobile disk to be tested is formatted according to the first configuration information. Specifically, the parameters in the first configuration file are read, the System.Diagnostics.Process starts the process, loads the parameters in the first configuration file read by the dsikpart command that correspond to the parameters after diskpart, performs disk initialization and formatting, and obtains the formatting result. The step of formatting the removable disk to be tested according to the first configuration information includes: Obtain target test environment parameters; the target test environment parameters include hardware test environment parameters and / or software test environment parameters; the hardware test environment parameters include at least one of the following: hardware name, hardware configuration information, hardware lifespan, hardware maintenance status; the software test environment parameters include at least one of the following: software system parameters, software test score; Determine the target adjustment parameters corresponding to the target test environment parameters; The first configuration information is adjusted according to the target adjustment parameters to obtain the target first configuration information. Specifically, the first configuration information is adjusted according to the target adjustment parameters to obtain the target first configuration information. The disk to be tested is formatted according to the target first configuration information.

2. The method according to claim 1, characterized in that, The method further includes: After the removable disk under test is formatted, the second attribute information of the removable disk under test is obtained; Determine the second configuration information corresponding to the second attribute information; Detect whether the first configuration information and the second configuration information are consistent; When the first configuration information is inconsistent with the second configuration information, a first abnormality alert operation is performed.

3. The method according to claim 2, characterized in that, The method further includes: When the first configuration information is consistent with the second configuration information, the specified type rate of the mobile disk to be tested is obtained, and the specified type rate includes at least one of the following: read rate and write rate; Compare the specified rate type with the preset rate; When the specified type rate fails to match the preset rate, a second abnormality alert is triggered.

4. The method according to claim 3, characterized in that, The method further includes: When the specified type rate and the preset rate are successfully matched, the processing result of the formatting process and the comparison result between the specified type rate and the preset rate are sent to the server.

5. A formatting test device for a portable hard disk, characterized in that, Applied to electronic devices, the device includes: an acquisition unit, a determination unit, a listening unit, a detection unit, and a formatting processing unit, wherein... The acquisition unit is used to acquire the first attribute information of the removable disk to be tested; The determining unit is used to determine the first configuration information corresponding to the first attribute information; The monitoring unit is used to monitor whether there is an interface insertion behavior through a specified USB interface. Specifically, it monitors the insertion and removal of the host computer's USB interface by overriding the WndProc method. The detection unit is used to detect whether the object inserted into the specified USB interface is the removable disk to be tested when the interface insertion behavior exists in the specified USB interface. The formatting processing unit is used to call the first configuration information when the inserted object of the specified USB interface is the mobile disk to be tested, and to perform formatting processing on the mobile disk to be tested according to the first configuration information. Specifically, it reads the parameters in the first configuration file, starts the process with System.Diagnostics.Process, loads the parameters in the first configuration file read by the dsikpart command that correspond to the parameters after diskpart, performs disk initialization and formatting, and obtains the formatting processing result. The step of formatting the removable disk to be tested according to the first configuration information includes: Obtain target test environment parameters; the target test environment parameters include hardware test environment parameters and / or software test environment parameters; the hardware test environment parameters include at least one of the following: hardware name, hardware configuration information, hardware lifespan, hardware maintenance status; the software test environment parameters include at least one of the following: software system parameters, software test score; Determine the target adjustment parameters corresponding to the target test environment parameters; The first configuration information is adjusted according to the target adjustment parameters to obtain the target first configuration information. Specifically, the first configuration information is adjusted according to the target adjustment parameters to obtain the target first configuration information. The disk to be tested is formatted according to the target first configuration information.

6. The apparatus according to claim 5, characterized in that, The device is also specifically used for: After the removable disk under test is formatted, the second attribute information of the removable disk under test is obtained; Determine the second configuration information corresponding to the second attribute information; Detect whether the first configuration information and the second configuration information are consistent; When the first configuration information is inconsistent with the second configuration information, a first abnormality alert operation is performed.

7. The apparatus according to claim 6, characterized in that, The device is also specifically used for: When the first configuration information is consistent with the second configuration information, the specified type rate of the mobile disk to be tested is obtained, and the specified type rate includes at least one of the following: read rate and write rate; Compare the specified rate type with the preset rate; When the specified type rate fails to match the preset rate, a second abnormality alert is triggered.

8. An electronic device, characterized in that, It includes a processor and a memory, the memory being used to store one or more programs and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-4.

9. A computer-readable storage medium, characterized in that, A computer program for storing electronic data interchange is provided, wherein the computer program causes a computer to perform the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Hardware product testing method and related equipment

    CN113538725A