Fan control method, electronic equipment and computer readable storage medium
By obtaining and adjusting the register parameter values of the fan to match the target speed, the problem of poor fan speed regulation is solved, achieving more accurate fan control and service life extension.
Patent Information
- Application Number
- CN202411057894.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, the speed regulation effect of fans is poor, resulting in a shortening of the service life of the fan. The control curve between the register value and the speed of fans produced by different manufacturers has different control curves, resulting in inconsistent speed regulation effect.
By obtaining the target gear and register parameter values of the target fan, obtaining the matching status of the current actual speed and the expected speed, adjusting the register parameter values to control the fan speed, and achieving more accurate speed regulation.
It improves the speed regulation effect of the fan, extends the service life of the fan, and solves the problem of inconsistent speed regulation curves between fans from different manufacturers.
Smart Images

Figure CN119062599A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computers, and specifically relates to a fan control method, an electronic device, and a computer-readable storage medium. Background Art
[0002] For outdoor equipment racks, since the equipment installed on the racks often works continuously, the operating temperature of the equipment is high, and the high operating temperature can easily cause the equipment to age prematurely or even overheat and be damaged. Therefore, the equipment on the racks is usually equipped with fans for cooling, but if the fan is kept at a high speed for a long time, the service life of the fan will be shortened.
[0003] In order to balance the above problems, adjustable speed fans are usually used to adaptively adjust the fan speed according to the temperature of the equipment, so as to control the equipment to work at an appropriate temperature while extending the fan life as much as possible. However, due to factors such as different fan manufacturers, different production batches, or fan operation and maintenance, it is usually impossible to ensure that the fan speed control curve is consistent. For example, fans of the same specifications produced by different manufacturers will also have different control curves (the relationship curve between the fan register value and the speed), and the fan board is a consumable part and usually needs to be replaced regularly.
[0004] The related technology usually adjusts the speed by adjusting the fan gear. However, after the fan board is replaced, the fan gear speed regulation usually cannot adapt to the replaced fan board, resulting in a poor fan speed regulation effect. Summary of the invention
[0005] The embodiments of the present application provide a fan control method, an electronic device, and a computer-readable storage medium, which can solve the problem of poor fan speed regulation effect in the related art.
[0006] In a first aspect, an embodiment of the present application provides a method for controlling a fan, comprising:
[0007] Get the target gear position of the target fan;
[0008] Acquire a register parameter value of the target fan at the target gear position and an expected rotation speed of the target fan at the target gear position, wherein the register parameter value is used to control the rotation speed of the target fan;
[0009] Obtaining a current actual rotation speed of the target fan when using the register parameter value;
[0010] When the current actual rotation speed does not match the expected rotation speed, the register parameter value of the target gear is adjusted to control the rotation speed of the target fan.
[0011] In a second aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0012] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed, the steps of the method described in the first aspect are implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect.
[0014] At least one of the above technical solutions provided in the embodiments of the present application can achieve the following technical effects:
[0015] In an embodiment of the present application, a target gear of a target fan is obtained; a register parameter value of the target fan in the target gear and an expected speed of the target fan in the target gear are obtained, and the register parameter value is used to control the speed of the target fan; the current actual speed of the target fan when the register parameter value is used is obtained; when the current actual speed does not match the expected speed, the register parameter value of the target gear is adjusted to control the speed of the target fan. In this way, when the target fan is in the target gear, the current actual speed of the target fan when the register parameter value corresponding to the target gear is used can be obtained. When the current actual speed does not match the expected speed corresponding to the target gear, the register parameter value corresponding to the target gear is adjusted to control the speed of the target fan. In this way, after the target fan is adjusted by the target gear, the target fan is further adjusted according to the matching of the current actual speed and the expected speed. Compared with the related art that only relies on the adjustment of the fan gear to adjust the fan speed, it has a better speed regulation effect and solves the problem of poor fan speed regulation effect in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 is a flow chart of a fan control method provided by an embodiment of the present application;
[0018] Figure 2 It is a general architecture diagram of an implementation environment of a fan control method provided in an embodiment of the present application;
[0019] Figure 3 It is a schematic diagram of a pulse width modulation (PWM) fan speed regulation method provided in an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of a control curve of a register parameter value and a fan speed provided in an embodiment of the present application;
[0021] Figure 5 is a flow chart of another fan control method provided by an embodiment of the present application;
[0022] Figure 6 It is a schematic diagram of a fan speed regulation concept provided by an embodiment of the present application;
[0023] Figure 7 is a specific flow chart of a fan control method provided by an embodiment of the present application;
[0024] Figure 8 It is a general concept diagram of a fan control method provided by an embodiment of the present application;
[0025] Fig. 9 is a structural block diagram of a fan control device provided in an embodiment of the present application;
[0026] Fig.10 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] The fan control method provided in the embodiment of the present application is applied to the fan speed adjustment scenario, and in particular, can be applied to the scenario of controlling the speed of the target fan by adjusting the register parameter value of the target fan. Specifically, when the target fan is in the target gear, the current actual speed of the target fan using the register parameter value corresponding to the target gear can be obtained, and when the current actual speed does not match the expected speed corresponding to the target gear, the register parameter value corresponding to the target gear is adjusted.
[0031] The fan control method provided in the embodiment of the present application can be executed by a target device, wherein the target device can be one electronic device or multiple electronic devices. In the case where the fan control method provided in the embodiment of the present application is executed by one electronic device, the electronic device can be a control board (i.e. Figure 2 The control panel of the fan control device may be a terminal device such as a desktop computer, a laptop computer, a mobile phone, a tablet, or a server, such as an independent physical server. When the fan control method provided in the embodiment of the present application is executed by multiple electronic devices, the multiple electronic devices may form a service cluster, which cooperate with each other to complete each step. The service cluster may be a server cluster composed of multiple servers.
[0032] The fan control method provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0033] See also Figure 1 , Figure 1 This is a flow chart of a fan control method provided in an embodiment of the present application.
[0034] like Figure 1 As shown, the method comprises the following steps:
[0035] Step 110: Obtain a target gear position of a target fan.
[0036] In the embodiment of the present application, the target fan may be one fan or multiple fans. The target fan may have multiple gears, and the target fan may correspond to different speeds when in different gears. For example, the lower the gear, the smaller the corresponding speed. The speed corresponding to gear 1 is 1000 rpm, and the speed corresponding to gear 2 is 2000 rpm. In theory, the more gears there are, the closer to stepless speed regulation, and the smoother the speed regulation of the target fan will be.
[0037] In the embodiment of the present application, when the target fan is used to dissipate heat for the target user, the target user can select the gear based on the correspondence between the gear and the speed. For example, if the target user requires a faster fan speed, a higher gear can be selected. Alternatively, when the target fan is used to dissipate heat for the device to be dissipated, the target gear can be obtained according to the operating temperature of the device to be dissipated to control the device to be dissipated to be at an appropriate operating temperature. Specifically, the following embodiments can be referred to.
[0038] In one embodiment of the present application, obtaining the target gear of the target fan includes: obtaining the current temperature of the device to be cooled; determining the target gear of the target fan based on the current temperature and the correspondence between the gear and the temperature, the temperature corresponding to the target gear being less than the current temperature; wherein the target fan is used to adjust the temperature of the device to be cooled.
[0039] In the embodiment of the present application, the device to be cooled is a device with a large cooling demand, such as a rack device (such as a telecommunications rack device) and a chassis device that works for a long time. Figure 2 , Figure 2 This is a general architecture diagram of the implementation environment of a fan control method provided in an embodiment of the present application. The target fan may include n fans (fan 1, fan 2, ..., fan n). The device to be cooled may include a control board, a circuit board, and a backplane. The target fan is used to cool the device to be cooled. The method provided in the embodiment of the present application can be executed by the control board. The control board may include a main board and a spare board. When the main board is not faulty, the method can be executed by the main board. When the main board is faulty, the method can be executed by the spare board. The circuit board may include m circuit boards, and the m circuit boards can be plugged into the spare board. However, it should be noted that Figure 2 This is only an example of the embodiment of the present application and does not limit the heat dissipation device.
[0040] In the embodiment of the present application, temperature sensors can be set on the devices to be cooled, that is, temperature sensors can be set on the control board main board, the control board standby board, the m circuit boards and the backplane. The control board may include a temperature monitoring module and a fan control module. The temperature monitoring module can be used to periodically obtain the temperature of the device to be cooled, and while obtaining the temperature of the device to be cooled, it can perform temperature alarms and over-temperature protection based on the temperature of the device to be cooled. For example, if the temperature of the device to be cooled exceeds a certain threshold, a temperature alarm can be performed. The fan control module can be used to control the speed of the target fan, manage the power on and off of the fan, the initialization of the fan, and the fan fault monitoring and alarm reporting.
[0041] In an embodiment of the present application, since the device to be cooled may include multiple board components (circuit boards, spare boards, etc.), the temperatures of the multiple board components may be acquired to obtain a temperature set. The temperature set may be processed based on a pre-set strategy to obtain the current temperature of the device to be cooled. For example, the highest temperature in the temperature set is determined as the current temperature of the device to be cooled, or the average temperature of the temperature set is determined as the current temperature of the device to be cooled. At the same time, the temperature monitoring module may transmit the current temperature to the fan control module.
[0042] After obtaining the current temperature, the target gear of the target fan can be determined based on the correspondence between the gear and the temperature. Specifically, each gear of the target fan can correspond to a temperature threshold. When the current temperature is higher than the temperature threshold corresponding to a certain gear, the gear can be switched to the gear. The higher the gear, the higher the priority of the switch. For example, the gear of the target fan includes 3 gears, the temperature threshold of gear 1 is 28°, the threshold of gear 2 is 30°, the threshold of gear 3 is 32°, and the current temperature is 31°. It can be determined that the target gear is gear 2.
[0043] In the embodiment of the present application, when the temperature monitoring module obtains the current temperature of the device to be cooled, if it is observed that the current temperature of the device to be cooled is in an abnormally high state, an additional gear adjustment request event may be sent to the fan control module. Specifically, the fan control module may periodically adjust the speed of the target fan. If the temperature monitoring module observes that the current temperature has reached the next gear of the current speed adjustment cycle, but the fan control module has not yet reached the next speed adjustment cycle, an additional gear adjustment request event may be sent to the fan control module, and the additional gear adjustment request event is used to instruct the target fan to enter the next speed adjustment cycle in advance.
[0044] In an embodiment of the present application, an implementation method for applying speed regulation of a target fan to a scenario where heat is dissipated from a device to be cooled. The target gear is determined by acquiring the current temperature of the device to be cooled, thereby achieving a better temperature control effect on the device to be cooled. The target gear can be switched in time according to the current temperature, thereby extending the service life of the target fan while controlling the operating temperature of the device to be cooled.
[0045] Step 120: Acquire a register parameter value of the target fan at the target gear position and an expected rotation speed of the target fan at the target gear position, wherein the register parameter value is used to control the rotation speed of the target fan.
[0046] In an embodiment of the present application, the target fan may include a PWM fan, which has the characteristics of precise speed control, good heat dissipation and low power consumption. The target gear may include multiple gears, each of which may correspond to a register parameter value and an expected speed, and the register parameter value may be used to control the target fan to switch to the target gear, and the expected speed is the lowest speed of the target fan when it is in the gear.
[0047] Take PWM fan as an example, please refer to Figure 3 and Figure 4 , Figure 3 is a schematic diagram of a PWM fan speed regulation method provided in an embodiment of the present application, Figure 4 It is a schematic diagram of a control curve of a register parameter value and a fan speed provided in an embodiment of the present application.
[0048] PWM speed regulation is also called duty cycle speed regulation. Figure 3 As shown in the figure, by changing the duration of the high level (T1), since the period (T) of the square wave remains unchanged, the duration of the low level (T2) can be indirectly changed, and the average voltage of the square wave can be changed, thereby adjusting the fan speed. Among them, the control process of the duty cycle is usually completed by setting the register in the control chip mounted on the CPU low-speed bus (IIC bus, SPI bus, etc.). In other words, by writing a single-byte register value (selected value 0x00~0xFF), 256-speed gear control can be achieved.
[0049] Due to factors such as different fan manufacturers, different production batches, or fan operation and maintenance, it is usually impossible to ensure that the fan's PWM register value and speed control curve are consistent. For example, fans from different batches of the same manufacturer, or fans of the same specification from different manufacturers, usually have different control curves, some of which are relatively flat, and some are relatively steep. When the control curve deviates seriously, it may cause the fan to oscillate at high and low speeds, fault alarms, or even complete failure of fan speed regulation.
[0050] like Figure 4 As shown, Figure 4 A and B in the figure are control curves for fans of the same specification but produced by different manufacturers. When the register parameter values of the two fans are both 0xaf, the speed of curve A can reach 2000 rpm, while curve B can only reach 1000 rpm.
[0051] Step 130: Obtain the current actual rotation speed of the target fan when the register parameter value is used.
[0052] In the embodiment of the present application, the register parameter value is written into the PWM controller of the target fan, and the current actual rotation speed of the target fan using the register parameter value can be obtained.
[0053] Step 140: When the current actual rotation speed does not match the expected rotation speed, adjust the register parameter value of the target gear to control the rotation speed of the target fan.
[0054] In the embodiment of the present application, the current actual speed may be greater than the expected speed, may be equal to the expected speed, or may be less than the expected speed. The mismatch between the current actual speed and the expected speed may include that the current actual speed is less than the expected speed, and may also include that the current actual speed is greater than the expected speed, and the speed difference between the current actual speed and the expected speed is greater than a certain threshold.
[0055] Among them, since the expected speed is the lowest speed of the target fan in the target gear, when the current actual speed is less than the expected speed, it can be considered that the current actual speed does not match the expected speed. At the same time, when the current actual speed is greater than the expected speed, the speed difference between the current actual speed and the expected speed can be determined first. If the speed difference is greater than a certain threshold, it can be considered that the current actual speed is too large and the current actual speed does not match the expected speed.
[0056] In the case where the current actual speed does not match the expected speed, the current actual speed of the target fan can be further adjusted by adjusting the register parameter value of the target gear so that the current actual speed matches the expected speed. Figure 4As shown, the control curve between the register parameter value and the rotation speed of the target fan is a monotonically increasing curve, that is, when the register parameter value increases, the rotation speed of the target fan also increases, and when the register parameter value decreases, the rotation speed of the target fan also decreases. Therefore, when the current actual rotation speed is less than the expected rotation speed, the register parameter value can be increased to increase the current actual rotation speed of the target fan, and when the current actual rotation speed is greater than the expected rotation speed and the difference between the current actual rotation speed and the expected rotation speed is greater than a certain threshold, the register parameter value can be decreased to decrease the current actual rotation speed of the target fan.
[0057] In one embodiment of the present application, when the current actual speed matches the expected speed, it is determined that the target gear is in a working state; when the current actual speed does not match the expected speed, it is determined that the target gear is in a speed regulation state; wherein the first period for speed matching when the target fan is in the speed regulation state is shorter than the second period for speed matching when the target fan is in the working state.
[0058] In an embodiment of the present application, the target gear being in the working state can be indicated, the register parameter value of the target fan being in the target gear has been adjusted, and the actual speed of the target fan when using the register parameter value matches the expected speed; the target gear being in the speed regulation state can be indicated, and the register parameter value of the target fan being in the target gear still needs to be adjusted.
[0059] When the target fan is in the target gear, if the target gear is in the speed regulation state, one adjustment may not be able to adjust the register parameter value corresponding to the target gear completely, and multiple adjustments are usually performed. Therefore, periodic speed matching can be used to observe whether the register parameter value corresponding to the target gear is adjusted. In addition, since the target fan has performance loss during use, even if the target gear is in the working state, the target fan can be periodically matched to check whether the target gear is still in the working state. If a speed mismatch is observed, the target gear can be switched from the working state to the speed regulation state.
[0060] Since the importance of speed regulation of the target gear is high, the priority of speed regulation of the target gear when the target gear is in the speed regulation state is higher than the priority of checking whether the target gear is still in the working state. Therefore, the first period (e.g., 5 seconds) for speed matching when the target gear is in the speed regulation state can be shorter than the second period (e.g., 3 minutes) for speed matching when the target gear is in the working state.
[0061] In the embodiment of the present application, the possibility that the target gear may switch from the working state to the speed regulation state is taken into consideration, so that the register parameter value of the target gear is more accurate, thereby making the speed regulation effect of the target fan better, and the speed matching period of the gear in the speed regulation state is shorter than the speed matching of the gear in the working state, thereby speeding up the speed regulation speed of the gear.
[0062] In an embodiment of the present application, a target gear of a target fan is obtained; a register parameter value of the target fan in the target gear and an expected speed of the target fan in the target gear are obtained, and the register parameter value is used to control the speed of the target fan; the current actual speed of the target fan when the register parameter value is used is obtained; when the current actual speed does not match the expected speed, the register parameter value of the target gear is adjusted to control the speed of the target fan. In this way, when the target fan is in the target gear, the current actual speed of the target fan when the register parameter value corresponding to the target gear is used can be obtained. When the current actual speed does not match the expected speed corresponding to the target gear, the register parameter value corresponding to the target gear is adjusted to control the speed of the target fan. In this way, after the target fan is adjusted by the target gear, the target fan is further adjusted according to the matching of the current actual speed and the expected speed. Compared with the related art that only relies on the adjustment of the fan gear to adjust the fan speed, it has a better speed regulation effect and solves the problem of poor fan speed regulation effect in the related art.
[0063] See also Figure 5 and Figure 6 , Figure 5 is a flow chart of another fan control method provided in an embodiment of the present application. Figure 6 FIG. 1 is a schematic diagram of a fan speed regulation concept provided by an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:
[0064] Step 510: Obtain a target gear position of a target fan.
[0065] Step 520: Acquire a register parameter value of the target fan at the target gear position and an expected rotation speed of the target fan at the target gear position, wherein the register parameter value is used to control the rotation speed of the target fan.
[0066] Step 530: Obtain the current actual rotation speed of the target fan when using the register parameter value.
[0067] Step 540: When the current actual rotational speed does not match the expected rotational speed, a rotational speed difference is obtained, where the rotational speed difference is the difference between the current actual rotational speed and the expected rotational speed.
[0068] In the embodiments of the present application, Figure 6 As shown, when the current actual speed matches the expected speed, it can be considered that the current register parameter value of the target gear has reached the standard, and the register parameter value corresponding to the target gear may not be adjusted. If the target gear is in the speed regulation state, the target gear can be switched from the speed regulation state to the working state, and the speed matching period is adjusted to the second period.
[0069] When the current actual speed does not match the expected speed, the speed difference between the current actual speed and the expected speed is obtained. For example, if the current actual speed is 3100 rpm and the expected speed is 3300 rpm, the speed difference can be determined to be 200 rpm.
[0070] Step 550: Obtain the register target upper limit value and the register target lower limit value.
[0071] In an embodiment of the present application, the register target upper limit value and the register target lower limit value are the value ranges of the register parameter value of the target gear. The register target upper limit value and the register target lower limit value can be directly determined according to the number of bytes written to the register parameter value. For example, if the register parameter value is a single-byte register value, i.e., 0x00 to 0xFF, 0x00 can be determined as the register target lower limit value, and 0xFF can be determined as the register target upper limit value. For the target gear, the register target upper limit value (register adjustment window upper limit value) and the register target lower limit value (register adjustment window lower limit value) constitute an adjustment window for adjusting the register parameter value, and the adjustment window is used to further determine the register parameter value of the target gear.
[0072] Alternatively, the register target upper limit value and register target lower limit value preset by engineers based on actual measured results during the fan product development stage can be obtained. Specifically, each gear can correspond to a gear table, which is used to manage information related to the gear, and can be referred to in Table 1 below. The register target upper limit value and register target lower limit value can be obtained by querying the gear table corresponding to the target gear.
[0073]
[0074] Table 1: Gear table
[0075] Step 560: Determine a register difference value based on the register target upper limit value and the register target lower limit value.
[0076] In an embodiment of the present application, the difference between the register target upper limit value and the register target lower limit value can be determined as the register difference value. For example, if the register target upper limit value is 0x4F and the register target lower limit value is 0x2F, then the register difference value can be determined to be 0x2F. Alternatively, when the rotation speed of the target fan is relatively small, the difference between the register parameter value and the register target upper limit value can be determined as the register difference value. When the rotation speed of the target fan is relatively large, the difference between the register parameter value and the register target lower limit value can be determined as the register difference value. For example, if the register target upper limit value is 0x4F, the register target lower limit value is the register parameter value of 0x2F, and the register parameter value is 0x3F, and the rotation speed of the current target fan is relatively small, the register difference value can be determined to be 0x1F (the difference between 0x4F and 0x3F).
[0077] Step 570: Based on the register difference and the rotation speed difference, adjust the register parameter value to control the rotation speed of the target fan.
[0078] In the embodiment of the present application, the adjustment step for adjusting the register parameter value can be determined according to the speed difference, and whether the adjustment step can be used can be determined based on the register difference. Specifically, the corresponding relationship between the speed difference and the adjustment step can be preset. For example, if the speed difference is less than 300 rpm, the adjustment step can be determined to be 10; if the speed difference is between (300, 600], the adjustment step can be determined to be 20.
[0079] Then, it is determined whether the adjustment step is smaller than the register difference. If the adjustment step is smaller than the register difference, the register parameter value is adjusted based on the adjustment step. If the adjustment step is larger than the register difference, the adjustment step is reduced. For example, if the adjustment step is 20 and the register difference is 30, the register parameter value can be adjusted (increased or decreased) based on the adjustment step.
[0080] Specifically, two situations of increasing the register parameter value and decreasing the register parameter value are described in detail below.
[0081] Scenario 1. In one embodiment of the present application, the mismatch between the current actual speed and the expected speed includes that the current actual speed is less than the expected speed; obtaining the register target upper limit value and the register target lower limit value includes: obtaining the current upper limit value and the current lower limit value of the register when the target fan is in the target gear; when the difference between the current upper limit value and the current lower limit value of the register is greater than a first threshold, determining the register parameter value as the register target lower limit value; when the register parameter value is greater than the current upper limit value of the register, resetting the register upper limit value.
[0082] When the current actual speed is less than the expected speed, Figure 6 In the case of low speed, such as Figure 6 As shown, you can first determine whether the current register parameter value is less than 0xFF (the theoretical maximum value of the register parameter value). If the current register parameter value is not less than 0xFF, since the current register parameter value has been adjusted to the theoretical maximum value, but the target fan still cannot reach the expected speed, it can be determined that the target fan has failed or aged (fan board failure 1). At this time, the target fan failure can be reported as an alarm without further adjustment of the register parameter value. If the current register parameter value is less than 0xFF, the value range of the register parameter value can be adjusted positively. The positive adjustment method can refer to the following method.
[0083] If the target gear is in the working state before adjusting the register parameter value this time, the target gear can be switched from the working state to the speed regulation state, and the speed matching period is adjusted to the first period.
[0084] In an embodiment of the present application, the current upper limit value of the register and the current lower limit value of the register can be obtained by querying the above Table 1. The first threshold is used to determine whether the current actual speed is too small compared to the expected speed, and can be set based on historical experience. For example, it can be set with reference to the following Table 2.
[0085]
[0086] Table 2 Global control parameters
[0087] In the case where the speed difference is greater than the first threshold, it can be considered that the current actual speed is too small. Moreover, for the target gear, the current register parameter value is too small, and it can be considered that the adjusted register parameter value cannot be less than the current register parameter value. Based on this, the current register parameter value can be determined as the register target lower limit value to increase the lower limit of the register parameter value range and shorten the register parameter value range. For example, the current register parameter value is 0x8F, the current register lower limit value is 0x7F, the current register upper limit value is 0x9F, and it is determined that the speed difference is greater than the first threshold, it can be determined that the register target lower limit value is 0x8F, that is, the lower limit of the register parameter value range is increased (adjusted from 0x7F to 0x8F).
[0088] In addition, since there may be an event of fan replacement during the speed regulation process, and the event is not detected (the gear table is not changed), the value range of the register parameter value determined based on the fan before replacement (the current lower limit value of the register and the current upper limit value of the register) is no longer applicable to the fan after replacement, and the current register parameter value may be greater than the current upper limit value of the register. For example, the speed of the fan after replacement is lower than the speed before replacement. At this time, if the current register parameter value is increased, even if the current register parameter value is increased to be greater than the current upper limit value of the register, the current actual speed may still be less than the expected speed. At this time, the current upper limit value of the register can be reset, and the value range of the register parameter value can be readjusted. Specifically, the upper limit value of the register is adjusted to 0xFF, the theoretical maximum value of the register parameter value.
[0089] To adjust the register parameter value, refer to the following method:
[0090] Exemplarily, in one embodiment of the present application, the mismatch between the current actual speed and the expected speed includes that the current actual speed is less than the expected speed; the adjusting of the register parameter value based on the register difference and the speed difference includes: determining an adjustment step based on the speed difference; and increasing the register parameter value with the adjustment step as the amplitude unit when the adjustment step is less than the register difference.
[0091] In the embodiment of the present application, after obtaining the speed difference, the adjustment step size can be calculated based on the function:
[0092] step = function (speed-gap);
[0093] Among them, step is the adjustment step size, speed-gap is the speed difference, and function is a monotonically increasing function, that is, the larger the speed-gap, the larger the step.
[0094] It should be noted that the specific formula of the function is not restricted here. For example, the formula for determining the adjustment step size can be: Wherein, λ is a preset coefficient, and max-speed is the maximum speed of the fan (such as the maximum speed in Table 2).
[0095] Exemplarily, in one embodiment of the present application, in order to avoid the adjustment step being too large (even exceeding the register parameter value range), the difference between the register parameter value and the register target upper limit value can be determined as the register difference; the historical speed of the register target upper limit value and the historical speed of the register target lower limit value are obtained, and the difference between the historical speed of the register target upper limit value and the historical speed of the register target lower limit value is determined as the first speed difference. Based on the speed difference, the register difference and the first speed difference, the adjustment step is determined by the following formula; when the adjustment step is less than the register difference, the register parameter value is increased by the adjustment step as the amplitude unit.
[0096]
[0097] Among them, pwm-gap is the register difference, λ is the preset coefficient, max-speed1 is the first speed difference of the fan, step is the adjustment step, and speed-gap is the speed difference.
[0098] After determining the adjustment step, it can be determined whether the adjustment step needs to be adjusted again. Specifically, it can be determined whether the adjustment step is less than the register difference. At the same time, in order to ensure that the register parameter value is adjusted this time, it can be determined whether the adjustment step is greater than or equal to 1. In other words, it is determined whether the adjustment step falls within the interval [1, register difference). If the condition is met, the register parameter value is increased by the adjustment step as the amplitude unit. That is, the adjusted register parameter value is determined by the following formula:
[0099] pwm-rval1=pwm-rval+step;
[0100] Among them, pwm-rval1 is the adjusted register parameter value, pwm-rval is the current register parameter value, and step is the adjustment step size.
[0101] By using the above formula, the register parameter value can be adjusted to a larger value, and the target fan speed will be faster. In addition, it should be noted that after adjusting the register interval and the register parameter value, the corresponding information in the gear table can be updated for the next speed adjustment cycle.
[0102] Scenario 2. In one embodiment of the present application, the mismatch between the current actual speed and the expected speed includes that the current actual speed is greater than the expected speed, and the speed difference is greater than a second threshold value; obtaining the register target upper limit value and the register target lower limit value includes: obtaining the current upper limit value and the current lower limit value of the register when the target fan is in the target gear; when the speed difference is greater than the first threshold value, determining the register parameter value as the register target upper limit value; when the register parameter value is less than the current lower limit value of the register, resetting the register lower limit value.
[0103] When the current actual speed is greater than the expected speed and the speed difference is greater than the second threshold, Figure 6 In the case of high speed, such as Figure 6 As shown, we can first determine whether the current register parameter value is greater than 0x00, that is, the theoretical minimum value of the register parameter value. If the current register parameter value is not greater than 0x00, the current register parameter value has been adjusted to a very small value, but the target fan is still running at high speed, so we can determine the control system of the target fan (i.e. Figure 2 If the target fan board (control board) or target fan board fails, the fault (fan board fault 2) can be reported to the operation and maintenance. Since the heat dissipation function of the target fan is still good in this case, the only problem is that the target fan is prematurely aged due to long-term high-speed operation, and no emergency intervention is required. If the current register parameter value is greater than 0x00, the value range of the register parameter value can be negatively adjusted. The negative adjustment method can refer to the following method.
[0104] In an embodiment of the present application, if the current actual speed is greater than the expected speed, it can be considered that the current actual speed meets the standard. However, when the speed difference is greater than the second threshold, considering the life of the target fan, the current register parameter value can be reduced to reduce the speed of the target fan and extend the life of the target fan. The second threshold is used to indicate whether the register parameter value of the target fan in the target gear needs to be adjusted. When the speed difference is greater than the second threshold, it can be determined whether the speed difference is greater than the first threshold. The first threshold is used to indicate whether the register upper limit value and the register lower limit value of the target gear need to be adjusted. There is no necessary size relationship between the first threshold and the second threshold.
[0105] In the case where the speed difference is greater than the first threshold, the first threshold may be greater than the second threshold, and it can be considered that the current actual speed is too large. Moreover, for the target gear, the current register parameter value is too large, and it can be considered that the adjusted register parameter value cannot be greater than the current register parameter value. Based on this, the current register parameter value can be determined as the register target upper limit value to lower the upper limit of the register parameter value range and shorten the register parameter value range. For example, the current register parameter value is 0x8F, the current lower limit value of the register is 0x7F, the current upper limit value of the register is 0x9F, and it is determined that the speed difference is greater than the first threshold, it can be determined that the register target upper limit value is 0x8F, that is, the upper limit of the register parameter value range is reduced (adjusted from 0x9F to 0x8F).
[0106] In addition, since there may be an event of fan replacement during the speed regulation process, and the event is not detected (the gear table is not changed), the value range of the register parameter value determined based on the fan before replacement (the current lower limit value of the register and the current upper limit value of the register) is no longer applicable to the fan after replacement, and the current register parameter value may be less than the current lower limit value of the register. For example, the speed of the fan after replacement is greater than the speed before replacement. At this time, if the current register parameter value is reduced, even if the current register parameter value is reduced to less than the current lower limit value of the register, the current actual speed may still be greater than the expected speed. At this time, the current lower limit value of the register can be reset, and the value range of the register parameter value can be readjusted. Specifically, the lower limit value of the register is adjusted to 0x00, the theoretical minimum value of the register parameter value.
[0107] To adjust the register parameter value, refer to the following method:
[0108] Exemplarily, in one embodiment of the present application, the mismatch between the current actual speed and the expected speed includes that the current actual speed is greater than the expected speed, and the speed difference is greater than a second threshold; adjusting the register parameter value based on the register difference and the speed difference includes: determining an adjustment step based on the speed difference; and reducing the register parameter value by the adjustment step as an amplitude unit when the adjustment step is smaller than the register difference.
[0109] In the embodiment of the present application, the register difference may be the difference between the register parameter value and the register target lower limit value; the historical speed of the register target upper limit value and the historical speed of the register target lower limit value are obtained, and the difference between the historical speed of the register target upper limit value and the historical speed of the register target lower limit value may be determined as the second speed difference. Based on the speed difference, the register difference and the second speed difference, the adjustment step is determined by the following formula; when the adjustment step is less than the register difference, the register parameter value is reduced by the adjustment step as the amplitude unit.
[0110]
[0111] Among them, pwm-gap is the register difference, λ is the preset coefficient, max-speed2 is the second speed difference of the target fan, step is the adjustment step, and speed-gap is the speed difference.
[0112] In order to avoid the adjustment step being too large (even greater than the length of the register parameter value interval), after determining the adjustment step, it can be determined whether the adjustment step needs to be adjusted again. Specifically, it can be determined whether the adjustment step is less than the register difference. At the same time, in order to ensure that the register parameter value is adjusted this time, it can be determined whether the adjustment step is greater than or equal to 1. In other words, it is determined whether the adjustment step falls within the interval [1, register difference). If the condition is met, the register parameter value is reduced by the adjustment step as the amplitude unit. That is, the adjusted register parameter value is determined by the following formula:
[0113] pwm_rval1=pwm_rval_step;
[0114] Among them, pwm-rval1 is the adjusted register parameter value, pwm-rval is the current register parameter value, and step is the adjustment step size.
[0115] By using the above formula, the register parameter value can be adjusted to a smaller value, and the speed of the target fan will be slower. In addition, it should be noted that after adjusting the register interval and the register parameter value, the corresponding information in the gear table can be updated for the next speed adjustment cycle.
[0116] In an embodiment of the present application, the register parameter value can be adaptively adjusted according to the speed difference between the current actual speed and the expected speed, and the register difference between the register target upper limit value and the register target lower limit value, so that the current actual speed is close to the expected speed.
[0117] See also Figure 7 and Figure 8 , Figure 7is a specific flow chart of a fan control method provided in an embodiment of the present application. Figure 8 FIG. 1 is a general concept diagram of a fan control method provided in an embodiment of the present application. Figure 7 As shown, the method comprises the following steps:
[0118] Step 710: Obtain the current temperature of the device to be cooled.
[0119] Step 720: Determine a target gear position of a target fan based on the current temperature and the correspondence between the gear position and the temperature, wherein the temperature corresponding to the target gear position is lower than the current temperature.
[0120] like Figure 8 As shown, after the control board is powered on, the initialization gear table can be imported through a file (such as a file stored in flash). In the initialization gear table, the state of the highest gear (0xFF) is the working state, and all other gears are defaulted to the speed regulation state. When starting the speed regulation, the default speed regulation cycle is the first cycle (5 seconds). After determining the target gear, the gear table of the target gear can be obtained. During the speed regulation process, the target fan can be inspected in place. When the target fan is in place, the target fan is inspected for speed regulation, and the current speed of the target fan in the target gear is obtained. Based on the current speed, the target fan is alarmed and faults are reported, and an adaptive algorithm is performed to adjust the speed of the target fan. After each speed regulation cycle, the gear of the next speed regulation cycle can be determined by the latest temperature obtained by the temperature monitoring module, and the next speed regulation cycle can be started based on the speed regulation cycle length of the gear.
[0121] Step 730: Acquire a register parameter value of the target fan at the target gear position and an expected rotation speed of the target fan at the target gear position, wherein the register parameter value is used to control the rotation speed of the target fan.
[0122] Step 740: Obtain the current actual rotation speed of the target fan when using the register parameter value.
[0123] Step 750: When the current actual rotational speed does not match the expected rotational speed, a rotational speed difference is obtained, where the rotational speed difference is the difference between the current actual rotational speed and the expected rotational speed.
[0124] Step 760: Obtain the register target upper limit value and the register target lower limit value.
[0125] Step 770: Determine a register difference value based on the register target upper limit value and the register target lower limit value.
[0126] Step 780: Based on the register difference and the rotation speed difference, adjust the register parameter value to control the rotation speed of the target fan.
[0127] In an embodiment of the present application, the mismatch between the current actual speed and the expected speed includes that the current actual speed is less than the expected speed (the first case), and also includes that the current actual speed is greater than the expected speed and the speed difference is greater than a second threshold value (the second case).
[0128] For the first case, the register target upper limit value and the register target lower limit value can be obtained in the following manner: obtain the current upper limit value and the current lower limit value of the register when the target fan is in the target gear; when the speed difference is greater than the first threshold, determine the register parameter value as the register target lower limit value; when the register parameter value is greater than the current upper limit value of the register, reset the register upper limit value.
[0129] The register parameter value is adjusted in the following manner: based on the rotation speed difference, an adjustment step is determined; when the adjustment step is smaller than the register difference, the register parameter value is increased with the adjustment step as an amplitude unit.
[0130] For the second case, the register target upper limit value and the register target lower limit value can be obtained in the following manner: obtain the current upper limit value and the current lower limit value of the register when the target fan is in the target gear; when the speed difference is greater than the first threshold, determine the register parameter value as the register target lower limit value; when the register parameter value is greater than the current upper limit value of the register, reset the register upper limit value.
[0131] The register parameter value is adjusted in the following manner: based on the rotation speed difference, an adjustment step is determined; when the adjustment step is smaller than the register difference, the register parameter value is reduced with the adjustment step as the amplitude unit.
[0132] In an embodiment of the present application, a target gear of a target fan is obtained; a register parameter value of the target fan in the target gear and an expected speed of the target fan in the target gear are obtained, and the register parameter value is used to control the speed of the target fan; the current actual speed of the target fan when the register parameter value is used is obtained; when the current actual speed does not match the expected speed, the register parameter value of the target gear is adjusted to control the speed of the target fan. In this way, when the target fan is in the target gear, the current actual speed of the target fan when the register parameter value corresponding to the target gear is used can be obtained. When the current actual speed does not match the expected speed corresponding to the target gear, the register parameter value corresponding to the target gear is adjusted to control the speed of the target fan. In this way, after the target fan is adjusted by the target gear, the target fan is further adjusted according to the matching of the current actual speed and the expected speed. Compared with the related art that only relies on the adjustment of the fan gear to adjust the fan speed, it has a better speed regulation effect and solves the problem of poor fan speed regulation effect in the related art.
[0133] It is important to understand that Figures 1 to 7 The explanations of the same or corresponding steps in the above may refer to each other. For example, Figure 1 The explanation of step 110 and step 120 in Figure 5 Step 510 and step 520 in .
[0134] At the same time, it should be understood that the fan control method provided in the embodiment of the present application can have the following beneficial effects: First, the present application provides an adaptive algorithm for adjusting the value range of the register parameter value, which can continuously detect the actual capacity of the current target fan for adaptive adjustment by checking the speed adjustment result of the previous round before each round of speed adjustment. Second, the PWM fan used in the present application can control the speed more accurately, and can provide better heat dissipation and lower energy consumption.
[0135] See also Fig. 9 , Fig. 9 is a structural block diagram of a fan control device provided in an embodiment of the present application. Fig. 9 As shown, an embodiment of the present application provides a fan control device 900 , and the fan control device 900 includes: an acquisition module 910 and a control module 920 .
[0136] The acquisition module 910 is used to acquire a target gear of a target fan; acquire a register parameter value of the target fan at the target gear and an expected speed of the target fan at the target gear, wherein the register parameter value is used to control the speed of the target fan; and acquire a current actual speed of the target fan when the register parameter value is used.
[0137] The control module 920 is used to adjust the register parameter value of the target gear to control the speed of the target fan when the current actual speed does not match the expected speed.
[0138] In an embodiment of the present application, a target gear of a target fan is obtained; a register parameter value of the target fan in the target gear and an expected speed of the target fan in the target gear are obtained, and the register parameter value is used to control the speed of the target fan; the current actual speed of the target fan when the register parameter value is used is obtained; when the current actual speed does not match the expected speed, the register parameter value of the target gear is adjusted to control the speed of the target fan. In this way, when the target fan is in the target gear, the current actual speed of the target fan when the register parameter value corresponding to the target gear is used can be obtained. When the current actual speed does not match the expected speed corresponding to the target gear, the register parameter value corresponding to the target gear is adjusted to control the speed of the target fan. In this way, after the target fan is adjusted by the target gear, the target fan is further adjusted according to the matching of the current actual speed and the expected speed. Compared with the related art that only relies on the adjustment of the fan gear to adjust the fan speed, it has a better speed regulation effect and solves the problem of poor fan speed regulation effect in the related art.
[0139] The fan control device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.
[0140] like Fig.10As shown, an embodiment of the present application also provides an electronic device 1000. The electronic device 1000 includes: a processor 1010 and a memory 1020, and the memory 1020 stores a program or instruction, and when the program or instruction is executed by the processor 1010, the steps of any of the methods described above are implemented. For example, when the program is executed by the processor 1010, the following process is implemented: obtaining a target gear of a target fan; obtaining a register parameter value of the target fan at the target gear and an expected speed of the target fan at the target gear, and the register parameter value is used to control the speed of the target fan; obtaining the current actual speed of the target fan when the register parameter value is used; and when the current actual speed does not match the expected speed, adjusting the register parameter value of the target gear to control the speed of the target fan. In this way, when the target fan is in the target gear, the current actual speed of the target fan using the register parameter value corresponding to the target gear can be obtained, so that when the current actual speed does not match the expected speed corresponding to the target gear, the register parameter value corresponding to the target gear can be adjusted to control the speed of the target fan. In this way, after the target fan is adjusted by the target gear, the speed of the target fan is further adjusted according to the matching situation between the current actual speed and the expected speed. Compared with the related technology that only relies on the adjustment of the fan gear to adjust the fan speed, it has a better speed regulation effect and solves the problem of poor fan speed regulation effect in the related technology.
[0141] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of each embodiment of the fan control method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0142] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0143] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0144] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0145] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0147] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for controlling a fan, characterized in that: include: Get the target gear position of the target fan; Acquire a register parameter value of the target fan at the target gear position and an expected rotation speed of the target fan at the target gear position, wherein the register parameter value is used to control the rotation speed of the target fan; Obtaining a current actual rotation speed of the target fan when using the register parameter value; When the current actual rotation speed does not match the expected rotation speed, the register parameter value of the target gear is adjusted to control the rotation speed of the target fan.
2. The method according to claim 1, characterized in that The step of obtaining a target gear position of a target fan includes: Get the current temperature of the device to be cooled; Based on the current temperature and the corresponding relationship between the gear and the temperature, determining a target gear of the target fan, wherein the temperature corresponding to the target gear is lower than the current temperature; The target fan is used to adjust the temperature of the device to be cooled.
3. The method according to claim 1, characterized in that: The adjusting the register parameter value comprises: Acquire a speed difference value, where the speed difference value is a difference between the current actual speed and the expected speed; Get the register target upper limit value and the register target lower limit value; determining a register difference value based on the register target upper limit value and the register target lower limit value; The register parameter value is adjusted based on the register difference and the rotation speed difference.
4. The method according to claim 3, characterized in that The current actual speed does not match the expected speed, including that the current actual speed is less than the expected speed; and adjusting the register parameter value based on the register difference and the speed difference, including: Based on the speed difference, determining an adjustment step size; When the adjustment step is smaller than the register difference, the register parameter value is increased with the adjustment step as an amplitude unit.
5. The method according to claim 3, characterized in that: The current actual speed does not match the expected speed, including that the current actual speed is less than the expected speed; and obtaining the register target upper limit value and the register target lower limit value includes: Obtaining a current upper limit value and a current lower limit value of a register of the target fan at the target gear position; In the case where the difference between the rotation speed differences is greater than a first threshold, determining the register parameter value as a register target lower limit value; When the register parameter value is greater than the current upper limit value of the register, the register upper limit value is reset.
6. The method according to claim 3, characterized in that The current actual speed does not match the expected speed, including that the current actual speed is greater than the expected speed, and the speed difference is greater than a second threshold; The obtaining of the register target upper limit value and the register target lower limit value includes: Obtaining a current upper limit value and a current lower limit value of a register of the target fan at the target gear position; When the rotation speed difference is greater than a first threshold, determining the register parameter value as a register target upper limit value; When the register parameter value is less than the current lower limit value of the register, the register lower limit value is reset.
7. The method according to claim 3, characterized in that The current actual speed does not match the expected speed, including that the current actual speed is greater than the expected speed, and the speed difference is greater than a second threshold; The adjusting the register parameter value based on the register difference and the rotation speed difference includes: Based on the speed difference, determining an adjustment step size; When the adjustment step is smaller than the register difference, the register parameter value is reduced with the adjustment step as the amplitude unit.
8. The method according to claim 1, characterized in that The method further comprises: When the current actual speed matches the expected speed, determining that the target gear is in a working state; In the case where the current actual speed does not match the expected speed, determining that the target gear is in a speed regulation state; Wherein, a first period for performing rotational speed matching when the target fan is in a speed regulating state is shorter than a second period for performing rotational speed matching when the target fan is in a working state.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: The medium stores a program or an instruction, and when the program or the instruction is executed, the steps of the method according to any one of claims 1 to 8 are implemented.
