Fan rotating speed statistical method and device

By generating timing pulses based on the valid edge of the fan synchronization tach signal, the real-time cycle of the fan is counted, which solves the problem of inaccurate traditional fan speed acquisition methods and achieves efficient and accurate fan speed statistics.

CN118582408APending Publication Date: 2024-09-03INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410524322.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

There are errors in the traditional fan speed acquisition method. Especially when the fan speed is frequently adjusted, the number of pulses is unstable, resulting in inaccurate speed statistics. Limited by the 8-bit register, the error increases when the statistical time is reduced, making it impossible to accurately obtain the fan speed.

Method used

Using the valid edge of the corresponding pulse of the fan synchronization tach signal as the starting point, a timing pulse with a preset time interval is generated, and the number of timing pulses between two adjacent valid edges is counted to obtain the real-time period of the fan, thereby determining the real-time speed, and The real-time period is stored in the fan real-time speed register and latched into the fan speed register.

Benefits of technology

It achieves accurate acquisition of fan speed, shortens statistical time, improves acquisition efficiency, and reduces errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118582408A
    Figure CN118582408A
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a fan rotating speed statistical method and device, and the method comprises the steps: taking an effective edge of a pulse corresponding to a fan synchronization tach signal as a starting point, and generating a timing pulse with a preset time interval; and counting the number of the timing pulses between two adjacent effective edges of the corresponding pulses of the fan synchronization tach signal to obtain a real-time period of the fan synchronization tach signal, and the real-time period is used for determining the real-time rotating speed of the fan. As the number of the timing pulses is counted between the two adjacent effective edges of the pulse corresponding to the fan synchronization tach signal to obtain the real-time period of the fan synchronization tach signal, and the timing pulses are generated by taking the effective edges of the pulse corresponding to the fan synchronization tach signal as the starting points, the real-time period of the fan can be accurately counted, and the real-time period of the fan can be accurately calculated. And the real-time rotating speed of the fan can be accurately obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a fan speed statistics method and device. Background Art

[0002] With the rapid development of data center business, the demand for data center switches is also increasing rapidly, the switch switching capacity, the number of panel ports and port rates are also increasing, and the power consumption of equipment is also increasing significantly, requiring fans with higher speeds or more fans to dissipate heat for the equipment. Usually, a dedicated baseboard management controller (Baseboard Management Controller, BMC) completes the whole machine heat dissipation strategy to maintain the whole machine working environment at a normal temperature. The dedicated BMC obtains the current equipment air inlet temperature, key chip temperature and air outlet temperature through temperature sensors arranged at various locations of the whole machine, and then obtains the current fan speed through a complex programmable logic device (Complex Programmable Logic Device, CPLD), and controls the fan speed, thereby maintaining the equipment ambient temperature within a reasonable range.

[0003] The traditional way to obtain fan speed is to continuously count the number of pulses within 1 minute and then calculate the fan speed. This method has certain errors, especially when the fan speed is frequently adjusted. Before the fan speed is locked, the number of pulses is unstable, and the fan speed counted within 1 minute is inaccurate. Moreover, as the fan speed increases, it is limited by the 8-bit register for counting the speed. In order to prevent the register from overflowing, the counting time can only be reduced, which will increase the error again and make the fan speed statistics even less accurate.

[0004] In short, the traditional method of obtaining the fan speed cannot accurately obtain the fan speed. Summary of the invention

[0005] The present invention provides a fan speed statistics method and device, which are used to solve the problem that the fan speed acquisition method in the prior art cannot accurately acquire the fan speed.

[0006] The present invention provides a fan speed statistics method, comprising:

[0007] Taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, a timing pulse with a preset time interval is generated;

[0008] Between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time rotation speed of the fan.

[0009] According to a fan speed statistics method provided by the present invention, a timing pulse with a preset time interval is generated with the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, including:

[0010] Detecting the effective edge of the pulse corresponding to the fan synchronous tach signal;

