CN114837979B - Fan control method and system - Google Patents

Fan control method and system Download PDF

Info

Publication number
CN114837979B
CN114837979B CN202210508404.6A CN202210508404A CN114837979B CN 114837979 B CN114837979 B CN 114837979B CN 202210508404 A CN202210508404 A CN 202210508404A CN 114837979 B CN114837979 B CN 114837979B
Authority
CN
China
Prior art keywords
fan
real
time
rotating speed
gpio pin
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210508404.6A
Other languages
Chinese (zh)
Other versions
CN114837979A (en
Inventor
叶剑文
王赞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Changfeng Technology Beijing Co Ltd
Original Assignee
Lenovo Changfeng Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Changfeng Technology Beijing Co Ltd filed Critical Lenovo Changfeng Technology Beijing Co Ltd
Priority to CN202210508404.6A priority Critical patent/CN114837979B/en
Publication of CN114837979A publication Critical patent/CN114837979A/en
Application granted granted Critical
Publication of CN114837979B publication Critical patent/CN114837979B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F04POSITIVE - DISPLACEMENT MACHINES FOR LIQUIDS; PUMPS FOR LIQUIDS OR ELASTIC FLUIDS
    • F04DNON-POSITIVE-DISPLACEMENT PUMPS
    • F04D27/00Control, e.g. regulation, of pumps, pumping installations or pumping systems specially adapted for elastic fluids
    • F04D27/004Control, e.g. regulation, of pumps, pumping installations or pumping systems specially adapted for elastic fluids by varying driving speed
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a fan control method and a system, which relate to the field of artificial intelligence, wherein the method comprises the following steps: obtaining a first MCU of a first fan based on preset functional conditions; determining a first USB interface according to the first GPIO lead angle, and determining a first fan interface according to the second GPIO lead angle, wherein the first fan interface is of a 4pin structure; determining a first PWM, a first FG; obtaining a first duty ratio based on a terminal, and modulating to obtain a first PWM square wave; acquiring a first real-time monitoring result from the first FG real-time monitoring, and further acquiring a first real-time rotating speed through calculation; and the terminal displays the first real-time rotating speed in real time according to the first USB interface. The problems of complex fan rotating speed control operation and low control precision in the prior art are solved. The remote control of the fan rotating speed is achieved, the control accuracy is improved, the fan rotating speed is displayed in real time, and a basic technical effect is provided for performance test in the development stage of the fan.

Description

Fan control method and system
Technical Field
The application relates to the field of artificial intelligence, in particular to a fan control method and system.
Background
The fan rotates at a certain speed to effectively dissipate heat of machine systems such as servers. In the prior art, when a fan is used for heat dissipation treatment, the fan is usually connected to a power supply with controllable voltage, and then the power supply voltage is manually adjusted, so that the rotation speed of the fan is correspondingly adjusted to be increased or decreased, in the process, subjective analysis is generally carried out according to historical adjustment experience by manual adjustment, and then the voltage adjustment amplitude is determined and manually set, so that the voltage adjustment is not specific and accurate, and the problems that the fan rotation speed control precision is low and the fan rotation speed control cannot be quantized are further caused. In the development stage of the fan, the air quantity, noise, heat dissipation effect and the like under the specific fan rotating speed condition are determined in a test and other modes, the adjustment and control of the fan rotating speed are precisely quantized, the accurate and reliable detection result is further ensured, and finally the research and development of the fan are promoted, and the usability of research and development results is ensured. The research utilizes computer technology to carry out accurate, direct-viewing control to the rotational speed of fan, has important meaning.
However, in the prior art, the fan is usually connected to a power source with controllable voltage, and the required fan rotation speed is obtained by manually adjusting the voltage, so that the fan rotation speed control operation is complex, and the control precision is low.
Disclosure of Invention
The application aims to provide a fan control method and a system, which are used for solving the technical problems that in the prior art, a fan is usually connected to a power supply with controllable voltage, the required fan rotating speed is obtained by manually adjusting the voltage, the fan rotating speed control operation is complex, and the control precision is low.
In view of the above, the present application provides a method and a system for controlling a fan.
In a first aspect, the present application provides a fan control method, which is implemented by a fan control system, where the method includes: obtaining a first MCU of a first fan based on preset functional conditions, wherein the first MCU comprises a first GPIO pin and a second GPIO pin; determining a first USB interface according to the first GPIO pin, and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure; determining a first PWM and a first FG according to the 4pin structure; obtaining a first duty cycle based on a terminal, wherein the first duty cycle accords with a preset duty cycle threshold; modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; based on the first PWM square wave, carrying out real-time monitoring on the first FG to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time; calculating to obtain a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan; and the terminal displays the first real-time rotating speed in real time according to the first USB interface.
In a second aspect, the present application also provides a fan control apparatus for performing a fan control method according to the first aspect, the apparatus comprising: the MCU is provided with a serial port function; the first GPIO pin is arranged on the MCU, is a USB interface and is used for supplying power to the fan control device and simultaneously reading and transmitting a fan rotating speed signal; the second GPIO pin is parallel to the first GPIO pin and is also arranged on the MCU, and the second GPIO pin is used for calculating the rotating speed of the fan; and the terminal is in communication connection with the MCU and is used for modulating the rotating speed of the fan and simultaneously receiving and displaying the rotating speed signal of the fan transmitted by the first GPIO pin in real time.
In a third aspect, the present application further provides a fan control system for performing a fan control method according to the first aspect, wherein the system comprises: the first obtaining unit is used for obtaining a first MCU of the first fan based on preset functional conditions, wherein the first MCU comprises a first GPIO pin and a second GPIO pin; the first determining unit is used for determining a first USB interface according to the first GPIO pin and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure; the second determining unit is used for determining a first PWM and a first FG according to the 4pin structure; the second obtaining unit is used for obtaining a first duty cycle based on the terminal, wherein the first duty cycle accords with a preset duty cycle threshold; the third obtaining unit is used for modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; the fourth obtaining unit is used for carrying out real-time monitoring on the first FG based on the first PWM square wave to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time; the fifth obtaining unit is used for calculating and obtaining a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan; the first execution unit is used for displaying the first real-time rotating speed in real time by the terminal according to the first USB interface.
In a fourth aspect, an electronic device includes a processor and a memory;
the processor for processing steps of performing any of the methods of the first aspect above;
the memory is coupled to the processor for storing a program that, when executed by the processor, causes the system to perform the steps of any of the methods of the first aspect described above.
In a fifth aspect, a computer readable storage medium has stored thereon a computer program which, when executed, implements the steps of any of the methods of the first aspect described above.
In a sixth aspect, a computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the steps of any of the methods of the first aspect described above.
One or more technical schemes provided by the application have at least the following technical effects or advantages:
1. the method comprises the steps of respectively setting a USB interface and a fan interface on an MCU based on the MCU with a serial port function, wherein the fan interface is of a 4pin structure; then modulating PWM in the 4pin structure at the terminal, further counting the square wave number of FG signals, and calculating to obtain the rotating speed of the fan based on the counted square wave number; and finally, sending the fan rotating speed to a bus switching chip by a USART pin, further converting the USART signal into a USB signal by the bus switching chip, transmitting the USB signal back to the terminal, and finally displaying the fan rotating speed in real time by the terminal. The accurate control of the fan rotating speed is realized through the modulation of the terminal to PWM, the accurate and specific fan rotating speed is obtained based on the square wave quantity calculation of FG signals, the rotating speed signals are further converted and transmitted by using the bus switching chip, the remote control of the fan rotating speed is achieved, the fan rotating speed control accuracy is improved, the specific fan rotating speed is displayed in real time, and the reliable and specific rotating speed data base technical effect is provided for the performance test in the development stage of the fan.
2. Through conversion and transmission of the fan rotating speed signals, the purpose of displaying the fan rotating speed in real time at the terminal is finally achieved, the fan rotating speed visualization is achieved, and a basic effect is provided for the detection of each performance of the fan at a specific fan rotating speed in the development stage of the fan.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
In order to more clearly illustrate the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described below, it being obvious that the drawings in the description below are only exemplary and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a fan control method according to the present application;
FIG. 2 is a flow chart illustrating a method for determining a first fan interface according to the present application;
FIG. 3 is a flow chart illustrating a real-time display of a first real-time rotational speed in a fan control method according to the present application;
FIG. 4 is a schematic diagram of a fan control apparatus according to the present application;
FIG. 5 is a schematic diagram of a fan control system according to the present application;
fig. 6 is a schematic structural diagram of an exemplary electronic device of the present application.
Reference numerals illustrate:
MCU100, first GPIO pin 110, second GPIO pin 120, terminal 200, first acquisition unit 11, first determination unit 12, second determination unit 13, second acquisition unit 14, third acquisition unit 15, fourth acquisition unit 16, fifth acquisition unit 17, first execution unit 18, bus 300, receiver 301, processor 302, transmitter 303, memory 304, bus interface 305.
Detailed Description
The application solves the technical problems that in the prior art, a fan is usually connected to a power supply with controllable voltage, the required fan rotating speed is obtained by manually adjusting the voltage, the fan rotating speed control operation is complex, and the control precision is low. The accurate control of the fan rotating speed is realized through the modulation of the terminal to PWM, the accurate and specific fan rotating speed is obtained based on the square wave quantity calculation of FG signals, the rotating speed signals are further converted and transmitted by using the bus switching chip, the remote control of the fan rotating speed is achieved, the fan rotating speed control accuracy is improved, the specific fan rotating speed is displayed in real time, and the reliable and specific rotating speed data base technical effect is provided for the performance test in the development stage of the fan.
The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
In the following, the technical solutions of the present application will be clearly and completely described with reference to the accompanying drawings, and it should be understood that the described embodiments are only some embodiments of the present application, but not all embodiments of the present application, and that the present application is not limited by the exemplary embodiments described herein. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. It should be further noted that, for convenience of description, only some, but not all of the drawings related to the present application are shown.
The application provides a fan control method, which is applied to a fan control system, wherein the method comprises the following steps: obtaining a first MCU of a first fan based on preset functional conditions, wherein the first MCU comprises a first GPIO pin and a second GPIO pin; determining a first USB interface according to the first GPIO pin, and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure; determining a first PWM and a first FG according to the 4pin structure; obtaining a first duty cycle based on a terminal, wherein the first duty cycle accords with a preset duty cycle threshold; modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; based on the first PWM square wave, carrying out real-time monitoring on the first FG to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time; calculating to obtain a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan; and the terminal displays the first real-time rotating speed in real time according to the first USB interface.
Having described the basic principles of the present application, various non-limiting embodiments of the present application will now be described in detail with reference to the accompanying drawings.
Example 1
Referring to fig. 1, the present application provides a fan control method, wherein the method is applied to a fan control system, and the method specifically includes the following steps:
step S100: based on a preset functional condition, a first MCU of a first fan is obtained, wherein the first MCU comprises a first GPIO pin and a second GPIO pin;
further, the preset function condition refers to a serial port function.
Specifically, the fan control method is applied to the fan control system, the fan rotating speed can be accurately modulated through terminal setting, and meanwhile, the accurate rotating speed of the fan is determined through intelligent calculation and displayed in real time. The first fan refers to any fan which is to be used for intelligently controlling the rotating speed of the fan by using the fan control system. The preset function condition is a serial port function, and is a basic function which the first MCU in the first fan should have for performing intelligent fan rotation speed modulation by using the fan control system. The first MCU is a micro control unit of the first fan, and the preset functional condition is a functional condition that the first MCU should have, that is, the serial port function, that is, the expansion interface of the first MCU should be capable of utilizing a serial communication mode. In addition, the first MCU includes a first GPIO pin, a second GPIO pin. Wherein the first GPIO pin and the second GPIO pin are different, i.e. the first MCU should be provided with at least two GPIO pins. The GPIO refers to a general purpose input/output port, for example, a USB interface port. The pins refer to wires leading from the internal circuits of the integrated circuit to the peripheral circuits. Through confirming the MCU which accords with the preset functional condition and simultaneously has at least two GPIO pins, the technical effect of providing a chip foundation for the follow-up intelligent control of the rotating speed of the fan is achieved.
Step S200: determining a first USB interface according to the first GPIO pin, and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure;
step S300: determining a first PWM and a first FG according to the 4pin structure;
further, as shown in fig. 2, step S200 of the present application further includes:
step S210: obtaining a first GND and a first 5V, wherein the first GND and the first 5V are connected with the first USB interface;
step S220: obtaining a first PWM and a first FG, wherein the first PWM is used for fan speed modulation, and the first FG is used for fan speed calculation;
step S230: obtaining the 4pin structure according to the first GND, the first 5V, the first PWM and the first FG;
step S240: and obtaining the second GPIO pin according to the 4pin structure, and taking the second GPIO pin as the first fan interface.
Specifically, the first GPIO pin on the first MCU is used as a first USB interface of the first fan, and the second GPIO pin is used as a first fan interface of the first fan. The first USB interface is used for supplying power to the fan control system, and the first fan interface is of a 4pin structure. The first fan interface, namely the 4pin structure, comprises a first GND, a first 5V, a first PWM and a first FG. The first GND is a grounding point, namely a power supply negative electrode, and the first 5V is a power supply positive electrode, and is respectively connected with two ends of the first USB interface. The first PWM is pulse width modulation, and is used for modulating the rotation speed of the first fan, and the first FG represents the rotation speed of the fan. Through confirming USB interface, the fan interface of first MCU to set the fan interface into four foot structure, reached for follow-up intelligent control fan rotational speed, and then calculate the technical effect that the real-time rotational speed of fan provided chip structure basis.
Step S400: obtaining a first duty cycle based on the terminal, wherein the first duty cycle accords with a preset duty cycle threshold;
further, the preset duty cycle threshold is 0 to 100.
Specifically, the terminal is in communication connection with the fan control system, and the setting and the modulation of the fan rotation speed can be performed on the terminal. Firstly, a user obtains a first duty cycle through modulation based on the terminal, wherein the first duty cycle refers to any one PWM duty cycle from 0 to 100, namely, when the user sets the duty cycle at the terminal, the set duty cycle ranges from 0 to 100, namely, the preset duty cycle threshold value must be met. Wherein, the duty ratio refers to the proportion of the energizing time to the total time in one pulse cycle. By obtaining the first duty ratio, a specific and accurate fan rotating speed setting value is obtained, and therefore the technical aim of accurately regulating and controlling the fan rotating speed according to actual requirements is achieved.
Step S500: modulating the first PWM according to the first duty ratio to obtain a first PWM square wave;
specifically, according to the first duty ratio set by the user at the terminal, the system automatically modulates the first PWM based on the first duty ratio, and then outputs a PWM square wave, that is, the first PWM square wave. By carrying out adaptive automatic modulation on the first PWM after the first duty ratio is obtained, the technical effect of automatically modulating the rotating speed of the fan based on the user requirement is achieved.
Step S600: based on the first PWM square wave, carrying out real-time monitoring on the first FG to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time;
step S700: calculating to obtain a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan;
specifically, after the first duty ratio is obtained and the system is automatically modulated, the real-time monitoring of the FG signal is performed on the first FG again, so that the real-time rotating speed of the first fan is calculated and determined.
Firstly, counting the number of high-frequency square waves sent by FG signals in preset unit time, wherein the preset unit time is set in a system in advance after comprehensive analysis by a user based on the precision requirement of actual rotation speed modulation and the like. For example, the preset unit time is 30s, 1min, etc., then the statistics of the total number of the electric frequency square waves in 30s or 1min is meant. Then, based on that two high-frequency square waves are generated when the fan rotates once, the total number of the high-frequency square waves obtained by monitoring the chip is divided by 2, and the final number is the number of turns of the first fan in a preset unit time. And finally, determining the real-time rotating speed of the first fan, namely calculating and determining the first real-time rotating speed according to the first real-time monitoring result.
The chip is monitored by FG signal square wave quantity, and the first real-time rotating speed of the first fan is calculated and determined, so that the technical effects of determining the real-time rotating speed of the fan based on actual monitoring data and improving the reliability and accuracy of the real-time rotating speed of the fan are achieved.
Step S800: and the terminal displays the first real-time rotating speed in real time according to the first USB interface.
Further, as shown in fig. 3, step S800 of the present application further includes:
step S810: obtaining a first USART signal by using a USART pin, wherein the first USART signal refers to the USART signal of the first real-time rotating speed;
step S820: obtaining a first bus transfer chip of the first USB interface;
step S830: converting the first USART signal into a first USB signal by using the first bus transfer chip;
step S840: and displaying the first USB signal in real time based on the terminal.
Specifically, after the first real-time rotation speed of the first fan is calculated based on the number of square waves of the FG signal, the USART pin automatically converts the first real-time rotation speed into a first USART signal, and transmits the converted first USART signal. Wherein the USART pin is a universal synchronous/asynchronous serial receiver/transmitter. Further, after the first bus transfer chip of the first USB interface receives the first USART signal, the first USART signal is automatically converted into a first USB signal, and the first USB signal is displayed in real time through a terminal connected through communication. The first bus transfer chip is a transfer chip of a USB bus, and can realize USB transfer serial ports, USB transfer IrDA infrared or USB transfer printing ports. Such as CH340, for example. The first USB signal is the first real-time rotational speed. Through conversion and transmission of the fan rotating speed signals, the target of displaying the first real-time rotating speed of the first fan in real time at the terminal is finally achieved, and the technical effect of fan rotating speed visualization is achieved.
In summary, the fan control method provided by the application has the following technical effects:
1. the method comprises the steps of respectively setting a USB interface and a fan interface on an MCU based on the MCU with a serial port function, wherein the fan interface is of a 4pin structure; then modulating PWM in the 4pin structure at the terminal, further counting the square wave number of FG signals, and calculating to obtain the rotating speed of the fan based on the counted square wave number; and finally, sending the fan rotating speed to a bus switching chip by a USART pin, further converting the USART signal into a USB signal by the bus switching chip, transmitting the USB signal back to the terminal, and finally displaying the fan rotating speed in real time by the terminal. The accurate control of the fan rotating speed is realized through the modulation of the terminal to PWM, the accurate and specific fan rotating speed is obtained based on the square wave quantity calculation of FG signals, the rotating speed signals are further converted and transmitted by using the bus switching chip, the remote control of the fan rotating speed is achieved, the fan rotating speed control accuracy is improved, the specific fan rotating speed is displayed in real time, and the reliable and specific rotating speed data base technical effect is provided for the performance test in the development stage of the fan.
2. Through conversion and transmission of the fan rotating speed signals, the purpose of displaying the fan rotating speed in real time at the terminal is finally achieved, the fan rotating speed visualization is achieved, and a basic effect is provided for the detection of each performance of the fan at a specific fan rotating speed in the development stage of the fan.
Example two
As shown in fig. 4, the present application discloses a fan control apparatus for performing the steps of the method according to the first embodiment, wherein the fan control apparatus includes:
the MCU100, the said MCU100 possesses the serial port function;
the first GPIO pin 110, the first GPIO pin 110 is disposed on the MCU100, and the first GPIO pin 110 is a USB interface for powering the fan control device, and simultaneously reading and transmitting a fan rotation speed signal;
a second GPIO pin 120, where the second GPIO pin 120 is parallel to the first GPIO pin 110 and is also disposed on the MCU100, and the second GPIO pin 120 is used to calculate the fan rotation speed;
and the terminal 200 is in communication connection with the MCU100, and is used for modulating the fan rotating speed and simultaneously receiving and displaying the fan rotating speed signal transmitted by the first GPIO pin 110 in real time.
Specifically, the fan control device needs an MCU with serial port function and at least two GPIO pins. Such as STM32, STM8 micro chips, etc.
First, the fan control device includes an MCU100, and a first GPIO pin 110 and a second GPIO pin 120 are disposed on the MCU 100. The first GPIO pin 110 is a USB interface, and is configured to supply power to the fan control device, and read and transmit a fan rotation speed signal; the second GPIO pin 120 is used to calculate the fan speed. And then, the second GPIO pin 120 is used to monitor the number of FG signal square waves of the MCU100, and calculate and determine the real-time rotation speed of the fan according to the monitored result of the number of FG signal square waves. Further, the first GPIO pin 110 transmits the fan speed signal to the terminal 200, and the fan speed signal is displayed by the terminal 200 in real time. By setting the PWM at the terminal 200, the technical aim of remotely regulating and controlling the fan is fulfilled, and the technical effect of providing a reliable and specific rotating speed data basis for performance test in the development stage of the fan is further achieved by visualizing the real-time rotating speed of the fan.
Example III
Based on the same inventive concept as the method for controlling a fan in the foregoing embodiment, the present application further provides a fan control system, referring to fig. 5, including:
a first obtaining unit 11, where the first obtaining unit 11 is configured to obtain a first MCU of a first fan based on a preset functional condition, where the first MCU includes a first GPIO pin and a second GPIO pin;
a first determining unit 12, where the first determining unit 12 is configured to determine a first USB interface according to the first GPIO pin and determine a first fan interface according to the second GPIO pin, and the first fan interface is of a 4pin structure;
a second determining unit 13, where the second determining unit 13 is configured to determine a first PWM and a first FG according to the 4pin structure;
a second obtaining unit 14, where the second obtaining unit 14 is configured to obtain a first duty cycle based on a terminal, and the first duty cycle accords with a preset duty cycle threshold;
a third obtaining unit 15, where the third obtaining unit 15 is configured to modulate the first PWM according to the first duty cycle to obtain a first PWM square wave;
a fourth obtaining unit 16, where the fourth obtaining unit 16 is configured to monitor the first FG in real time based on the first PWM square wave, to obtain a first real-time monitoring result, where the first real-time monitoring result refers to a number of real-time square waves in a preset unit time;
a fifth obtaining unit 17, where the fifth obtaining unit 17 is configured to calculate and obtain a first real-time rotation speed according to the first real-time monitoring result, where the first real-time rotation speed is a real-time rotation speed of the first fan;
the first execution unit 18, where the first execution unit 18 is configured to display the first real-time rotation speed in real time according to the first USB interface.
Further, the system further comprises:
a sixth obtaining unit, configured to obtain a first GND and a first 5V, where the first GND and the first 5V are connected to the first USB interface;
a seventh obtaining unit configured to obtain a first PWM for fan speed modulation and a first FG for fan speed calculation;
an eighth obtaining unit configured to obtain the 4pin structure according to the first GND, the first 5V, the first PWM, the first FG;
the first setting unit is used for obtaining the second GPIO pin according to the 4pin structure and taking the second GPIO pin as the first fan interface.
Further, the system further comprises:
a ninth obtaining unit, configured to obtain a first USART signal using a USART pin, where the first USART signal is a USART signal of the first real-time rotation speed;
a tenth obtaining unit, configured to obtain a first bus transfer chip of the first USB interface;
the first conversion unit is used for converting the first USART signal into a first USB signal by utilizing the first bus transfer chip;
and the second execution unit is used for displaying the first USB signal in real time based on the terminal.
Further, the system further comprises:
the second setting unit is used for the serial port function under the preset function condition.
Further, the system further comprises:
and a third setting unit for the preset duty ratio threshold value to be 0 to 100.
The embodiments of the present application are described in a progressive manner, and each embodiment focuses on the difference from the other embodiments, and a fan control method and a specific example in the first embodiment of fig. 1 are equally applicable to a fan control system of the present embodiment, and from the foregoing detailed description of a fan control method, those skilled in the art will clearly know about a fan control system of the present embodiment, so that, for brevity of the description, they will not be described in detail herein. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Exemplary electronic device
The electronic device of the present application is described below with reference to fig. 6.
Fig. 6 illustrates a schematic structural view of an electronic device according to the present application.
Based on the inventive concept of a fan control method according to the foregoing embodiments, the present application also provides a fan control system having a computer program stored thereon, which when executed by a processor, implements the steps of any one of the foregoing fan control methods.
Where in FIG. 6, a bus architecture (represented by bus 300), bus 300 may comprise any number of interconnected buses and bridges, with bus 300 linking together various circuits, including one or more processors, represented by processor 302, and memory, represented by memory 304. Bus 300 may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., as are well known in the art and, therefore, will not be described further herein. Bus interface 305 provides an interface between bus 300 and receiver 301 and transmitter 303. The receiver 301 and the transmitter 303 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium.
The processor 302 is responsible for managing the bus 300 and general processing, while the memory 304 may be used to store data used by the processor 302 in performing operations.
The application provides a fan control method, which is applied to a fan control system, wherein the method comprises the following steps: obtaining a first MCU of a first fan based on preset functional conditions, wherein the first MCU comprises a first GPIO pin and a second GPIO pin; determining a first USB interface according to the first GPIO pin, and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure; determining a first PWM and a first FG according to the 4pin structure; obtaining a first duty cycle based on a terminal, wherein the first duty cycle accords with a preset duty cycle threshold; modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; based on the first PWM square wave, carrying out real-time monitoring on the first FG to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time; calculating to obtain a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan; and the terminal displays the first real-time rotating speed in real time according to the first USB interface. The fan rotating speed control device solves the technical problems that in the prior art, a fan is normally connected to a power supply with controllable voltage, the required fan rotating speed is obtained by manually adjusting the voltage, the fan rotating speed control operation is complex, and the control precision is low. The accurate control of the fan rotating speed is realized through the modulation of the terminal to PWM, the accurate and specific fan rotating speed is obtained based on the square wave quantity calculation of FG signals, the rotating speed signals are further converted and transmitted by using the bus switching chip, the remote control of the fan rotating speed is achieved, the fan rotating speed control accuracy is improved, the specific fan rotating speed is displayed in real time, and the reliable and specific rotating speed data base technical effect is provided for the performance test in the development stage of the fan.
The application also provides a fan control system, which comprises: a processor coupled to a memory for storing a program that, when executed by the processor, causes the system to perform the steps of the method of any of the above embodiments.
The application also provides an electronic device, which comprises a processor and a memory;
the processor configured to process steps of performing the method according to any one of the above embodiments;
the memory is coupled to the processor for storing a program that, when executed by the processor, causes the system to perform the steps of the method of any of the above embodiments.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed, implements the steps of the method of any of the above embodiments.
The application also provides a computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the steps of the method according to any of the above embodiments.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely software embodiment, an entirely hardware embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application is in the form of a computer program product that can be embodied on one or more computer-usable storage media including computer-usable program code. And the computer-usable storage medium includes, but is not limited to: a U-disc, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk memory, a compact disc-Read-only memory (CD-ROM), an optical memory, and other various media capable of storing program codes.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the present application and the equivalent techniques thereof, the present application is also intended to include such modifications and variations.

Claims (9)

1. A method of controlling a fan, the method being applied to a fan control system, the system being communicatively coupled to a terminal, the method comprising:
based on a preset functional condition, a first MCU of a first fan is obtained, wherein the first MCU comprises a first GPIO pin and a second GPIO pin;
determining a first USB interface according to the first GPIO pin, and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure;
determining a first PWM and a first FG according to the 4pin structure;
obtaining a first duty cycle based on the terminal, wherein the first duty cycle accords with a preset duty cycle threshold;
modulating the first PWM according to the first duty ratio to obtain a first PWM square wave;
based on the first PWM square wave, carrying out real-time monitoring on the first FG to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time;
calculating to obtain a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan;
and the terminal displays the first real-time rotating speed in real time according to the first USB interface.
2. The method of claim 1, wherein the determining a first fan interface from the second GPIO pin, wherein the first fan interface is a 4pin structure, comprises:
obtaining a first GND and a first 5V, wherein the first GND and the first 5V are connected with the first USB interface;
obtaining a first PWM and a first FG, wherein the first PWM is used for fan speed modulation, and the first FG is used for fan speed calculation;
obtaining the 4pin structure according to the first GND, the first 5V, the first PWM and the first FG;
and obtaining the second GPIO pin according to the 4pin structure, and taking the second GPIO pin as the first fan interface.
3. The method of claim 1, wherein the terminal displaying the first real-time rotational speed in real time according to the first USB interface, comprises:
obtaining a first USART signal by using a USART pin, wherein the first USART signal refers to the USART signal of the first real-time rotating speed;
obtaining a first bus transfer chip of the first USB interface;
converting the first USART signal into a first USB signal by using the first bus transfer chip;
and displaying the first USB signal in real time based on the terminal.
4. The method of claim 1, wherein the predetermined function condition is a serial port function.
5. The method of claim 1, wherein the preset duty cycle threshold is from 0 to 100.
6. A fan control apparatus for performing the steps of the method of any of claims 1-5, the apparatus comprising:
the MCU is provided with a serial port function;
the first GPIO pin is arranged on the MCU, is a USB interface and is used for supplying power to the fan control device and simultaneously reading and transmitting a fan rotating speed signal;
the second GPIO pin is parallel to the first GPIO pin and is also arranged on the MCU, and the second GPIO pin is used for calculating the rotating speed of the fan;
and the terminal is in communication connection with the MCU and is used for modulating the rotating speed of the fan and simultaneously receiving and displaying the rotating speed signal of the fan transmitted by the first GPIO pin in real time.
7. A fan control system for performing the steps of the method of any of claims 1-5, the system comprising:
the first obtaining unit is used for obtaining a first MCU of the first fan based on preset functional conditions, wherein the first MCU comprises a first GPIO pin and a second GPIO pin;
the first determining unit is used for determining a first USB interface according to the first GPIO pin and determining a first fan interface according to the second GPIO pin, wherein the first fan interface is of a 4pin structure;
the second determining unit is used for determining a first PWM and a first FG according to the 4pin structure;
the second obtaining unit is used for obtaining a first duty cycle based on the terminal, wherein the first duty cycle accords with a preset duty cycle threshold;
the third obtaining unit is used for modulating the first PWM according to the first duty ratio to obtain a first PWM square wave;
the fourth obtaining unit is used for carrying out real-time monitoring on the first FG based on the first PWM square wave to obtain a first real-time monitoring result, wherein the first real-time monitoring result refers to the number of real-time square waves in a preset unit time;
the fifth obtaining unit is used for calculating and obtaining a first real-time rotating speed according to the first real-time monitoring result, wherein the first real-time rotating speed refers to the real-time rotating speed of the first fan;
the first execution unit is used for displaying the first real-time rotating speed in real time by the terminal according to the first USB interface.
8. An electronic device comprising a processor and a memory;
the processor for processing to perform the method of any one of claims 1-5;
the memory being coupled to the processor for storing a program which, when executed by the processor, causes the system to perform the steps of the method of any of claims 1-5.
9. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed, implements the steps of the method according to any of claims 1-5.
CN202210508404.6A 2022-05-10 2022-05-10 Fan control method and system Active CN114837979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210508404.6A CN114837979B (en) 2022-05-10 2022-05-10 Fan control method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210508404.6A CN114837979B (en) 2022-05-10 2022-05-10 Fan control method and system

Publications (2)

Publication Number Publication Date
CN114837979A CN114837979A (en) 2022-08-02
CN114837979B true CN114837979B (en) 2023-09-12

Family

ID=82569520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210508404.6A Active CN114837979B (en) 2022-05-10 2022-05-10 Fan control method and system

Country Status (1)

Country Link
CN (1) CN114837979B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014032411A1 (en) * 2012-08-29 2014-03-06 华为技术有限公司 Fan control method, device and system
CN104199529A (en) * 2014-09-16 2014-12-10 山东超越数控电子有限公司 Intelligent computerized fan control method
CN112460053A (en) * 2020-11-12 2021-03-09 山东云海国创云计算装备产业创新中心有限公司 Fan control method, system, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190293076A1 (en) * 2018-03-26 2019-09-26 In Win Development, Inc. Control method for adjusting rotating speed of multiple fans according to temperature
US10866006B2 (en) * 2018-06-25 2020-12-15 Dell Products L.P. Systems and methods for fan typing and anomaly detection

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014032411A1 (en) * 2012-08-29 2014-03-06 华为技术有限公司 Fan control method, device and system
CN104199529A (en) * 2014-09-16 2014-12-10 山东超越数控电子有限公司 Intelligent computerized fan control method
CN112460053A (en) * 2020-11-12 2021-03-09 山东云海国创云计算装备产业创新中心有限公司 Fan control method, system, equipment and storage medium

Also Published As

Publication number Publication date
CN114837979A (en) 2022-08-02

Similar Documents

Publication Publication Date Title
US11329493B2 (en) Method and system for testing output state of adaptor and computer storage medium
CN114837979B (en) Fan control method and system
CN116468338A (en) Digital twinning-based intelligent water affair monitoring method and system and electronic equipment
CN202352045U (en) Portable real-time image monitoring data acquirer for high-pressure water injection
US9160574B2 (en) Signal adjusting device comprising termination resistor unit in which a signal line is subjected to termination
CN102081124B (en) System and method for identifying high-speed peripheral equipment interconnected signal
CN112667188A (en) Display brightness control method, device, system, electronic terminal and readable storage medium
CN111781499A (en) Electric tuning test method, device, electronic equipment, storage medium and system
CN111413568A (en) Frequency converter test system and frequency converter test method
CN110969720B (en) Method, device and system for determining manual workload
US8063595B2 (en) Location system and method
CN210294400U (en) Transponder transmission module test equipment
CN112856733A (en) Air conditioner control method based on mobile terminal and mobile terminal
CN103220053B (en) Gain control index testing method of radio frequency receiver
CN218211393U (en) Remote automatic calibration system for digital multimeter
CN109714053A (en) Terminal device, the system and method for digital communication are carried out using analog signal pin
JPS6239925A (en) Online type serial communication interface to computer and/or terminal from current loop
CN214951552U (en) Pulse water meter based on artificial intelligence measurement
Cintra et al. Development of a Wireless Data Acquisition System for Application in Real-Time Closed-Loop Control Systems
CN219019040U (en) Wireless HART communicator
CN214335157U (en) Motor MTPA parameter calibration system
CN107627878A (en) A kind of intelligent charging spot
RU219428U1 (en) DEVICE FOR TESTING DATA TRANSMISSION CHANNELS WITH RS485 INTERFACE
CN112031916A (en) Engine cooling fan speed regulation control system, device and terminal equipment
CN113375736A (en) Pulse water meter based on artificial intelligence metering and control method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant