Server fan control method and device, computer device and readable storage medium
By calculating short- and long-term moving averages of server components in real time, and combining temperature data to generate trends and algorithm adjustments, the server fan control algorithm is simplified, solving the problems of high complexity and poor stability in existing technologies, and achieving fast response and stable adjustment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGCHANG INFORMATION TECH (HANGZHOU) CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-06-05
AI Technical Summary
Existing server fan control algorithms are complex in structure and difficult to implement in software, resulting in poor timeliness and stability, as well as inconvenience in engineering deployment and maintenance.
By calculating the short- and long-term moving averages of the target component in real time and combining them with temperature data, trend adjustment and algorithm adjustment are generated, enabling rapid coordination between feedforward and feedback control, simplifying control logic, and reducing algorithm complexity.
Significantly improves the response speed and operational stability of fan regulation, reduces the difficulty of engineering deployment and maintenance, ensures rapid response to sudden temperature rises and reduces temperature overshoot.
Smart Images

Figure CN122152089A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server heat dissipation technology, and in particular to a server fan control method, device, computer equipment, and readable storage medium. Background Technology
[0002] Server heat dissipation performance is one of the key technical aspects affecting the stable operation and reliability of server products, and its core lies in the precise control of cooling fan speed. Typically, server systems use temperature sensors to monitor the temperature of heat-generating components such as the CPU (Central Processing Unit) in real time, transmitting this temperature information to the BMC (Baseboard Management Controller). The BMC calculates the fan speed adjustment based on preset speed control algorithms such as PID (Proportional-Integral-Derivative) algorithms, and then adjusts the fan speed through PWM (Pulse Width Modulation) signals. When the component temperature exceeds the set control point, the PID algorithm outputs a positive speed increment, driving the fan to accelerate to enhance heat dissipation until the temperature drops below the control point. However, traditional PID control suffers from lag and temperature overshoot issues when responding to rapid temperature rises. To overcome this problem, various improved schemes have emerged that incorporate power consumption data for feedforward adjustment.
[0003] In related technologies, improved solutions typically involve real-time collection of power consumption data from heat-generating components, combined with temperature information, to predict or determine temperature change trends, and then intervene in advance to adjust fan speed. For example, some solutions dynamically adjust the fan speed by calculating the correlation coefficient between power consumption and temperature; others predict temperature changes based on current power consumption, heat dissipation, and target power consumption, and then adjust the speed accordingly; still others look up a preset speed control parameter table based on real-time power consumption and calculate the target speed using a linear formula.
[0004] However, the applicant recognizes that the relevant technology has at least the following technical problems in its implementation: The improved solution relies on a relatively complex feature extraction, parameter prediction, or table lookup calculation process. The control algorithm structure is complex and the software implementation is difficult. It is not convenient in engineering deployment and maintenance. Furthermore, the server fan adjustment logic needs to rely on multi-parameter coordination and heavy computational processing, resulting in poor timeliness and stability. Summary of the Invention
[0005] In view of this, this application provides a server fan control method, device, computer equipment, and readable storage medium. The main purpose is to solve the problems that the current control algorithm has a complex structure, is difficult to implement in software, is not convenient in engineering deployment and maintenance, and causes the server fan adjustment logic to rely on multi-parameter coordination and heavy computational processing, resulting in poor timeliness and stability.
[0006] According to a first aspect of this application, a server fan control method is provided, the method comprising: The first moving average is calculated in real time based on the power consumption data of the target component in the server in the past first historical time period, and the second moving average is calculated in real time based on the power consumption data of the target component in the past second historical time period. The second period of the second historical time period is less than the first period of the first historical time period, and the difference between the first period and the second period meets the preset standard. The trend adjustment amount is determined based on the relative changing trend between the first moving average and the second moving average; The temperature data of the target component is collected in real time, and the temperature data is calculated using a preset temperature control algorithm to obtain the algorithm adjustment amount; Based on the trend adjustment amount and the algorithm adjustment amount, a fan drive signal is generated and sent to the server to control the fan speed of the server.
[0007] Beneficial effects: By calculating the short-period and long-period moving averages of the power consumption of the target component in real time, and generating trend adjustment amounts based on their relative change trends, complex calculations are replaced by simple moving average analysis. This allows for the direct capture of dynamic power consumption trends. Simultaneously, the algorithmic adjustment amount based on temperature data is combined to control the fan speed, achieving rapid coordination between feedforward regulation and feedback control. This effectively reduces hysteresis and temperature overshoot when responding to sudden temperature rises. Furthermore, the entire control logic does not require multi-parameter coordination or recalculation, significantly reducing algorithm complexity and implementation difficulty, improving the response speed and operational stability of fan regulation, and making engineering deployment and maintenance more convenient and reliable.
[0008] Optionally, a moving average is calculated based on the power consumption data of the target component over historical time periods, including: The power consumption data of the target component is collected in real time and a real-time power consumption data sequence is generated. The real-time power consumption data sequence includes the power consumption data collected at each sampling time and the power consumption data collected at each sampling time is arranged in chronological order. Define a time window with the same period length as the historical time period targeted by the current calculation, wherein the historical time period targeted by the current calculation is the first historical time period or the second historical time period; The time window is mapped onto the real-time power consumption data sequence, and the time window is continuously slid across the real-time power consumption data sequence as time progresses. During the sliding of the time window, the average value of all power consumption data currently covered by the time window on the real-time power consumption data sequence is calculated in real time at each moment until the duration of all calculated moments reaches the duration of the historical time period targeted by the current calculation, and multiple average values are obtained. The multiple average values are sorted in chronological order to form an average value curve, which is then used as the moving average line.
[0009] Beneficial effects: By defining a time window and calculating the average value by sliding it over a real-time power consumption data sequence, effective smoothing and trend feature extraction of power consumption data can be achieved with lower computational overhead. This replaces complex feature coefficient calculations or prediction models. The original data is transformed into a moving average line that clearly reflects the long-term benchmark and short-term fluctuations through a simple sliding average operation. This not only significantly reduces the algorithm complexity and real-time processing burden, but also ensures the continuity and stability of trend signal generation, laying a solid foundation for subsequent fast and reliable fan feedforward control.
[0010] Optionally, determining the trend adjustment amount based on the relative changing trend between the first moving average and the second moving average includes: The first moving average line is compared with the second moving average line to determine the relative change trend, wherein the relative change trend indicates a short-term increase in power consumption, no trend change, or a short-term decrease in power consumption. When the relative change trend indicates a short-term increase in power consumption, a trend adjustment amount is generated to indicate that the current speed control amount of the fan is increased by a specified value; When the relative change trend indicates that no trend change has occurred, a trend adjustment amount with a value of 0 is generated; When the relative change trend indicates a short-term decrease in power consumption, the trend adjustment amount is generated to indicate that the current speed control amount of the fan is reduced by a specified value.
[0011] Beneficial effects: By directly comparing the crossover events of long and short period moving averages to determine the trend, only a simple comparison of numerical values is needed to generate a clear fixed adjustment amount. This simple and definite logic replaces complex trend prediction or parameter lookup calculations, significantly reducing the complexity and computational overhead of control decisions. At the same time, it ensures the real-time performance and high reliability of the trend feedforward signal, providing a clear and robust triggering basis for the rapid and smooth adjustment of fan speed.
[0012] Optionally, comparing the first moving average with the second moving average to determine the relative trend includes: Place the first moving average and the second moving average in the same coordinate system, and identify whether there is an intersection point between the first moving average and the second moving average; If it is determined that there is an intersection point between the first moving average line and the second moving average line, then the intersection time corresponding to the intersection point is determined, and based on the values corresponding to the first moving average line and the second moving average line at the time before and after the intersection time, the relative change trend used to indicate the short-term power consumption increase or short-term power consumption decrease is generated. If it is determined that the first moving average and the second moving average do not intersect, then the relative trend of change is generated to indicate that no trend change has occurred.
[0013] Beneficial effects: By detecting the crossover events of two moving averages at discrete time points, trend reversals can be determined. Only the numerical relationship between adjacent time points needs to be compared, avoiding complex continuous curve analysis or slope calculation. With low computational overhead, the instantaneous and accurate capture of trend changes can be achieved, providing clear and delay-free trigger signals for feedforward adjustment, and significantly enhancing the response speed and control reliability to sudden power consumption changes.
[0014] Optionally, generating the relative trend indicating a short-term increase or decrease in power consumption based on the values corresponding to the first moving average and the second moving average at the time preceding and following the crossover time includes: When the value corresponding to the first moving average at the previous moment is greater than the value corresponding to the second moving average at the previous moment and the value corresponding to the first moving average at the next moment is less than the value corresponding to the second moving average at the previous moment, the relative change trend used to indicate the short-term increase in power consumption is generated. When the value corresponding to the first moving average at the previous moment is less than the value corresponding to the second moving average at the previous moment, and the value corresponding to the first moving average at the next moment is greater than the value corresponding to the second moving average at the previous moment, the relative change trend used to indicate the short-term power consumption decrease is generated.
[0015] Beneficial effects: By capturing the reversal of the magnitude relationship between long and short period averages at adjacent times, the trend direction is identified. It only involves two direct magnitude comparisons, avoiding complex calculations, making trend judgment fast, certain and strong anti-interference ability. It can accurately trigger feedforward adjustment actions with minimal calculation delay, thereby ensuring the immediacy of the response to power consumption changes and the overall robustness of the control system.
[0016] Optionally, the step of using a preset temperature control algorithm to calculate the temperature data and obtain the algorithm adjustment amount includes: Determine a preset target temperature control point, and calculate the temperature deviation between the temperature indicated by the temperature data and the target temperature control point; Based on the temperature deviation value, the preset temperature control algorithm is invoked to calculate and obtain the algorithm adjustment amount, which is used to maintain the temperature of the target component within a specified temperature range.
[0017] Beneficial effects: By introducing a target temperature control point and calculating the real-time temperature deviation, and using a preset temperature control algorithm to generate precise algorithm adjustment amounts, closed-loop feedback control of component temperature is achieved. This effectively ensures temperature stability and control accuracy under steady-state or gradual load changes, eliminates steady-state errors, and complements the feedforward adjustment amount based on power consumption trends. Together, they form a complete control strategy with fast response and precise control, significantly improving overall regulation reliability.
[0018] Optionally, the step of generating a fan drive signal and sending it to the server based on the trend adjustment amount and the algorithm adjustment amount to control the fan speed of the server includes: The trend adjustment amount and the algorithm adjustment amount are summed, and the sum is used as the final adjustment amount. Based on the final adjustment amount, the fan drive signal is generated and sent to the server so that the server controls the fan speed by executing the fan drive signal.
[0019] Beneficial effects: By generating the final control signal by summing the trend adjustment amount and the algorithm adjustment amount, and replacing the complex weighting or decision logic with the fusion strategy of linear superposition of feedforward and feedback signals, the predictive adjustment based on power consumption trend can enhance temperature-based control without delay. While significantly reducing the complexity of signal synthesis, it achieves an efficient unity of fast response and stable adjustment, with rapid response and strong robustness.
[0020] According to a second aspect of this application, a server fan control device is provided, the device comprising: The moving average calculation module is used to calculate a first moving average in real time based on the power consumption data of the target component in the server in the past first historical time period, and to calculate a second moving average in real time based on the power consumption data of the target component in the past second historical time period. The second period of the second historical time period is less than the first period of the first historical time period, and the difference between the first period and the second period meets a preset standard. The trend determination module is used to determine the trend adjustment amount based on the relative change trend between the first moving average and the second moving average. The temperature control calculation module is used to collect the temperature data of the target component in real time, and calculate the temperature data using a preset temperature control algorithm to obtain the algorithm adjustment amount; The control module is used to generate a fan drive signal based on the trend adjustment amount and the algorithm adjustment amount and send it to the server to control the fan speed of the server.
[0021] According to a third aspect of this application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the first aspects above.
[0022] According to a fourth aspect of this application, a readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.
[0023] By employing the above technical solutions, this application provides a server fan control method, device, computer equipment, and readable storage medium. This application calculates the short-period and long-period moving averages of the power consumption of the target component in real time, and generates a trend adjustment amount based on their relative change trend. This achieves the replacement of complex calculations with simple moving average analysis, directly capturing the dynamic trend of power consumption. At the same time, it combines the algorithmic adjustment amount based on temperature data to jointly control the fan speed, realizing rapid coordination between feedforward regulation and feedback control. This effectively reduces hysteresis and temperature overshoot when responding to sudden temperature rises. Moreover, the entire control logic does not require multi-parameter coordination or recalculation, significantly reducing algorithm complexity and implementation difficulty, improving the response speed and operational stability of fan regulation, and making engineering deployment and maintenance more convenient and reliable.
[0024] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0025] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This paper illustrates a schematic flowchart of a server fan control method according to an embodiment of this application. Figure 2 This paper illustrates a schematic flowchart of another server fan control method provided in an embodiment of this application. Figure 3 This paper shows a schematic diagram of the structure of a server fan control device according to an embodiment of the present application; Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation
[0026] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0027] This application provides a server fan control method, such as... Figure 1 As shown, the method includes: S10: Calculate the first moving average line in real time based on the power consumption data of the target component in the server in the past first historical time period, and calculate the second moving average line in real time based on the power consumption data of the target component in the past second historical time period.
[0028] In this embodiment, it is first necessary to acquire historical power consumption data of the target component, such as the CPU, in the server in real time, and then perform calculations based on two time windows of different lengths. Specifically, it is necessary to continuously record and store the power consumption sequence of the target component over a relatively long period of time, for example, taking a first historical time period of 60 seconds. Based on the power consumption value at each sampling moment within these 60 seconds, a first moving average is calculated and named MA-60. Simultaneously, a second moving average is calculated based on the power consumption data of the past 10 seconds, using a shorter time window, i.e., a second historical time period, for example, a second historical time period of 10 seconds, and named MA-10, to capture recent power consumption fluctuations. The moving average is a commonly used data smoothing method that reflects the overall level and trend of data by calculating the arithmetic mean of data within a specified window. The average mentioned in this embodiment is used to characterize the long-term and short-term baseline states of power consumption.
[0029] It should be noted that the second period of the second historical time period is shorter than the first period of the first historical time period, and the difference between the first and second period lengths meets the preset standard. That is, the first historical time period is a long period and the second historical time period is a short period. In actual application, the preset standard can indicate that the time difference between the long and short periods needs to reach 50 seconds. Thus, the long period length can be set to 60 seconds and the short period length to 10 seconds to ensure that the long and short periods can effectively represent the trends at different time scales.
[0030] In this way, by replacing complex feature coefficient extraction or model prediction with simple moving average calculation, two key signals characterizing the long-term steady state and short-term dynamics of power consumption can be obtained directly and with low overhead, providing clear and computationally inexpensive input for subsequent trend judgment.
[0031] For example, CPU power consumption is sampled once per second, and power consumption queues for the most recent 60 seconds and the most recent 10 seconds are always maintained. The average value of these two queues is recalculated every time a sample is taken, thereby updating the values of MA-60 and MA-10 in real time.
[0032] In step S10, which involves calculating a moving average based on the power consumption data of the target component over historical time periods, the process includes the following steps: First, the power consumption data of the target component needs to be collected in real time through a built-in power monitoring unit, such as the sensor interface in the server's BMC. The target component can be a heat-generating chip such as a CPU or GPU, and a real-time power consumption data sequence needs to be generated. The real-time power consumption data sequence includes the power consumption data collected at each sampling time, and the power consumption data collected at each sampling time is arranged in chronological order. That is, it consists of discrete sampling points arranged in chronological order. Each sampling point corresponds to a power consumption value collected at a specific time. The unit of power consumption value can be watts. For example, it can be set to collect once per second, thereby obtaining a power consumption value stream that progresses over time, ensuring the timeliness and continuity of the data, and providing raw input for subsequent trend analysis.
[0033] Based on the generated real-time power consumption data sequence, a time window with the same period length as the historical time period targeted by the current calculation is defined. The historical time period targeted by the current calculation is either the first historical time period or the second historical time period. In other words, in practical applications, two time windows need to be defined: a long-period window for calculating the first moving average and a short-period window for calculating the second moving average. For example, the long-period window might be 60 seconds, and the short-period window might be 10 seconds. The time window is essentially a data buffer, and its size is determined by both the period length and the sampling frequency. For example, if sampling is done once per second, a 60-second period corresponds to a window capacity of 60 data points.
[0034] Next, the time window is mapped onto the real-time power consumption data sequence. As time progresses and new sampling points arrive, the window slides forward one unit on the sequence, always ensuring that the window covers the most recent specified length of data. During the sliding time window process, it is necessary to calculate the average value of all power consumption data currently covered by the time window on the real-time power consumption data sequence at each moment, until the total duration of all calculated moments reaches the duration of the historical time period targeted by the current calculation, resulting in multiple average values.
[0035] At the same time, by organizing multiple average values in chronological order, an average value curve can be formed, which can then be used as a moving average line.
[0036] It should be noted that the above description describes the logic for generating moving averages. As can be seen from the foregoing description of the embodiments, this application involves two historical time periods. Therefore, in this application, the logic described above needs to be used to generate corresponding moving averages for each historical time period, that is, to generate a first moving average for the first historical time period and a second moving average for the second historical time period, and to use the first and second moving averages in the subsequent calculation process.
[0037] S20: Determine the trend adjustment amount based on the relative changing trend between the first moving average and the second moving average.
[0038] In this embodiment, a trend adjustment amount is determined based on the calculated relative position change between the first moving average and the second moving average. Specifically, in each control cycle, such as every second, the values of the first and second moving averages at the current moment are compared, and their magnitude relationship at the previous moment is recorded. The turning point of the trend is identified by determining whether the two moving averages "cross over" or "cross over". "Crossing over" means that the value of the second moving average at the previous moment was lower than or equal to the value of the first moving average, while the value of the second moving average at the current moment is higher than the value of the first moving average. This is interpreted as short-term power consumption showing an upward trend exceeding the long-term benchmark. "Crossing over" is the opposite, meaning that the value of the second moving average at the previous moment changed from being higher than or equal to the value of the first moving average to being lower than the value of the first moving average at the current moment, indicating a downward trend in short-term power consumption.
[0039] In this way, by directly using the intuitive and definite mathematical relationship of the intersection of two moving averages through the above process, the short-term trend of power consumption can be quantified without relying on a pre-set complex parameter table or performing linear formula calculations. The decision-making logic is simple and stable.
[0040] For example, if in a certain second the value of the second moving average is 95 watts and the value of the first moving average is 90 watts, then the value of the second moving average is greater than the value of the first moving average; while in the previous second the value of the second moving average was 89 watts and the value of the first moving average was 90 watts, then the value of the second moving average is less than the value of the first moving average, and an "upward crossover" has occurred.
[0041] In step S20, which involves determining the trend adjustment amount based on the relative trend between the first moving average and the second moving average, the following steps are included: S21: Compare the first moving average with the second moving average to determine the relative trend.
[0042] In this embodiment, to determine the trend, not only are the values of the first and second moving averages compared at the current moment, but their value relationships at the previous moment are also recorded and compared. Based on a continuous time-point comparison method, this identifies whether the two moving averages intersect and the direction of the intersection, thus determining the relative trend of the two moving averages. The relative trend indicates a short-term increase in power consumption, no trend change, or a short-term decrease in power consumption. In this way, by simply comparing numerical values, the dynamic change in power consumption from quantitative to qualitative can be captured, replacing the cumbersome calculations required for complex correlation coefficients or predictive models.
[0043] In this embodiment of the application, optionally, the first moving average line is compared with the second moving average line to determine the relative trend of change. The specific process is as follows: First, the first and second moving averages are placed in the same coordinate system, so that the two moving averages share the same time axis. Each discrete sampling time corresponds to a pair of specific values, namely the long-term mean and the short-term mean at that time, thereby ensuring the strict synchronous comparability of the data in the time dimension. Subsequently, in this coordinate system, it is identified whether there is an intersection point between the first and second moving averages. Since the data is discretely sampled, the intersection point described in this embodiment may not happen exactly at the sampling time in a strictly mathematical sense. Therefore, in practical applications, the intersection point can be identified by comparing the relative position changes of the two lines at adjacent sampling times. If the numerical relationship between the two moving averages reverses between two consecutive sampling times, it is determined that an intersection has occurred in that time interval, and the subsequent sampling time is defined as the intersection time.
[0044] If an intersection point is identified between the first and second moving averages, a relative trend indicating a short-term increase or decrease in power consumption is generated based on the corresponding values on the first and second moving averages at the moments before and after the intersection. Conversely, if no intersection point is identified between the first and second moving averages, indicating that the numerical relationship between the two moving averages remains consistent or that their values are completely equal without reversal, a relative trend indicating no change in trend is generated.
[0045] In this way, through the above process, without the need for complex curve fitting, derivative calculations, or predictive model inferences, the critical point where the dynamic trend of power consumption changes fundamentally can be captured simply by directly comparing the magnitudes of two pairs of means at adjacent time points. This achieves real-time and robust detection of trend reversals with low computational overhead, providing clear and timely trigger signals for feedforward adjustment. For example, when CPU power consumption fluctuations cause the value of the second moving average to jump from 89 watts (lower than the first moving average in the previous second) to 95 watts (higher than the first moving average in the current second), an "upward crossing" point can be identified, and the trend of "short-term power consumption increase" can be determined. This allows for early intervention and adjustment, effectively alleviating the lag problem of traditional pure temperature feedback. While ensuring rapid response, its simple logic also provides high operational stability and maintainability.
[0046] Further, in this embodiment of the application, optionally, based on the values corresponding to the first moving average line and the second moving average line at the time before and after the crossover time, a relative trend indicating a short-term increase or decrease in power consumption is generated. The specific process is as follows: When the value corresponding to the first moving average at the current moment is greater than the value corresponding to the second moving average at the previous moment, and the value corresponding to the first moving average at the next moment is less than the value corresponding to the second moving average at the previous moment, it indicates that before the crossover occurs, the short-term power consumption level is still below the long-term benchmark. However, after the crossover, the relationship reverses, with the long-term level value being less than the short-term level value, meaning that the short-term level has jumped above the long-term benchmark. This reversal from "below" to "above" is defined as "crossing over" in this embodiment of the application, and thus, a relative trend indicating the increase in short-term power consumption is generated.
[0047] Conversely, when the value corresponding to the first moving average at the previous moment is less than the value corresponding to the second moving average at the previous moment, and the value corresponding to the first moving average at the next moment is greater than the value corresponding to the second moving average at the previous moment, it indicates a reversal from "up" to "down", i.e., "downward crossing". Therefore, it generates a relative change trend indicating a short-term decrease in power consumption.
[0048] In this way, through the above process, the embodiments of this application transform the abstract concept of trend into a clear logical judgment between two consecutive moments and two sets of specific values, eliminating ambiguity and eliminating the need to calculate the rate of change or slope. The response speed is fast, and it can be immediately identified in the first sampling period when the trend turns, providing a trigger signal without delay for feedforward control. At the same time, since the logic is simple and only involves comparison operations, the computing resources occupied during operation are extremely low, and the judgment result is stable and reliable, unaffected by fluctuations in complex algorithm parameters.
[0049] S22: When the relative change trend indicates a short-term increase in power consumption, generate a trend adjustment amount to indicate that the current fan speed control amount should be increased by a specified value.
[0050] In this embodiment, when the relative trend indicates a short-term increase in power consumption, a positive, fixed-value trend adjustment needs to be generated. Specifically, in this embodiment, a constant is preset. , The value must be greater than 0. This serves as a fixed adjustment range for speed regulation. Therefore, when the relative trend indicates a short-term increase in power consumption, the trend adjustment amount can be set to... .
[0051] It should be noted that the trend adjustment amount in this embodiment is a direct speed control increment, and its unit is consistent with the unit of the fan speed control signal, so that it can be directly superimposed on the algorithm adjustment amount calculated by the preset temperature control algorithm.
[0052] In this way, by setting a fixed adjustment value, it can be ensured that the magnitude of the feedforward adjustment is constant regardless of the steepness of the power consumption increase, avoiding the complexity and instability caused by real-time calculation based on the power consumption change rate, and making the control action certain and consistent. Moreover, as a feedforward signal, the purpose of this adjustment is to provide a basic speed increase in advance before the temperature rises significantly due to the increase in power consumption, thereby actively building a heat dissipation margin.
[0053] For example, assume a preset fixed adjustment value The value is 5, and its unit is consistent with the PWM duty cycle increment. Therefore, the trend adjustment amount generated at this time is +5, indicating that the control logic needs to immediately increase the current fan speed control amount by 5 units.
[0054] S23: When the relative trend indicates no trend change, generate a trend adjustment amount with a value of 0.
[0055] In this embodiment, when the relative trend indicator shows no trend change, meaning the two moving averages have not crossed, and the magnitude relationship between the two moving averages remains stable within adjacent control cycles (e.g., the value of the second moving average is always higher than, lower than, or equal to the value of the first moving average), the power consumption can be considered to be in a relatively stable trend state without any abrupt changes requiring feedforward intervention. In this case, the trend adjustment value generated in this embodiment is 0, meaning no feedforward adjustment based on the power consumption trend will be applied. The fan speed control is entirely dominated by the subsequent preset temperature control algorithm, ensuring that the control logic does not introduce unnecessary speed disturbances during the stable power consumption phase, maintaining quiet operation and a low power consumption state. It also simplifies control decisions, triggering additional control actions only when a clear trend inflection point is detected.
[0056] For example, suppose that for several consecutive periods, the value of the second moving average is detected to fluctuate between 92 watts and 94 watts, while the value of the first moving average is stable at 90 watts. The value of the second moving average is always higher than the value of the first moving average and has not crossed below it. In this case, although the absolute value of short-term power consumption is higher than the long-term benchmark, the trend adjustment amount generated is still 0 because the trend is stable and unchanged. It will not increase or decrease the fan speed.
[0057] S24: When the relative change trend indicates a short-term decrease in power consumption, generate a trend adjustment amount to indicate that the current fan speed control amount should be reduced by a specified value.
[0058] In this embodiment, when the relative change trend indicates a short-term decrease in power consumption, the execution logic is symmetrical to but opposite in direction to step S22 above, and the preset fixed adjustment value is also invoked. However, it generates a negative trend adjustment value. This adjustment indicates that the current fan speed control amount needs to be reduced. This allows for proactive reduction of fan speed when a clear downward trend in power consumption is detected, rather than passively waiting for the temperature to drop and for the preset temperature control algorithm to respond slowly. This not only helps to reduce fan noise and energy consumption in a timely manner when the load decreases, but also prevents the phenomenon of excessive cooling that causes the component temperature to fall below the optimal operating range due to excessive heat dissipation, thus achieving dual optimization of energy efficiency and quiet operation.
[0059] Thus, as can be seen from the description of steps S22 to S24 above, the trend adjustment quantity generation mechanism proposed in this application, through the combination of simplified cross event detection and fixed quantity output, transforms the complex feedforward prediction problem into a clear and robust logical judgment, significantly reducing the algorithm complexity and implementation difficulty.
[0060] For example, when the workload drops sharply, and the value of the second moving average decreases from 85 watts in the previous second to 78 watts in the current second, while the value of the first moving average remains at 82 watts, the "downward crossover" condition is triggered, assuming a fixed adjustment value. If the value is 5, a trend adjustment amount of -5 will be generated, indicating that the fan speed control amount will be reduced by 5 units, thereby reducing the heat dissipation intensity in advance.
[0061] S30: Real-time acquisition of temperature data of the target component, calculation of the temperature data using a preset temperature control algorithm, and obtaining the algorithm adjustment amount.
[0062] In this embodiment of the application, temperature data of the target component is collected in real time by a temperature sensor, and the temperature data is calculated using a preset temperature control algorithm.
[0063] The preset temperature control algorithm can be a PID control algorithm. The PID control algorithm will calculate the algorithm adjustment amount required to drive the fan speed based on the deviation between the current temperature and the target control point, as well as its integral and derivative terms. Thus, the technical solution of this application embodiment retains the accuracy and steady-state regulation capability of traditional temperature feedback control.
[0064] In step S30, which involves using a preset temperature control algorithm to calculate the temperature data and obtain the algorithm adjustment amount, the following process is included: First, a preset target temperature control point needs to be determined. This target temperature control point is a constant representing the ideal operating temperature or safe temperature threshold of the component, and its unit can be degrees Celsius. Then, the temperature deviation between the indicated temperature and the target temperature control point is calculated; that is, how much the current temperature of the component differs from the target temperature control point. Specifically, if the current actual temperature is lower than the target temperature control point, the deviation is positive, indicating that there is room for temperature increase or excessive heat dissipation; if the current actual temperature is higher than the target temperature control point, the deviation is negative, indicating a risk of overheating and the need for enhanced heat dissipation.
[0065] After obtaining the temperature deviation value, this embodiment of the application combines the temperature deviation value with a preset temperature control algorithm to calculate and obtain an algorithm adjustment amount. This algorithm adjustment amount is used to maintain the temperature of the target component within a specified temperature range. In practical applications, the preset temperature control algorithm can be a PID (Proportional-Integral-Derivative) control algorithm. The PID control algorithm adjusts the temperature deviation value... The proportional (P), integral (I), and derivative (D) terms are weighted and summed to calculate the precise algorithm adjustment. The formula for the preset temperature control algorithm is as follows: Formula 1: Formula 1:
[0066] In Formula 1, , and These are pre-tuned proportional, integral, and derivative coefficients, which together determine the controller's response strength to current deviation, historical cumulative deviation, and the rate of change of deviation. Proportional term Provides an immediate response proportional to the current deviation; It is the integral term of the deviation, representing the time from the start of control to the current moment. The cumulative sum of all historical temperature deviations up to this point, the integral term Steady-state error is eliminated by accumulating past deviations; This is the differential term of the deviation, that is, the rate of change of the temperature deviation value over time. It represents the trend and speed of temperature change. The algorithm then predicts future trends based on the rate of change of the deviation, providing damping to reduce overshoot. The calculated algorithm adjustment amount... It is a signed numerical value; its sign determines whether the fan speed increases or decreases, and its magnitude determines the adjustment range. For example, when the CPU temperature exceeds the 70°C control point due to increased load, the deviation... The value is negative, and after calculation by the PID control algorithm, A positive number indicates that the fan speed needs to be increased to improve heat dissipation.
[0067] In this way, the PID feedback control mechanism provides precise and stable closed-loop temperature regulation, effectively addressing normal temperature fluctuations and ensuring the server's thermal safety under steady-state or slowly changing loads. As the foundation or fine-tuning element of the entire control system, the PID control algorithm compensates for potential steady-state errors that might arise from relying solely on feedforward trend adjustment, complementing the previously generated trend adjustment. The trend adjustment is responsible for proactively coarse-grained adjustments to sudden, rapid power consumption changes, while the PID control algorithm's adjustment is responsible for precise fine-tuning of the actual, real-time temperature conditions. Together, they achieve rapid and precise fan speed control, preventing temperature overshoot while avoiding unnecessary speed oscillations and energy consumption. For example, when the server CPU is running a continuous computing task, its temperature stabilizes at 72°C, slightly above the target temperature control point of 70°C. The PID control algorithm will continuously output a small but stable positive value. The value is adjusted to maintain the fan speed at a slightly higher speed to ensure that the temperature does not rise further. If the power consumption trend is stable at this time, the trend adjustment amount is 0, and the fan speed is precisely maintained by the PID output.
[0068] S40: Based on trend adjustment and algorithm adjustment, generate fan drive signals and send them to the server to control the server's fan speed.
[0069] In this embodiment, the final fan drive signal, such as the PWM duty cycle, needs to be generated based on the trend adjustment amount and the algorithm adjustment amount. Specifically, the algorithm adjustment amount calculated by PID can be added to the trend adjustment amount determined based on the power consumption trend to obtain the fan drive signal for the current period, and then sent to the fan drive circuit of the server to achieve real-time control of the fan speed.
[0070] In this way, through the above-mentioned fusion mechanism, the control signal not only responds to the current temperature state, but also proactively responds to the potential temperature change direction revealed by the power consumption trend. When the power consumption rises rapidly, even if the temperature has not yet reached the control point, the trend adjustment amount has been injected with a positive driving amount in advance to actively increase the fan speed to suppress the upcoming temperature rise, effectively reducing the inherent lag and temperature overshoot problems of traditional pure PID control. Moreover, the entire control process has clear logic and lightweight computation, simplifying the complex feedforward prediction into the detection of moving average crossover events and the response of fixed quantities, significantly improving the timeliness of response and the robustness of overall control, while reducing the complexity of software implementation and maintenance costs.
[0071] For example, if the algorithm adjustment amount calculated by the PID at a certain moment indicates... A 3% increase is needed, while the power consumption trend is judged to be "upward crossing," resulting in an adjustment amount. , Equivalent to 2% Then the final issued The drive signal will be increased by 5% from the current level, and the fan speed will be increased more significantly in advance to cope with the rapid temperature rise caused by the sudden increase in power consumption.
[0072] In step S40, which involves generating a fan drive signal based on the trend adjustment amount and the algorithm adjustment amount and sending it to the server to control the fan speed of the server, the following steps are included: S41: Sum the trend adjustment amount and the algorithm adjustment amount, and use the sum as the final adjustment amount.
[0073] In this embodiment, the generated trend adjustment amount and the calculated algorithm adjustment amount are algebraically added together, and the sum is used as the final adjustment amount to fuse the two independently calculated control signals into a unified output command. This process only involves numerical addition and does not introduce complex weighting coefficients, priority judgments, or nonlinear functions. This allows the contributions of the trend adjustment amount of feedforward regulation and the algorithm adjustment amount of feedback control to be combined linearly and without delay. The trend adjustment amount, as an instantaneous and deterministic offset of the algorithm adjustment amount, can minimize the computational complexity and decision delay of the signal fusion process, ensuring the immediacy of the control response. At the same time, it clearly separates the feedforward action based on power consumption prediction and the feedback action based on temperature measurement, making the entire control logic structure transparent, easy to understand, debug, and maintain.
[0074] For example, in a certain control cycle, a trend adjustment of +5 is generated based on the "upward" determination of the power consumption trend, while the PID algorithm calculates the algorithm adjustment based on the current temperature. If the value is +3, then by summing the values, the final adjustment amount is +8 (i.e., 5+3). The final adjustment amount indicates that the fan speed control signal needs to be increased by a total of 8 units in the current cycle.
[0075] S42: Based on the final adjustment amount, generate a fan drive signal and send the fan drive signal to the server so that the server can control the fan speed by executing the fan drive signal.
[0076] In this embodiment, after obtaining the final adjustment amount, it needs to be converted into actual hardware control actions. This can be achieved by a control system such as a BMC generating a corresponding fan drive signal based on the final adjustment amount. Specifically, the fan drive signal can be a PWM (Pulse Width Modulation) signal. When generating the fan drive signal, a PWM value representing the current fan speed reference can be pre-maintained, such as a duty cycle value. The final adjustment amount is added to this reference value to obtain a new target PWM control value. Subsequently, the hardware PWM controller of the control system generates a pulse sequence with a corresponding duty cycle and a fixed period based on this target value; this is the final fan drive PWM signal. Then, the generated PWM signal is sent to the fan drive circuit on the server motherboard or directly connected to the fan via an internal bus such as I2C or a dedicated interface.
[0077] Accordingly, after receiving this PWM signal, the fan's internal drive circuit adjusts the motor's power supply according to the pulse's duty cycle, thereby executing the command encoded by the signal to precisely increase, decrease, or maintain the speed. This enables rapid transmission from control decisions to physical actions. The final adjustment amount, combined with feedforward and feedback, is transformed into an actual change in heat dissipation capacity through this standardized hardware interface. This allows the fan to respond earlier and faster to suppress temperature rise when power consumption suddenly increases, and to slow down the speed earlier to reduce noise and energy consumption when the load decreases. Ultimately, this achieves the control goal of fast response, stable operation, and optimized energy efficiency.
[0078] Continuing with the previous example, assuming the current fan's PWM base duty cycle is 100 units, after receiving the final adjustment amount +8, the new target PWM value is calculated to be 108 (i.e., 100+8). The BMC then generates a PWM pulse signal with a duty cycle of 108 and sends it out through the fan interface. When the server fan receives this signal, its speed increases to a higher level corresponding to the 108 duty cycle, thereby providing stronger heat dissipation capabilities.
[0079] In summary, the complete logical process of the technical solution in this application embodiment is summarized as follows: like Figure 2 As shown, firstly, power consumption data for the past 60 seconds is acquired and its moving average MA-60 is calculated. Simultaneously, power consumption data for the past 10 seconds is acquired and its moving average MA-10 is calculated. Next, the relative trend between MA-10 and MA-60 is analyzed in real time: if MA-10 crosses above MA-60, it is determined that short-term power consumption is showing an upward trend, generating a positive fixed adjustment amount to increase the control amount of the current fan speed. Value; if the MA-10 crosses below the MA-60, it is considered a downtrend, generating a negative adjustment volume. If the two do not cross, it is determined that there is no significant trend change, and the adjustment amount is 0. Simultaneously with trend determination, the component's temperature data is acquired in real time, and a preset PID control algorithm is used to calculate an algorithmic adjustment amount. Finally, the adjustment amount will be based on the trend. Adjustment amount based on temperature algorithm The synthesis is performed, and the next control cycle is calculated according to Formula 2 below. The final PWM control signal applied to the fan at any time. : Formula 2:
[0080] The technical solution of this application drives the fan speed according to the final PWM control signal, thereby completing a complete closed-loop control process.
[0081] The method provided in this application calculates the short-period and long-period moving averages of the power consumption of the target component in real time, and generates a trend adjustment amount based on their relative change trend. This achieves the replacement of complex calculations with simple moving average analysis, which can directly capture the dynamic trend of power consumption. At the same time, it combines the algorithmic adjustment amount of temperature data to jointly control the fan speed, realizing the rapid coordination of feedforward regulation and feedback control. This effectively reduces hysteresis and temperature overshoot when responding to sudden temperature rises. Moreover, the entire control logic does not require multi-parameter coordination or recalculation, which significantly reduces the algorithm complexity and implementation difficulty, improves the response speed and operational stability of fan regulation, and makes engineering deployment and maintenance more convenient and reliable.
[0082] Furthermore, as Figure 1 To specifically implement the method, this application provides a server fan control device, such as... Figure 3 As shown, the device includes: a moving average calculation module 301, a trend determination module 302, a temperature control calculation module 303, and a control module 304.
[0083] The moving average calculation module 301 is used to calculate a first moving average in real time based on the power consumption data of the target component in the server in the past first historical time period, and to calculate a second moving average in real time based on the power consumption data of the target component in the past second historical time period. The second period of the second historical time period is less than the first period of the first historical time period, and the difference between the first period and the second period meets a preset standard. The trend determination module 302 is used to determine the trend adjustment amount based on the relative change trend between the first moving average and the second moving average. The temperature control calculation module 303 is used to collect the temperature data of the target component in real time, and calculate the temperature data using a preset temperature control algorithm to obtain the algorithm adjustment amount; The control module 304 is used to generate a fan drive signal based on the trend adjustment amount and the algorithm adjustment amount and send it to the server to control the fan speed of the server.
[0084] In a specific application scenario, the moving average calculation module 301 is used to collect power consumption data of the target component in real time and generate a real-time power consumption data sequence. The real-time power consumption data sequence includes power consumption data collected at each sampling time, and the power consumption data collected at each sampling time is arranged in chronological order. A time window with the same period length as the historical time period targeted by the current calculation is defined, wherein the historical time period targeted by the current calculation is the first historical time period or the second historical time period. The time window is mapped onto the real-time power consumption data sequence, and the time window is continuously slid on the real-time power consumption data sequence as time progresses. During the sliding of the time window, the average value of all power consumption data currently covered by the time window on the real-time power consumption data sequence is calculated in real time at each moment until the duration of all calculated moments reaches the duration of the historical time period targeted by the current calculation, resulting in multiple average values. The multiple average values are arranged in chronological order to form an average value curve, and the average value curve is used as the moving average line.
[0085] In a specific application scenario, the trend determination module 302 is used to compare the first moving average line with the second moving average line to determine the relative change trend, wherein the relative change trend indicates a short-term increase in power consumption, no trend change, or a short-term decrease in power consumption; when the relative change trend indicates a short-term increase in power consumption, a trend adjustment amount is generated to indicate that the current speed control amount of the fan is increased by a specified value; when the relative change trend indicates no trend change, a trend adjustment amount with a value of 0 is generated; when the relative change trend indicates a short-term decrease in power consumption, a trend adjustment amount is generated to indicate that the current speed control amount of the fan is decreased by a specified value.
[0086] In a specific application scenario, the trend determination module 302 is used to place the first moving average line and the second moving average line in the same coordinate system and identify whether the first moving average line and the second moving average line have an intersection point; if it is determined that the first moving average line and the second moving average line have an intersection point, then the intersection time corresponding to the intersection point is determined, and based on the values corresponding to the first moving average line and the second moving average line at the time before and after the intersection time, the relative change trend used to indicate short-term power consumption increase or short-term power consumption decrease is generated; if it is determined that the first moving average line and the second moving average line do not have an intersection point, then the relative change trend used to indicate that no trend change has occurred is generated.
[0087] In a specific application scenario, the trend determination module 302 is used to generate a relative change trend indicating a short-term increase in power consumption when the value corresponding to the first moving average at the previous moment is greater than the value corresponding to the second moving average at the previous moment and the value corresponding to the first moving average at the next moment is less than the value corresponding to the second moving average at the previous moment; and to generate a relative change trend indicating a short-term decrease in power consumption when the value corresponding to the first moving average at the previous moment is less than the value corresponding to the second moving average at the previous moment and the value corresponding to the first moving average at the next moment is greater than the value corresponding to the second moving average at the previous moment.
[0088] In specific application scenarios, the temperature control calculation module 303 is used to determine a preset target temperature control point, and to calculate the temperature deviation between the temperature indicated by the temperature data and the target temperature control point; combined with the temperature deviation value, the preset temperature control algorithm is called to calculate and obtain the algorithm adjustment amount, which is used to maintain the temperature of the target component within a specified temperature range.
[0089] In a specific application scenario, the control module 304 is used to sum the trend adjustment amount and the algorithm adjustment amount, and use the sum value obtained by the summation calculation as the final adjustment amount; based on the final adjustment amount, the control module 304 generates the fan drive signal and sends the fan drive signal to the server, so that the server controls the fan speed by executing the fan drive signal.
[0090] The device provided in this application calculates the short-period and long-period moving averages of the power consumption of the target component in real time, and generates a trend adjustment amount based on their relative change trend. This achieves the replacement of complex calculations with simple moving average analysis, directly capturing the dynamic trend of power consumption. At the same time, it combines the algorithmic adjustment amount of temperature data to jointly control the fan speed, realizing rapid coordination between feedforward regulation and feedback control. This effectively reduces hysteresis and temperature overshoot when responding to sudden temperature rises. Moreover, the entire control logic does not require multi-parameter coordination or recalculation, significantly reducing algorithm complexity and implementation difficulty, improving the response speed and operational stability of fan regulation, and making engineering deployment and maintenance more convenient and reliable.
[0091] It should be noted that other corresponding descriptions of the functional units involved in the server fan control device provided in this application embodiment can be found in the following references. Figure 1 and Figure 2 The corresponding description in [the document] will not be repeated here.
[0092] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0093] The above embodiments and the technical features in the embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0094] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
[0095] In an exemplary embodiment, see Figure 4 The invention also provides a computer device including a bus, a processor, a memory, and a communication interface. It may also include an input / output interface and a display device, wherein the various functional units can communicate with each other via the bus. The memory stores a computer program, and the processor executes the program stored in the memory to perform the server fan control method described in the above embodiments.
[0096] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the server fan control method.
[0097] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented in hardware or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0098] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application.
[0099] Those skilled in the art will understand that the modules in the apparatus of the implementation scenario can be distributed within the apparatus of the implementation scenario as described, or they can be located in one or more apparatuses different from this implementation scenario, with corresponding changes. The modules of the above-described implementation scenario can be combined into one module, or they can be further divided into multiple sub-modules.
[0100] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of the implementation scenario.
[0101] The above disclosures are only a few specific implementation scenarios of this application. However, this application is not limited to these. Any variations that can be conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A server fan control method, characterized in that, include: The first moving average is calculated in real time based on the power consumption data of the target component in the server in the past first historical time period, and the second moving average is calculated in real time based on the power consumption data of the target component in the past second historical time period. The second period of the second historical time period is less than the first period of the first historical time period, and the difference between the first period and the second period meets the preset standard. The trend adjustment amount is determined based on the relative changing trend between the first moving average and the second moving average; The temperature data of the target component is collected in real time, and the temperature data is calculated using a preset temperature control algorithm to obtain the algorithm adjustment amount; Based on the trend adjustment amount and the algorithm adjustment amount, a fan drive signal is generated and sent to the server to control the fan speed of the server.
2. The method according to claim 1, characterized in that, Based on the power consumption data of the target component over historical time periods, a moving average is calculated, including: The power consumption data of the target component is collected in real time and a real-time power consumption data sequence is generated. The real-time power consumption data sequence includes the power consumption data collected at each sampling time and the power consumption data collected at each sampling time is arranged in chronological order. Define a time window with the same period length as the historical time period targeted by the current calculation, wherein the historical time period targeted by the current calculation is the first historical time period or the second historical time period; The time window is mapped onto the real-time power consumption data sequence, and the time window is continuously slid across the real-time power consumption data sequence as time progresses. During the sliding of the time window, the average value of all power consumption data currently covered by the time window on the real-time power consumption data sequence is calculated in real time at each moment until the duration of all calculated moments reaches the duration of the historical time period targeted by the current calculation, and multiple average values are obtained. The multiple average values are sorted in chronological order to form an average value curve, which is then used as the moving average line.
3. The method according to claim 1, characterized in that, The step of determining the trend adjustment amount based on the relative changing trend between the first moving average and the second moving average includes: The first moving average line is compared with the second moving average line to determine the relative change trend, wherein the relative change trend indicates a short-term increase in power consumption, no trend change, or a short-term decrease in power consumption. When the relative change trend indicates a short-term increase in power consumption, a trend adjustment amount is generated to indicate that the current speed control amount of the fan is increased by a specified value; When the relative change trend indicates that no trend change has occurred, a trend adjustment amount with a value of 0 is generated; When the relative change trend indicates a short-term decrease in power consumption, the trend adjustment amount is generated to indicate that the current speed control amount of the fan is reduced by a specified value.
4. The method according to claim 3, characterized in that, The step of comparing the first moving average with the second moving average to determine the relative trend includes: Place the first moving average and the second moving average in the same coordinate system, and identify whether there is an intersection point between the first moving average and the second moving average; If it is determined that there is an intersection point between the first moving average line and the second moving average line, then the intersection time corresponding to the intersection point is determined, and based on the values corresponding to the first moving average line and the second moving average line at the time before and after the intersection time, the relative change trend used to indicate the short-term power consumption increase or short-term power consumption decrease is generated. If it is determined that the first moving average and the second moving average do not intersect, then the relative trend of change is generated to indicate that no trend change has occurred.
5. The method according to claim 4, characterized in that, The step of generating the relative change trend indicating a short-term increase or decrease in power consumption based on the values corresponding to the first moving average and the second moving average at the time preceding and following the crossover time includes: When the value corresponding to the first moving average at the previous moment is greater than the value corresponding to the second moving average at the previous moment and the value corresponding to the first moving average at the next moment is less than the value corresponding to the second moving average at the previous moment, the relative change trend used to indicate the short-term increase in power consumption is generated. When the value corresponding to the first moving average at the previous moment is less than the value corresponding to the second moving average at the previous moment, and the value corresponding to the first moving average at the next moment is greater than the value corresponding to the second moving average at the previous moment, the relative change trend used to indicate the short-term power consumption decrease is generated.
6. The method according to claim 1, characterized in that, The step of using a preset temperature control algorithm to calculate the temperature data and obtain the algorithm adjustment amount includes: Determine a preset target temperature control point, and calculate the temperature deviation between the temperature indicated by the temperature data and the target temperature control point; Based on the temperature deviation value, the preset temperature control algorithm is invoked to calculate and obtain the algorithm adjustment amount, which is used to maintain the temperature of the target component within a specified temperature range.
7. The method according to claim 1, characterized in that, The step of generating a fan drive signal based on the trend adjustment amount and the algorithm adjustment amount and sending it to the server to control the fan speed of the server includes: The trend adjustment amount and the algorithm adjustment amount are summed, and the sum is used as the final adjustment amount. Based on the final adjustment amount, the fan drive signal is generated and sent to the server so that the server controls the fan speed by executing the fan drive signal.
8. A server fan control device, characterized in that, include: The moving average calculation module is used to calculate a first moving average in real time based on the power consumption data of the target component in the server in the past first historical time period, and to calculate a second moving average in real time based on the power consumption data of the target component in the past second historical time period. The second period of the second historical time period is less than the first period of the first historical time period, and the difference between the first period and the second period meets a preset standard. The trend determination module is used to determine the trend adjustment amount based on the relative change trend between the first moving average and the second moving average. The temperature control calculation module is used to collect the temperature data of the target component in real time, and calculate the temperature data using a preset temperature control algorithm to obtain the algorithm adjustment amount; The control module is used to generate a fan drive signal based on the trend adjustment amount and the algorithm adjustment amount and send it to the server to control the fan speed of the server.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.