SSD fault repair method, device, computer equipment, readable storage medium and program product
By performing power-on-down reset of SSD faults in data center network equipment, the system interruption problem caused by SSD faults is solved, and the continuity of data processing tasks and automated fault repair are achieved.
Patent Information
- Application Number
- CN202411835062.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-12-04
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In data center network equipment, SSD failures often cause the system to fail to work properly. The prior art is usually solved by power-off restarts, but this will interrupt the tasks being performed and affect business continuity.
By calling the preset reset function when detecting SSD failure, if the reset is unsuccessful and the number of retrys reaches the preset threshold, the faulty SSD is powered on and off to realize separate repair of the fault without restarting the entire machine.
This method can repair SSD failures without interrupting tasks, ensure the continuity of data processing tasks, and no operation and maintenance intervention is required. The system automatically completes fault repair, which is more efficient.
Smart Images

Figure CN119759658A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a SSD fault repair method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the rise of artificial intelligence generated content (AIGC) and intelligent computing centers, the requirements for data center network equipment are getting higher and higher. When the current mainstream network equipment is running for a long time, there is a high probability that the solid state drive (SSD) will fail, such as becoming read-only, making the system unable to work properly. When an abnormality occurs, the SMART properties of the SSD hard disk are queried, and no abnormality is reported.
[0003] In the case of the above SSD failure, the system is generally restored by powering off and restarting the device. For example, the user can power off and restart the device by pressing a restart button.
[0004] Although SSD failures can be eliminated by powering off and restarting the device to restore the system, in actual applications, devices equipped with SSDs generally need to carry corresponding data processing tasks. For example, network devices need to carry customer business traffic. Restarting the device will interrupt the task currently being executed by the device (for example, restarting the network device will interrupt the traffic), affecting the continuity of customer business and causing inconvenience to users. Summary of the invention
[0005] Based on this, it is necessary to provide an SSD fault repair method, device, computer equipment, computer-readable storage medium and computer program product that can improve the continuity of data processing tasks in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for repairing an SSD fault, comprising:
[0007] When an SSD failure is detected, the preset reset function is called to reset;
[0008] If the reset is unsuccessful, determine whether the number of reset retries reaches a preset threshold;
[0009] If the reset retry times reach the preset threshold, the faulty SSD is powered on and off and reset.
[0010] In one embodiment, when an SSD failure is detected, before calling a preset reset function to reset, the method further includes:
[0011] Register a hook function in the system kernel, where the hook function is used to instruct the BSP to execute the SSD power-on and power-off logic;
[0012] If the number of reset retries reaches the preset threshold, the faulty SSD is powered on and off and reset, including:
[0013] If the number of reset retries reaches the preset threshold, the above hook function is obtained;
[0014] Call BSP according to the hook function to power on and off the faulty SSD.
[0015] In one embodiment, after powering on and resetting the failed SSD, the method further includes:
[0016] Record the power-on and power-off reset actions in the log, and return to the step of calling the preset reset function to reset.
[0017] In one embodiment, the SSD fault repair method further includes:
[0018] If the reset is successful, determine whether the port connection is established;
[0019] If yes, the fault repair is successfully recorded in the log;
[0020] If the port connection is not established and the number of reset retries is greater than a preset threshold, the failure of fault repair is recorded in the log.
[0021] In one embodiment, the SSD fault repair method further includes:
[0022] If the number of reset retries is less than the preset threshold, determining whether the SSD has timed out in response;
[0023] If yes, the data flow of the interface between the CPU and the SSD is slowed down;
[0024] If not, return to the step of calling the preset reset function to reset.
[0025] In one embodiment, after the data traffic of the interface between the CPU and the SSD is slowed down, the method further includes:
[0026] The speed reduction process is recorded in the log, and the step of calling the preset reset function to reset is returned.
[0027] In a second aspect, the present application further provides an SSD fault repair device, comprising:
[0028] The reset function calling module is used to call the preset reset function to reset when an SSD failure is detected;
[0029] The first judgment module is used to judge whether the number of reset retries reaches a preset threshold if the reset is unsuccessful;
[0030] The SSD power-on and power-off reset module is used to power-on and power-off reset the faulty SSD if the number of reset retries reaches a preset threshold.
[0031] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the SSD fault repair method in any of the above embodiments are implemented.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the SSD fault repair method in any of the above embodiments are implemented.
[0033] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the SSD fault repair method in any of the above embodiments.
[0034] The above-mentioned SSD fault repair method, device, computer equipment, computer-readable storage medium and computer program product, when an SSD fault is detected, call the preset reset function to reset; if the reset is unsuccessful, determine whether the number of reset retries reaches the preset threshold; if the number of reset retries reaches the preset threshold, the faulty SSD is powered on and off and reset. By adding a separate power-on and power-off processing process for the SSD hard disk to the repair process, when an SSD fault occurs, the system can perform a separate power-on and power-off repair on the SSD hard disk without restarting the entire machine or interrupting the currently executing task, thereby ensuring the continuity of the data processing task. And there is no need for operation and maintenance intervention, the system automatically completes SSD fault repair, which is more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A schematic diagram of a flow chart of an SSD fault repair method in one embodiment;
[0037] Figure 2 A schematic diagram of a flow chart of an SSD fault repair method in another embodiment;
[0038] Figure 3 A schematic diagram of a flow chart of a method for repairing an SSD failure in another embodiment;
[0039] Figure 4 A schematic diagram of a processing flow after successfully resetting by calling a preset reset function in one embodiment;
[0040] Figure 5 A schematic diagram of a subsequent processing flow when the number of reset retries is less than a preset threshold in an embodiment;
[0041] Figure 6 A schematic diagram of a flow chart of a method for repairing an SSD failure in another embodiment;
[0042] Figure 7 is a structural block diagram of an SSD fault repair device in one embodiment;
[0043] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] In an exemplary embodiment, Figure 1 As shown, a method for repairing SSD faults is provided, and the method is applied to network devices such as switches as an example for explanation. It is understandable that the method can also be applied to other devices equipped with SSDs, such as servers, more specifically, such as independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide cloud computing services; it can also be applied to terminals, such as various personal computers, laptops, IoT devices, etc. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, gaming devices, etc. In this embodiment, the method includes the following steps S202 to S206. Among them:
[0046] S202, when an SSD failure is detected, calling a preset reset function to reset.
[0047] Among them, the preset reset function is a function used for device hard disk error processing and repair, and is generally stored in the device storage system. During the data transmission process, if the SSD has a communication error or a read-write error due to power fluctuations or other interference, such as changing from a read-write state to a read-only state, the switch system can call the preset reset function to perform a reset process to solve the fault problem. For SSDs with SATA (Serial Advanced Technology Attachment) interfaces, the preset reset functions are ata_do_reset and other functions; for SSDs with other interface types, such as PCIe interfaces, the commonly used reset functions under the corresponding interface types can also be used, and examples are not given one by one here.
[0048] For example, for an SSD with a SATA interface, when an SSD failure is detected in the current Linux kernel, the SATA driver of the switch may call ata_do_reset to perform a reset (comreset).
[0049] S204: If the reset is unsuccessful, determine whether the number of reset retries reaches a preset threshold.
[0050] Specifically, if the switch fails to reset by calling the preset reset function, it is necessary to further determine whether the number of reset retries reaches the preset threshold. The number of reset retries refers to the number of times the preset reset function is called. The system sets an upper limit for the number of reset retries, which is the preset threshold. For example, it can be 3, 4 or 5 times. The preset threshold can be selected according to actual needs.
[0051] S206: If the number of reset retries reaches a preset threshold, the faulty SSD is powered on and off and reset.
[0052] In traditional technology, if the switch calls the preset reset function and the number of reset retries reaches the preset threshold, it will generally feedback the repair failure result and exit the fault repair process. At this time, if you want to continue to complete the SSD fault repair, you need to power off and restart the entire machine. The power off and restart operation of the entire machine needs to interrupt the task currently being executed by the device, affecting business continuity.
[0053] In this embodiment, taking the preset threshold of 3 times as an example, the switch determines that the reset retry times reach 3 times, that is, after the reset fails after the third call of the preset reset function, the faulty SSD is individually powered on and off. The SSD has a separate power supply pin, so the switch can perform power-on and power-off reset logic on the SSD alone without powering off and restarting the whole machine, so as to realize the independent restart of the faulty SSD, thereby clearing the previous error state, such as the read-only state.
[0054] The above SSD fault repair method, when an SSD fault is detected, calls the preset reset function for reset; if the reset is unsuccessful, determines whether the number of reset retries reaches the preset threshold; if the number of reset retries reaches the preset threshold, the SSD is powered on and off and reset. By adding a separate power-on and power-off processing process for the SSD hard disk to the repair process, when an SSD fault occurs, the system can perform a separate power-on and power-off repair on the SSD hard disk without restarting the entire machine or interrupting the currently executing task, thus ensuring the continuity of the data processing task. And without the need for operation and maintenance intervention, the system automatically completes the SSD fault repair, which is more efficient.
[0055] In an exemplary embodiment, Figure 2 As shown, before S202, it also includes:
[0056] S201, registering a hook function in the system kernel, wherein the hook function is used to instruct the BSP to execute SSD power-on and power-off logic.
[0057] It can be understood that the switch registers the hook function into the system kernel when the BSP (i.e., board support package) is initialized, and when an SSD failure occurs, the system kernel can be triggered to automatically call the hook function to instruct the BSP to execute the SSD power-on and power-off logic.
[0058] Example of registering hook function interface code:
[0059]
[0060]
[0061] S206 includes:
[0062] S302, if the number of reset retries reaches a preset threshold, obtain the above hook function;
[0063] S304, calling the BSP according to the hook function to power on and off the faulty SSD and reset it.
[0064] When an SSD failure occurs, the switch system kernel can be triggered to automatically call the hook function. Exemplarily, the system kernel first obtains the previously registered hook function, and then calls the BSP to power on and off the SSD according to the hook function. For example, the BSP configures the CPLD (complex programmable logic device) to power on and off the SSD.
[0065] Code example of calling the hook function in the system kernel:
[0066]
[0067]
[0068] In this embodiment, by registering a hook function for instructing BSP to execute SSD power-on and power-off logic into the system kernel, the system can automatically call the hook function to respond when the trigger condition is met, thereby automatically completing SSD fault repair in an efficient and timely manner.
[0069] In an exemplary embodiment, Figure 3 As shown, after the faulty SSD is powered on and off and reset, the following steps are also included:
[0070] S208, recording the power-on and power-off reset actions in the log, and returning to the step of calling the preset reset function to perform the reset.
[0071] Specifically, after the switch performs power-on and power-off reset on the SSD, the switch records the power-on and power-off reset action on the SSD in the system log. Whether the reset is successful or failed, it is recorded in the system log for operation and maintenance personnel to view and use.
[0072] After the switch records the power-on and power-off reset actions in the log, it needs to return to the step of calling the preset reset function to reset again, and cyclically execute the SSD fault repair process until the feedback result of repair success or repair failure is obtained and the reset logic is exited.
[0073] In this embodiment, by recording the power-on and power-off reset actions in the log, it is convenient for operation and maintenance personnel to view and use the system log, so as to provide a basis for operation and maintenance work or optimization of the SSD fault repair process.
[0074] In one embodiment, if Figure 4 As shown, the above SSD fault repair method also includes:
[0075] S402: If the reset is successful, determine whether a port connection is established.
[0076] Specifically, if the switch successfully resets by calling the preset reset function, it further determines whether to establish a port connection, wherein the port includes both the port on the upper chip side connected to the SSD, such as the CPU side port, and the SSD side port.
[0077] S404: If yes, record in the log that the fault is repaired successfully.
[0078] The switch calls the preset reset function to reset successfully, and determines that the port between the SSD and the upper chip has established a connection, indicating that the SSD fault is repaired successfully, and the fault repair success is recorded in the system log. It can also feedback the result of the successful SSD fault repair, exit the fault repair logic, and the process ends.
[0079] S406: If the port connection is not established and the number of reset retries is greater than a preset threshold, a fault repair failure is recorded in a log.
[0080] Specifically, the switch calls the preset reset function to reset successfully, but determines that the port between the SSD and the upper chip is still not connected. At this time, the SSD fault still exists and the SSD cannot be used normally. If the number of reset retries is greater than the preset threshold, it means that the SSD fault repair has failed, and the fault repair failure is recorded in the system log. The result of the SSD fault repair failure can also be fed back, and the fault repair logic is exited, and the process ends.
[0081] The inventor found in actual research that during the SSD fault repair process, sometimes even if the system calls the preset reset function to reset successfully, the SSD still cannot be used normally. The cause is often found to be due to a problem with the port connection between the SSD and the upper chip. However, in the traditional technology, the port status is generally not automatically detected when repairing the SSD fault, which reduces the efficiency of SSD fault repair. In this embodiment, when the switch calls the preset reset function to reset successfully, a port connection status detection process is further added and recorded in the system log, so that even if the SSD fault repair fails, it is easy to find the cause in time, which is conducive to improving the efficiency of SSD fault repair.
[0082] In an exemplary embodiment, Figure 5 As shown, the above SSD fault repair method also includes:
[0083] S502: If the number of reset retries is less than a preset threshold, determine whether the SSD response has timed out.
[0084] For example, when the switch calls the preset reset function and the number of reset retries is less than the preset threshold, it does not need to start the process of powering on and off the SSD, but enters the process of determining whether the SSD response has timed out. SSD response timeout may be caused by a large amount of CPU and memory resources being occupied, excessive load, or driver compatibility issues or even hardware connection issues.
[0085] S504: If yes, the interface data traffic between the CPU and the SSD is slowed down.
[0086] For example, the interface data flow can be decelerated by adjusting the speed mode of the interface between the CPU and the SSD from a high speed mode to a lower speed mode. For example, a SATA interface SSD can be adjusted from a SATA 3.0 mode to a SATA 2.0 or SATA 1.0 mode.
[0087] S506: If not, return to the step of calling the preset reset function to reset.
[0088] In this embodiment, if the number of reset retries is less than a preset threshold, it is further determined whether the SSD response has timed out, and in the case of a response timeout, the interface data traffic between the CPU and the SSD is slowed down. This can reduce compatibility issues or SSD failures caused by high loads to a certain extent, making it easier to eliminate SSD failures as soon as possible without necessarily powering on and off the SSD to reset it, further reducing the impact on business continuity.
[0089] In an exemplary embodiment, see Figure 5 After the data flow of the interface between the CPU and the SSD is slowed down, the method further includes:
[0090] S508, recording the speed reduction processing action in the log, and returning to the step of calling the preset reset function to reset.
[0091] In this embodiment, after the speed reduction process is performed on the interface between the CPU and the SSD, the speed reduction process action is further recorded in the system log so that the operation and maintenance personnel can view and use it.
[0092] In a specific embodiment, Figure 6 As shown, a method for repairing an SSD fault is provided, comprising the following steps:
[0093] S1, detects whether the SSD is faulty, if so, enters S2;
[0094] S2, call the preset reset function to reset;
[0095] S3, determine whether the reset is successful, if not, go to S4, if yes, go to S11;
[0096] S4, determine whether the number of reset retries is greater than the threshold, if not, enter S5, if yes, enter S13
[0097] S5, determine whether the number of reset retries reaches the threshold, if yes, go to S6, if no, go to S8;
[0098] S6, power on and off the SSD to reset;
[0099] S7, record the power-on and power-off reset actions in the log, and return to S2;
[0100] S8, determine whether the SSD response timeout; if so, enter S9, if not, return to S2;
[0101] S9, reducing the speed of the interface data traffic between the CPU and the SSD;
[0102] S10, record the speed reduction process in the log, and return to S2;
[0103] S11, determine whether the port connection is established; if so, enter S12, if not, return to S4;
[0104] S12, record the failure repair success in the log, and exit the failure repair process;
[0105] S13, record the failure of fault repair in the log, and exit the fault repair process.
[0106] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0107] Based on the same inventive concept, the embodiment of the present application also provides an SSD fault repair device for implementing the SSD fault repair method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more SSD fault repair device embodiments provided below can refer to the above limitations on the SSD fault repair method, and will not be repeated here.
[0108] In an exemplary embodiment, Figure 7 As shown, an SSD fault repair device 900 is provided, comprising: a reset function calling module 901, a first judgment module 902 and an SSD power-on and power-off reset module 903, wherein:
[0109] A reset function calling module 901 is used to call a preset reset function to reset the SSD when an SSD failure is detected;
[0110] The first judgment module 902 is used to judge whether the number of reset retries reaches a preset threshold if the reset is unsuccessful;
[0111] The SSD power-on and power-off reset module 903 is used to power-on and power-off reset the faulty SSD if the number of reset retries reaches the preset threshold.
[0112] In an exemplary embodiment, the apparatus further comprises:
[0113] The registration module is used to register a hook function in the system kernel, and the hook function is used to instruct the BSP to execute the SSD power-on and power-off logic.
[0114] The SSD power-on and power-off reset module 903 is also used to obtain the hook function if the number of reset retries reaches a preset threshold; and call the BSP according to the hook function to power-on and power-off reset the faulty SSD.
[0115] In an exemplary embodiment, the apparatus further comprises:
[0116] The recording and returning module is used to record the power-on and power-off reset actions in a log, and return to the step of calling the preset reset function to perform the reset.
[0117] In an exemplary embodiment, the apparatus further comprises:
[0118] A second judgment module is used to judge whether to establish a port connection if the reset is successful;
[0119] The recording and returning module is further configured to record the failure of fault repair in the log if the port connection is not established and the number of reset retries is greater than the preset threshold.
[0120] In an exemplary embodiment, the apparatus further comprises:
[0121] A third judgment module, configured to judge whether the SSD responds to a timeout if the number of reset retries is less than the preset threshold;
[0122] A speed reduction processing module, used for reducing the speed of the interface data traffic between the CPU and the SSD if the SSD response times out;
[0123] The recording and returning module is also used to return to the step of calling the preset reset function to perform a reset if the SSD response does not time out.
[0124] In an exemplary embodiment, the recording and returning module is further used to record the speed reduction processing action in a log, and return to the step of calling the preset reset function to perform a reset.
[0125] Each module in the above-mentioned SSD fault repair device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0126] In an exemplary embodiment, a computer device is provided. The computer device may be a switch, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a SSD fault repair method is implemented.
[0127] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0128] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0129] When an SSD failure is detected, the preset reset function is called to reset;
[0130] If the reset is unsuccessful, determine whether the number of reset retries reaches a preset threshold;
[0131] If the reset retry times reach the preset threshold, the faulty SSD is powered on and off and reset.
[0132] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0133] A hook function is registered in the system kernel, and the hook function is used to instruct the BSP to execute the SSD power-on and power-off logic; if the reset retry times reach a preset threshold, the faulty SSD is powered on and off, including: if the reset retry times reach a preset threshold, the hook function is obtained; according to the hook function, the BSP is called to power on and off the faulty SSD.
[0134] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0135] After the SSD is powered on and off and reset, the power-on and power-off reset actions are recorded in the log, and the steps of calling the preset reset function to perform the reset are returned.
[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0137] If the reset is successful, determine whether the port connection is established; if so, record the failure repair success in the log; if the port connection is not established and the reset retry number is greater than a preset threshold, record the failure repair failure in the log.
[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0139] If the number of reset retries is less than the preset threshold, determine whether the SSD has timed out; if so, slow down the interface data traffic between the CPU and the SSD; if not, return to the step of calling the preset reset function to reset.
[0140] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0141] After the interface data traffic between the CPU and the SSD is decelerated, the deceleration action is recorded in the log, and the step of calling the preset reset function to perform a reset is returned.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0143] When an SSD failure is detected, the preset reset function is called to reset;
[0144] If the reset is unsuccessful, determine whether the number of reset retries reaches a preset threshold;
[0145] If the reset retry times reach the preset threshold, the faulty SSD is powered on and off and reset.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0147] A hook function is registered in the system kernel, and the hook function is used to instruct the BSP to execute the SSD power-on and power-off logic; if the reset retry times reach a preset threshold, the faulty SSD is powered on and off, including: if the reset retry times reach a preset threshold, the hook function is obtained; according to the hook function, the BSP is called to power on and off the faulty SSD.
[0148] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0149] After the SSD is powered on and off and reset, the power-on and power-off reset actions are recorded in the log, and the steps of calling the preset reset function to perform the reset are returned.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0151] If the reset is successful, determine whether the port connection is established; if so, record the failure repair success in the log; if the port connection is not established and the reset retry number is greater than the preset threshold, record the failure repair failure in the log.
[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0153] If the number of reset retries is less than the preset threshold, determine whether the SSD has timed out; if so, slow down the interface data traffic between the CPU and the SSD; if not, return to the step of calling the preset reset function to reset.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0155] After the interface data traffic between the CPU and the SSD is decelerated, the deceleration action is recorded in the log, and the step of calling the preset reset function to perform a reset is returned.
[0156] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0158] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited thereto.
[0159] The patent application of this invention belongs to the intellectual property achievement of the key special project "Multimodal Network and Communication" of the National Key R&D Program "Multimodal Network Back-end Compilation System", and is funded by the National Key R&D Program (Project No. 2022YFB2901500, Project No. 2022YFB2901503).
[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0161] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for repairing an SSD fault, characterized in that: include: When an SSD failure is detected, the preset reset function is called to reset; If the reset is unsuccessful, determine whether the number of reset retries reaches a preset threshold; If the reset retry times reaches the preset threshold, the failed SSD is powered on and off and reset.
2. The method according to claim 1, characterized in that When an SSD failure is detected, before calling a preset reset function to reset, the method further includes: Register a hook function in the system kernel, where the hook function is used to instruct the BSP to execute the SSD power-on and power-off logic; If the number of reset retries reaches the preset threshold, powering on and resetting the faulty SSD includes: If the reset retry times reaches the preset threshold, obtaining the hook function; The BSP is called according to the hook function to perform power-on and power-off reset on the faulty SSD.
3. The method according to claim 1, characterized in that After the faulty SSD is powered on and off and reset, the method further includes: The power-on and power-off reset actions are recorded in a log, and the step of calling the preset reset function to perform the reset is returned.
4. The method according to claim 1, characterized in that: Also includes: If the reset is successful, determine whether the port connection is established; If yes, the fault repair is successfully recorded in the log; If the port connection is not established and the number of reset retries is greater than the preset threshold, the failure of fault repair is recorded in the log.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: If the number of reset retries is less than the preset threshold, determining whether the SSD has timed out in response; If yes, the data flow of the interface between the CPU and the SSD is slowed down; If not, return to the step of calling the preset reset function to reset.
6. The method according to claim 5, characterized in that After the data flow of the interface between the CPU and the SSD is slowed down, the method further includes: The speed reduction process is recorded in the log, and the step of calling the preset reset function to reset is returned.
7. A SSD fault repair device, characterized in that: include: The reset function calling module is used to call the preset reset function to reset when an SSD failure is detected; The first judgment module is used to judge whether the number of reset retries reaches a preset threshold if the reset is unsuccessful; The SSD power-on and power-off reset module is used to power-on and power-off reset the faulty SSD if the number of reset retries reaches the preset threshold.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.