Test method, device, equipment and medium for realizing storage automatic partition management

CN116541223BActive Publication Date: 2026-09-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310504496.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2026-09-22
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

[0005]针对上述传统Windows下存储测试依赖人工手动进行,测试效率低,数据出了事容易出错,准确率低以及测试错误无法及时停止,浪费测试资源的缺陷,本发明提供一种实现存储自动化分区管理的测试方法、装置、设备及介质,以解决上述技术问题

Benefits of technology

[0079]本发明提供的实现存储自动化分区管理的测试方法、装置、设备及介质,实现windows下存储测试时自动进行自定义的分区管理,替代传统手动逐盘分区管理的全过程,并能对测试状态持续监测,出现问题及时告警,及时中止测试。本发明有完整的分区管理策略的策略池、存在日志检测机制和测试中止机制,根据与服务器存储设备实际测试场景进行适配并不断完善的分区管理策略。本发明通过自动化执行标准化过程,解决手动操作易出错的问题,提高测试准确度,提升测试效率,在应用过程中有效提升测试质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541223B_ABST
    Figure CN116541223B_ABST
Patent Text Reader

Abstract

The application provides a kind of to realize the test method, device, equipment and medium of storage automation partition management, belong to storage test technical field, the method steps are as follows: select partition management strategy, connect the machine under test according to the position of machine under test;According to the partition management strategy selected, hard disk screening and partition state analysis are carried out, and strategy translation is carried out to establish instruction set of machine under test hard disk;According to the test strategy, the instruction set is cut and combined, and the partition target script is generated and executed, to obtain the execution result file;The process log is recorded in the process of instruction set generation and partition target script execution, the execution result file is analyzed to determine whether the partition target script is executed successfully, whether the partition of the disk under test is verified to take effect, and the selected partition management strategy and process log are collected.The application realizes automatic custom partition management when testing storage under windows, continuously monitors the test state, improves the test accuracy and improves the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of storage testing technology, specifically relating to a testing method, apparatus, equipment, and medium for realizing automated storage partition management. Background Technology

[0002] In Windows storage testing, many scenarios involve hard drive partition deletion and creation. Traditional Windows hard drive partition management requires manual intervention. This involves manually selecting the partition management strategy, manually managing each hard drive, manually verifying the effectiveness of the partition management process, and manually terminating the test. Furthermore, the test requires manually checking the hard drive status, capacity, and whether the partitions are activated and formatted successfully. The entire testing process relies on manual monitoring and recording, making it impossible to generate a unified log file.

[0003] In summary, current traditional Windows storage testing relies on manual operation, which involves repetitive tasks, low testing efficiency, high manpower investment, and high testing costs. Manual storage testing under Windows is also prone to errors and has low accuracy when there is a heavy workload of data processing and operation. The entire process monitoring of storage testing under Windows is also done manually, which makes it impossible to detect and stop errors in time, resulting in a long testing time and a waste of testing resources.

[0004] Therefore, it is essential to provide a testing method, apparatus, equipment, and medium for achieving automated storage partition management, addressing the aforementioned shortcomings. Summary of the Invention

[0005] To address the shortcomings of traditional Windows storage testing, which relies on manual operation, resulting in low testing efficiency, susceptibility to data errors, low accuracy, and the inability to promptly stop testing due to errors, thus wasting testing resources, this invention provides a testing method, apparatus, device, and medium for automated storage partition management to solve the aforementioned technical problems.

[0006] In a first aspect, the present invention provides a testing method for implementing automated storage partition management, comprising the following steps:

[0007] S1. Select the partition management strategy and connect to the machine under test based on its location;

[0008] S2. Based on the selected partition management strategy, screen the hard drives to be tested and analyze their partition status, and translate the strategy into a set of instructions for the hard drives to be tested;

[0009] S3. Based on the test strategy, the instruction set is cut and combined to generate and execute the partition target script, and the execution result file is obtained;

[0010] S4. Record process logs for the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management strategy and process logs.

[0011] Furthermore, the specific steps of step S1 are as follows:

[0012] S11. Develop a partition management strategy in advance that meets the testing requirements based on the test scenario;

[0013] S12. Create a policy pool to store the defined partition management policies;

[0014] S13. Obtain the actual test scenario and determine whether the required partition management strategy exists in the strategy pool;

[0015] If so, select the required partition management policy from the policy pool according to the actual test scenario, and proceed to step S14;

[0016] If not, formulate a corresponding partition management strategy and add the newly formulated partition management strategy to the strategy pool, then return to step S13;

