A kind of control method for fan, device and terminal
Technical field
The invention belongs to fan control technical field, particularly relate to a kind of control method for fan, device and terminal.
Background technology
Along with popularizing of notebook computer, for quick heat radiating, a lot of notebook computers are fitted with fan, and are blown to CPU by embedded controller controls fan, help CPU heat radiation so that CPU can be properly functioning, quickly processes data.
But, the control method for fan of existing notebook, it is necessary to be connected SMBUS bus between embedded controller (EmbeddedController, EC) and temperature sensor, it is unfavorable for that main board for notebook computer designs highly integrated.Its reason is in that, in the field of main board for notebook computer design, the temperature of embedded controller controls fan CPU reads, it is usually embedded controller by SMBUS bus, it is connected to the temperature sensor of its one end, use SMBUS bus protocol to obtain, owing to adding SMBUS bus, be unfavorable for that main board for notebook computer designs highly integrated.
Summary of the invention
The purpose of the embodiment of the present invention is in that to provide a kind of control method for fan, aim to solve the problem that the control method for fan of existing notebook, need between embedded controller with temperature sensor, be connected SMBUS bus, be unfavorable for the highly integrated problem that main board for notebook computer designs.
The embodiment of the present invention is achieved in that a kind of control method for fan, including:
Whether detection operating system gets control;
After described operating system gets control, every Preset Time, send to mainboard and read cpu temperature request;
In default memory area, read the cpu temperature that mainboard sends;
Rotation speed of the fan is controlled according to described cpu temperature.
The another object of the embodiment of the present invention is in that to provide a kind of fan control device, including:
Operating system phase detection module, is used for detecting whether operating system gets control;
Cpu temperature request sending module, for after described operating system gets control, every Preset Time, sends to mainboard and reads cpu temperature request;
Cpu temperature request read module, for, in default memory area, reading the cpu temperature that mainboard sends;
Rotation speed of the fan controls module, for controlling rotation speed of the fan according to described cpu temperature.
A kind of terminal, including above-mentioned fan control device, mainboard, CPU and fan, described fan control device is connected in described mainboard, and described mainboard connects described CPU and described fan respectively.
In embodiments of the present invention, after described operating system gets control, every Preset Time, send to mainboard and read cpu temperature request, in default memory area, read the cpu temperature that mainboard sends, control rotation speed of the fan according to described cpu temperature.Without being connected SMBUS bus between embedded controller with temperature sensor, solve the highly integrated problem being unfavorable for that main board for notebook computer designs, under the premise controlling rotation speed of the fan, can design by highly integrated main board for notebook computer, thus both ensure that the reliability controlling rotation speed of the fan, also improve the degree of integration of main board for notebook computer design.
Accompanying drawing explanation
Fig. 1 is the flowchart of a kind of control method for fan that the embodiment of the present invention provides;
Fig. 2 is the flowchart of the control method for fan step S103 that the embodiment of the present invention provides;
Fig. 3 is the flowchart whether the detection fan that the embodiment of the present invention provides blocks;
Fig. 4 is the flowchart of the reading temperature that the embodiment of the present invention provides;
Fig. 5 is the flowchart controlling fan of the offer of the embodiment of the present invention;
Fig. 6 is the structured flowchart of a kind of fan control device that the embodiment of the present invention provides.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein is only in order to explain the present invention, is not intended to limit the present invention.
Embodiment one
With reference to the flowchart that Fig. 1, Fig. 1 are a kind of control method for fan that the embodiment of the present invention provides, details are as follows:
In step S101, whether detection operating system gets control;
Wherein, embedded controller is by receiving the ACPI_ENABLE notice of mainboard, to detect whether operating system gets control.
When embedded controller receives the ACPI_ENABLE notice of mainboard, detecting the operating system stage that currently comes into, represent that control is given operating system by mainboard, operating system gets control.
After whether described detection operating system gets control, including:
Before described operating system gets control, control rotation speed of the fan and be in middling speed state.
Wherein, after user presses starting key, embedded controller starts to power on according to certain sequential to mainboard.Open state is divided into two stages, the startup stage that the first stage being and mainboard not yet give operating system by control, carry out mainboard self-inspection etc.;Second stage is mainboard and gives operating system by control, operating system control to run.In the first phase, because mainboard performs to perform for order, it does not have the concept of multitask and the time of operation are shorter, so it is more stable to dispel the heat, it is possible to take middling speed always to run and without reference to current temperature status.
The differentiation critical point of first stage and second stage can go to ACPI_ENABLE for mainboard, notifies that embedded controller realizes.
In step s 102, after described operating system gets control, every Preset Time, send to mainboard and read cpu temperature request;
Notify at the ACPI_ENABLE getting mainboard, embedded controller detects after currently coming into the operating system stage, set relevant SCI interrupt vector number, a SCI interrupt signal is produced every two seconds, main frame is had no progeny in receiving, it is judged that whether SCI interrupt vector number is read DTS temperature (i.e. the temperature of CPU) request.If the then depositor of reading and saving DTS temperature, being sent in the middle of the embedded controller ram space specified by 6266 ports, follow-up embedded controller can be obtained by the temperature value of current CPU and carries out the operations such as rotation speed of the fan adjustment, FREQUENCY CONTROL, excess temperature shutdown.
In step s 103, in default memory area, read the cpu temperature that mainboard sends;
In step S104, control rotation speed of the fan according to described cpu temperature.
After reading cpu temperature, according to control program, if current temperature value reaches the upper limit threshold values of current rotation speed of the fan, then improve rotation speed of the fan and be up at full speed;If current temperature value is lower than the lower limit threshold values of current rotation speed of the fan, then reduces rotation speed of the fan and be low to moderate most and do not turn.
In embodiments of the present invention, after described operating system gets control, every Preset Time, send to mainboard and read cpu temperature request, in default memory area, read the cpu temperature that mainboard sends, control rotation speed of the fan according to described cpu temperature.Without being connected SMBUS bus between embedded controller with temperature sensor, solve the highly integrated problem being unfavorable for that main board for notebook computer designs, under the premise controlling rotation speed of the fan, can design by highly integrated main board for notebook computer, thus both ensure that the reliability controlling rotation speed of the fan, also improve the degree of integration of main board for notebook computer design.
Embodiment two
With reference to the flowchart that Fig. 2, Fig. 2 are the control method for fan step S103 that the embodiment of the present invention provides, details are as follows:
In step s 201, according to described cpu temperature, detect described fan the need of speed change;
In step S202, when needs speed change, described rotation speed of the fan being switched to the state corresponding with described cpu temperature, described state includes not turning state, lower-speed state, middling speed state, full-speed state.
Wherein, when needs speed change, adopt pulse-modulated signal to change rotation speed of the fan, gradually rotation speed of the fan is switched to the state corresponding with described cpu temperature.
Such as, when needs speed change, change 1/8th wind speed every time, continue just to be finally completed for 8 seconds the switching of rotation speed of the fan.
In the present embodiment, adopt pulse-modulated signal, gradually rotation speed of the fan is switched to the state corresponding with described cpu temperature, it is possible to smoothly speed change, reduce noise, allow the imperceptible fan of user in speed change.
Embodiment three
Being the flowchart whether the detection fan that the embodiment of the present invention provides blocks with reference to Fig. 3, Fig. 3, details are as follows:
In step S301, whether detection fan blocks;
In step s 302, when described fan blocks, perform the thread of forced shutdown.
Increasing a threshold temperature detection, if more than this temperature, the rotating speed of fan is in and does not turn state, represents that fan blocks, and the thread performing forced shutdown shuts down by force, and forbids start a period of time.
In the present embodiment, if the words of the state still not turned more than this temperature but the rotating speed of fan are just shut down by force and forbid start a period of time, avoiding wind sheltering fan-out when now damaging, occurring reducing the situation in the life-span of CPU and mainboard, thus improve the life-span of CPU and mainboard.
Embodiment four
With reference to the flowchart that Fig. 4, Fig. 4 are the reading temperature that the embodiment of the present invention provides, details are as follows:
In step S401, fan middling speed turns;
In step S402, detect whether to enter operating system, be then perform step S403, otherwise continue to detect whether to enter operating system;
In step S403, initialize real-time device, SCI interrupt vector number is set;
In step s 404, detect whether to occur SCI to interrupt, be then perform step S404, otherwise continue to detect whether to occur SCI to interrupt;
In step S405, produce SCI and interrupt, interrupt vector press-in storehouse;
In step S406, process other service processes.
Embodiment five
Being the flowchart controlling fan of the offer of the embodiment of the present invention with reference to Fig. 5, Fig. 5, details are as follows:
In step S501, fan middling speed turns;
Wherein, middling speed turn expression rotate with the state of middling speed.
In step S502, detect whether to enter operating system, be then perform step S503, otherwise perform step S501;
In step S503, detect whether to need speed change, be then perform step S504, otherwise perform step S501;
In step S504, it is switched to corresponding rotating speed;
In step S505, detect whether dedusting, be then perform step S506, otherwise perform step S501;
In step S506, turn at full speed;
Wherein, the state rotation represented with at full speed is turned at full speed.
In step s 507, whether detection fan blocks, and is then perform step S508, otherwise performs step S501;
In step S508, forced shutdown.
Embodiment six
Fig. 6 is the structured flowchart of a kind of fan control device that the embodiment of the present invention provides, and this device can run on embedded controller.For the ease of illustrating, illustrate only part related to the present embodiment.
Operating system phase detection module 61, is used for detecting whether operating system gets control;
Cpu temperature request sending module 62, for after described operating system gets control, every Preset Time, sends to mainboard and reads cpu temperature request;
Cpu temperature request read module 63, for, in default memory area, reading the cpu temperature that mainboard sends;
Rotation speed of the fan controls module 64, for controlling rotation speed of the fan according to described cpu temperature.
In a kind of implementation of the present embodiment, in this fan control device, described fan control device includes:
Middling speed status control module, for, before described operating system gets control, controlling rotation speed of the fan and be in middling speed state.
In a kind of implementation of the present embodiment, described cpu temperature request read module, specifically for, in default memory area, reading the cpu temperature that mainboard is sent by 6266 ports.
In a kind of implementation of the present embodiment, in this fan control device, described rotation speed of the fan controls module and includes:
Speed change detection unit, for according to described cpu temperature, detecting described fan the need of speed change;
Rotation speed of the fan switch unit, for when needs speed change, described rotation speed of the fan being switched to the state corresponding with described cpu temperature, described state includes not turning state, lower-speed state, middling speed state, full-speed state.
As one embodiment of the present of invention, it is provided that a kind of terminal, including above-mentioned fan control device, mainboard, CPU and fan, described fan control device is connected in described mainboard, and described mainboard connects described CPU and described fan respectively.
The device that the embodiment of the present invention provides can be applied in the embodiment of the method for aforementioned correspondence, and details, referring to the description of above-described embodiment, do not repeat them here.
Through the above description of the embodiments, those skilled in the art is it can be understood that can add the mode of required common hardware by software to the present invention and realize.Described program can be stored in read/write memory medium, described storage medium, such as random access memory, flash memory, read only memory, programmable read only memory, electrically erasable programmable memorizer, depositor etc..This storage medium is positioned at memorizer, and processor reads the information in memorizer, performs the method described in each embodiment of the present invention in conjunction with its hardware.
The above; being only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, any those familiar with the art is in the technical scope that the invention discloses; the change that can readily occur in or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with scope of the claims.