[0011] When the valid edge arrives, the counting variable is cleared to zero, and the counting variable is accumulated according to the preset clock cycle and step size 1; otherwise, the counting variable is accumulated according to the preset clock cycle and step size 1;

[0012] When the counting variable is accumulated to a predetermined number of times, the timing pulse is output; otherwise, the counting variable is accumulated continuously with a preset clock cycle and a step of 1, wherein the predetermined number of times is obtained by dividing a preset time interval by the preset clock cycle.

[0013] According to a fan speed counting method provided by the present invention, between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, including:

[0014] Detecting the effective edge of the pulse corresponding to the fan synchronous tach signal;

[0015] When the effective edge arrives, the real-time cycle is cleared and it is determined whether the timing pulse arrives, otherwise, it is directly determined whether the timing pulse arrives;

[0016] When the timing pulse arrives, the real-time period is accumulated in step 1, otherwise, the real-time period is kept unchanged.

[0017] According to a fan speed statistics method provided by the present invention, after obtaining the real-time period of the fan synchronization tach signal, the method further includes:

[0018] Storing the real-time cycle in a fan real-time speed register;

[0019] The refresh enable signal of the fan speed register is set to be valid based on the fan speed reading signal;

[0020] When the refresh enable signal is valid, the real-time period in the fan real-time speed register is latched into the fan speed register.

[0021] According to a fan speed statistics method provided by the present invention, a refresh enable signal of a fan speed register is set to be valid based on a fan speed reading signal, including:

[0022] Receive fan-related register read signals;

[0023] Determine whether the read address of the fan-related register read signal is the fan speed register;

[0024] In the case where the read address is the fan speed register, the refresh counter is cleared to zero, and it is determined whether the preset timing duration has been reached; otherwise, it is directly determined whether the preset timing duration has been reached;

[0025] When the preset timing duration is reached, the refresh counter is incremented by 1, otherwise, the refresh counter remains unchanged;

[0026] Determine whether the refresh counter reaches the cumulative number of times, and when the cumulative number of times is reached, set the refresh enable signal to an enable valid level, otherwise, the refresh enable signal maintains an enable invalid level;

[0027] The preset timing duration and the accumulated number of times are determined based on the shortest duration for completing reading the fan speed register, and the product of the preset timing duration and the accumulated number of times is equal to the shortest duration.

[0028] According to a fan speed statistics method provided by the present invention, when the refresh enable signal is valid, the real-time period in the fan real-time speed register is latched into the fan speed register, comprising:

[0029] When the refresh enable signal is valid and all bits of the fan real-time speed register are 1, the real-time cycle in the fan real-time speed register is latched into the fan speed register;

[0030] When the refresh enable signal is valid and the valid edge of the pulse corresponding to the fan synchronization tach signal arrives, the real-time cycle of the fan real-time speed register is updated, and the updated real-time cycle is latched into the fan speed register.

[0031] According to a fan speed statistics method provided by the present invention, before generating a timing pulse with a preset time interval with the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, the method further includes:

[0032] The fan asynchronous tach signal is acquired, and the jitter signal at the edge of the fan asynchronous tach signal is filtered to obtain the fan synchronous tach signal.

[0033] According to a fan speed statistics method provided by the present invention, the effective edge of the pulse corresponding to the fan synchronous tach signal is a falling edge.

[0034] The present invention also provides a fan speed statistics device, comprising:

[0035] A timer module, used to generate a timing pulse with a preset time interval, taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point;

[0036] The real-time speed statistics module is used to count the number of the timing pulses between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time speed of the fan.

[0037] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a fan speed statistics method as described above is implemented.

[0038] The present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the fan speed statistics method described in any one of the above methods is implemented.

[0039] In the fan speed statistics method and device provided by the present invention, the number of the timing pulses is counted between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time cycle of the fan synchronous tach signal, and the timing pulse is generated starting from the valid edge of the pulse corresponding to the fan synchronous tach signal, so that the real-time cycle of the fan can be accurately counted, that is, the real-time speed of the fan can be accurately obtained. In addition, in this embodiment, a cycle of fan rotation is directly timed, and compared with the traditional solution of counting the number of pulses within 1 minute, the duration of a cycle is much less than 1 minute, which shortens the fan speed statistics time and improves the efficiency of obtaining the fan speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 is a schematic diagram of a hardware system architecture that can be used in the fan speed statistics method provided by the present invention;

