Hard disk power-on method and device, readable storage medium and electronic equipment

By using a decision tree model to determine the data initialized upon power-up of the hard drive, and dynamically deciding whether to perform a power-off reconstruction chain, the problem of timely recovery when communication between the hard drive and the host fails is solved, communication recovery efficiency is improved, and invalid attempts are reduced.

CN121008674BActive Publication Date: 2026-05-15CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
Filing Date
2025-07-04
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, when SATA hard drives fail to communicate with the host, the inability to handle the problem in a timely manner leads to a poor user experience, and there are frequent invalid attempts to rebuild the chain.

Method used

A decision tree model is used to determine the hard drive's power-on initialization data, including power-on duration, out-of-band speed negotiation results, and identification command execution results. This dynamically determines whether to perform a power-off link reconstruction operation to ensure timely link recovery in the event of communication failure.

Benefits of technology

It improves the efficiency of hard drive-host communication recovery, reduces invalid rebuild chain attempts, and avoids the problem of host unresponsiveness caused by slow recovery of internal hard drive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121008674B_ABST
    Figure CN121008674B_ABST
Patent Text Reader

Abstract

The application discloses a hard disk power-on method and device, a readable storage medium and an electronic device. The hard disk is powered on and initialized to obtain power-on initialization data. The power-on duration, out-of-band speed negotiation result and identification command execution result included in the power-on initialization data are input into a trained decision tree model to determine whether to perform a power-off link reconstruction operation. A decision result is output. The hard disk is processed based on the decision result. In the case that the host computer fails to normally establish communication with the hard disk due to abnormal conditions, link reconstruction is attempted in a timely and active manner. After the host computer and the hard disk are disconnected, the link can be automatically recovered. The problem that the host computer cannot respond due to slow recovery of information such as the internal mapping table of the hard disk is avoided. Therefore, the efficiency of triggering the power-off link reconstruction is improved, and invalid link reconstruction attempts are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hard disk technology, and in particular to a method, apparatus, readable storage medium, and electronic device for powering on a hard disk. Background Technology

[0002] In modern computer systems, SATA (Serial ATA) hard drives are widely used as primary data storage devices in various computers and servers. The power-on process of a SATA hard drive typically includes the following three stages: First, the host (the system accessing the storage device) supplies power to the hard drive, and the hard drive enters a power-on state to perform self-tests and initialization; second, the hard drive and the host negotiate out-of-band (OOB) speeds; finally, the host sends an identify command to the hard drive to identify its information.

[0003] However, whether the hard drive can successfully establish communication with the host is often related to many factors, such as power-on time and whether the `identify` command executes successfully. If abnormal conditions prevent the host from establishing normal communication with the hard drive, the host will be unable to read or write data or even boot up, affecting the user experience.

[0004] Therefore, in order to improve the stability and usability of hard drives, it is crucial to proactively and promptly handle situations where communication between the hard drive and the host fails. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a method, apparatus, readable storage medium and electronic device for powering on a hard disk, which can improve the efficiency of triggering a power failure reconstruction chain and reduce invalid reconstruction chain attempts.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0007] A method for powering on a hard drive, comprising the following steps:

[0008] Perform power-on initialization on the hard drive to obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results.

[0009] The power-on duration, the out-of-band speed negotiation result, and the recognition command execution result are input into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation, and the decision result is output.

[0010] The hard drive is processed based on the decision result.

[0011] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0012] A hard disk power-on device, comprising:

[0013] The power-on module is used to perform power-on initialization on the hard drive and obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results.

[0014] The decision module is used to input the power-on duration, the out-of-band speed negotiation result, and the recognition command execution result into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation and output the decision result.

[0015] The processing module is used to process the hard disk based on the decision result.

[0016] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0017] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps of the above-described hard disk power-on method.

[0018] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0019] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the various steps in the above-described hard disk power-on method.