[0017] S14. Determine whether to perform partition management on the local machine;

[0018] If so, select the local machine as the machine to be tested and proceed to step S2;

[0019] If not, proceed to step S15;

[0020] S15. Select the remote target machine as the machine under test, and use the executor to connect to the machine under test via a remote protocol.

[0021] Furthermore, the specific steps of step S2 are as follows:

[0022] S21. Obtain all hard drive information of the machine under test, filter all hard drives under test according to the partition management strategy, generate a set of hard drives under test, and record the information of each hard drive under test;

[0023] S22. Traverse the set of hard disks to be tested to obtain the partition status of each hard disk to be tested, translate the partition management policy, and filter out the hard disks to be tested that need to be processed based on the partition status;

[0024] S23. Determine the partitioning operation instructions that need to be performed on the hard drive under test based on the partitioning management strategy and the information of the hard drive under test, and establish a set of instruction operations.

[0025] Furthermore, the specific steps of step S3 are as follows:

[0026] S31. Obtain the test strategy;

[0027] When the test strategy is a single hard drive and a single script strategy, proceed to step S32;

[0028] When the testing strategy is a unified management script strategy, proceed to step S33;

[0029] When the test strategy is the hard disk classification script strategy, proceed to step S34;

[0030] S32. Divide the instructions in the instruction set according to the hard disk under test, generate a partition target script for each hard disk under test, execute the partitioning separately for each hard disk under test, and proceed to step S35;

[0031] S33. Generate a unified partition target script for all hard disks under test according to the instruction set, execute the partition target script uniformly, and proceed to step S35;

[0032] S34. Divide the instructions in the instruction set according to the hard disk type, generate a partition target script for the same type of hard disk under test, and execute the partitioning separately for each type of hard disk under test;

[0033] S35. Output the execution results of each instruction in the partition target script to the execution result file.

[0034] Furthermore, the specific steps of step S4 are as follows:

[0035] S41. Record process logs for the policy pool maintenance process before instruction set generation, the selection process of the machine under test, the partition management policy translation process, the partition target script generation process, and the partition execution process of the hard disk under test;

[0036] S42. Parse the execution result file and determine whether the partition target script was executed successfully in combination with the partition management strategy. After the partition target script is executed successfully, verify whether the partition of the disk under test is effective.

[0037] S43. The process of collecting and recording data includes logging the hard drive partitions under test, employing a partition management strategy, and backing up the collected files.

[0038] Furthermore, the specific steps of step S42 are as follows:

[0039] S421. Parse the execution result file to obtain the output of each instruction;

[0040] S422. Obtain the partition management policy and verify whether the corresponding partition target script has been executed successfully based on the partition management policy;

[0041] If so, proceed to step S424;

[0042] If not, proceed to step S423;

[0043] S423. Based on the pre-set execution failure handling result, choose to continue to the next step or terminate the test, and proceed to step S43;

[0044] S424. Compare the partition status of the hard drive under test before and after executing the partition target script to determine whether the partition of the hard drive under test has taken effect.

[0045] Furthermore, a machine learning model for the hard disk partition under test is established, and the model is trained based on the partition management strategy and the set of instructions used in the partition target script. The trained machine learning model is then used to automatically partition the hard disk.

[0046] Furthermore, in step S43, when the machine under test is a remote target machine, the collected files are backed up to the execution machine.

[0047] Secondly, the present invention provides a testing apparatus for realizing automated storage partition management, comprising:

[0048] The strategy selection and machine under test connection module is used to select the partition management strategy and connect the machine under test according to its location.

[0049] The strategy translation module is used to filter the hard drives to be tested and analyze the partition status according to the selected partition management strategy, and to translate the strategy into an instruction set for the hard drives to be tested.

[0050] The partition script execution module is used to cut and combine the instruction set according to the test strategy, generate and execute the partition target script, and obtain the execution result file.

[0051] The partition result collection module is used to record process logs of the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management strategy and process logs.

[0052] Furthermore, the strategy selection and device-under-test (DUT) connectivity module includes:

[0053] The strategy formulation unit is used to formulate partition management strategies in advance that meet the test requirements based on the test scenario;

[0054] The policy storage unit is used to create policy pools and store the defined partition management policies.

[0055] The strategy judgment unit is used to obtain the actual test scenario and determine whether the required partition management strategy exists in the strategy pool.

[0056] The strategy selection unit is used to select the required partition management strategy from the strategy pool based on the actual test scenario.

[0057] The strategy supplement unit is used to formulate corresponding partition management strategies and supplement the newly formulated partition management strategies to the strategy pool;

