Method and device for electrifying hard disk in server, server and medium
The storage controller controls the out-of-band handshake signal and start-and-turn signal of the hard disk, which solves the problem of large-scale current impact when the mechanical hard disk is powered on, ensures that the hard disk is turned on and recognized normally after the server is powered on, and improves system stability and the reliability of the RAID array.
Patent Information
- Application Number
- CN202510672326.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, the large-scale startup of a mechanical hard disk when the server is powered on causes excessive current peak, which may lead to server downtime or hardware damage, and the CPLD control method causes a healthy hard disk to be misjudged as a failure, affecting the construction of the RAID array and data reliability.
Through the power-up strategy executed by the storage controller, the out-of-band handshake signal of the hard disk is continuously received, and the out-of-band start-up signal is sent in groups based on the preset number of hard disks and the startup time interval, to control the start-up time of the hard disk to avoid large-scale current impact.
Effectively distribute the impact of the hard disk start-and-turn current, ensure that the hard disk start-and-turn within the time window that can be discovered by the disk array card, improve system stability and the success rate of RAID array construction, and avoid the misjudgement of healthy hard disks as faults.
Smart Images

Figure CN120508257A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a method and device for powering on a hard disk in a server, a server, and a medium. Background Art
[0002] In current storage technology, servers are typically equipped with numerous mechanical hard drives, typically mounted on disk array cards. During the startup process, these hard drives generate a significant current spike as the disks begin to spin up. If a large number of hard drives are simultaneously powered on in a server, the current flowing through the drive backplane can suddenly increase dramatically. This can potentially exceed the capacity of the server power supply or backplane, ultimately causing server downtime or hardware damage.
[0003] To address this issue, existing solutions typically use a Complex Programmable Logic Device (CPLD) to schedule the startup of a specific number of mechanical hard drives (HDDs). This helps distribute the current peak during HDD startup and prevents excessive transient current draw. However, this CPLD-based approach to HDD startup has limitations. Because the CPLD controls HDD startup independently of the disk array card (RAID), the RAID card attempts to discover all HDDs after system power-up. The RAID card has a limited window for discovering HDDs. If some HDDs, controlled by the CPLD, delay startup and become ready beyond the RAID card's window, the RAID card will mark these undiscovered HDDs as offline or faulty. This can cause otherwise healthy HDDs to be mistakenly identified as faulty, impacting RAID configuration and data reliability, and compromising system stability and maintenance.
[0004] It can be seen that how to improve the stability of the system when the hard disk is powered on is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, server and medium for powering on a hard disk in a server, which can improve the stability of the system when the hard disk is powered on.
[0006] In a first aspect, a method for powering on a hard disk in a server is provided, which is executed by a storage controller, the method comprising: reading a power-on strategy, the power-on strategy comprising: a preset number of hard disks and a preset startup time interval; after the server is powered on, continuously receiving out-of-band handshake signals from each hard disk, the out-of-band handshake signal being used to control hard disk initialization and rate negotiation; according to the power-on strategy, sending an out-of-band start signal to a hard disk group at intervals of a preset startup time interval, so that each hard disk in the hard disk group is started until all mounted hard disks have completed the startup, wherein the hard disk group is a hard disk group obtained by grouping the hard disks that received the out-of-band handshake signals according to a preset number of hard disks based on the reception time of the out-of-band handshake signals of each hard disk.
[0007] In a preferred example, the present application can be further configured as follows: the process of determining the power-on strategy includes: obtaining multiple power-on strategies to be tested, the multiple power-on strategies to be tested have the same start-up time interval to be tested and different numbers of hard disks to be tested; testing the multiple power-on strategies to be tested to obtain a first power peak value for each power-on strategy to be tested; determining the first power-on strategy to be tested from the multiple power-on strategies to be tested based on the first power peak value and the maximum power supply peak value; setting multiple start-up time intervals to be tested based on the number of hard disks to be tested of the first power-on strategy to be tested to obtain multiple second power-on strategies to be tested; testing the multiple second power-on strategies to be tested to obtain a second power peak value for each second power-on strategy to be tested; determining the power-on strategy from the multiple second power-on strategies to be tested based on the second power peak value and the maximum power supply peak value.
[0008] In a preferred example, the present application can be further configured as follows: according to the power-on strategy, at a preset startup time interval, an out-of-band startup signal is sent to the hard disk group so that each hard disk in the hard disk group can be started until all mounted hard disks have completed the startup, including: at a preset startup time interval, sending an out-of-band startup signal to each batch of the hard disk group in turn; determining whether the total amount of hard disks that have been started is the same as the total amount of standard hard disks; if so, determining that all mounted hard disks have completed the startup.
[0009] In a preferred example, the present application can be further configured as follows: It also includes: in the process of powering on according to the power-on strategy, if the number of hard disks in the hard disk group that currently needs to be powered on is less than the preset number of hard disks, and it is not the last hard disk group, then the startup time interval is extended, and an out-of-band start signal is determined and sent to the new hard disk group that currently needs to be powered on.
[0010] In a preferred example, the present application can be further configured as follows: the storage controller is a disk array card or an expander.
[0011] In a preferred example, the present application may be further configured as follows: when the storage controller is an expander, after all mounted hard disks have completed startup, it further includes: sending information of all hard disks that have completed startup to the disk array card.
[0012] In a preferred example, the present application can be further configured as follows: It also includes: during the power-on process according to the power-on strategy, if it is detected that the power peak of the hard disk group at startup is greater than the preset maximum power threshold, the preset number of hard disks is reduced, and the remaining hard disks are regrouped according to the adjusted number of hard disks.
[0013] On the second aspect, a hard disk power-on device in a server is provided, comprising: a reading module for reading a power-on strategy, wherein the power-on strategy comprises: a preset number of hard disks and a preset startup time interval; a handshake module for continuously receiving out-of-band handshake signals from each hard disk after the server is powered on, wherein the out-of-band handshake signal is used to control hard disk initialization and rate negotiation; a power-on module for sending an out-of-band start-up signal to the hard disk group at intervals of a preset startup time interval according to the power-on strategy, so that each hard disk in the hard disk group can be started until all mounted hard disks have completed the startup, wherein the hard disk group is a hard disk group obtained by grouping the hard disks that have received the out-of-band handshake signal according to the preset number of hard disks based on the reception time of the out-of-band handshake signal of each hard disk.
[0014] In a third aspect, a server is provided, comprising: a storage controller; the storage controller comprises: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the hard disk power-on method in the server as described in any one of the first aspects.
[0015] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the hard disk power-on method in the server as described in any one of the first aspects.
[0016] In a fifth aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed by a processor, implements the hard disk power-on method in a server as described in any one of the first aspects.
[0017] In summary, the method for powering on a hard disk in a server provided by this application has the following beneficial technical effects:
[0018] A method for powering on a hard disk in a server is executed by a storage controller, the method comprising: reading a power-on strategy, the power-on strategy comprising: a preset number of hard disks and a preset startup time interval; after the server is powered on, continuously receiving out-of-band handshake signals from each hard disk, the out-of-band handshake signals being used to control hard disk initialization and rate negotiation; and sending an out-of-band start-up signal to a hard disk group at intervals of the preset startup time interval based on the power-on strategy, so that each hard disk in the hard disk group is started up, until all mounted hard disks have completed the startup, wherein the hard disk group is a hard disk group obtained by grouping the hard disks that received the out-of-band handshake signals according to the preset number of hard disks based on the reception time of the out-of-band handshake signals of each hard disk.
[0019] After the storage controller is powered on, it precisely controls the spin-up timing of the mechanical hard drives by controlling the device wake-up operation in the out-of-band signal. After the server is powered on, it continuously receives out-of-band handshake signals from each hard drive for initialization and rate negotiation. At this point, the hard drives are not immediately woken up. Instead, based on the sequence of handshake signals received and the power-on strategy, a preset boot interval is set to wake up a preset number of hard drives that have already completed handshakes, completing the spin-up and thus achieving staggered hard drive spin-up. In this way, the spin-up of the hard drives is dispersed to different time points, avoiding large-scale current shocks. At the same time, because the entire process is controlled by the storage controller, it can ensure that the hard drives complete the spin-up and are normally identified within the time window that the disk array card can detect.
[0020] In addition, the present application also provides a hard disk power-on device in a server, a server, and a medium, all of which have the above-mentioned beneficial technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 The present invention provides a flowchart of a method for powering on a hard disk in a server according to an embodiment of the present invention.
[0023] Figure 2 This is a structural diagram of a mechanical hard disk directly mounted under a disk array card provided by an embodiment of the present invention.
[0024] Figure 3 This is a structural diagram of a mechanical hard disk mounted under an expander provided by an embodiment of the present invention.
[0025] Figure 4A schematic structural diagram of a hard disk power-on device in a server provided by an embodiment of the present invention.
[0026] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0028] The terms "including" and "having," as used in the present description and accompanying drawings, and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.
[0029] The present invention aims to provide a more optimized and reliable method for staggered powering of a hard disk matrix in a server, overcoming the shortcomings of the CPLD solution in the prior art and ensuring that the hard disks can be normally identified and used by the disk array card while being powered on in a controlled staggered manner.
[0030] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0031] Next, a method, device, server, and medium for powering on a hard disk in a server provided by an embodiment of the present invention are described in detail.
[0032] Figure 1 A flowchart of a method for powering on a hard disk in a server provided by an embodiment of the present invention is provided. The method for powering on the hard disk in the server is executed by a storage controller.
[0033] The method proposed in this invention is applicable to two common hard disk topologies:
[0034] like Figure 2 As shown, the mechanical hard drive is directly mounted under the disk array card, that is, the storage controller is the disk array card. In this topology, the number of mechanical hard drives that can be mounted is generally limited by the number of channels on the disk array card itself. The method of this application is applicable to the disk array card firmware, which starts after the server is powered on.
[0035] like Figure 3As shown, a mechanical hard drive is mounted under an expander, which in turn connects to a disk array card via a wide port. This topology allows for the connection of more hard drives, as the expander can expand connectivity, making it suitable for servers with high-density storage requirements. The method of this application is applicable to the expander firmware, which starts after the server is powered on.
[0036] Specifically, the methods include:
[0037] S101 , reading a power-on strategy, where the power-on strategy includes: a preset number of hard disks and a preset startup time interval.
[0038] The firmware boots up, identifies, and loads the pre-set staggered power-on policy. The staggered power-on policy defines the number of hard drives to be started each time (the pre-set number of hard drives) and the interval between each start (the pre-set start interval). For example, it is set to start three hard drives every five seconds.
[0039] S102 : After the server is powered on, the server continuously receives out-of-band handshake signals from each hard disk. The out-of-band handshake signals are used to control hard disk initialization and rate negotiation.
[0040] The hard drive backplane powers on, and the mechanical hard drives begin connecting to the disk array cards. At this point, the storage controller begins receiving OOB (out-of-band) handshake signals from the hard drives to initialize the devices and negotiate the data rate. This initialization process includes configuring hard drive parameters and checking firmware. Furthermore, the out-of-band handshake signals are used to negotiate the data rate, determining the optimal communication rate between the two parties to ensure efficient and stable data transmission.
[0041] During this phase, the storage controller does not send a startup (device wake-up) signal to the mechanical hard drive. Power is applied but the drive does not start. After powering on, the hard drive seeks initialization with the storage controller. During initialization, the hard drive initiates a handshake. The hard drive sends an out-of-band handshake signal to the storage controller. This signal contains some basic information about the hard drive, such as the model and serial number. Upon receiving this handshake signal, the storage controller performs identification and verification to confirm the drive's identity and compatibility. If verification succeeds, the storage controller sends a confirmation signal to the hard drive and begins deeper communication with the hard drive, negotiating communication parameters (such as data transfer rate and data block size). Through this handshake process, a stable communication connection is established between the hard drive and the storage controller.
[0042] S103 , according to the power-on strategy, at a preset startup time interval, sequentially sending an out-of-band startup signal to each batch of hard disk groups, so that each hard disk in the hard disk group is started up, until all mounted hard disks have completed the startup.
[0043] The hard disk group is obtained by grouping the hard disks that received the out-of-band handshake signals according to the reception time of the out-of-band handshake signals of the respective hard disks and according to the preset number of hard disks.
[0044] Based on the staggered power-on strategy, the storage controller begins sending out-of-band spin-up signals to the first batch of hard drives (the first drive group) when the number of hard drives receiving out-of-band handshake signals reaches the preset number. These signals initiate the spin-up process. After the preset time interval expires, the storage controller sends spin-up signals to the next batch of hard drives based on the staggered power-on strategy, causing them to spin up. This process repeats until all mounted mechanical hard drives have been spun up.
[0045] It is understandable that in the embodiment of the present application, multiple hard disks are grouped according to the preset number of hard disks based on the time of receiving the out-of-band handshake signal of each hard disk to determine multiple batches of hard disk groups;
[0046] Specifically, after receiving the out-of-band handshake signal from each hard drive, the storage controller accurately records the time of receipt using an internal timer. The hard drives are then grouped based on a preset number of hard drives and the order of their receipt times. It is understood that the storage controller continuously receives out-of-band handshake signals from each hard drive and then gradually groups them based on their receipt times. Grouping can be based solely on receipt time, or it can be achieved through a weighted calculation based on both receipt time and drive importance. The earlier the receipt time and the higher the drive's importance, the higher the priority assigned to the group and the higher the priority assigned to the drive. Specifically, for each hard drive, a priority score is calculated: priority score = (W_time * normalized receipt time) + (W_importance * normalized drive importance). In one implementation, the normalized receipt time = (current time - receipt time) / maximum time window, and the normalized drive importance = (drive importance level - minimum importance) / (maximum importance - minimum importance). Furthermore, when determining each batch of hard drive groups, a priority score is determined based on the currently received, ungrouped hard drives, and the first batch of hard drive groups is determined based on the priority scores. Taking this as an example, the subsequent hard disk groups are calculated in sequence.
[0047] It can be seen that in the embodiment of the present application, after the storage controller is powered on, the device wake-up operation in the out-of-band signal is controlled to achieve precise control of the mechanical hard disk startup timing. After the server is powered on, the out-of-band handshake signal of each hard disk is continuously received to perform initialization and rate negotiation. At this time, the hard disk is not woken up immediately. Instead, according to the sequence of the obtained handshake signals and the power-on strategy, the preset startup time interval is set to wake up the hard disks that have achieved handshake corresponding to the preset number of hard disks to complete the startup, thereby achieving staggered startup of the hard disks. In this way, the startup of the hard disks is dispersed to different time points, avoiding large-scale current shocks. At the same time, since the entire process is controlled by the storage controller, it can ensure that the hard disk completes the startup and is normally identified within the time window that can be discovered by the disk array card.
[0048] A possible implementation method of an embodiment of the present application is a power-on strategy determination process, including: obtaining multiple power-on strategies to be tested, the multiple power-on strategies to be tested have the same test startup time interval and a different number of hard disks to be tested; testing the multiple power-on strategies to be tested to obtain a first power peak value for each power-on strategy to be tested; determining a first power-on strategy to be tested from the multiple power-on strategies to be tested based on the first power peak value and the maximum power supply peak value; setting multiple test startup time intervals based on the number of hard disks to be tested of the first power-on strategy to be tested to obtain multiple second power-on strategies to be tested; testing the multiple second power-on strategies to be tested to obtain a second power peak value for each second power-on strategy to be tested; and determining the power-on strategy from the multiple second power-on strategies to be tested based on the second power peak value and the maximum power supply peak value.
[0049] In an embodiment of the present application, a series of power-on strategies for different numbers of hard disks are generated, for example, starting from 2 hard disks, and gradually increasing the number of hard disks until the maximum number of hard disks supported by the system is reached - 2. Each strategy is tested and measured at the first power peak, where the first power peak can include: the current maximum power-on power and the maximum power-on power during the startup time interval to be tested, and of course, the stable power. The corresponding maximum power peak includes the maximum power-on power of the power supply (the instantaneous maximum power of the power supply * a, where a is a fixed coefficient to ensure that the power supply has sufficient buffering when the load fluctuates) and the maximum stable power. At this time, the current maximum power-on power and the maximum power-on power during the startup time interval to be tested need to be less than the maximum power-on power of the power supply, and of course the stable power also needs to be less than the maximum stable power.
[0050] Exemplarily, multiple power-on strategies to be tested are tested to obtain test data as shown in Table 1.
[0051] Table 1
[0052]
[0053] In one feasible method, the power peak of each strategy is evaluated, and the strategy with the largest number of hard disks among the strategies whose power peak does not exceed the maximum peak of the power supply is selected as the first power-on strategy to be tested. For example, taking Table 1 as an example, if the maximum startup power of the power supply with the maximum peak is 450W, the first power-on strategy to be tested is to select 12 hard disks. Then, based on the selected number of hard disks, the startup time interval is adjusted to obtain a plurality of second power-on strategies to be tested. At this time, the plurality of second power-on strategies to be tested include the number of hard disks and the startup time interval. The time interval can be from very short (such as 0.1 seconds) to longer (such as 6 seconds). Each time interval strategy is tested, and the power peak during off-peak startup is measured. Finally, the second power-on strategy to be tested with a short interval and a second power peak not exceeding the maximum peak of the power supply is selected as the final power-on strategy.
[0054] In another achievable method, the power peak of each strategy is evaluated, and strategies whose power peak does not exceed the maximum peak of the power supply are selected as the first power-on strategy to be tested. Furthermore, for each first power-on strategy to be tested, the startup time interval is adjusted based on the selected number of hard drives to obtain multiple second power-on strategies to be tested. In this case, the multiple second power-on strategies to be tested include the number of hard drives and the startup time interval, which can range from very short (e.g., 0.1 seconds) to longer (e.g., 6 seconds). Each time interval strategy is tested, and the power peak during off-peak startup is measured. Ultimately, a second power-on strategy to be tested with a short interval and a second power peak that does not exceed the maximum peak of the power supply is selected. Furthermore, from all the selected second power-on strategies corresponding to the first power-on strategies to be tested, the strategy with the shortest test time is selected as the final power-on strategy.
[0055] The specific method used is not limited in this embodiment of the application, and users can set it according to actual needs.
[0056] After obtaining the power-on strategy, we can conduct actual verification to ensure that the power peak in the real environment meets the expected situation, and then optimize the strategy. Furthermore, we can adjust the strategy accordingly based on the ambient temperature to ensure the safe and stable operation of the server.
[0057] It can be seen that in the embodiment of the present application, the number of hard disks and the startup time interval can be confirmed in sequence, so that the final power-on strategy is more accurate.
[0058] A possible implementation of the embodiment of the present application is to sequentially send an out-of-band spin-up signal to each batch of hard disk groups at a preset startup time interval, so that each hard disk in the hard disk group is spun up until all mounted hard disks are spun up, including:
[0059] At a preset startup time interval, an out-of-band spin-up signal is sequentially sent to each batch of hard disk groups; it is determined whether the total amount of the hard disks that have been spun up is the same as the total amount of the standard hard disks; if so, it is determined that all the mounted hard disks have completed the spin-up.
[0060] The standard total number of hard drives refers to the total number of mounted hard drives. After sending an out-of-band spin-up signal, the system checks whether the total number of spun-up hard drives matches the standard total number of hard drives. If so, all hard drives have been successfully spun up. If the two totals are not equal, the system sends an out-of-band spin-up signal to the next hard drive group at a preset startup interval until the two totals are equal, completing the spin-up of all hard drives. Alternatively, if the two totals are different but no next hard drive group exists, all valid hard drives have been spun up.
[0061] It can be seen that in the embodiment of the present application, by comparing the total number of hard disks that have been spun up with the total number of standard hard disks, it is possible to quickly determine whether all hard disks have completed the spin-up.
[0062] A possible implementation method of an embodiment of the present application also includes: in the process of powering on according to the power-on strategy, if the number of hard disks in the hard disk group that currently needs to be powered on is less than the preset number of hard disks, and it is not the last hard disk group, then the startup time interval is extended, the new hard disk group that currently needs to be powered on is determined, and an out-of-band start signal is sent to the new hard disk group that currently needs to be powered on.
[0063] Specifically, when the hard disk group starts to be powered on according to the power-on strategy, the number of hard disks in the hard disk group that currently needs to be powered on will be monitored in real time, and the number of hard disks in the current hard disk group will be compared with it. If it is found that the number of hard disks in the hard disk group that currently needs to be powered on is less than the preset number of hard disks, it will be further determined whether the hard disk group is the last hard disk group; if the hard disk group is not the last hard disk group, and the number of hard disks in the hard disk group that currently needs to be powered on is less than the preset number of hard disks, the operation of extending the startup time interval is executed. The specific extension range is no longer limited in the embodiment of this application, and the user can set it according to actual needs. After extending the startup time interval, the system will determine the next new hard disk group that needs to be powered on according to the order of the power-on strategy, and the number of hard disks in this hard disk group is less than or equal to the preset number of hard disks.
[0064] It can be seen that in the process of powering on according to the power-on strategy, if the number of hard disks in the hard disk group that currently needs to be powered on is less than the preset number of hard disks, and it is not the last hard disk group, by extending the startup time interval, the new hard disk group that currently needs to be powered on can be re-determined so that the hard disk can be powered on in time.
[0065] A possible implementation of the embodiment of the present application, when the storage controller is an expander, after all mounted hard disks have completed startup, further includes: sending information of all hard disks that have completed startup to the disk array card.
[0066] Specifically, mechanical hard drives are mounted under an expander, which connects to the disk array card via a wide port. In this implementation, the expander primarily controls staggered power-on. After the server is powered on, the expander firmware begins booting. The specific steps are as follows: Step 1: The expander firmware boots, identifies and loads the preset staggered power-on policy, which defines the number of hard drives to be powered on and the time interval. Step 2: The hard drive backplane is powered on, and the mechanical hard drives begin connecting to the expander. The expander begins receiving out-of-band handshake signals from the hard drives, performing device initialization and speed negotiation. During this phase, the expander does not send spin-up (device wake-up) signals to the mechanical hard drives. Step 3: Based on the staggered power-on policy identified in Step 1, when the upper limit for the number of hard drives to be powered on is reached, the expander begins sending spin-up signals (out-of-band wake-up signals) to the first batch of hard drives, initiating the spin-up process for those drives that have received the spin-up signals. Step 4: After the preset time interval expires, the expander again sends spin-up signals to the next batch of hard drives based on the staggered power-on policy, initiating the spin-up of these drives. This process repeats until all mechanical hard drives mounted in the expander have been spun up. Step 5: After all mechanical hard drives have finished spinning up and stabilized, the Expander begins uploading the mounted hard drive information to the connected disk array card. After receiving this information, the disk array card can discover and identify all hard drives and proceed with subsequent RAID configuration operations.
[0067] A possible implementation method of an embodiment of the present application also includes: during the power-on process according to the power-on strategy, if it is detected that the power peak of the hard disk group at startup is greater than the preset maximum power threshold, the preset number of hard disks is reduced, and the remaining hard disks are regrouped according to the adjusted number of hard disks.
[0068] Specifically, when the hard disk group is powered on according to the power-on strategy, the power monitoring module monitors the power situation of each hard disk group at startup in real time. The power monitoring module is usually composed of a hardware circuit and a corresponding software algorithm. The hardware circuit is responsible for collecting power signals, and the software algorithm processes and analyzes the collected signals to obtain the power peak. At the same time, the value of the preset maximum power threshold is read, which is less than the maximum peak value of the power supply; and the power peak value of the monitored hard disk group at startup is compared with it. If it is found that the startup power peak of a hard disk group is greater than the preset maximum power threshold, the system will execute the operation of reducing the number of preset hard disks. The reduction range of the preset number of hard disks can be set according to actual conditions and experience. For example, the preset number of hard disks can be reduced by 1 first, and then subsequent operations can be performed. After reducing the preset number of hard disks, the remaining hard disks will be regrouped to ensure that the power of each hard disk group at startup will not exceed the preset maximum power threshold again.
[0069] It can be seen that in the embodiment of the present application, by monitoring the power peak and timely adjusting the preset number of hard disks and regrouping, the power level, that is, the current level, when the hard disk group starts can be effectively controlled.
[0070] Based on any of the above embodiments, the present invention provides a method for implementing staggered power-on of a hard disk array in a server. By controlling the start-up of mechanical hard disks in a timely and quantitative manner under the control of a disk array card or expander, the method brings the following beneficial effects:
[0071] 1. Effectively disperse power-on current surges: By staggering the simultaneous spin-up of numerous hard drives, the current surge on the power supply and hard drive backplane caused by the server power-on moment is significantly reduced, avoiding the risk of server downtime, reboots, or hardware damage caused by excessive instantaneous current.
[0072] 2. Improved system stability and reliability: This solution addresses the issue in existing CPLD solutions where hard drives cannot be properly discovered by the disk array card due to staggered power-up. All hard drives can now be started in an orderly manner under the control of the disk array card, ensuring that they are available within the disk array card's scanning window. This prevents healthy hard drives from being mistakenly identified as faulty, improving the success rate of RAID array construction and data reliability.
[0073] 3. Better compatibility and controllability: This method integrates staggered power-on control into the disk array card or expander firmware, tightly integrating it with the hard drive discovery and management mechanism. Compared to standalone CPLD solutions, this approach offers better compatibility and control accuracy. The staggered power-on strategy can be flexibly adjusted to suit different hardware configurations and requirements.
[0074] 4. Applicable to different hard disk topologies: The present invention provides implementation schemes applicable to two common topologies: direct hard disk mounting to disk array cards and expansion mounting via Expander, which has good universality.
[0075] Figure 4 A structural schematic diagram of a hard disk power-on device in a server provided in an embodiment of the present invention includes: a reading module 210, used to read a power-on strategy, the power-on strategy including: a preset number of hard disks and a preset startup time interval; a handshake module 220, used to continuously receive out-of-band handshake signals from each hard disk after the server is powered on, the out-of-band handshake signals being used to control hard disk initialization and rate negotiation; a power-on module 230, used to send an out-of-band start-up signal to the hard disk group at intervals of the preset startup time interval based on the power-on strategy, so that each hard disk in the hard disk group can be started until all mounted hard disks have completed the startup, wherein the hard disk group is a hard disk group obtained by grouping the hard disks that have received the out-of-band handshake signals according to the preset number of hard disks based on the reception time of the out-of-band handshake signals of each hard disk.
[0076] A possible implementation of the embodiment of the present application further includes:
[0077] A power-on strategy determination module is used to obtain multiple power-on strategies to be tested, where the multiple power-on strategies to be tested have the same start-up time interval to be tested and different numbers of hard disks to be tested; test the multiple power-on strategies to be tested to obtain a first power peak value for each power-on strategy to be tested; determine a first power-on strategy to be tested from the multiple power-on strategies to be tested based on the first power peak value and the maximum power supply peak value; set multiple start-up time intervals to be tested based on the number of hard disks to be tested of the first power-on strategy to be tested to obtain multiple second power-on strategies to be tested; test the multiple second power-on strategies to be tested to obtain a second power peak value for each second power-on strategy to be tested; and determine a power-on strategy from the multiple second power-on strategies to be tested based on the second power peak value and the maximum power supply peak value.
[0078] A possible implementation method of an embodiment of the present application is that the power-on module 230 is specifically used to: send an out-of-band start signal to each batch of hard disk groups in turn at a preset start time interval; determine whether the total number of hard disks that have been started is the same as the total number of standard hard disks; if so, determine that all mounted hard disks have completed the start-up.
[0079] In a possible implementation of an embodiment of the present application, the power-on module 230 is also used to: during the power-on process according to the power-on strategy, if the number of hard disks in the hard disk group that currently needs to be powered on is less than the preset number of hard disks and is not the last hard disk group, then the startup time interval is extended, and an out-of-band start signal is determined and sent to the new hard disk group that currently needs to be powered on.
[0080] In a possible implementation of the embodiment of the present application, the storage controller is a disk array card or an expander.
[0081] In a possible implementation of the embodiment of the present application, when the storage controller is an expander, the embodiment further includes a sending module configured to send information of all hard disks that have completed startup to the disk array card.
[0082] In a possible implementation method of an embodiment of the present application, the power-on module 230 is also used to: during the power-on process according to the power-on strategy, if it is detected that the power peak of the hard disk group at the start-up is greater than the preset maximum power threshold, then the preset number of hard disks is reduced, and the remaining hard disks are regrouped according to the adjusted number of hard disks.
[0083] Figure 4 The description of the features in the corresponding embodiment can be found in Figure 1 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.
[0084] Figure 5 A structural diagram of a server provided in an embodiment of the present invention, such as Figure 5 As shown, the server includes: a storage controller; the storage controller includes: a memory 60 for storing computer programs;
[0085] The processor 61 is configured to implement the steps of the method in the above embodiment when executing a computer program.
[0086] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing content required to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor for handling computational operations related to machine learning.
[0087] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc.
[0088] In some embodiments, the server may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0089] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation to the server, and may include more or fewer components than shown in the figure.
[0090] It is understood that if the methods in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the current technology, 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 executes all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable ROM, a register, a hard drive, a removable disk, a CD-ROM, a magnetic disk, or an optical disk, and other media that can store program code.
[0091] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0092] Based on this, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0093] The above describes in detail the method, device, server, and medium for powering on a hard disk in a server provided by the embodiments of the present invention. The various embodiments are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between the various embodiments can be referenced for reference. The device disclosed in the embodiments corresponds to the method disclosed in the embodiments, so the description is relatively brief. For relevant details, refer to the method description.
[0094] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0095] The above describes in detail the method, device, server, and medium for powering on a hard disk in a server provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is intended only to facilitate understanding of the method and core concepts of the present invention. It should be noted that those skilled in the art may make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for powering on a hard disk in a server, characterized in that: Executed by a storage controller, the method includes: Reading a power-on strategy, wherein the power-on strategy includes: a preset number of hard disks and a preset startup time interval; After the server is powered on, it continuously receives out-of-band handshake signals from each hard disk, which are used to control hard disk initialization and speed negotiation; According to the power-on strategy, an out-of-band start signal is sent to the hard disk group at intervals of a preset start time interval so that each hard disk in the hard disk group can be started until all mounted hard disks have completed the startup. The hard disk group is a hard disk group obtained by grouping the hard disks that have received the out-of-band handshake signal according to the reception time of the out-of-band handshake signal of each hard disk according to a preset number of hard disks.
2. The method for powering on a hard disk in a server according to claim 1, wherein: The process of determining the power-on strategy includes: Acquire multiple power-on strategies to be tested, wherein the multiple power-on strategies to be tested have the same test start time interval and different numbers of hard disks to be tested; Testing multiple power-on strategies to be tested to obtain a first power peak value for each power-on strategy to be tested; Determining a first power-on strategy to be tested from a plurality of power-on strategies to be tested according to the first power peak value and the maximum power supply peak value; Setting a plurality of test start-up time intervals based on the number of hard disks to be tested in the first test power-on strategy to obtain a plurality of second test power-on strategies; Testing a plurality of second power-on strategies to be tested to obtain a second power peak value for each second power-on strategy to be tested; A power-on strategy is determined from a plurality of second power-on strategies to be tested according to the second power peak value and the maximum power supply peak value.
3. The method for powering on a hard disk in a server according to claim 1, wherein: According to the power-on strategy, at a preset startup time interval, an out-of-band startup signal is sent to the hard disk group so that each hard disk in the hard disk group is started up until all mounted hard disks are started up, including: At a preset startup time interval, sending an out-of-band startup signal to each batch of hard disk groups in sequence; Determine whether the total number of hard disks that have been started is the same as the total number of standard hard disks; If so, make sure all mounted hard disks have completed spinning up.
4. The method for powering on a hard disk in a server according to claim 1, wherein: Also includes: During the power-on process according to the power-on strategy, if the number of hard disks in the hard disk group currently requiring power-on is less than the preset number of hard disks and it is not the last hard disk group, the startup time interval is extended, and an out-of-band startup signal is determined and sent to the new hard disk group currently requiring power-on.
5. The method for powering on a hard disk in a server according to claim 1, wherein: The storage controller is a disk array card or an expander.
6. The method for powering on a hard disk in a server according to claim 5, characterized in that: When the storage controller is an expander, after all mounted hard disks have completed startup, the method further includes: Send information about all hard disks that have completed startup to the disk array card.
7. The method for powering on a hard disk in a server according to claim 1, wherein: Also includes: During the power-on process according to the power-on strategy, if it is detected that the power peak of the hard disk group at startup is greater than the preset maximum power threshold, the preset number of hard disks is reduced, and the remaining hard disks are regrouped according to the adjusted number of hard disks.
8. A hard disk power-on device in a server, characterized in that: include: A reading module is used to read a power-on strategy, wherein the power-on strategy includes: a preset number of hard disks and a preset startup time interval; A handshake module, configured to continuously receive out-of-band handshake signals from each hard disk after the server is powered on. The out-of-band handshake signals are used to control hard disk initialization and speed negotiation. A power-on module is used to send an out-of-band start signal to the hard disk group at a preset start time interval according to the power-on strategy, so that each hard disk in the hard disk group can be started until all mounted hard disks have completed the startup. The hard disk group is a hard disk group obtained by grouping the hard disks that have received the out-of-band handshake signal according to the reception time of the out-of-band handshake signal of each hard disk according to a preset number of hard disks.
9. A server, characterized in that: include: Storage controller; The storage controller includes: a memory for storing a computer program; A processor, configured to execute the computer program to implement the steps of the hard disk power-on method in a server as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the hard disk power-on method in the server according to any one of claims 1 to 7 are implemented.