[0020] The beneficial effects of this invention are as follows: The hard drive is initialized upon power-on, generating power-on initialization data. This data, including power-on duration, out-of-band speed negotiation results, and recognition command execution results, is input into a trained decision tree model to determine whether to perform a power-off reconstruction chain operation. The model outputs a decision result, and the hard drive is processed based on this result. By dynamically determining whether a power-off reconstruction chain is needed based on the real-time communication establishment status between the host and the hard drive, the decision tree model ensures that in cases where the host fails to establish normal communication with the hard drive due to abnormal circumstances, a timely and proactive reconstruction chain attempt is made. The link can be automatically restored after communication between the host and the hard drive is lost, avoiding the problem of slow recovery of information such as the hard drive's internal mapping table, which could lead to the host's inability to respond. This improves the efficiency of triggering the power-off reconstruction chain and reduces invalid reconstruction chain attempts. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the steps of a hard disk power-on method according to an embodiment of the present invention;

[0022] Figure 2 This is a schematic diagram of the structure of a hard disk power-on device according to an embodiment of the present invention;

[0023] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention;

[0024] Figure 4 This is a flowchart illustrating the SATA hard drive power-on initialization process in a hard drive power-on method according to an embodiment of the present invention.

[0025] Figure 5 This is a flowchart illustrating the power-on process of a hard disk power-on method according to an embodiment of the present invention.

[0026] Figure 6 This is a schematic diagram of a decision tree model in a hard disk power-on method according to an embodiment of the present invention. Detailed Implementation

[0027] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0028] Please refer to Figure 1 A method for powering on a hard drive, comprising the following steps:

[0029] Perform power-on initialization on the hard drive to obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results.

[0030] The power-on duration, the out-of-band speed negotiation result, and the recognition command execution result are input into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation, and the decision result is output.

[0031] The hard drive is processed based on the decision result.

[0032] As can be seen from the above description, the beneficial effects of the present invention are as follows: The hard drive is initialized upon power-on, and power-on initialization data is obtained. The power-on initialization data, including the power-on duration, out-of-band speed negotiation result, and recognition command execution result, is input into a trained decision tree model to determine whether to perform a power-off reconstruction chain operation. The decision result is output, and the hard drive is processed based on the decision result. Thus, based on the real-time communication establishment status between the host and the hard drive, the decision tree model dynamically determines whether a power-off reconstruction chain is needed. This ensures that in the event that the host fails to establish normal communication with the hard drive due to abnormal circumstances, a timely and proactive reconstruction chain attempt is made. The link can be automatically restored after the communication between the host and the hard drive is disconnected, avoiding the problem of slow recovery of information such as the hard drive's internal mapping table, which leads to the host's inability to respond. This improves the efficiency of triggering the power-off reconstruction chain and reduces invalid reconstruction chain attempts.

[0033] Furthermore, the decision result includes performing a power outage rebuild chain operation;

[0034] The processing of the hard disk based on the decision result includes:

[0035] If the decision result is to perform the power outage and rebuild chain operation, then a power outage command is sent to the hard drive to disconnect the power supply to the hard drive;

[0036] After waiting for the first preset time, the hard drive is powered on and initialized again;

[0037] Determine whether a read / write command has been received within the second preset time period. If not, return to the step of sending a power-off command to the hard drive. If yes, determine that the power-off reconstruction chain was successful.

[0038] As described above, when the decision is to perform a power outage and link rebuild operation, the hard drive is powered off, and after a certain period of time, the link is rebuilt, which effectively solves the problems of hard drive power-on delay and link establishment failure.

[0039] Furthermore, the decision outcome includes not performing the power outage rebuild chain operation;

[0040] The processing of the hard disk based on the decision result includes:

[0041] If the decision result is to not perform the power-off reconstruction chain operation, then collect the power-on feedback data of the hard drive;

[0042] The trained decision tree model is updated based on the power-on feedback data.

