CN114837979A - Fan control method and system - Google Patents

Fan control method and system Download PDF

Info

Publication number
CN114837979A
CN114837979A CN202210508404.6A CN202210508404A CN114837979A CN 114837979 A CN114837979 A CN 114837979A CN 202210508404 A CN202210508404 A CN 202210508404A CN 114837979 A CN114837979 A CN 114837979A
Authority
CN
China
Prior art keywords
fan
real
time
rotating speed
gpio
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.)
Granted
Application number
CN202210508404.6A
Other languages
Chinese (zh)
Other versions
CN114837979B (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Mechanical Engineering (AREA)
  • General Engineering & Computer Science (AREA)
  • Control Of Positive-Displacement Air Blowers (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

The application discloses a fan control method and system, and relates to the field of artificial intelligence, wherein the method comprises the following steps: obtaining a first MCU of a first fan based on a preset functional condition; 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 and a first FG; obtaining a first duty ratio based on a terminal, and modulating to obtain a first PWM square wave; monitoring the first FG in real time to obtain a first real-time monitoring result, and further calculating to obtain a first real-time rotating speed; and the terminal displays the first real-time rotating speed in real time according to the first USB interface. The problems of complex operation and low control precision of fan rotating speed control in the prior art are solved. The fan speed remote control system has the advantages that the fan speed is remotely controlled, the control accuracy is improved, the fan speed is displayed in real time, and the basic technical effect is provided for the performance test of the fan in the research and development stage.

Description

Fan control method and system
Technical Field
The present application relates to the field of artificial intelligence, and in particular, to a method and a system for controlling a fan.
Background
The fan rotates at a certain speed to effectively dissipate heat of machine systems such as servers. When the fan is used for heat dissipation processing in the prior art, the fan is usually connected to a power supply with controllable voltage, and then the power supply voltage is adjusted manually, so that the rotating speed of the corresponding adjusting fan is increased or decreased. In the fan development stage, the air volume, the noise, the heat dissipation effect and the like under the condition of specific fan rotating speed are determined through tests and other modes, the adjustment control of the fan rotating speed is required to be accurately quantized, the detection result is accurate and reliable, and finally the development of the fan is promoted and the availability of the development result is guaranteed. The research of using the computer technology to accurately and intuitively control the rotating speed of the fan has important significance.
However, in the prior art, the fan is usually connected to a voltage-controllable power supply, and the required fan speed is obtained by manually adjusting the voltage, so that the technical problems of complicated fan speed control operation and low control precision exist.
Disclosure of Invention
The present application provides a fan control method and system, which are used to solve the technical problems of complicated control operation of fan rotation speed and low control accuracy in the prior art that a fan is usually connected to a voltage-controllable power supply, and a required fan rotation speed is obtained by manually adjusting a voltage.
In view of the foregoing, 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, wherein the method includes: obtaining a first MCU of a first fan based on a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle; 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 and a first FG according to the 4pin structure; obtaining a first duty ratio based on a terminal, wherein the first duty ratio accords with a preset duty ratio threshold value; modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; monitoring the first FG in real time 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 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 executing the fan control method according to the first aspect, the apparatus including: the MCU has a serial port function; the first GPIO lead angle is arranged on the MCU, is a USB interface and is used for supplying power to the fan control device and reading and transmitting a fan rotating speed signal; the second GPIO lead angle is parallel to the first GPIO lead angle and is also arranged on the MCU, and the second GPIO lead angle 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 receiving and displaying a fan rotating speed signal transmitted by the first GPIO lead angle in real time.
In a third aspect, the present application further provides a fan control system for executing the fan control method according to the first aspect, wherein the system includes: the first obtaining unit is used for obtaining a first MCU of a first fan based on a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle; the first determining unit is used for 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; a second determining unit, configured to determine a first PWM and a first FG according to the 4pin structure; a second obtaining unit, configured to obtain a first duty ratio based on a terminal, where the first duty ratio meets a preset duty ratio threshold; a third obtaining unit, configured to modulate the first PWM according to the first duty cycle to obtain a first PWM square wave; a fourth obtaining unit, configured to perform real-time monitoring on the first FG based on the first PWM square wave to obtain a first real-time monitoring result, where the first real-time monitoring result is a number of real-time square waves in a preset unit time; a fifth obtaining unit, 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; and 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, comprising a processor and a memory;
the processor configured to process steps for performing any of the above methods of the first aspect;
the memory, coupled to the processor, for storing a program which, when executed by the processor, causes the system to perform the steps of any of the above methods of the first aspect.
In a fifth aspect, a computer readable storage medium has stored thereon a computer program which, when executed, performs the steps of any of the above methods of the first aspect.
In a sixth aspect, a computer program product comprises a computer program and/or instructions, wherein the computer program and/or instructions, when executed by a processor, performs the steps of any of the above methods of the first aspect.
One or more technical solutions provided in the present application have at least the following technical effects or advantages:
1. the method comprises the steps that a USB interface and a fan interface are respectively arranged 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 a 4pin structure at a terminal, further counting the number of square waves of FG signals, and calculating to obtain the rotating speed of the fan based on the counted number of the square waves; and finally, the rotating speed of the fan is sent to the bus switching chip from the USART lead angle, the bus switching chip further converts the USART signal into a USB signal and transmits the USB signal back to the terminal, and finally the rotating speed of the fan is displayed by the terminal in real time. The method has the advantages that the fan rotating speed is accurately controlled by modulating the terminal on PWM, accurate and specific fan rotating speed is obtained by calculation based on the number of FG signal square waves, rotating speed signals are further converted and transmitted by the aid of the bus switching chip, remote fan rotating speed regulation and control are achieved, fan rotating speed regulation and control accuracy is improved, specific fan rotating speed is displayed in real time, and reliable and specific rotating speed data basis is provided for performance test in a fan research and development stage.
2. Through the conversion and the transmission of the fan rotating speed signals, the aim of displaying the rotating speed of the fan at the terminal in real time is finally achieved, the visualization of the rotating speed of the fan is achieved, and the effect of providing a basis for the examination of various performances of the fan at a specific rotating speed of the fan is provided for the research and development stage of the fan.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only exemplary, and for those skilled in the art, other drawings can be obtained according to the provided drawings without inventive effort.
FIG. 1 is a flow chart illustrating a fan control method according to the present disclosure;
FIG. 2 is a flowchart illustrating a method for determining a first fan interface according to the present disclosure;
FIG. 3 is a schematic flow chart illustrating a real-time display of a first real-time rotation speed according to a fan control method of the present application;
FIG. 4 is a schematic structural 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.
Description of reference numerals:
the device comprises an MCU100, a first GPIO lead angle 110, a second GPIO lead angle 120, a terminal 200, a first obtaining unit 11, a first determining unit 12, a second determining unit 13, a second obtaining unit 14, a third obtaining unit 15, a fourth obtaining unit 16, a fifth obtaining unit 17, a first executing unit 18, a bus 300, a receiver 301, a processor 302, a transmitter 303, a memory 304 and a bus interface 305.
Detailed Description
The application provides a fan control method and a fan control system, and 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 method has the advantages that the fan rotating speed is accurately controlled by modulating the terminal on PWM, accurate and specific fan rotating speed is obtained by calculation based on the number of FG signal square waves, rotating speed signals are further converted and transmitted by the aid of the bus switching chip, remote fan rotating speed regulation and control are achieved, fan rotating speed regulation and control accuracy is improved, specific fan rotating speed is displayed in real time, and reliable and specific rotating speed data basis is provided for performance test in a fan research and development stage.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
In the following, the technical solutions in the present application will be clearly and completely described with reference to the accompanying drawings, and it is to be understood that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments of the present application, and it is to be understood that the present application is not limited by the example embodiments described herein. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application. It should be further noted that, for the convenience of description, only some but not all of the elements relevant to the present application are shown in the drawings.
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 a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle; 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 and a first FG according to the 4pin structure; obtaining a first duty ratio based on a terminal, wherein the first duty ratio accords with a preset duty ratio threshold value; modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; monitoring the first FG in real time 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 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 principles of the present application, various non-limiting embodiments thereof will now be described in detail with reference to the accompanying drawings.
Example one
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: obtaining a first MCU of a first fan based on a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle;
further, the preset function condition refers to a serial port function.
Specifically, the fan control method is applied to the fan control system, the rotating speed of the fan 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 use the fan control system to intelligently control the rotating speed of the fan. The preset functional condition refers to a serial port function, and is a basic function that a first MCU in the first fan needs to utilize the fan control system to modulate the intelligent rotating speed of the fan. The first MCU is a micro control unit of the first fan, and the preset function condition is a function 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 using a serial communication mode. In addition, the first MCU comprises a first GPIO lead angle and a second GPIO lead angle. Wherein the first and second GPIO pins are different, that is, the first MCU should have at least two GPIO pins. The GPIO refers to a general purpose input/output port, such as a USB interface port. The lead angle refers to a connection wire led out from an internal circuit of the integrated circuit and connected with a peripheral circuit. Through confirming that the MCU accords with the preset functional condition and 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 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;
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 modulating the rotating speed of the fan, and the first FG is used for calculating the rotating speed of the fan;
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 lead angle according to the 4pin structure, and taking the second GPIO lead angle as the first fan interface.
Specifically, the first GPIO pin on the first MCU is used as the first USB interface of the first fan, and the second GPIO pin is used as the 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. Wherein, the first fan interface, i.e. the 4pin structure, includes a first GND, a first 5V, a first PWM, and a first FG. The first GND is a ground point, i.e., a negative electrode of a power supply, and the first 5V is a positive electrode of the power supply and is connected to two ends of the first USB interface, respectively. The first PWM, pulse width modulation, is used to perform speed modulation on the first fan, and the first FG represents a fan speed. The technical effect of providing a chip structure foundation for follow-up intelligent control of the rotating speed of the fan and further calculation of the real-time rotating speed of the fan is achieved by determining the USB interface and the fan interface of the first MCU and setting the fan interface to be of a four-pin structure.
Step S400: obtaining a first duty ratio based on the terminal, wherein the first duty ratio meets a preset duty ratio 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 modulation of the fan speed can be performed on the terminal. Firstly, a user modulates and obtains a first duty ratio based on the terminal, wherein the first duty ratio refers to any one PWM duty ratio from 0 to 100, namely, when the user sets the duty ratio at the terminal, the set duty ratio ranges from 0 to 100, namely, the preset duty ratio threshold value must be met. The duty ratio refers to the proportion of the electrifying time to the total time in one pulse cycle. By obtaining the first duty ratio, a specific and accurate fan rotating speed set value is obtained, and therefore the technical aim of accurately regulating and controlling the rotating speed of the fan 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: monitoring the first FG in real time 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 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 a first duty ratio is obtained and the system is automatically modulated, the first FG is monitored in real time again, and therefore the real-time rotating speed of the first fan is calculated and determined.
Firstly, counting the number of high-frequency square waves emitted by FG signals in preset unit time, wherein the preset unit time is set in a system in advance after comprehensive analysis according to the precision requirement of a user on actual rotating speed modulation and the like. For example, if the preset unit time is 30s, 1min, etc., then it means to count the total number of high-frequency square waves within 30s or 1 min. And then based on that two high-frequency square waves are generated every turn of the fan, dividing the total number of the high-frequency square waves obtained by monitoring the chip by 2 to finally obtain the number which is the number of turns of the first fan in preset unit time. And finally determining the real-time rotating speed of the first fan, namely calculating and determining a first real-time rotating speed according to the first real-time monitoring result.
The first real-time rotating speed of the first fan is calculated and determined by monitoring the number of FG signal square waves of the chip, so that the technical effects of determining the real-time rotating speed of the fan and improving the reliability and accuracy of the real-time rotating speed of the fan based on actual monitoring data 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 lead angle, wherein the first USART signal refers to the USART signal of the first real-time rotating speed;
step S820: acquiring a first bus switching chip of the first USB interface;
step S830: converting the first USART signal into a first USB signal by using the first bus adapter chip;
step S840: and displaying the first USB signal in real time based on the terminal.
Specifically, after a first real-time rotating speed of a first fan is obtained through calculation based on the number of square waves of FG signals, a USART lead angle automatically converts the first real-time rotating speed into a first USART signal, and the first USART signal after conversion is transmitted. Wherein the USART argument is a universal synchronous/asynchronous serial receive/transmitter. Further, the first bus switching chip of the first USB interface receives the first USART signal, and then automatically converts the first USART signal into a first USB signal, and the first USB signal is displayed in real time through the terminal connected to the communication. The first bus switching chip is a switching chip of a USB bus and can realize switching from a USB to a serial port, switching from the USB to an IrDA infrared or switching from the USB to a printing port. Such as CH 340. The first USB signal is the first real-time rotating speed. Through the conversion and the transmission of the fan rotating speed signals, the aim of displaying the first real-time rotating speed of the first fan at the terminal in real time is finally achieved, and the technical effect of visualizing the rotating speed of the fan is achieved.
In summary, the fan control method provided by the present application has the following technical effects:
1. the method comprises the steps that a USB interface and a fan interface are respectively arranged 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 a 4pin structure at a terminal, further counting the number of square waves of FG signals, and calculating to obtain the rotating speed of the fan based on the counted number of the square waves; and finally, the rotating speed of the fan is sent to the bus switching chip from the USART lead angle, the bus switching chip further converts the USART signal into a USB signal and transmits the USB signal back to the terminal, and finally the rotating speed of the fan is displayed by the terminal in real time. The method has the advantages that the fan rotating speed is accurately controlled by modulating the terminal on PWM, accurate and specific fan rotating speed is obtained by calculation based on the number of FG signal square waves, rotating speed signals are further converted and transmitted by the aid of the bus switching chip, remote fan rotating speed regulation and control are achieved, fan rotating speed regulation and control accuracy is improved, specific fan rotating speed is displayed in real time, and reliable and specific rotating speed data basis is provided for performance test in a fan research and development stage.
2. Through the conversion and the transmission of the fan rotating speed signals, the aim of displaying the rotating speed of the fan at the terminal in real time is finally achieved, the visualization of the rotating speed of the fan is achieved, and the effect of providing a basis for the examination of various performances of the fan at a specific rotating speed of the fan is provided for the research and development stage of the fan.
Example two
As shown in fig. 4, the present invention discloses a fan control device for executing the steps of the method according to the first embodiment, wherein the fan control device comprises:
the MCU100, the MCU100 has the function of serial port;
the first GPIO lead angle 110 is arranged on the MCU100, and the first GPIO lead angle 110 is a USB interface and is used for supplying power to the fan control device and reading and transmitting a fan rotating speed signal;
the second GPIO lead angle 120 is parallel to the first GPIO lead angle 110 and is also arranged on the MCU100, and the second GPIO lead angle 120 is used for calculating the rotation speed of the fan;
and the terminal 200 is in communication connection with the MCU100 and is used for modulating the rotating speed of the fan and receiving and displaying a fan rotating speed signal transmitted by the first GPIO lead angle 110 in real time.
Specifically, the fan control device needs an MCU with a serial port function and at least two GPIO pins at the same time as a basis. Such as STM32, STM8 microchip, etc.
Firstly, the fan control device comprises an MCU100, and the MCU100 is provided with a first GPIO lead angle 110 and a second GPIO lead angle 120. The first GPIO lead angle 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 lead angle 120 is used to calculate the fan speed. And then, monitoring the quantity of the FG signal square waves of the MCU100 by using the second GPIO lead angle 120, and calculating and determining the real-time rotating speed of the fan according to the monitoring result of the quantity of the FG signal square waves. Further, the first GPIO lead 110 transmits the fan speed signal to the terminal 200, and the fan speed signal is displayed by the terminal 200 in real time. Through setting up PWM at terminal 200, realized carrying out the technical goal of remote control to the fan, further through the real-time rotational speed of visual fan, reached the technical effect that provides reliable, concrete rotational speed data basis for the performance test of fan research and development stage.
EXAMPLE III
Based on the same inventive concept as the fan control method in the first embodiment, the present application further provides a fan control system, referring to fig. 5, where the system includes:
the first obtaining unit 11 is configured to obtain a first MCU of a first fan based on a preset function condition, where the first MCU includes a first GPIO lead and a second GPIO lead;
a first determining unit 12, where the first determining unit 12 is configured to determine a first USB interface according to the first GPIO lead angle, and determine a first fan interface according to the second GPIO lead angle, where the first fan interface is 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 ratio based on a terminal, where the first duty ratio meets a preset duty ratio 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 perform real-time monitoring on the first FG 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;
and the first execution unit 18, where the first execution unit 18 is configured to display the first real-time rotation speed in real time by the terminal 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 and a first FG, where the first PWM is used for fan rotation speed modulation, and the first FG is used for fan rotation speed calculation;
an eighth obtaining unit, configured to obtain the 4pin structure according to the first GND, the first 5V, the first PWM, and the first FG;
and the first setting unit is used for obtaining the second GPIO lead angle according to the 4pin structure and taking the second GPIO lead angle as the first fan interface.
Further, the system further comprises:
a ninth obtaining unit, configured to obtain a first USART signal using a USART argument, 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 adapter chip of the first USB interface;
the first conversion unit is used for converting the first USART signal into a first USB signal by using the first bus switching 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:
and the second setting unit is used for setting the preset functional condition to be a serial port function.
Further, the system further comprises:
a third setting unit, wherein the third setting unit is used for setting the preset duty ratio threshold value to be 0-100.
In this specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, the fan control method and the specific example in the first embodiment of fig. 1 are also applicable to a fan control system of this embodiment, and a fan control system in this embodiment is clearly known to those skilled in the art through the foregoing detailed description of a fan control method, so for the sake of brevity of the description, detailed description is omitted here. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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 diagram of an electronic device according to the present application.
Based on the inventive concept of the fan control method in the foregoing embodiments, the present application further provides a fan control system, on which a computer program is stored, which when executed by a processor implements the steps of any one of the methods of the fan control method described above.
Where in fig. 6 a bus architecture (represented by bus 300), bus 300 may include any number of interconnected buses and bridges, bus 300 linking together various circuits including one or more processors, represented by processor 302, and memory, represented by memory 304. The bus 300 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 305 provides an interface between the bus 300 and the 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, and the memory 304 may be used for storing 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 a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle; 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 and a first FG according to the 4pin structure; obtaining a first duty ratio based on a terminal, wherein the first duty ratio accords with a preset duty ratio threshold value; modulating the first PWM according to the first duty ratio to obtain a first PWM square wave; monitoring the first FG in real time 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 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 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 are solved. The method has the advantages that the fan rotating speed is accurately controlled by modulating the terminal on PWM, accurate and specific fan rotating speed is obtained by calculation based on the number of FG signal square waves, rotating speed signals are further converted and transmitted by the aid of the bus switching chip, remote fan rotating speed regulation and control are achieved, fan rotating speed regulation and control accuracy is improved, specific fan rotating speed is displayed in real time, and reliable and specific rotating speed data basis is provided for performance test in a fan research and development stage.
The present application further provides a fan control system, wherein, includes: a processor coupled to a memory, the memory 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 is used for processing and executing the steps of the method in any one of the first embodiment;
the memory, coupled to the processor, stores 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 further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, which when executed performs the steps of the method of any of the above embodiments.
The present application also provides a computer program product comprising a computer program and/or instructions, wherein the computer program and/or instructions, when executed by a processor, performs the steps of the method of any of the above embodiments.
As will be appreciated by one skilled in the art, 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 may be embodied on one or more computer-usable storage media having computer-usable program code embodied therewith. And such computer-usable storage media include, but are not limited to: various media capable of storing program codes, such as a usb disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk Memory, a Compact Disc Read-Only Memory (CD-ROM), and an optical Memory.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 an instruction system 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 the 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 changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the present application and its equivalent technology, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A fan control method applied to a fan control system, the system being in communication connection with a terminal, the method comprising:
obtaining a first MCU of a first fan based on a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle;
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 and a first FG according to the 4pin structure;
obtaining a first duty ratio based on the terminal, wherein the first duty ratio meets a preset duty ratio threshold;
modulating the first PWM according to the first duty ratio to obtain a first PWM square wave;
monitoring the first FG in real time 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 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 according to the second GPIO lead angle, 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 modulating the rotating speed of the fan, and the first FG is used for calculating the rotating speed of the fan;
obtaining the 4pin structure according to the first GND, the first 5V, the first PWM and the first FG;
and obtaining the second GPIO lead angle according to the 4pin structure, and taking the second GPIO lead angle as the first fan interface.
3. The method of claim 1, wherein the terminal displays the first real-time rotation speed in real time according to the first USB interface, and the method comprises:
obtaining a first USART signal by using a USART lead angle, wherein the first USART signal refers to the USART signal of the first real-time rotating speed;
acquiring a first bus switching chip of the first USB interface;
converting the first USART signal into a first USB signal by using the first bus adapter chip;
and displaying the first USB signal in real time based on the terminal.
4. The method of claim 1, wherein the predetermined functional condition is a serial port function.
5. The method of claim 1, wherein the preset duty cycle threshold is 0 to 100.
6. A fan control apparatus for performing the steps of the method of claims 1-5, the apparatus comprising:
the MCU has a serial port function;
the first GPIO lead angle is arranged on the MCU, is a USB interface and is used for supplying power to the fan control device and reading and transmitting a fan rotating speed signal;
the second GPIO lead angle is parallel to the first GPIO lead angle and is also arranged on the MCU, and the second GPIO lead angle 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 receiving and displaying a fan rotating speed signal transmitted by the first GPIO lead angle in real time.
7. A fan control system for performing the steps of the method of claims 1-5, the system comprising:
the first obtaining unit is used for obtaining a first MCU of a first fan based on a preset function condition, wherein the first MCU comprises a first GPIO lead angle and a second GPIO lead angle;
the first determining unit is used for 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;
a second determining unit, configured to determine a first PWM and a first FG according to the 4pin structure;
a second obtaining unit, configured to obtain a first duty ratio based on a terminal, where the first duty ratio meets a preset duty ratio threshold;
a third obtaining unit, configured to modulate the first PWM according to the first duty cycle to obtain a first PWM square wave;
a fourth obtaining unit, configured to perform real-time monitoring on the first FG based on the first PWM square wave, and obtain a first real-time monitoring result, where the first real-time monitoring result is a number of real-time square waves in a preset unit time;
a fifth obtaining unit, 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;
and 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 coupled with 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 claims 1-5.
9. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when executed, carries out the steps of the method of any of claims 1-5.
10. A computer program product comprising a computer program and/or instructions, characterized in that the computer program and/or instructions, when executed by a processor, implement the steps of the method of any one 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 true CN114837979A (en) 2022-08-02
CN114837979B 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 (5)

* 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
US20190293076A1 (en) * 2018-03-26 2019-09-26 In Win Development, Inc. Control method for adjusting rotating speed of multiple fans according to temperature
US20190390864A1 (en) * 2018-06-25 2019-12-26 Dell Products L.P. Systems and methods for fan typing and anomaly detection
CN112460053A (en) * 2020-11-12 2021-03-09 山东云海国创云计算装备产业创新中心有限公司 Fan control method, system, equipment and storage medium

Patent Citations (5)

* 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
US20190293076A1 (en) * 2018-03-26 2019-09-26 In Win Development, Inc. Control method for adjusting rotating speed of multiple fans according to temperature
US20190390864A1 (en) * 2018-06-25 2019-12-26 Dell Products L.P. Systems and methods for fan typing and anomaly detection
CN112460053A (en) * 2020-11-12 2021-03-09 山东云海国创云计算装备产业创新中心有限公司 Fan control method, system, equipment and storage medium

Also Published As

Publication number Publication date
CN114837979B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
US20200093460A1 (en) Method, device, ultrasonic probe and terminal for adjusting detection position
CN112506454B (en) Mobile terminal and data display method and device thereof
CN103488513A (en) Universal driving method for plug and play of device
CN114837979A (en) Fan control method and system
CN108933841A (en) A kind of control method and device of radio-frequency front-end equipment
CN202352045U (en) Portable real-time image monitoring data acquirer for high-pressure water injection
US20110004433A1 (en) System and method for testing frequency range
CN108006925A (en) Air-conditioning stress test method, computer installation, computer-readable recording medium
CN115904849B (en) PCIE link signal testing method, system, computer equipment and medium
CN115566296B (en) Battery power display method, electronic device, program product and medium
CN115695241A (en) Communication pressure testing method and electronic equipment
CN112416837B (en) Method, circuit and electronic device for forwarding data from SPI module to UART module
CN112526494B (en) Distance measurement data acquisition method and device, storage medium and electronic device
CN210181590U (en) MCU parameter testing system
CN109066892B (en) Split screen electronic equipment charging circuit and charging control method
RU219428U1 (en) DEVICE FOR TESTING DATA TRANSMISSION CHANNELS WITH RS485 INTERFACE
CN112856733A (en) Air conditioner control method based on mobile terminal and mobile terminal
CN214751425U (en) Data acquisition and communication device for detecting instrument
CN109714053A (en) Terminal device, the system and method for digital communication are carried out using analog signal pin
US11983134B2 (en) Method for recognizing another electronic device by using plurality of interfaces, and electronic device therefor
RU155907U1 (en) SERIAL COMMUNICATION CHANNELS CONTROL DEVICE
CN214951552U (en) Pulse water meter based on artificial intelligence measurement
CN203732621U (en) Measuring instrument measuring power factor
CN114167338B (en) Single-point voltage calibration and calibration method and device
CN110718052B (en) Wireless acquisition device and data acquisition method

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