[0042] Figure 2 This is one of the flow charts of the fan speed statistics method provided by the present invention;

[0043] Figure 3 This is the second flow chart of the fan speed statistics method provided by the present invention;

[0044] Figure 4 This is the third flow chart of the fan speed statistics method provided by the present invention;

[0045] Figure 5 This is the fourth flow chart of the fan speed statistics method provided by the present invention;

[0046] Figure 6 This is the fifth flow chart of the fan speed statistics method provided by the present invention;

[0047] Figure 7 It is a schematic diagram of the structure of the firmware responsible for fan speed statistics in the hardware system architecture that can be used by the fan speed statistics method provided by the present invention;

[0048] Figure 8 It is a structural schematic diagram of a fan speed statistics device provided by the present invention;

[0049] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. 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.

[0051] The fan speed statistics method of the embodiment of the present invention can be (but is not limited to) based on Figure 1 The system architecture is implemented, specifically, Figure 1The system architecture includes BMC and CPLD. BMC includes I2C_Master module. CPLD includes: I2C_Slave module, clock_rst_manage module, register_space module, fcb_basic_reg module, fcb_misc_reg module and fan_reg module. Among them, I2C_Master is mainly responsible for communicating with I2C_Slave of CPLD, clock_rst_manage is mainly responsible for clock signal and reset signal management; fcb_basic_reg is mainly responsible for fan tray firmware version number, fan hardware version number, firmware release date, fan tray code and watchdog management; fcb_misc_reg is mainly responsible for fan tray FRU (Field Replace Unit, field replaceable unit), board interrupt and manufacturer and other global information management; fan_reg is mainly responsible for fan speed control, fan interrupt, fan in place, fan wind direction and fan speed statistics and other functions; register_space module is used to allocate register addresses for fcb_basic_reg module, fcb_misc_reg module and fan_reg module when running. Since the embodiment of the present invention is a fan speed statistics method, only the firmware fan_reg needs to be improved at the software level, which will not affect the existing hardware design, thereby reducing the complexity of system hardware solution design.

[0052] The fan speed counting method according to the embodiment of the present invention has the following specific process: Figure 2 As shown, including:

[0053] Step S210: Generate a timing pulse with a preset time interval, taking the effective edge of the pulse corresponding to the fan synchronous tach signal as the starting point. The tach signal is a pulse signal that indicates the speed of the fan, and its frequency is proportional to the speed of the fan. In other words, the higher the fan speed, the higher the frequency of the tach signal. Therefore, the fan speed can be counted by measuring the frequency or period of the tach signal. In this step, the timing starts when the effective edge of the pulse corresponding to the fan synchronous tach signal arrives, and a timing pulse with a preset time interval is generated, which can effectively and accurately count the time between two adjacent effective edges, that is, the real-time period of fan rotation.

[0054] Step S220: between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time cycle of the fan synchronous tach signal, and the real-time cycle is used to determine the real-time rotation speed of the fan. Since the time between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal is the rotation cycle of the fan, counting the number of timing pulses between two adjacent valid edges is equivalent to counting the real-time cycle of the fan rotation (because the number of timing pulses multiplied by the preset time interval is the time required for the current fan to rotate one circle, that is, the real-time cycle expressed in time), therefore, the real-time cycle of this embodiment is a real-time cycle represented by the number of timing pulses. Since there is a fixed relationship between the rotation cycle and the rotation speed of the fan (the number of real-time cycles contained in 1 minute is the real-time rotation speed), counting the real-time cycle of the fan is equivalent to counting the real-time rotation speed of the fan. Among them, the smaller the preset time interval of the timing pulse, the more accurate the timing and the smaller the error. Preferably, the preset time interval is 2us.

[0055] In the fan speed statistics method of the embodiment of the present invention, the number of the timing pulses is counted between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time cycle of the fan synchronous tach signal, and the timing pulse is generated starting from the valid edge of the pulse corresponding to the fan synchronous tach signal, so that the real-time cycle of the fan can be accurately counted, that is, the real-time speed of the fan can be accurately obtained. In addition, in this embodiment, a cycle of fan rotation is directly timed. Compared with the traditional solution of counting the number of pulses within 1 minute, the duration of a cycle is much less than 1 minute, which shortens the fan speed statistics time and improves the efficiency of obtaining the fan speed.

[0056] In some embodiments, the specific process of step S210 is as follows: Figure 3 As shown, the following steps are included:

[0057] The effective edge of the pulse corresponding to the fan synchronous tach signal is detected. Specifically, a 2-bit shift register is used to left-shift the fan synchronous tach signal to detect whether the effective edge arrives.

[0058] When the valid edge arrives, the counting variable us_cnt is cleared and the counting variable is accumulated according to the preset clock cycle and step size 1. Otherwise, the counting variable is accumulated according to the preset clock cycle and step size 1. The preset clock cycle is the system clock cycle of the device where the fan is located, for example: 20ns, Figure 3 In the code, us_cnt++ means that us_cnt is incremented by 1 at every preset clock cycle.

[0059] When the counting variable is accumulated to a predetermined number of times, the timing pulse is output, otherwise, the counting variable is accumulated with a preset clock cycle and step size 1, wherein the predetermined number of times is obtained by dividing the preset time interval by the preset clock cycle. For example, if the preset time interval is 2us, then the preset number of times is 2us / 20ns=100 times, that is, after us_cnt++ counts 100 times, a timing pulse is output.

[0060] In this embodiment, a timing pulse for counting the real-time cycle of the fan is generated by using the system clock cycle and counting method. The implementation is simple and can be realized without changing the hardware.

[0061] In some embodiments, the specific process of step S220 is as follows: Figure 4 As shown, the following steps are included:

[0062] The effective edge of the pulse corresponding to the fan synchronous tach signal is detected. Specifically, a 2-bit shift register is used to left-shift the fan synchronous tach signal to detect whether the effective edge arrives.

[0063] When the valid edge arrives, the real-time period is cleared and it is determined whether the timing pulse arrives. Otherwise, it is directly determined whether the timing pulse arrives.

[0064] When the timing pulse arrives, the real-time period is accumulated in step 1, otherwise, the real-time period is kept unchanged.

[0065] In this embodiment, when the effective edge of the pulse corresponding to the fan synchronization tach signal arrives, the timing pulses are cleared and then counted, and the number of the counted timing pulses between two adjacent falling edges can represent the real-time cycle of the fan.

[0066] In some embodiments, Figure 2 As shown, after step S220, the following steps are also included:

[0067] Step S230: storing the real-time cycle in the fan real-time speed register. Since the smaller the preset time interval of the timing pulse is, the more timing pulses correspond to one cycle, and the more data bits need to be stored, therefore, in actual use, the fan real-time speed register preferably can use a 16-bit to 32-bit register. A register with a larger storage capacity can store more bits of data, so that a smaller preset time interval can be used, that is, a clock with higher time accuracy can be used to count the real-time cycle of the fan, and the error of the final counted fan real-time speed is smaller.

[0068] Step S240: The refresh enable signal of the fan speed register is set to be valid based on the fan speed reading signal. The fan speed register is a register accessed by an external program, and the fan speed register is used by the external program to read the real-time cycle of the fan therefrom. After the external program reads the real-time cycle (i.e., the number of timing pulses), the real-time cycle of the current fan rotation expressed in time is obtained by multiplying the number of timing pulses by the preset time interval, and then the number of real-time cycles expressed in time within 1 minute is counted to obtain the real-time speed of the fan.

[0069] It should be noted that the clock_rst_manage module can manage the timing pulses and transmit the preset time interval of the timing pulses as parameters through the I2C_Slave of the CPLD to the I2C_Master module of the BMC, so that the external program can access the BMC to obtain the preset time interval of the timing pulses, and finally calculate the real-time speed of the fan.

[0070] Step S250: When the refresh enable signal is valid, the real-time cycle in the fan real-time speed register is latched into the fan speed register. In this embodiment, when the refresh enable signal is true, it indicates that the external program wants to obtain the real-time speed of the fan. Therefore, the real-time cycle in the fan real-time speed register is latched into the fan speed register, so that the external program can read the real-time cycle of the fan from the fan speed register, and then obtain the real-time speed of the fan.

[0071] In some embodiments, the specific process of step S240 is as follows: Figure 5 As shown, the following steps are included:

[0072] A fan-related register read signal is received. The fan-related register read signal may be a signal initiated by the BMC. The fan-related register may be a fan speed register, a fan interrupt register, a fan in-position register, and the like.

[0073] Determine whether the read address of the fan-related register read signal is the fan speed register. Specifically, compare the address in the fan-related register read signal with the address of the fan speed register. If they are consistent, it means that the fan speed register is currently being read.

[0074] When the read address is the fan speed register, the refresh counter refresh_cnt is cleared to zero and it is determined whether the preset timing duration has been reached, otherwise, it is directly determined whether the preset timing duration has been reached. The preset timing duration can be set according to actual conditions, for example: 25ms.

[0075] When the preset timing duration is reached, the refresh counter refresh_cnt is incremented by 1, otherwise, the refresh counter refresh_cnt remains unchanged.

[0076] It is determined whether the refresh counter refresh_cnt reaches the cumulative number of times. When the cumulative number of times is reached, the refresh enable signal is set to the enable valid level, otherwise, the refresh enable signal maintains the enable invalid level. When the refresh enable signal is set to the enable valid level, the external program can read data from the fan speed register.

[0077] In this embodiment, the preset timing duration and the accumulated number of times are determined based on the shortest duration for completing the reading of the fan speed register, and the product of the preset timing duration and the accumulated number of times is equal to the shortest duration. For example, if the shortest duration for completing the reading of the fan speed register is 200ms and the preset timing duration is 25ms, then the accumulated number of times is 8.

[0078] In this embodiment, through the specific process of setting the refresh enable signal of the fan speed register based on the fan speed reading signal to be effective, it is ensured that the fan speed register is not updated within the shortest time to complete the reading of the fan speed register, so as to ensure that the correct data is read. After the external program completes the data reading, the value of the fan speed register is updated in real time.

[0079] In some embodiments, step S250 specifically includes:

[0080] When the refresh enable signal is valid and all bits of the fan real-time speed register are 1, the real-time cycle in the fan real-time speed register is latched into the fan speed register. If all bits of the fan real-time speed register are 1, it means that the fan has stopped (for a long time), because after the fan stops, the fan synchronization tach signal will not be generated, and no valid edge will arrive. Then the number of timing pulses will continue to accumulate, resulting in a large number accumulated, making all bits of the fan real-time speed register 1. In the case of fan stop, the value of the fan real-time speed register (the value of all bits being 1) is latched into the fan speed register, and the external program reads the value to obtain the information that the fan has stopped.

[0081] When the refresh enable signal is valid and the effective edge of the pulse corresponding to the fan synchronous tach signal arrives, the real-time cycle of the fan real-time speed register is updated, and the updated real-time cycle is latched into the fan speed register. When the refresh enable signal is valid and the effective edge of the pulse corresponding to the fan synchronous tach signal arrives, the updated real-time cycle needs to be latched into the fan speed register so that the external program can obtain the latest real-time cycle.