[0043] As described above, when the decision result is not to perform the power outage and link reconstruction operation, the decision tree model is updated through real-time feedback, thereby continuously optimizing the decision-making process and improving the success rate of link establishment.

[0044] Furthermore, before performing power-on initialization on the hard drive and obtaining power-on initialization data, the process further includes:

[0045] Collect a training dataset, which includes input features and their corresponding labels. The input features include power-on initialization data used for training, and the labels include whether a power-off reconstruction chain operation is performed.

[0046] Use the training dataset as the root node;

[0047] Calculate the information gain for each of the input features;

[0048] In the training dataset of the current node, the input feature with the largest information gain is selected, and the training dataset is divided into multiple subsets based on the input feature with the largest information gain, with each subset corresponding to a child node;

[0049] The information gain step of calculating each input feature is recursively executed for each subset until a preset stopping condition is met, and the label of the subset is set as the category of the child node to obtain the trained decision tree model.

[0050] As described above, decision tree models can handle multiple types of data. By training a decision tree model, it is possible to integrate communication data from different hosts and hard drives to establish state data and make accurate judgments.

[0051] Further, calculating the information gain for each of the input features includes:

[0052] Calculate the entropy of the training dataset;

[0053] Calculate the conditional entropy of the dataset given the input features;

[0054] The information gain is calculated based on the entropy and the conditional entropy.

[0055] As described above, selecting features by calculating information gain helps to predict target variables more accurately, improves model performance, effectively reduces interference from irrelevant features, and lowers the possibility of overfitting.

[0056] Further, the calculation of the entropy of the training dataset specifically involves:

[0057] ;

[0058] In the formula, Represents the training dataset D The entropy of whether to perform a power outage and chain reconstruction operation. This indicates that the power outage reconstruction chain is executed on the training dataset. D The probability in This indicates that the power outage reconstruction chain is not executed in the training dataset. D The probability of it;

[0059] The calculation of the conditional entropy of the dataset under the given input features is specifically as follows:

[0060] ;

[0061] In the formula, Indicates input features f Training dataset under certain conditions D conditional entropy, Indicates by features f The i The subset of values ​​that determines whether to perform the power outage reconstruction chain operation. m Representing input features f The number of possible values, Represents the training dataset D The total number of samples in the middle. Indicates the first i A subset of whether to execute the power outage reconstruction chain operation The number of samples in the middle Indicates the first i A subset of whether to execute the power outage reconstruction chain operation The entropy.

[0062] As described above, calculating conditional entropy can quantify the uncertainty of a dataset under given feature conditions, which helps in selecting the features that best reduce uncertainty.

[0063] Furthermore, the calculation of information gain based on the entropy and the conditional entropy specifically involves:

[0064] ;

[0065] In the formula, Representing input features f Information gain.

[0066] As described above, feature selection is automatically performed based on the calculated information gain during the construction of the decision tree, without the need for manual intervention. This improves the efficiency and accuracy of feature selection, focuses on the most valuable features, increases data utilization, and enhances the model's decision-making ability.

[0067] Please refer to Figure 2 Another embodiment of the present invention provides a hard disk power-on device, comprising:

[0068] The power-on module is used to perform power-on initialization on the hard drive and obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results.

[0069] The decision module is used to input the power-on duration, the out-of-band speed negotiation result, and the recognition command execution result into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation and output the decision result.

[0070] The processing module is used to process the hard disk based on the decision result.

[0071] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps in the above-described hard disk power-on method.

[0072] Please refer to Figure 3Another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement each step of the above-described hard disk power-on method.

[0073] The hard disk power-on method, apparatus, readable storage medium, and electronic device described above are applicable to scenarios involving the establishment of communication between a host and a SATA hard disk. The following detailed embodiments illustrate these methods:

[0074] Please refer to Figure 1 , Figures 4-6 Embodiment 1 of the present invention is as follows:

[0075] A method for powering on a hard drive, comprising the following steps:

[0076] S1. Collect a training dataset, which includes input features and their corresponding labels. The input features include power-on initialization data used for training, and the labels include whether a power-off reconstruction chain operation is performed.

[0077] S2. Use the training dataset as the root node.

[0078] S3. Calculate the information gain of each input feature, specifically including S31-S33:

[0079] S31. Calculate the entropy of the training dataset. Entropy is a metric used to measure the purity of a dataset. Specifically:

[0080] ;

[0081] In the formula, Represents the training dataset D The entropy of whether to perform a power outage and chain reconstruction operation. This indicates that the power outage reconstruction chain is executed on the training dataset. D The probability in This indicates that the power outage reconstruction chain is not executed in the training dataset. D The probability in; S32, calculate the conditional entropy of the dataset under the condition that the input features are, specifically:

[0082] ;

[0083] In the formula, Indicates input features f Training dataset under certain conditions D conditional entropy, Indicates by features f The i The subset of values ​​that determines whether to perform the power outage reconstruction chain operation. m Representing input featuresf The number of possible values, i.e., the training dataset. D Classified as m A subset of whether to perform the power outage reconstruction chain operation. Represents the training dataset D The total number of samples in the middle. Indicates the first i A subset of whether to execute the power outage reconstruction chain operation The number of samples in the middle Indicates the first i Subset The entropy.

[0084] S33. Calculate the information gain based on the entropy and the conditional entropy, specifically as follows:

[0085] ;

[0086] In the formula, Representing input features f Information gain.

[0087] S4. In the training dataset of the current node, select the input feature with the largest information gain, and divide the training dataset into multiple subsets based on the input feature with the largest information gain. Each subset corresponds to a child node, and each subset corresponds to a value or range of the feature.

[0088] S5. Recursively execute the step of calculating the information gain of each input feature for each subset until a preset stopping condition is met, and set the label of the subset as the category of the child node to obtain the trained decision tree model.

[0089] like Figure 6 As shown, Figure 6 An example of a trained decision tree model is shown.

[0090] In one alternative implementation, the method further includes storing the trained decision tree model into NAND (flash memory).

[0091] In one alternative implementation, the preset stopping condition includes the subset having only one decision outcome.

[0092] S6. Perform power-on initialization on the hard drive to obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results.

[0093] like Figure 4 As shown, Figure 4 It demonstrates the basic process of hard drive power-on initialization.

[0094] The power-on duration is the time from when the hard drive is connected to the power supply to when out-of-band speed negotiation begins. The out-of-band speed negotiation result is whether the out-of-band speed negotiation was successfully completed. The identification command execution result is whether the identification command was successfully received and executed.

[0095] In an alternative implementation, the method further includes loading the trained decision tree model from a NAND flash memory.

[0096] S7. Input the power-on duration, the out-of-band speed negotiation result, and the recognition command execution result into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation, and output the decision result, such as... Figure 5 As shown.

[0097] The decision result includes executing the power outage reconstruction chain operation and not executing the power outage reconstruction chain operation.

[0098] S8. Process the hard disk based on the decision result, such as... Figure 5 As shown, it specifically includes:

[0099] S81. If the decision result is to perform the power outage and chain reconstruction operation, then execute S811-S813.

[0100] S811. Send a power-off command to the hard disk to disconnect the power supply to the hard disk.

[0101] S812. After waiting for the first preset time, the hard disk is re-powered and initialized.

[0102] The first preset duration can be set according to the actual situation, such as 1 second or 3 seconds.

[0103] S813. Determine whether a read / write command has been received within the second preset time period. If not, return to execute S811. If yes, confirm that the power outage reconstruction chain was successful.

[0104] The second preset duration can be set according to the actual situation, such as 1 minute.

[0105] In one alternative implementation, after confirming that the power outage reconstruction chain is successful, steps S821-S822 can also be executed.

[0106] S82. If the decision result is that the power outage and chain reconstruction operation is not performed, then S821-S822 are executed.