[0058] The local machine judgment unit is used to determine whether to perform partition management on the local machine;

[0059] The local machine selection unit is used to select a local machine as the machine to be tested when performing partition management on the local machine.

[0060] The remote machine selection unit is used to select a remote target machine as the machine under test when the local machine performs partition management, and to connect to the machine under test using the executor via a remote protocol.

[0061] Furthermore, the strategy translation module includes:

[0062] The test disk filtering unit is used to obtain all disk information of the machine under test, filter all the test disks according to the partition management strategy, generate a set of test disks, and record the information of each test disk.

[0063] The test disk filtering unit is used to traverse the set of test disks to obtain the partition status of each test disk, translate the partition management policy, and filter out the test disks that need to be processed based on the partition status.

[0064] The instruction set establishment unit is used to determine the partition-type operation instructions that need to be performed on the hard drive under test based on the partition management strategy and the information of the hard drive under test, and to establish the instruction operation set.

[0065] Furthermore, the partitioning script execution module includes:

[0066] Test measurement acquisition unit, used to acquire test strategies;

[0067] A single hard drive partition unit is used when the test strategy is a single hard drive single script strategy. The instructions in the instruction set are divided according to the hard drive under test, and a partition target script is generated for each hard drive under test. The partition is executed separately for each hard drive under test.

[0068] The unified partitioning unit for hard disks is used to generate a unified partitioning target script for all hard disks under test based on the instruction set when the test strategy is a unified management script strategy, and to execute the partitioning target script uniformly.

[0069] The hard disk type partition unit is used to divide the instructions in the instruction set according to the hard disk type when the test strategy is the hard disk type script strategy. It generates a partition target script for the same type of hard disk under test and executes partitioning separately for each type of hard disk under test.

[0070] The execution result file generation unit is used to output the execution result of each instruction in the partition target script to the execution result file.

[0071] Furthermore, the partitioning result collection module includes:

[0072] The process log recording unit is used to record process logs for the policy pool maintenance process before instruction set generation, the selection process of the machine under test, the partition management policy translation process, the partition target script generation process, and the partition execution process of the hard disk under test.

[0073] The execution result judgment unit is used to parse the execution result file, and in combination with the partition management strategy, determine whether the partition target script was executed successfully, and verify whether the partition of the disk under test is effective after the partition target script is executed successfully;

[0074] The file backup unit is used to collect and record process logs and partition management strategies for the hard disk under test, and to back up the collected files.

[0075] Thirdly, the present invention provides an apparatus including a processor and a memory;

[0076] The memory is used to store a computer program, and the processor is used to retrieve and run the computer program from the memory, causing the device to perform the method described in the first aspect above.

[0077] Fourthly, the present invention provides a storage medium storing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect.

[0078] The beneficial effects of this invention are as follows:

[0079] This invention provides a testing method, apparatus, device, and medium for automated storage partition management. It enables automated, customized partition management during storage testing under Windows, replacing the traditional manual disk-by-disk partition management process. It also continuously monitors the test status, promptly alerting and halting tests in case of problems. This invention features a complete partition management strategy pool, an existence log detection mechanism, and a test termination mechanism. The partition management strategy is adapted to and continuously improved based on the actual testing scenarios of server storage devices. By automating standardized processes, this invention solves the problem of errors inherent in manual operation, improves test accuracy and efficiency, and effectively enhances test quality during application.

[0080] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects.

[0081] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description

[0082] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0083] Figure 1 This is a schematic flowchart of Embodiment 1 of the test method for implementing automated storage partition management according to the present invention.

[0084] Figure 2 This is a schematic diagram of the second embodiment of the test method for implementing automated storage partition management according to the present invention.

[0085] Figure 3 This is a schematic diagram of the test device for implementing automated storage partition management according to the present invention. Detailed Implementation

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

[0087] Example 1:

[0088] like Figure 1 As shown, this invention provides a testing method for implementing automated storage partition management, comprising the following steps:

[0089] S1. Select the partition management strategy and connect to the machine under test based on its location;

[0090] S2. Based on the selected partition management strategy, screen the hard drives to be tested and analyze their partition status, and translate the strategy into a set of instructions for the hard drives to be tested;

[0091] S3. Based on the test strategy, the instruction set is cut and combined to generate and execute the partition target script, and the execution result file is obtained;

[0092] S4. Record process logs for the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management strategy and process logs.

[0093] Example 2:

[0094] like Figure 2 As shown, this invention provides a testing method for implementing automated storage partition management, comprising the following steps:

[0095] S1. Select a partition management strategy and connect to the machine under test based on its location; the specific steps for step S1 are as follows:

[0096] S11. Develop a partition management strategy in advance that meets the testing requirements based on the test scenario;

[0097] S12. Create a policy pool to store the defined partition management policies;

[0098] S13. Obtain the actual test scenario and determine whether the required partition management strategy exists in the strategy pool;

[0099] If so, select the required partition management policy from the policy pool according to the actual test scenario, and proceed to step S14;

[0100] If not, formulate a corresponding partition management strategy and add the newly formulated partition management strategy to the strategy pool, then return to step S13;

[0101] S14. Determine whether to perform partition management on the local machine;

[0102] If so, select the local machine as the machine to be tested and proceed to step S2;

[0103] If not, proceed to step S15;

[0104] S15. Select the remote target machine as the machine under test, and use the execution machine to connect to the machine under test via a remote protocol;

[0105] S2. Based on the selected partition management strategy, screen the hard drives to be tested and analyze their partition status, then translate the strategy into a set of instructions for the hard drives to be tested; the specific steps of step S2 are as follows:

[0106] S21. Obtain all hard drive information of the machine under test, filter all hard drives under test according to the partition management strategy, generate a set of hard drives under test, and record the information of each hard drive under test;

[0107] S22. Traverse the set of hard disks to be tested to obtain the partition status of each hard disk to be tested, translate the partition management policy, and filter out the hard disks to be tested that need to be processed based on the partition status;

[0108] S23. Determine the partitioning operation instructions that need to be performed on the hard drive under test based on the partitioning management strategy and the information of the hard drive under test, and establish a set of instruction operations;

[0109] S3. Based on the testing strategy, the instruction set is segmented and combined to generate and execute the partition target script, obtaining the execution result file; the specific steps of step S3 are as follows:

[0110] S31. Obtain the test strategy;

[0111] When the test strategy is a single hard drive and a single script strategy, proceed to step S32;

[0112] When the testing strategy is a unified management script strategy, proceed to step S33;

[0113] When the test strategy is the hard disk classification script strategy, proceed to step S34;

[0114] S32. Divide the instructions in the instruction set according to the hard disk under test, generate a partition target script for each hard disk under test, execute the partitioning separately for each hard disk under test, and proceed to step S35;

[0115] S33. Generate a unified partition target script for all hard disks under test according to the instruction set, execute the partition target script uniformly, and proceed to step S35;

[0116] S34. Divide the instructions in the instruction set according to the hard disk type, generate a partition target script for the same type of hard disk under test, and execute the partitioning separately for each type of hard disk under test;

[0117] S35. Output the execution result of each instruction in the partition target script to the execution result file;

[0118] S4. Record process logs for the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management policy and process logs; the specific steps of step S4 are as follows:

[0119] S41. Record process logs for the policy pool maintenance process before instruction set generation, the selection process of the machine under test, the partition management policy translation process, the partition target script generation process, and the partition execution process of the hard disk under test;

[0120] S42. Parse the execution result file and determine whether the partition target script was executed successfully in combination with the partition management strategy. After the partition target script is executed successfully, verify whether the partition of the disk under test is effective.

[0121] S43. The process of collecting and recording data includes logging the hard drive partitions under test, employing a partition management strategy, and backing up the collected files.

[0122] Example 3:

[0123] like Figure 2 As shown, this invention provides a testing method for implementing automated storage partition management, comprising the following steps:

[0124] S1. Select a partition management strategy and connect to the machine under test based on its location; the specific steps for step S1 are as follows:

[0125] S11. Develop a partition management strategy in advance that meets the testing requirements based on the test scenario;

[0126] S12. Create a policy pool to store the defined partition management policies;

[0127] S13. Obtain the actual test scenario and determine whether the required partition management strategy exists in the strategy pool;

[0128] If so, select the required partition management policy from the policy pool according to the actual test scenario, and proceed to step S14;

[0129] If not, formulate a corresponding partition management strategy and add the newly formulated partition management strategy to the strategy pool, then return to step S13;

[0130] The partition management of various types and scenarios is unified into specific policies, which can be continuously added and improved, and can be directly retrieved from the policy pool when needed;

[0131] Depending on the different test scenarios, the partition management requirements for the hard drive under test will also be different. For specific test scenarios, partition management strategies that meet the test requirements need to be formulated. The partition management strategies are collected in a unified strategy pool, which can be flexibly selected and called. Moreover, as the test scenarios become more diverse, they can be flexibly expanded, modified and improved.