[0082] In some embodiments, before step S210, the method further includes: obtaining a fan asynchronous tach signal, filtering a jitter signal at the edge of the fan asynchronous tach signal, to obtain the fan synchronous tach signal. Specifically, Figure 6 As shown, the fan asynchronous tach signal is shifted to the left. The fan asynchronous tach signal can be shifted to the left through a 4-bit to 8-bit shift register. For example, the signal edge jitter is usually within the range of 100ns, and each shift of the register is 20ns. Therefore, a 5-bit shift register can be used. Then, it is determined whether the 5-bit shift register is all 1. When all 5 bits are 1, the fan tach signal is assigned to 1. Otherwise, it is determined whether the 5-bit shift register is all 0. When all 5 bits are 0, the fan tach signal is assigned to 0. Otherwise, the fan speed register value remains unchanged (the fan speed has not yet been counted, so the fan speed register value remains unchanged). The 5-bit shift register continues to shift the external fan asynchronous tach signal into the 5-bit shift register in sequence to continue to judge. This processing method is intended to filter the abnormal situation of the fan asynchronous tach signal edge being too slow or the fan speed signal jittering, obtain the fan synchronous tach signal, avoid the abnormal fan speed statistics caused by abnormal conditions, and further improve the reliability and accuracy of the fan speed statistics.

[0083] In some embodiments, the effective edge of the pulse corresponding to the fan synchronous tach signal is the falling edge. Due to the limitation of hardware performance, the rising edge of the pulse corresponding to the fan synchronous tach signal is relatively slow. Using the rising edge will lead to inaccurate statistics of the duration between two adjacent rising edges, and the falling edge is steeper than the rising edge. Therefore, using the falling edge is more accurate for statistics of the duration between two adjacent falling edges, that is, the statistics of the real-time cycle are more accurate, thereby obtaining a more accurate real-time fan speed.

[0084] In practical applications, the method of the above embodiment can be implemented in the form of firmware in CPLD. Specifically, the firmware is Figure 1 The fan_reg module in the fan_reg module can use (but is not limited to) Figure 7 The firmware design structure, the fan_reg module includes: fan_debounce module, fan_speed_real module, 2us_timer module, fan_fresh_en module, fan_speed module, fan_present module, fan_int module and fan_speed_ctrl module.

[0085] Among them, the fan_debounce module mainly debounces the fan asynchronous tach signal, and inputs the debounced fan synchronous tach signal to the fan_speed_real module and the 2us_timer module.

[0086] The 2us_timer module is used to generate a timing pulse with a preset time interval, taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, and input the timing pulse to the fan_speed_real module.

[0087] The fan_speed_real module is used to count the number of the timing pulses between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time period of the fan synchronous tach signal, and store the real-time period in the fan real-time speed register.

[0088] The fan_fresh_en module is used to set the refresh enable signal of the fan speed register to be valid based on the fan speed reading signal, and input the valid refresh enable signal to the fan_speed module.

[0089] The fan_speed module is mainly used to maintain and update the fan speed register. When the refresh enable signal is valid, the real-time cycle in the fan real-time speed register is latched into the fan speed register.

[0090] The other three modules: fan_present module, fan_int module and fan_speed_ctrl module are used for the management of fan presence, fan interruption and fan speed control, which are basically the same as the implementation methods in the existing related technologies and will not be repeated here.

[0091] The fan speed statistics device provided by the present invention is described below. The fan speed statistics device described below and the fan speed statistics method described above can be referred to each other.

[0092] The fan speed counting device provided by the present invention is as follows: Figure 8 As shown, the device comprises:

[0093] The timer module 810 is used to generate a timing pulse with a preset time interval, taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point.

[0094] The real-time speed statistics module 820 is used to count the number of the timing pulses between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time speed of the fan.

[0095] In the fan speed counting device of the present invention, the number of the timing pulses is counted between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time cycle of the fan synchronous tach signal, and the timing pulse is generated starting from the valid edge of the pulse corresponding to the fan synchronous tach signal, so that the real-time cycle of the fan can be accurately counted, that is, the real-time speed of the fan can be accurately obtained. In addition, in this embodiment, a cycle of the fan rotation is directly timed. Compared with the traditional solution of counting the number of pulses within 1 minute, the duration of a cycle is much less than 1 minute, which shortens the fan speed counting time and improves the efficiency of obtaining the fan speed.