[0107] S821. Collect the power-on feedback data of the hard drive.

[0108] The power-on feedback data includes power-on duration, out-of-band speed negotiation results, identification command execution results, and whether the link was successfully established.

[0109] S822. Update the trained decision tree model based on the power-on feedback data.

[0110] Based on the accumulation and feedback of historical data, the decision tree model is incrementally learned and adjusted to gradually optimize it, improving the accuracy of link reconstruction strategy judgment under different conditions. The updated decision tree model is stored in NAND flash memory as the judgment model for the next power-on, thereby improving the hard drive's adaptability to different situations, reducing invalid link reconstruction attempts, and improving system efficiency.

[0111] The hardware power-on method of the present invention automatically restores the link when communication between the host and the hard disk fails to be established, and avoids the problem of slow recovery of information such as the internal mapping table of the hard disk, which leads to the host being unable to respond. By automatically triggering the reconstruction of the link, time waste is reduced and efficiency is improved.

[0112] Please refer to Figure 2 Embodiment two of the present invention is as follows:

[0113] A hard disk power-on device, comprising:

[0114] The power-on module is used to perform power-on initialization on the hard drive and obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results.

[0115] The decision module is used to input the power-on duration, the out-of-band speed negotiation result, and the recognition command execution result into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation and output the decision result.

[0116] The processing module is used to process the hard disk based on the decision result.

[0117] Embodiment 3 of the present invention is as follows:

[0118] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the various steps of the hard disk power-on method in Embodiment 1.

[0119] Embodiment four of the present invention is as follows:

[0120] Please refer to Figure 3 An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the hard disk power-on method in Embodiment 1.

[0121] In summary, this invention provides a hard disk power-on method, apparatus, readable storage medium, and electronic device. The method involves power-on initialization of the hard disk to obtain power-on initialization data. This data, including power-on duration, out-of-band speed negotiation results, and recognition command execution results, is input into a trained decision tree model to determine whether to perform a power-off reconstruction chain operation. The model outputs a decision result, and based on this result, the hard disk is processed. This dynamic determination of whether a power-off reconstruction chain is needed, based on the real-time communication establishment status between the host and the hard disk, ensures that even if the host fails to establish normal communication with the hard disk due to abnormal circumstances, a power-off reconstruction chain can still be performed. In this situation, timely and proactive chain reconstruction attempts can automatically restore the link after the host and hard drive communication is lost, avoiding the problem of slow recovery of information such as the hard drive's internal mapping table, which leads to the host's inability to respond. This improves the efficiency of triggering power outage chain reconstruction and reduces invalid chain reconstruction attempts. When the decision result is to execute the power outage chain reconstruction operation, the hard drive is powered off, and after a certain period of time, the chain reconstruction is performed, effectively solving the problems of hard drive power-on delay and link establishment failure. When the decision result is not to execute the power outage chain reconstruction operation, the decision tree model is updated through real-time feedback, thereby continuously optimizing the decision-making process and improving the success rate of link establishment.

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

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

[0124] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each component can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0125] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

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

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

[0128] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for powering on a hard disk, characterized in that, Including the following steps: Collect a training dataset, which includes input features and their corresponding labels. The input features include power-on initialization data used for training, and the labels include whether a power-off reconstruction chain operation is performed. Use the training dataset as the root node; Calculate the information gain for each of the input features; The trained decision tree model is obtained based on the information gain and the training dataset; Perform power-on initialization on the hard drive to obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results. The power-on duration, the out-of-band speed negotiation result, and the recognition command execution result are input into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation, and the decision result is output. The hard drive is processed based on the decision result; Calculating the information gain for each input feature includes: The entropy of the training dataset is calculated as follows: ; In the formula, Represents the training dataset D The entropy of whether to perform a power outage and chain reconstruction operation. This indicates that the power outage reconstruction chain is executed on the training dataset. D The probability in This indicates that the power outage reconstruction chain is not executed in the training dataset. D The probability of it; Calculate the conditional entropy of the dataset given the input features, specifically as follows: ; In the formula, Indicates input features f Training dataset under certain conditions D conditional entropy, Indicates by features f The i The subset of values ​​that determines whether to perform the power outage reconstruction chain operation. m Representing input features f The number of possible values, Represents the training dataset D The total number of samples in the middle. Indicates the first i A subset of whether to execute the power outage reconstruction chain operation The number of samples in the middle Indicates the first i A subset of whether to execute the power outage reconstruction chain operation entropy, The information gain is calculated based on the entropy and the conditional entropy.