[0132] For example, formulate a partition management strategy: select all non-system disks as the hard drives to be tested; skip hard drives with existing partitions, and create a partition for those without partitions based on the hard drive capacity; for example, create a 500GB partition for hard drives to be tested that are 500GB or larger, and create a 200GB partition for hard drives to be tested that are smaller than 500GB, and use the format quick command to perform quick partitioning.

[0133] S14. Determine whether to perform partition management on the local machine;

[0134] If so, select the local machine as the machine to be tested and proceed to step S2;

[0135] If not, proceed to step S15;

[0136] S15. Select the remote target machine as the machine under test, and use the execution machine to connect to the machine under test via a remote protocol; WinRM technology is used to automatically connect to the remote machine under test; WinRM is a Windows remote management technology.

[0137] Partition management can be performed on a local machine or remotely connected to and operated on a remote machine under test. In most automated testing scenarios, there is a fixed Linux execution machine that is remotely connected to and tested via the WinRM protocol. This invention is compatible with both scenarios and can be freely selected.

[0138] S2. Based on the selected partition management strategy, screen the hard drives to be tested and analyze their partition status, then translate the strategy into a set of instructions for the hard drives to be tested; the specific steps of step S2 are as follows:

[0139] S21. Obtain all hard drive information of the machine under test, filter all hard drives under test according to the partition management strategy, generate a set of hard drives under test, and record the information of each hard drive under test; viewing and filtering the hard drives under test of the machine under test is done in the following way:

[0140] Using the diskpart tool in the cmd command prompt, the listdisk command can be executed to obtain all the hard drives on the machine. The system drive letter can be obtained using os.getenv or SystemDrive. By filtering and comparing, information such as the ID of each hard drive, whether it is a system drive, disk size, and status can be obtained. For example, in partition management strategies, all non-system drives need to be selected as the target set of hard drives to be tested, and the corresponding hard drive ID and disk size information should be recorded.

[0141] S22. Traverse the set of hard drives to be tested to obtain the partition status of each hard drive, translate the partition management policy, and filter out the hard drives to be tested that need to be processed based on the partition status; automatically determine the specific disk situation of the machine under test, and automatically filter out the hard drives to be tested that meet the test requirements; analyze the current disk partition status: traverse the list of hard drives to be tested, select a disk using the selectdisk id command, and execute the list partition command to obtain the partition status of all partitions under the disk; for example, if the partition management policy requires skipping existing partitions and creating a partition based on the hard drive capacity for non-partitioned disks, this step requires deleting hard drives that have already created partitions to achieve hard drive filtering;

[0142] S23. Based on the partition management policy and the information of the hard drive under test, determine the partition-type operation instructions that need to be performed on the hard drive under test, and establish an instruction operation set; process the disk and instructions according to the policy: After the above two steps, the disk under test and the detailed information set have been selected. The next step is to convert these disks under test and the operations to be performed into specific instruction sets according to the partition management policy; for example, the partition management policy requires different instructions to be associated with different disk sizes. Taking the creation of a 500G partition on disk 0 and quick formatting as an example, the instructions are as follows:

[0143] sekect disk 0,create partition primary size=512000,active,formatquick;

[0144] To create a 200GB partition on disk 1 without formatting, the command is as follows:

[0145] sekect disk 1,create partition primary size=512000,active;

[0146] S3. Based on the testing strategy, the instruction set is segmented and combined to generate and execute the partition target script, obtaining the execution result file; the specific steps of step S3 are as follows:

[0147] S31. Obtain the test strategy;

[0148] When the test strategy is a single hard drive and a single script strategy, proceed to step S32;

[0149] When the testing strategy is a unified management script strategy, proceed to step S33;

[0150] When the test strategy is the hard disk classification script strategy, proceed to step S34;

[0151] S32. Divide the instructions in the instruction set according to the hard disk under test, generate a partition target script for each hard disk under test, execute the partitioning separately for each hard disk under test, and proceed to step S35;

[0152] S33. Generate a unified partition target script for all hard disks under test according to the instruction set, execute the partition target script uniformly, and proceed to step S35;

[0153] S34. Divide the instructions in the instruction set according to the hard disk type, generate a partition target script for the same type of hard disk under test, and execute the partitioning separately for each type of hard disk under test;

[0154] S35. Output the execution result of each instruction in the partition target script to the execution result file;

