Abnormal power failure test method and device for solid state hard disk during data encryption and decryption process
By creating multi-level initial data sets on solid-state drives and simulating different types of power-down events, detecting the encryption and decryption status and scoring, the problem of the failure of the existing technology to effectively test the impact of power-down events in the data encryption and decryption process of solid-state drives is solved, and the anti-interference ability and security of data processing are improved.
Patent Information
- Application Number
- CN202510222214.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-02-27
AI Technical Summary
The prior art has failed to effectively simulate and test the impact of different types of power-down events in the data encryption and decryption process of solid-state drives, resulting in data integrity and security being threatened.
By creating multi-level initial data sets on a formatted solid-state drive and simulating different types of power-down events at different stages of the encryption and decryption operation, including continuous power-down, long power-down and periodic power-down. After each simulated power-down event, restart the hard disk and detect the encrypted and decrypted state of the data set, comparing with the pre-power-down state to determine the test score.
This method can effectively evaluate the impact of different power-down events on the data encryption and decryption process, improve the anti-interference ability and security in the data processing process, and identify the weakness conditions of the hard disk based on the test scores, and generate targeted test reports.
Smart Images

Figure CN119724320B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic digital data processing, and in particular to a method, device, storage medium and program product for testing abnormal power failure of a solid state hard disk during data encryption and decryption. Background Art
[0002] As data security requirements increase, solid-state drives (SSDs) play an increasingly critical role in data encryption and decryption processing. These operations ensure that data stored on SSDs remain secure from unauthorized access. Especially in data centers and enterprise-level applications, data encryption has become a necessary standard.
[0003] In the related art, when SSDs perform data encryption and decryption, they usually use standard encryption algorithms, such as AES or RSA. These algorithms can effectively ensure data security when encrypting and decrypting data. In existing data encryption and decryption tests, initial data sets are usually created on SSDs, and then encryption or decryption operations are performed on these data sets to test the effectiveness of the algorithm and the processing capabilities of the hard disk.
[0004] However, the related art does not fully consider the impact of power failure events that may occur in actual applications on the data encryption and decryption process. In actual applications, power failure events may cause the encryption or decryption process to be interrupted, thereby affecting the integrity and security of the data. Summary of the invention
[0005] The present application provides a method and device for testing abnormal power failure of a solid-state hard disk during data encryption and decryption, which is used to solve the problem of how to effectively simulate and test the impact of different types of power failure events during the data encryption and decryption process of the solid-state hard disk to ensure the integrity and security of data in the event of a power failure.
[0006] In a first aspect, the present application provides a method for testing abnormal power failure of a solid state drive during data encryption and decryption, which is applied to a power failure testing device. The method includes:
[0007] Creating a multi-level initial data set on the formatted solid state drive to be tested, and using a preset algorithm to perform encryption or decryption operations on the initial data set, the initial data set includes a static data set and a dynamic data set, and different initial data sets correspond to different preset algorithms;
[0008] In different preset stages of the encryption or decryption operation, the controllable power supply control system is controlled to simulate different types of power failure events, the preset stages include the start stage, the middle stage and the stage to be completed of the encryption or decryption operation, and the types of power failure events include continuous power failure, long-term power failure and periodic power failure;
[0009] After each simulated power-off event, restart the solid-state hard disk to be tested and detect the encryption or decryption status of the initial data set;
[0010] Comparing the encryption or decryption state with the encryption or decryption state before power failure, and determining the test scores corresponding to different types of power failure events at different encryption or decryption stages of the solid state drive to be tested;
[0011] A weakness condition is determined based on the test score and a test report is generated, wherein the weakness condition is a preset stage and a power-off event corresponding to a test score that is lower than a preset score threshold.
[0012] Through the above-mentioned embodiment, the power-off test device creates a multi-level initial data set on the solid-state hard disk, and simulates different types of power-off events at different stages of encryption or decryption operations thereon, re-detects the encryption or decryption status of the data set after each power-off, and compares it with the status before the power-off to obtain a scoring result, so as to simulate the specific impact of different power-off events on the data integrity and security at different encryption or decryption stages, thereby improving the anti-interference capability and security in the data processing process.
[0013] In some embodiments, after the step of comparing the encryption or decryption state with the state before power failure to determine the test scores corresponding to different types of power failure events at different encryption or decryption stages of the solid state drive to be tested, the method further includes:
[0014] If it is detected that more than a preset number of new test scores all exceed a preset upper limit threshold, the test score is recorded;
[0015] A preset algorithm for performing encryption or decryption operations on the initial data set is replaced, and a new test score is obtained again.
[0016] Through the above embodiment, after the power-off test device detects that the number of test scores exceeding the preset number exceeds the preset upper limit threshold, it first records these scores. Thereafter, the encryption or decryption algorithm is replaced to obtain a new test score, so that the test method can not only evaluate the impact of the power-off event on data encryption and decryption, but also adjust the encryption or decryption algorithm involved in the test based on the actual test results, further improving the data security and reliability of the solid-state drive when facing extreme power environments.
[0017] In some embodiments, the step of respectively controlling the controllable power supply control system to simulate different types of power failure events specifically includes:
[0018] Select one or more power-off scenarios according to user needs. The causes of abnormal power-off in different power-off scenarios are different.
[0019] Controlling the controllable power supply control system to perform abnormal power-off control on the power-off event according to the power-off scenario, so that the power-off cause of the power-off event matches the power-off scenario;
[0020] Under the abnormal power-off control, the controllable power supply control systems are respectively controlled to simulate different types of power-off events.
[0021] Through the above embodiments, before simulating different types of power failure events, the power failure test device can select the power failure scenario according to user needs, and then select the most likely power failure type according to the needs of the actual application scenario, so that the test results are more targeted and practical. It not only improves the reliability of the solid-state drive under specific application conditions, but also more accurately reveals the potential data security risks under different power failure conditions.
[0022] In some embodiments, the step of using a preset algorithm to encrypt or decrypt the initial data set specifically includes:
[0023] Sending multiple encryption or decryption operation request instructions to the solid state drive to be tested;
[0024] According to the request instruction, a plurality of independent encryption or decryption operations are started on the solid state drive to be tested by using multithreading technology, and each of the encryption or decryption operations corresponds to an initial data set.
[0025] Through the above-mentioned embodiment, the power-off test device uses multi-threading technology to simultaneously start multiple independent encryption or decryption operations on the solid-state hard disk, and each operation corresponds to an initial data set. This method can simultaneously evaluate the processing efficiency and security of multiple data sets under the same or different encryption algorithms. Among them, the multi-threaded operation simulates the data processing scenario in a data center or enterprise environment, which helps to discover the performance bottleneck and security weaknesses of the hard disk under high load conditions.
[0026] In some embodiments, the steps of controlling the controllable power control system to simulate different types of power failure events at different preset stages of the encryption or decryption operation; restarting the solid state drive to be tested and detecting the encryption or decryption status of the initial data set after each simulated power failure event specifically include:
[0027] Receive power fluctuation strategies uploaded by users;
[0028] In different preset stages of the encryption or decryption operation, the power fluctuation strategy is respectively executed and lasts for a preset time period;
[0029] After the preset time period, the encryption or decryption status of the initial data set is detected.
[0030] Through the above embodiment, the power failure test device receives the power fluctuation strategy uploaded by the user and detects the status of the data set after a preset time. This method can more accurately simulate the performance of the hard disk in an actual power unstable environment according to the power fluctuation situation defined by the user, and thus more accurately evaluate the data security and operation stability of the solid state drive under different power conditions.
[0031] In some embodiments, the step of comparing the encryption or decryption state with the state before power failure to determine the test scores corresponding to different types of power failure events at different encryption or decryption stages of the solid state drive to be tested specifically includes:
[0032] Comparing the encryption or decryption state with that before power failure to obtain a comparison result including multiple evaluation indicators;
[0033] Each evaluation indicator in the comparison result is scored based on a preset evaluation standard, and a weighted test score corresponding to different types of power-off events in different encryption or decryption stages of the solid-state hard disk to be tested is obtained.
[0034] Through the above embodiments, the power-off test device compares the data status before and after encryption or decryption through multiple evaluation indicators and scores based on preset evaluation criteria, which can provide a quantitative evaluation system for evaluating the performance of solid-state drives when facing different types of power-off events. This helps manufacturers and users understand the performance of products in actual applications and make targeted product improvements.
[0035] In some embodiments, after the step of determining the weakness condition according to the test score and generating a test report, the method further includes:
[0036] Obtaining the weakness conditions corresponding to all solid-state hard disks to be tested within a preset time period, and the encryption or decryption algorithms corresponding to the weakness conditions;
[0037] Performing statistical analysis on the weakness condition and the encryption or decryption algorithm to determine weakness condition sequences and algorithm sequences corresponding to different types of solid state drives to be tested;
[0038] The weakness condition sequence and algorithm sequence are preferentially used to perform abnormal power failure test on the next solid state drive of the same type to be tested.
[0039] Through the above embodiments, the power-off test device provides data support for subsequent tests by statistically analyzing the weakness conditions and encryption or decryption algorithms of all SSDs to be tested. This method can identify common weaknesses of SSDs in specific power-off tests from historical data, and use this information to optimize subsequent test processes. This not only improves the efficiency of the test, but also enables the product quality of SSDs to be continuously improved.
[0040] In a second aspect, the present application provides a power failure test device, the power failure test device comprising: one or more processors and a memory;
[0041] The memory is coupled to the one or more processors, and the memory is used to store computer program code, which includes computer instructions. The one or more processors call the computer instructions so that the power-off test device can implement an abnormal power-off test method for a solid-state hard disk during data encryption and decryption provided in the above embodiment, which will not be repeated here.
[0042] In a third aspect, the present application provides a computer-readable storage medium, including instructions. When the instructions are executed on a power-off test device, the power-off test device can implement an abnormal power-off test method for a solid-state hard disk during data encryption and decryption provided in the above-mentioned embodiment, which will not be repeated here.
[0043] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a power-off test device, the power-off test device can implement an abnormal power-off test method for a solid-state hard disk during data encryption and decryption provided in the above-mentioned embodiment, which will not be repeated here.
[0044] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0045] 1. The power-off test device creates a multi-level initial data set on the solid-state drive and simulates different types of power-off events at different stages of encryption or decryption operations. After each power-off, the encryption or decryption status of the data set is re-detected and compared with the status before the power-off to obtain a scoring result to determine the specific impact of different power-off events on the data integrity and security at different encryption or decryption stages. This test method can improve the anti-interference ability and security of the data processing process.
[0046] 2. The power-off test device allows multiple independent encryption or decryption operations to be started simultaneously on the SSD by introducing multi-threading technology, and each operation corresponds to an initial data set. This method simulates multi-task concurrent processing scenarios that are common in the real world, especially in data centers and high-performance computing environments. It not only improves the practical applicability of the test, but also helps to more comprehensively evaluate the performance and security of SSDs in multi-task environments, thereby ensuring the stability and security of data in high-concurrency scenarios.
[0047] 3. The power-off test device determines the weakness of the SSD based on the test score and generates a more targeted test report accordingly. Furthermore, by collecting and statistically analyzing the test scores and weakness of all SSDs to be tested, it can not only point out the performance and security weaknesses of a single hard drive, but also identify common problems in a series of products, facilitating subsequent targeted testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flow chart of a method for testing abnormal power failure of a solid state drive during data encryption and decryption in an embodiment of the present application;
[0049] Figure 2 It is another flow chart of a method for testing abnormal power failure of a solid state drive during data encryption and decryption in an embodiment of the present application;
[0050] Figure 3 It is a schematic diagram of the structure of a physical device of the power-off test device in the embodiment of the present application. DETAILED DESCRIPTION
[0051] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.
[0052] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0053] For ease of understanding, the following is a flow chart of the method provided in this implementation. Figure 1 , which is a flow chart of a method for abnormal power failure testing of a solid state drive during data encryption and decryption in an embodiment of the present application.
[0054] S101, creating a multi-level initial data set on the formatted solid state drive to be tested, and using a preset algorithm to perform encryption or decryption operations on the initial data set.
[0055] The power-off test device first formats the SSD to be tested to ensure that the hard disk is in a clean, standard initial state. Formatting can clear all data on the hard disk and re-partition the storage space according to the specified file system (such as NTFS, exFAT, etc.). After formatting, the power-off test device begins to create a multi-level initial data set on the hard disk containing files and directory structures of different types and sizes. For example, a directory tree containing different types of files such as text files, pictures, and videos can be created, and subdirectories can be generated at different depths and breadths. This multi-level data set can better simulate complex data storage scenarios in the real world, thereby improving the comprehensiveness and reliability of the test.
[0056] After creating the initial data set, the power-off test device uses a preset algorithm to encrypt or decrypt the data. Optional encryption algorithms include but are not limited to symmetric encryption algorithms (such as AES, 3DES, etc.) and asymmetric encryption algorithms (such as RSA, ECC, etc.). By using different encryption algorithms and key lengths, the encryption and decryption performance and stability of the solid-state drive at different security levels can be evaluated. At the same time, the test can also cover different encryption modes (such as ECB, CBC, XTS, etc.) to verify the hard drive's support for various common encryption schemes.
[0057] For example, the power-off tester can create a multi-layer directory tree containing 1,000 files on a formatted SSD, including text, images, audio, etc., with sizes ranging from a few KB to several GB. These files are then encrypted using an AES-256-bit key in XTS mode. This process not only tests the storage capacity of the hard drive, but also verifies its encryption processing capabilities.
[0058] S102: In different preset stages of the encryption or decryption operation, respectively control the controllable power supply control system to simulate different types of power failure events.
[0059] The power-off test device focuses on testing the behavior and data security of the SSD when it encounters a sudden power-off during the encryption or decryption process. In order to fully evaluate the hard drive's ability to withstand power failures, the test process simulates different types of power-off events at different stages of encryption or decryption.
[0060] Specifically, the power failure test device divides the encryption or decryption process into multiple preset stages, such as the start stage, the middle stage, and the stage to be completed. In each stage, the controllable power control system simulates different types of power failure events, such as instantaneous power failure, continuous power failure, periodic power failure, etc. By precisely controlling the time point and duration of power failure, the power failure test device can evaluate the ability of the solid-state drive to cope with power failure under different encryption or decryption progress.
[0061] For example, when performing AES encryption on a 100GB data file, the power-off test device can trigger power-off events when the encryption reaches different progress such as 20%, 50%, and 80%. The same type of power-off event can be triggered each time the encryption reaches different progress such as 20%, 50%, and 80%, and then the power-off event can be switched to execute the power-off event again at each stage; or a power-off lasting 2 seconds can be simulated at 20% progress, a periodic power-off with an interval of 100 milliseconds can be simulated at 50% progress, and an instantaneous power-off can be simulated at 80% progress, etc., without limitation here. In this way, the test covers all key stages of the encryption operation, and also simulates a variety of real abnormal power-off situations.
[0062] It is understandable that the controllable power control system can accurately control the voltage and current supplied to the solid-state drive, and flexibly simulate various power-off events according to preset time points and durations. Among them, the controllable power control system usually includes a programmable power supply, an electronic load, and a digital control unit, etc., which can achieve sub-millisecond power-off control. By programming different power-off modes, the controllable power control system automates the test process and improves test efficiency and repeatability.
[0063] S103 , after each simulated power-off event, restart the solid-state hard disk to be tested and detect the encryption or decryption status of the initial data set.
[0064] This step mainly evaluates the recovery capability and data integrity of the SSD after a power outage. After simulating a power outage during the encryption or decryption process of the SSD, the power outage test device will re-power the hard disk to simulate the restart process after an abnormal power outage.
[0065] After the restart is complete, the power failure test device will immediately check the status of the initial data set to evaluate the impact of the power failure on data encryption or decryption. Specifically, the test device accesses the files in the initial data set one by one to check whether their encryption or decryption status is consistent with that before the power failure. In the case of a power failure during the encryption process, the test device will count the number and proportion of fully encrypted, partially encrypted, and unencrypted files; in the case of a power failure during the decryption process, the test device will count the number and proportion of fully decrypted, partially decrypted, and undecrypted files.
[0066] Of course, in addition to checking the encryption or decryption status of the file, the power failure test device will also verify the integrity and consistency of the file. This is achieved by comparing the hash values of the file (such as MD5, SHA-256, etc.). Specifically, the power failure test device calculates the hash value of each file and compares it with the hash value calculated before the power failure. If the two are inconsistent, it is determined that the file has been damaged or the data has been lost during the power failure. The power failure test device will record in detail the number of damaged files, the location, and the degree of damage.
[0067] S104: Compare the encryption or decryption state with the state before power failure to determine the test scores corresponding to different types of power failure events in different encryption or decryption stages of the solid state drive to be tested.
[0068] In this step, the power-off test device comprehensively analyzes the data collected in the previous steps to evaluate the overall performance of the solid-state drive under different power-off conditions. Specifically, the power-off test device compares the data encryption or decryption status after each power-off with the status before the power-off, and refers to the results of the file integrity check to obtain a series of test scores that reflect the hard drive's ability to resist power-off.
[0069] Among them, the test score includes multiple dimensions, each of which corresponds to a key performance indicator of the solid-state drive under power-off conditions. For example, multiple scoring items such as "encryption or decryption completion", "data integrity", and "recovery speed" can be set. Among them, "encryption or decryption completion" reflects the proportion of encryption or decryption tasks that the hard disk has completed when the power fails; "data integrity" reflects the severity of data damage or loss caused by power failure; "recovery speed" reflects the speed at which the hard disk resumes encryption or decryption tasks after power failure. In addition, each scoring item has a quantitative scoring standard. For example, "encryption or decryption completion" can be set to 0-100 points, where 100 points means that all data has been completely encrypted or decrypted before power failure, and 0 points means that the encryption or decryption task has not yet started; "data integrity" can be set to 0-10 points, where 10 points means that all data is intact after power failure, and 0 points means that all data is lost; "recovery speed" can be set to 0-5 points, where 5 points means that the hard disk can resume encryption or decryption tasks within 1 second after power failure, and 0 points means that the hard disk cannot automatically resume tasks.
[0070] Furthermore, during the actual scoring, the power failure test device will give the scores of each scoring item according to the results of each power failure test. For example, if a power failure occurs at 70% of the progress of the AES encryption process, and the statistics after restart show that 65% of the data has been encrypted and 5% of the data has been damaged, and the hard disk recovers the encryption task within 10 seconds, then the "encryption completion" score of this test is 65, the "data integrity" score is 9.5, and the "recovery speed" score is 4.
[0071] Next, the power-off test device summarizes the scores of each scoring item in a weighted manner and calculates the test scores of the SSD at different encryption or decryption stages and different power-off types. These test scores can reflect the comprehensive power-off resistance of the hard disk and reveal its strengths and weaknesses in data security, integrity and recoverability.
[0072] S105. Determine the weakness conditions based on the test scores and generate a test report.
[0073] After determining the scores of various tests of the SSD, the power-off test device statistically analyzes all the scoring data, identifies the test items with low scores, and determines the weak conditions of the hard disk in terms of power-off resistance based on this. Among them, weak conditions refer to various factors that cause the SSD to perform poorly in specific power-off scenarios, including but not limited to specific stages of encryption or decryption, specific types of power-off events, etc. For example, if the test data shows that when the hard disk encounters continuous power failure in the last 10% progress stage of AES encryption, the "Data Integrity" score is only 4 points (out of 10 points) on average, which is significantly lower than the performance in other stages and power-off types, then it can be determined that "the last 10% progress stage of AES encryption" and "continuous power failure" are the two main weak conditions of the hard disk.
[0074] Furthermore, after identifying the weakness, the power-off test device automatically generates a detailed test report. The report not only contains the raw data and scoring results of each test, but also focuses on analyzing the weakness of the hard disk and gives targeted optimization suggestions. For example, for the weakness of the above-mentioned AES encryption, the test report can suggest that the manufacturer focus on optimizing the final stage of the encryption algorithm, adding data protection measures in the key expansion and round key generation links, and recommend adding large-capacity capacitors to the hard disk to extend the data protection time in the continuous power-off scenario, etc., which are not limited here.
[0075] In the above embodiment, the power-off test device creates a multi-level initial data set on the solid-state hard disk, and simulates different types of power-off events at different stages of encryption or decryption operations. After each power-off, the encryption or decryption status of the data set is re-detected and compared with the status before the power-off to obtain a scoring result, so as to determine the specific impact of different power-off events on the data integrity and security at different encryption or decryption stages. This testing method can improve the anti-interference ability and security in the data processing process.
[0076] The following is a more detailed description of the process of the method provided by this embodiment. Figure 2 , which is another flow chart of a method for abnormal power failure testing of a solid state drive during data encryption and decryption in an embodiment of the present application.
[0077] S201. Send multiple encryption or decryption operation request instructions to the solid state drive to be tested.
[0078] The power-off test device sends a series of encryption or decryption operation request instructions to the SSD under test. These request instructions contain specific parameters for performing encryption or decryption tasks on different initial data sets, such as the location and size of the initial data set, the encryption algorithm and key used, etc. By sending request instructions, the power-off test device can control the data security tasks performed on the SSD and simulate the complex data access mode in real application scenarios.
[0079] Specifically, the power-off test device intelligently generates a request instruction sequence according to the test requirements. Among them, the number and type of request instructions can be dynamically adjusted according to the comprehensiveness requirements of the test. For example, if it is necessary to focus on testing the solid-state drive's support for the AES encryption algorithm, an instruction sequence based on AES encryption requests can be generated; if it is necessary to comprehensively test the data security characteristics of the hard disk, the instruction sequence will include a variety of mainstream encryption algorithms in a balanced manner. At the same time, the power-off test device can also reasonably set the parameters of each request instruction. For example, different initial data sets can be randomly selected as encryption or decryption objects, keys of different strengths can be assigned, different encryption modes can be specified, etc., which are not limited here.
[0080] For example, in one embodiment, the power-off test device may generate a request instruction sequence as follows:
[0081] Perform AES-256 encryption on the 512KB data block located at the hard disk logical address 1000-2000, using CBC mode and the key "Kzkk9#Jd".
[0082] S202: Based on the request instruction, multiple independent encryption or decryption operations are started on the solid state drive to be tested by using multi-threading technology.
[0083] The power failure test device uses multi-threading technology to simultaneously start multiple independent encryption or decryption operations on the solid state drive according to the request instruction sent in step S201. The multi-threading technology allows multiple data processing tasks to be performed simultaneously, and the parallel processing capability of the solid state drive can be used to improve the test efficiency and authenticity.
[0084] Specifically, the power-off test device creates an independent thread for each request instruction. Each thread is responsible for driving the solid-state drive to perform the encryption or decryption task specified by the instruction. For example, if a request instruction requires AES encryption of a data block, the corresponding thread will call the AES encryption module of the hard disk, pass in the address of the data block, encryption key and other parameters, and start the encryption operation. Multiple threads corresponding to multiple request instructions can work in parallel and perform different security operations on different data at the same time. For example, for the request instruction sequence generated in step S201, the power-off test device can create the following multi-threaded tasks:
[0085] Thread 1: Performs AES encryption on 512KB data blocks, with high priority and an estimated execution time of 0.5 seconds;
[0086] Thread 2: performs RSA decryption on 1MB blocks, with medium priority and an estimated execution time of 2 seconds.
[0087] In the above embodiment, the power-off test device uses multi-threading technology to simultaneously start multiple independent encryption or decryption operations on the solid-state hard disk, each operation corresponding to an initial data set. This method can simultaneously evaluate the processing efficiency and security of multiple data sets under the same or different encryption algorithms. Among them, the multi-threaded operation simulates the data processing scenario in a data center or enterprise environment, which helps to discover the performance bottlenecks and security weaknesses of the hard disk under high load conditions.
[0088] S203: Select one or more simulated power-off scenarios according to user needs, where different simulated power-off scenarios may cause different abnormal power-off reasons.
[0089] The power-off test device provides an interactive test configuration interface, allowing users to select and customize specific scenarios for simulating power-off according to actual needs. Each simulation scenario corresponds to a real reason that may cause abnormal power-off of the solid-state drive, such as power grid fluctuations, power failures, interference from power-consuming devices, etc. Users can select one or more simulated power-off scenarios based on factors such as the application environment of the hard drive and the purpose of the test, and customize a personalized test plan.
[0090] Specifically, the power-off test device presets a variety of typical power-off scenarios, and each scenario has detailed parameters available for configuration. For example, for the "grid fluctuation" scenario, the user can set the voltage fluctuation range, duration, frequency of fluctuation, etc.; for the "power failure" scenario, the type of faulty power supply (such as capacitors, resistors, etc.), the circuit location where the fault occurs, etc. can be set; for the "equipment interference" scenario, the type of interference source (such as motors, transformers, etc.), the frequency and intensity of the interference signal, etc. can be selected. By adjusting these parameters, users can customize simulated power-off scenarios according to various extreme situations that may be encountered in actual hard disk applications. At the same time, the power-off test device also allows users to customize power-off scenarios. Users can also edit the voltage and current curves of the power supply output, or write control scripts to dynamically simulate complex power-off processes, which are not limited here.
[0091] S204: Control the controllable power supply control system to simulate a power failure scenario to perform abnormal power failure control.
[0092] The power-off test device controls the controllable power supply control system to apply a corresponding power-off test to the solid-state hard disk according to the power-off scenario selected by the user.
[0093] Specifically, the controllable power supply control system includes a programmable controller and a high-power power supply. The controller is responsible for parsing the control instructions sent by the power-off test device, converting the user-defined power-off scenarios into a series of precise voltage, current thresholds and durations, and driving the power supply to output fluctuating voltage and current according to these parameters. At the same time, the controller can also monitor the output electrical parameters in real time, compare and calibrate with the preset power-off curve, and ensure that the power supply output meets the requirements of the simulated power-off scenario. The high-power power supply is directly connected to the solid-state drive, and outputs a series of high-precision, wide-range voltage and current combinations according to the controller to simulate the preset power-off environment.
[0094] In the above embodiment, before simulating different types of power failure events, the power failure test device can select the power failure scenario according to user needs, and then select the most likely power failure type according to the needs of the actual application scenario, so that the test results are more targeted and practical. This not only improves the reliability of the solid-state drive under specific application conditions, but also more accurately reveals the potential data security risks under different power failure situations.
[0095] S205 , in different preset stages of the encryption or decryption operation, respectively controlling the controllable power supply control system to simulate different types of power failure events.
[0096] This step is the same as step S102 and will not be repeated here.
[0097] S206 , after each simulated power-off event, restart the solid state drive to be tested and detect the encryption or decryption status of the initial data set.
[0098] This step is the same as step S103 and will not be repeated here.
[0099] S207. In different preset stages of the encryption or decryption operation, respectively execute the power fluctuation strategy and continue for a preset time period.
[0100] The power-off test device executes a pre-set power fluctuation strategy at different encryption or decryption stages and lasts for a specific period of time to simulate various power abnormalities in the actual application environment.
[0101] Specifically, the power-off test device first divides the encryption or decryption process of the solid-state drive into several preset stages, such as the data reading stage, the key generation and exchange stage, the data block encryption stage, etc. Then, for each stage, the power-off test device predefines one or more power fluctuation strategies. Each strategy accurately specifies the voltage fluctuation amplitude, duration, number of repetitions, and other parameters applied in this stage. For example, in the key exchange stage, a "voltage drop strategy" can be designed: the voltage is reduced from 5V to 2V within 100 milliseconds, and then restored after 200 milliseconds, and repeated 3 times. This strategy simulates the impact of instantaneous undervoltage of the power supply on the security of the key in the actual system. During the test execution stage, the power-off test device tracks the encryption or decryption progress of the solid-state drive in real time. When it is detected that a preset stage has been entered, the power-off test device immediately notifies the controllable power supply control system to execute the power fluctuation strategy corresponding to this stage. The controllable power supply then applies voltage or current interference of a specific waveform to the solid-state drive according to the parameters specified in the strategy, and accurately controls the duration of the interference.
[0102] For example, when performing full AES 256-bit encryption on a 100GB data disk, the power failure test device can design the following phased power fluctuation test strategy:
[0103] Data reading phase (estimated to last 10 minutes): reduce the voltage by 10% every 2 minutes, continue for 30 seconds, then restore, repeat 5 times.
[0104] Key generation phase (estimated to last 2 minutes): The power is randomly cut off every 30 seconds, with the power off duration ranging from 50 to 200 milliseconds, and repeated 4 times in total.
[0105] Data encryption phase (estimated to last 60 minutes): When the encryption progress reaches 25%, 50%, and 75%, a 600-ms power-off is performed.
[0106] S208: After a preset period of time, detect the encryption or decryption status of the initial data set.
[0107] After each power fluctuation strategy is executed for a specific period of time, the power failure test device immediately checks the status of the initial data set involved in the test to evaluate the impact of the power anomaly on the data encryption or decryption results.
[0108] Specifically, in the process of applying a certain power fluctuation strategy, the power failure test device continuously monitors the time progress of the strategy execution. Once the preset interference duration (such as 200 milliseconds in the example of step S207) is reached, the power failure test device immediately notifies the controllable power supply to restore the normal power supply voltage, and starts to analyze the encryption or decryption status of the initial data set, wherein the analysis process of the encryption or decryption status is referred to step S103, which will not be repeated here.
[0109] In the above embodiment, the power failure test device receives the power fluctuation strategy uploaded by the user and detects the status of the data set after a preset time. This method can more accurately simulate the performance of the hard disk in an actual power unstable environment according to the power fluctuation situation defined by the user, and thus more accurately evaluate the data security and operation stability of the solid state drive under different power conditions.
[0110] S209: Compare the encryption or decryption state with the state before power failure to determine the test scores corresponding to different types of power failure events in different encryption or decryption stages of the solid state drive to be tested.
[0111] This step is the same as step S104 and will not be repeated here.
[0112] S210: more than a preset number of test scores all exceed a preset upper limit threshold.
[0113] After obtaining a series of test scores, the power-off test device will count the number of scores that are higher than the preset upper threshold. If more than the preset number (such as 80%) of test scores have reached the corresponding upper threshold, it is determined that under the current test conditions, the power-off resistance of the solid-state drive to be tested has reached a very high level. This shows that the existing encryption or decryption algorithm can already well protect data security, and it is not meaningful to continue using the current algorithm for more tests. At this point, the power-off test device records this set of test data as a benchmark performance indicator of the hard drive's ability to resist power failures under a specific algorithm. These data can be used for horizontal comparison with the test results of other hard drives or algorithms, or as a reference for subsequent hard drive improvements.
[0114] S211. Replace the encryption or decryption algorithm of the initial data set and re-obtain a new test score.
[0115] After recording the test scores that exceed the threshold, in order to further explore the hard disk's anti-power-off potential, the power-off test device automatically changes the encryption or decryption algorithm of the initial data set, and uses the new algorithm to re-perform a round of testing to obtain new test score data.
[0116] Specifically, the power-off test device selects different encryption or decryption algorithms in turn and applies them to the initial data set according to the pre-set algorithm sequence. For example, if the starting algorithm is AES-256, the next algorithm may be RSA-2048, and the next one may be ECC-384, etc. Each time the algorithm is changed, the power-off test device will re-execute a complete round of power-off test according to the process of steps S201-S209 and record the new test score.
[0117] By continuously changing algorithms and repeating tests, the power-off test device can obtain data on the SSD's ability to withstand power-off under a variety of mainstream data security algorithms. These data can demonstrate the hard drive's comprehensive ability to cope with data security requirements of different intensities and types, allowing manufacturers and users to have a more comprehensive understanding of the hard drive's security features.
[0118] In addition, the power-off test device can also analyze the power-off resistance shortcomings of the hard disk by recording the changing trends of the test scores generated under different algorithms. For example, if the hard disk scores are very high under AES encryption, but the scores drop significantly after switching to RSA, it may indicate that the hard disk is not able to resist power failure when performing asymmetric encryption, and the manufacturer needs to focus on optimization.
[0119] In the above embodiment, after the power-off test device detects that the number of test scores exceeding the preset upper limit threshold exceeds the preset number, the power-off test device first records these scores. After that, the encryption or decryption algorithm is replaced to obtain a new test score, so that the test method can not only evaluate the impact of the power-off event on data encryption and decryption, but also adjust the encryption or decryption algorithm involved in the test based on the actual test results, further improving the data security and reliability of the solid-state drive when facing extreme power environments.
[0120] S212. Determine the weakness conditions based on the test scores and generate a test report.
[0121] After completing multiple sets of power-off tests using different algorithms, the power-off test device comprehensively analyzes all the scoring data, comprehensively evaluates the data security performance of the SSD, and generates a detailed test report.
[0122] Specifically, the power-off test device sets an expected lower limit for the score (such as "encryption completion" below 60 points, or "data integrity" below 6 points, etc.). Any test item with a score below this lower limit will be marked as a potential security weakness.
[0123] Next, the test device analyzes the commonalities of these weak test items to identify key factors that may lead to insufficient hard disk security performance, namely weak conditions. These weak conditions may involve specific stages of encryption or decryption, or a certain type of power failure event. By determining the weak conditions, the power failure test device can more accurately point out the areas where the hard disk needs to be improved in terms of data security.
[0124] Furthermore, after identifying the weak conditions, the power-off test device compiles them together with all the test data into a complete test report. The report not only contains the original scores and statistical results of each group of tests, but also records the corresponding weak conditions and gives targeted optimization suggestions.
[0125] S213, obtaining the weakness conditions corresponding to all the solid state drives to be tested within a preset time period, and the encryption or decryption algorithms corresponding to the weakness conditions.
[0126] Specifically, the power failure test device sets a fixed data statistical period, such as one week or one month. At the end of each statistical period, the power failure test device reviews all hard disks that have completed the test within the period and extracts two types of key data from their test reports: the identified weakness conditions of each hard disk, and the data encryption or decryption algorithms corresponding to these weakness conditions.
[0127] S214: Statistically analyze the weakness conditions and the encryption or decryption algorithms to determine weakness condition sequences and algorithm sequences corresponding to different types of solid state drives to be tested.
[0128] After obtaining a certain amount of hard disk weakness data, the power-off test device further uses big data analysis technology to analyze valuable common laws and trend characteristics to guide subsequent hard disk testing and design optimization work.
[0129] Specifically, the power-off test device divides all the tested hard disks into several categories according to the key attributes of the tested solid-state hard disks, such as brand, model, and capacity. Then, for each type of hard disk, the power-off test device counts all the weakness conditions that have appeared in them, and forms a weakness condition sequence from high to low according to the frequency of occurrence. This sequence intuitively shows the most common and typical data security risks of this type of hard disk. At the same time, the power-off test device can also count the main encryption or decryption algorithms corresponding to each weakness condition to form an algorithm sequence that matches the weakness sequence.
[0130] By generating these weakness sequences and algorithm sequences, the power-off test device can summarize general test rules applicable to a specific type of hard disk from a large number of test cases. These rules can be used to predict the power-off resistance performance of hard disks of the same type and automatically generate more targeted test plans for the test device.
[0131] The power-off test device of the embodiment of the present invention is an electronic device, Figure 3 A schematic diagram of the architecture of an electronic device suitable for implementing an embodiment of the present invention is shown.
[0132] It should be noted that Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0133] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions (computer programs), or by controlling related hardware through instructions (computer programs), and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. The electronic device of this embodiment includes a storage medium and a processor, wherein a plurality of instructions are stored in the storage medium, and the instructions can be loaded by the processor to execute any step of the method provided in the embodiment of the present invention.
[0134] Specifically, the storage medium and the processor are electrically connected directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more signal lines. The storage medium stores computer execution instructions for implementing the data access control method, including at least one software function module that can be stored in the storage medium in the form of software or firmware. The processor executes various functional applications and data processing by running the software program and module stored in the storage medium. The storage medium can be, but is not limited to, random access storage medium (Random Access Memory, referred to as: RAM), read-only storage medium (Read Only Memory, referred to as: ROM), programmable read-only storage medium (Programmable Read-Only Memory, referred to as: PROM), erasable read-only storage medium (Erasable Programmable Read-Only Memory, referred to as: EPROM), electrically erasable read-only storage medium (Electric Erasable Programmable Read-Only Memory, referred to as: EEPROM), etc. Among them, the storage medium is used to store programs, and the processor executes the program after receiving the execution instruction.
[0135] Furthermore, the software programs and modules in the above-mentioned storage medium may also include an operating system, which may include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components. The processor may be an integrated circuit chip having signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., which may implement or execute the various methods, steps, and logic flow diagrams disclosed in this embodiment. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0136] Since the instructions stored in the storage medium can execute the steps in any method provided in the embodiments of the present invention, the beneficial effects of any method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0137] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for testing abnormal power failure of a solid state hard disk during data encryption and decryption, applied to a power failure testing device, characterized in that: The method comprises: Creating a multi-level initial data set on the formatted solid state drive to be tested, and using a preset algorithm to perform encryption or decryption operations on the initial data set, the initial data set includes a static data set and a dynamic data set, and different initial data sets correspond to different preset algorithms; In different preset stages of the encryption or decryption operation, the controllable power supply control system is controlled to simulate different types of power failure events, the preset stages include the start stage, the middle stage and the stage to be completed of the encryption or decryption operation, and the types of power failure events include continuous power failure, long-term power failure and periodic power failure; After each simulated power-off event, restarting the solid-state hard disk to be tested and detecting the encryption or decryption status of the initial data set; Comparing the encryption or decryption state with the encryption or decryption state before power failure, and determining test scores corresponding to different types of power failure events at different encryption or decryption stages of the solid state drive to be tested; A weakness condition is determined based on the test score and a test report is generated, wherein the weakness condition is a preset stage and a power-off event corresponding to a test score that is lower than a preset score threshold.
2. The method according to claim 1, characterized in that After the step of comparing the encryption or decryption state with the state before power failure to determine the test scores corresponding to different types of power failure events at different encryption or decryption stages of the solid state drive to be tested, the method further includes: If it is detected that more than a preset number of new test scores all exceed a preset upper limit threshold, the new test scores are recorded; The preset algorithm for performing encryption or decryption operations on the initial data set is replaced, and a new test score is obtained again.
3. The method according to claim 1, characterized in that The steps of respectively controlling the controllable power supply control system to simulate different types of power failure events specifically include: Select one or more power-off scenarios according to user needs, and the causes of abnormal power-off in different power-off scenarios are different; Controlling the controllable power supply control system to perform abnormal power-off control on the power-off event according to the power-off scenario, so that the power-off cause of the power-off event matches the power-off scenario; Under the abnormal power-off control, the controllable power supply control systems are respectively controlled to simulate different types of power-off events.
4. The method according to claim 1, characterized in that The step of using a preset algorithm to perform an encryption or decryption operation on the initial data set specifically includes: Sending multiple encryption or decryption operation request instructions to the solid state drive to be tested; According to the request instruction, a plurality of independent encryption or decryption operations are started on the solid state drive to be tested by using multithreading technology, and each encryption or decryption operation corresponds to an initial data set.
5. The method according to claim 1, characterized in that: The controllable power control system is controlled to simulate different types of power failure events at different preset stages of the encryption or decryption operation; After each simulated power-off event, the step of restarting the solid state drive to be tested and detecting the encryption or decryption status of the initial data set specifically includes: Receive power fluctuation strategies uploaded by users; In different preset stages of the encryption or decryption operation, respectively executing the power fluctuation strategy and continuing for a preset time period; After the preset time period, the encryption or decryption status of the initial data set is detected.
6. The method according to claim 1, characterized in that The step of comparing the encryption or decryption state with the state before power failure to determine the test scores corresponding to different types of power failure events at different encryption or decryption stages of the solid state drive to be tested specifically includes: Comparing the encryption or decryption state with that before power failure to obtain a comparison result including multiple evaluation indicators; Each evaluation index in the comparison result is scored based on a preset evaluation standard, and a test score corresponding to different types of power-off events in different encryption or decryption stages of the solid-state hard disk to be tested is obtained by weighting.
7. The method according to claim 1, characterized in that After the step of determining the weakness condition according to the test score and generating a test report, the method further includes: Obtaining the weakness conditions corresponding to all solid-state hard disks to be tested within a preset time period, and the encryption or decryption algorithms corresponding to the weakness conditions; Performing statistical analysis on the weakness conditions and the encryption or decryption algorithms to determine weakness condition sequences and algorithm sequences corresponding to different types of solid state drives to be tested; The weakness condition sequence and algorithm sequence are preferentially used to perform abnormal power failure test on the next solid state hard disk to be tested of the same type.
8. A power-off test device, characterized in that: The power-off test device comprises: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the power-off test device to perform the method according to any one of claims 1 to 7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a power-off test device, the power-off test device is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product is run on a power-off test device, the power-off test device is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method, system and equipment for testing stability of hard disk
CN117037892A
Data processing method and device of solid state disk controller and solid state disk controller
CN118963665A