2. The hard disk power-on method according to claim 1, characterized in that, The decision outcome includes performing a power outage-to-rebuild chain operation; The processing of the hard disk based on the decision result includes: If the decision result is to perform the power outage and rebuild chain operation, then a power outage command is sent to the hard drive to disconnect the power supply to the hard drive; After waiting for the first preset time, the hard drive is powered on and initialized again; Determine whether a read / write command has been received within the second preset time period. If not, return to the step of sending a power-off command to the hard drive. If yes, determine that the power-off reconstruction chain was successful.

3. The hard disk power-on method according to claim 1, characterized in that, The decision outcome includes not performing the power outage rebuild chain operation; The processing of the hard disk based on the decision result includes: If the decision result is to not perform the power-off reconstruction chain operation, then collect the power-on feedback data of the hard drive; The trained decision tree model is updated based on the power-on feedback data.

4. The hard disk power-on method according to claim 1, characterized in that, The decision tree model trained based on the information gain and the training dataset includes: In the training dataset of the current node, the input feature with the largest information gain is selected, and the training dataset is divided into multiple subsets based on the input feature with the largest information gain, with each subset corresponding to a child node; The information gain step of calculating each input feature is recursively executed for each subset until a preset stopping condition is met, and the label of the subset is set as the category of the child node to obtain the trained decision tree model.

5. The hard disk power-on method according to claim 1, characterized in that, The calculation of information gain based on the entropy and the conditional entropy specifically involves: ; In the formula, Representing input features f Information gain.

6. A hard disk power-on device, characterized in that, include: The training module is used to collect a training dataset, which includes input features and their corresponding labels. The input features include power-on initialization data used for training, and the labels include whether a power-off reconstruction chain operation is performed. Use the training dataset as the root node; Calculate the information gain for each of the input features; The trained decision tree model is obtained based on the information gain and the training dataset; The power-on module is used to perform power-on initialization on the hard drive and obtain power-on initialization data, which includes power-on duration, out-of-band speed negotiation results, and identification command execution results. The decision module is used to input the power-on duration, the out-of-band speed negotiation result, and the recognition command execution result into the trained decision tree model to determine whether to perform the power-off reconstruction chain operation and output the decision result. The processing module is used to process the hard disk based on the decision result; Calculating the information gain for each input feature includes: The entropy of the training dataset is calculated as follows: ; In the formula, Represents the training dataset D The entropy of whether to perform a power outage and chain reconstruction operation. This indicates that the power outage reconstruction chain is executed on the training dataset. D The probability in This indicates that the power outage reconstruction chain is not executed in the training dataset. D The probability of it; Calculate the conditional entropy of the dataset given the input features, specifically as follows: ; In the formula, Indicates input features f Training dataset under certain conditions D conditional entropy, Indicates by features f The i The subset of values ​​that determines whether to perform the power outage reconstruction chain operation. m Representing input features f The number of possible values, Represents the training dataset D The total number of samples in the middle. Indicates the first i A subset of whether to execute the power outage reconstruction chain operation The number of samples in the middle Indicates the first i A subset of whether to execute the power outage reconstruction chain operation entropy, The information gain is calculated based on the entropy and the conditional entropy.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the hard disk power-on method as described in any one of claims 1 to 5.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements each step of the hard disk power-on method as described in any one of claims 1 to 5.