[0155] Leveraging the characteristics of the diskpart tool, the partition management policy is translated within the computer case, parsing out the specific instruction set. This set is then segmented and combined to generate multiple executable scripts. These scripts are executed via the Windows command prompt (Windows cmd) to manage the entire partition management process. For example, during the policy translation process, the disk under test is combined with specific diskpart partition management instructions. This can be achieved by creating a separate partition target script for each hard drive for separate execution and result management, or by generating a unified partition target script for consistent result management, or by grouping disks of the same type into a single script for categorized result management. In short, the optimal script generation method is selected based on the testing strategy and to better control the partition management process.

[0156] The partition target script group generated by different partition management strategies can be called and executed. By executing "diskpart / s script name > execution result file" in cmd, the commands in the partition target script will be executed sequentially, and the execution result of each instruction will be output to the corresponding execution result file, which is convenient for parsing, analysis, result judgment, verification, test termination, etc.

[0157] The partition management strategy required for different disks under test is executed. The partition target script realizes the standardized process of automated execution, solves the problem of errors caused by manual operation, and improves the accuracy of testing.

[0158] The target script for partitioning is generated using Python, Windows control intelligent positioning technology, and pyautogui automatic button clicking technology.

[0159] S4. Record process logs for the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management policy and process logs; the specific steps of step S4 are as follows:

[0160] S41. Record process logs for the policy pool maintenance process before instruction set generation, the selection process of the machine under test, the partition management policy translation process, the partition target script generation process, and the partition execution process of the hard disk under test;

[0161] S42. Parse the execution result file and determine whether the partition target script was executed successfully based on the partition management strategy. After the partition target script is executed successfully, verify whether the partition on the disk under test is effective. The specific steps of step S42 are as follows:

[0162] S421. Parse the execution result file to obtain the output of each instruction;

[0163] S422. Obtain the partition management policy and verify whether the corresponding partition target script has been executed successfully based on the partition management policy;

[0164] If so, proceed to step S424;

[0165] If not, proceed to step S423;

[0166] S423. Based on the pre-set execution failure handling result, choose to continue to the next step or terminate the test, and proceed to step S43;

[0167] S424. Compare the partition status of the hard drive under test before and after executing the partition target script to determine whether the partition of the hard drive under test has taken effect;

[0168] S43. The process of collecting and recording logs and partitions of the hard disk under test adopts a partition management strategy, and the collected files are backed up; in step S43, when the machine under test is a remote target machine, the collected files are backed up to the execution machine;

[0169] Each time the partition target script is executed, the execution result file is obtained. The output of each command in the result file is parsed to determine whether the instruction was executed successfully and whether disk partition management is effective. The criteria for judging test failure and success vary depending on the partition management strategy; therefore, result judgment and verification are crucial. This determines whether to continue to the next step or terminate the test after a failure in a certain step. Throughout the automated partition management process, each operation is logged. Before the end of each step, all log files are collected and sent back to the execution machine for backup and problem traceability.

[0170] Every step and operation is recorded in detail, including the initial state of the disk under test, the execution process of the partition management strategy, and the final effective state. After the test is completed, the logs can be backed up and archived to facilitate problem tracking and improve test quality.

[0171] In some embodiments, a machine learning model for the hard disk partition under test is established, and the machine learning model is trained according to the partition management strategy selection and the instruction set used in the partition target script. The trained machine learning model for the hard disk partition under test is then used to automatically partition the hard disk.

[0172] Example 4:

[0173] like Figure 3 As shown, the present invention provides a test apparatus for realizing automated storage partition management, comprising:

[0174] The strategy selection and machine under test connection module is used to select the partition management strategy and connect the machine under test according to its location.

[0175] The strategy translation module is used to filter the hard drives to be tested and analyze the partition status according to the selected partition management strategy, and to translate the strategy into an instruction set for the hard drives to be tested.

[0176] The partition script execution module is used to cut and combine the instruction set according to the test strategy, generate and execute the partition target script, and obtain the execution result file.

[0177] The partition result collection module is used to record process logs of the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management strategy and process logs.

[0178] Example 5:

[0179] like Figure 3 As shown, the present invention provides a test apparatus for realizing automated storage partition management, comprising:

[0180] The strategy selection and device-under-test (DUT) connection module is used to select the partition management strategy and connect to the DUT based on its location. The strategy selection and DUT connection module includes:

[0181] The strategy formulation unit is used to formulate partition management strategies in advance that meet the test requirements based on the test scenario;

[0182] The policy storage unit is used to create policy pools and store the defined partition management policies.

[0183] The strategy judgment unit is used to obtain the actual test scenario and determine whether the required partition management strategy exists in the strategy pool.

[0184] The strategy selection unit is used to select the required partition management strategy from the strategy pool based on the actual test scenario.