[0096] Optionally, the timer module 810 is specifically used to detect the effective edge of the pulse corresponding to the fan synchronization tach signal; when the effective edge arrives, the counting variable is cleared and the counting variable is accumulated according to a preset clock cycle and a step of 1, otherwise, the counting variable is accumulated according to a preset clock cycle and a step of 1; when the counting variable is accumulated to a predetermined number of times, the timing pulse is output, otherwise, the counting variable is accumulated continuously according to the preset clock cycle and a step of 1, wherein the predetermined number of times is obtained by dividing a preset time interval by the preset clock cycle.

[0097] Optionally, the real-time speed statistics module 820 is specifically used to detect the effective edge of the pulse corresponding to the fan synchronization tach signal; when the effective edge arrives, the real-time cycle is cleared and it is determined whether the timing pulse has arrived, otherwise, it is directly determined whether the timing pulse has arrived; when the timing pulse arrives, the real-time cycle is accumulated in step 1, otherwise, the real-time cycle is kept unchanged.

[0098] Optionally, the real-time speed statistics module 820 is further configured to store the real-time cycle in a fan real-time speed register, and the fan speed statistics device further includes:

[0099] The refresh module 830 is used to set the refresh enable signal of the fan speed register to be valid based on the fan speed reading signal.

[0100] The speed latch module 840 is used to latch the real-time period in the fan real-time speed register into the fan speed register when the refresh enable signal is valid.

[0101] Optionally, the refresh module 830 is specifically used to receive a fan-related register read signal; determine whether the read address of the fan-related register read signal is the fan speed register; when the read address is the fan speed register, clear the refresh counter and determine whether the preset timing duration has been reached, otherwise, directly determine whether the preset timing duration has been reached; when the preset timing duration is reached, the refresh counter is increased by 1, otherwise, the refresh counter remains unchanged; determine whether the refresh counter has reached the cumulative number of times, and when the cumulative number of times is reached, set the refresh enable signal to an enable valid level, otherwise, the refresh enable signal maintains an enable invalid level; wherein the preset timing duration and the cumulative number of times are determined based on the shortest duration for completing the reading of the fan speed register, and the product of the preset timing duration and the cumulative number of times is equal to the shortest duration.

[0102] Optionally, the speed latch module 840 is specifically used to latch the real-time period in the fan real-time speed register into the fan speed register when the refresh enable signal is valid and all bits of the fan real-time speed register are 1; when the refresh enable signal is valid and the effective edge of the pulse corresponding to the fan synchronization tach signal arrives, update the real-time period of the fan real-time speed register and latch the updated real-time period into the fan speed register.

[0103] Optionally, the fan speed statistics device also includes: a signal de-jitter module 850, which is used to obtain the fan asynchronous tach signal before generating a timing pulse with a preset time interval with the effective edge of the pulse corresponding to the fan synchronous tach signal as the starting point, and filter the jitter signal on the edge of the fan asynchronous tach signal to obtain the fan synchronous tach signal.

[0104] Optionally, the effective edge of the pulse corresponding to the fan synchronization tach signal is a falling edge.

[0105] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the fan speed statistics method, which includes:

[0106] A timing pulse with a preset time interval is generated with the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point.

[0107] Between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time rotation speed of the fan.

[0108] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0109] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the fan speed statistics method provided by the above methods, the method includes:

[0110] A timing pulse with a preset time interval is generated with the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point.

[0111] Between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time rotation speed of the fan.

[0112] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the fan speed statistics method provided by the above methods is implemented, and the method includes:

[0113] A timing pulse with a preset time interval is generated with the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point.

[0114] Between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time rotation speed of the fan.

[0115] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fan speed statistics method, characterized in that: include: Taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, a timing pulse with a preset time interval is generated; Between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time rotation speed of the fan.