[0185] The strategy supplement unit is used to formulate corresponding partition management strategies and supplement the newly formulated partition management strategies to the strategy pool;

[0186] The local machine judgment unit is used to determine whether to perform partition management on the local machine;

[0187] The local machine selection unit is used to select a local machine as the machine to be tested when performing partition management on the local machine.

[0188] The remote machine selection unit is used to select a remote target machine as the machine under test when the local machine performs partition management, and the execution machine connects to the machine under test through a remote protocol.

[0189] The strategy translation module is used to filter and analyze the partition status of the hard drive under test according to the selected partition management strategy, and translate the strategy to create a set of instructions for the hard drive under test; the strategy translation module includes:

[0190] The test disk filtering unit is used to obtain all disk information of the machine under test, filter all the test disks according to the partition management strategy, generate a set of test disks, and record the information of each test disk.

[0191] The test disk filtering unit is used to traverse the set of test disks to obtain the partition status of each test disk, translate the partition management policy, and filter out the test disks that need to be processed based on the partition status.

[0192] The instruction set establishment unit is used to determine the partition-type operation instructions that need to be performed on the hard drive under test based on the partition management strategy and the information of the hard drive under test, and to establish the instruction operation set.

[0193] The partition script execution module is used to cut and combine the instruction set according to the test strategy, generate and execute the partition target script, and obtain the execution result file; the partition script execution module includes:

[0194] Test measurement acquisition unit, used to acquire test strategies;

[0195] A single hard drive partition unit is used when the test strategy is a single hard drive single script strategy. The instructions in the instruction set are divided according to the hard drive under test, and a partition target script is generated for each hard drive under test. The partition is executed separately for each hard drive under test.

[0196] The unified partitioning unit for hard disks is used to generate a unified partitioning target script for all hard disks under test based on the instruction set when the test strategy is a unified management script strategy, and to execute the partitioning target script uniformly.

[0197] The hard disk type partition unit is used to divide the instructions in the instruction set according to the hard disk type when the test strategy is the hard disk type script strategy. It generates a partition target script for the same type of hard disk under test and executes partitioning separately for each type of hard disk under test.

[0198] The execution result file generation unit is used to output the execution result of each instruction in the partition target script to the execution result file;

[0199] The partition result collection module records process logs for the instruction set generation process and the partition target script execution process, analyzes the execution result files to determine whether the partition target script executed successfully, verifies whether the partitions on the disk under test are effective, and collects the selected partition management strategy and process logs. The partition result collection module includes:

[0200] The process log recording unit is used to record process logs for the policy pool maintenance process before instruction set generation, the selection process of the machine under test, the partition management policy translation process, the partition target script generation process, and the partition execution process of the hard disk under test.

[0201] The execution result judgment unit is used to parse the execution result file, and in combination with the partition management strategy, determine whether the partition target script was executed successfully, and verify whether the partition of the disk under test is effective after the partition target script is executed successfully;

[0202] The file backup unit is used to collect and record process logs and partition management strategies for the hard disk under test, and to back up the collected files.

[0203] Example 6:

[0204] This invention provides a device, including a processor and a memory;

[0205] The memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that the device performs the methods described in Embodiment 1, Embodiment 2 or Embodiment 3 above.

[0206] Example 7:

[0207] This invention provides a storage medium,

[0208] The storage medium stores instructions that, when run on a computer, cause the computer to execute the methods described in Embodiment 1, Embodiment 2, or Embodiment 3.

[0209] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.

Claims