2. The fan speed statistics method according to claim 1, characterized in that: Taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, a timing pulse with a preset time interval is generated, including: Detecting the effective edge of the pulse corresponding to the fan synchronous tach signal; When the valid edge arrives, the counting variable is cleared to zero, and the counting variable is accumulated according to the preset clock cycle and step size 1; otherwise, the counting variable is accumulated according to the preset clock cycle and step size 1; When the counting variable is accumulated to a predetermined number of times, the timing pulse is output; otherwise, the counting variable is accumulated continuously with a preset clock cycle and a step of 1, wherein the predetermined number of times is obtained by dividing a preset time interval by the preset clock cycle.

3. The fan speed statistics method according to claim 1, characterized in that: Between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal, the number of the timing pulses is counted to obtain the real-time period of the fan synchronous tach signal, including: Detecting the effective edge of the pulse corresponding to the fan synchronous tach signal; When the effective edge arrives, the real-time cycle is cleared and it is determined whether the timing pulse arrives, otherwise, it is directly determined whether the timing pulse arrives; When the timing pulse arrives, the real-time period is accumulated in step 1, otherwise, the real-time period remains unchanged.

4. The fan speed statistics method according to claim 1, characterized in that: After obtaining the real-time cycle of the fan synchronous tach signal, it also includes: Storing the real-time cycle in a fan real-time speed register; The refresh enable signal of the fan speed register is set to be valid based on the fan speed reading signal; When the refresh enable signal is valid, the real-time period in the fan real-time speed register is latched into the fan speed register.

5. The fan speed statistics method according to claim 4, characterized in that: The refresh enable signal of the fan speed register is set to be valid based on the fan speed reading signal, including: Receive fan-related register read signals; Determine whether the read address of the fan-related register read signal is the fan speed register; In the case where the read address is the fan speed register, the refresh counter is cleared to zero, and it is determined whether the preset timing duration has been reached; otherwise, it is directly determined whether the preset timing duration has been reached; When the preset timing duration is reached, the refresh counter is incremented by 1, otherwise, the refresh counter remains unchanged; Determine whether the refresh counter reaches the cumulative number of times, and when the cumulative number of times is reached, set the refresh enable signal to an enable valid level, otherwise, the refresh enable signal maintains an enable invalid level; The preset timing duration and the accumulated number of times are determined based on the shortest duration for completing reading the fan speed register, and the product of the preset timing duration and the accumulated number of times is equal to the shortest duration.

6. The fan speed statistics method according to claim 4, characterized in that: When the refresh enable signal is valid, latching the real-time cycle in the fan real-time speed register into the fan speed register includes: When the refresh enable signal is valid and all bits of the fan real-time speed register are 1, the real-time cycle in the fan real-time speed register is latched into the fan speed register; When the refresh enable signal is valid and the valid edge of the pulse corresponding to the fan synchronous tach signal arrives, the real-time cycle of the fan real-time speed register is updated, and the updated real-time cycle is latched into the fan speed register.

7. The fan speed statistics method according to any one of claims 1 to 6, characterized in that: Before generating a timing pulse with a preset time interval with the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point, the method further includes: The fan asynchronous tach signal is acquired, and the jitter signal at the edge of the fan asynchronous tach signal is filtered to obtain the fan synchronous tach signal.

8. The fan speed statistics method according to any one of claims 1 to 6, characterized in that: The effective edge of the pulse corresponding to the fan synchronous tach signal is the falling edge.

9. A fan speed statistics device, characterized in that: include: A timer module, used to generate a timing pulse with a preset time interval, taking the effective edge of the pulse corresponding to the fan synchronization tach signal as the starting point; The real-time speed statistics module is used to count the number of the timing pulses between two adjacent valid edges of the pulse corresponding to the fan synchronous tach signal to obtain the real-time period of the fan synchronous tach signal, and the real-time period is used to determine the real-time speed of the fan.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the fan speed statistics method according to any one of claims 1 to 8 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fan speed statistics method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Rotating speed integration method and circuit for data acquisition

    CN120195422A

  • Method and device for detecting rotating speed of fan and electronic equipment

    CN121299155A