1. A testing method for achieving automated storage partition management, characterized in that, Includes the following steps: S1. Select the partition management strategy and connect to the machine under test based on its location; S2. Based on the selected partition management strategy, screen the hard drives to be tested and analyze their partition status, and translate the strategy into a set of instructions for the hard drives to be tested; The specific steps of step S2 are as follows: S21. Obtain all hard drive information of the machine under test, filter all hard drives under test according to the partition management strategy, generate a set of hard drives under test, and record the information of each hard drive under test; viewing and filtering the hard drives under test of the machine under test is done in the following way: Using the cmd command, execute the listdisk command with the diskpart tool to obtain all hard drives on the machine. The system drive letter can be obtained using os.getenv or SystemDrive. By filtering and comparing, you can obtain the ID of each hard drive, whether it is the system drive, its size, and status information. S22. Traverse the set of hard disks to be tested to obtain the partition status of each hard disk to be tested, translate the partition management policy, and filter out the hard disks to be tested that need to be processed based on the partition status; S23. Determine the partition-type operation instructions that need to be performed on the hard drive under test based on the partition management strategy and the information of the hard drive under test, and establish an instruction operation set; process the disk and instructions according to the strategy: after the above two steps, the disk under test and the detailed information set have been selected. According to the partition management strategy, these disks under test and the operations to be performed are transformed into specific instruction sets. S3. Based on the test strategy, the instruction set is cut and combined to generate and execute the partition target script, and the execution result file is obtained; The specific steps of step S3 are as follows: S31. Obtain the test strategy; When the test strategy is a single hard drive and a single script strategy, proceed to step S32; When the testing strategy is a unified management script strategy, proceed to step S33; When the test strategy is the hard disk classification script strategy, proceed to step S34; S32. Divide the instructions in the instruction set according to the hard disk under test, generate a partition target script for each hard disk under test, execute the partitioning separately for each hard disk under test, and proceed to step S35; S33. Generate a unified partition target script for all hard disks under test according to the instruction set, execute the partition target script uniformly, and proceed to step S35; S34. Divide the instructions in the instruction set according to the hard disk type, generate a partition target script for the same type of hard disk under test, and execute the partitioning separately for each type of hard disk under test; S35. Output the execution results of each instruction in the partition target script to the execution result file; S4. Record process logs for the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management strategy and process logs; The specific steps of step S4 are as follows: S41. Record process logs for the policy pool maintenance process before instruction set generation, the selection process of the machine under test, the partition management policy translation process, the partition target script generation process, and the partition execution process of the hard disk under test; S42. Parse the execution result file and determine whether the partition target script was executed successfully in combination with the partition management strategy. After the partition target script is executed successfully, verify whether the partition of the disk under test is effective. S43. The process of collecting and recording data includes logging the hard drive partitions under test, employing a partition management strategy, and backing up the collected files.

2. The test method for implementing automated storage partition management as described in claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Develop a partition management strategy in advance that meets the testing requirements based on the test scenario; S12. Create a policy pool to store the defined partition management policies; S13. Obtain the actual test scenario and determine whether the required partition management strategy exists in the strategy pool; If so, select the required partition management policy from the policy pool according to the actual test scenario, and proceed to step S14; If not, formulate a corresponding partition management strategy and add the newly formulated partition management strategy to the strategy pool, then return to step S13; S14. Determine whether to perform partition management on the local machine; If so, select the local machine as the machine to be tested and proceed to step S2; If not, proceed to step S15; S15. Select the remote target machine as the machine under test, and use the executor to connect to the machine under test via a remote protocol.

3. The test method for implementing automated storage partition management as described in claim 2, characterized in that, The specific steps of step S42 are as follows: S421. Parse the execution result file to obtain the output of each instruction; S422. Obtain the partition management policy and verify whether the corresponding partition target script has been executed successfully based on the partition management policy; If so, proceed to step S424; If not, proceed to step S423; S423. Based on the pre-set execution failure handling result, choose to continue to the next step or terminate the test, and proceed to step S43; S424. Compare the partition status of the hard drive under test before and after executing the partition target script to determine whether the partition of the hard drive under test has taken effect.

4. The test method for implementing automated storage partition management as described in claim 1, characterized in that, A machine learning model for partitioning the hard drive to be tested is established, and the model is trained based on the partition management strategy and the set of instructions used in the partition target script. The trained machine learning model is then used to automatically partition the hard drive.

5. A testing apparatus for realizing automated storage partition management, performing the method according to any one of claims 1-4, characterized in that, include: The strategy selection and machine under test connection module is used to select the partition management strategy and connect the machine under test according to its location. The strategy translation module is used to filter the hard drives to be tested and analyze the partition status according to the selected partition management strategy, and to translate the strategy into an instruction set for the hard drives to be tested. The partition script execution module is used to cut and combine the instruction set according to the test strategy, generate and execute the partition target script, and obtain the execution result file. The partition result collection module is used to record process logs of the instruction set generation process and the partition target script execution process, analyze the execution result file to determine whether the partition target script was executed successfully, verify whether the partition of the disk under test is effective, and collect the selected partition management strategy and process logs.

6. A device, characterized in that, Including processor and memory; The memory is used to store a computer program, and the processor is used to retrieve and run the computer program from the memory, causing the device to perform the method described in any one of claims 1-4.

7. A storage medium, characterized in that, The storage medium stores instructions that, when run on a computer, cause the computer to perform the method described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method for intelligently and automatically adjusting storage equipment partition in computer system

    CN102253895A

  • Hard disk partition test method and device, equipment and storage medium

    CN112463500A

  • Storage pressure testing method, device, equipment and medium

    CN115185757A