CN101281418A - Method for setting general-purpose serial bus equipment as well as computer readable recording medium - Google Patents
Method for setting general-purpose serial bus equipment as well as computer readable recording medium Download PDFInfo
- Publication number
- CN101281418A CN101281418A CNA200710093700XA CN200710093700A CN101281418A CN 101281418 A CN101281418 A CN 101281418A CN A200710093700X A CNA200710093700X A CN A200710093700XA CN 200710093700 A CN200710093700 A CN 200710093700A CN 101281418 A CN101281418 A CN 101281418A
- Authority
- CN
- China
- Prior art keywords
- usb device
- program
- state
- computing machine
- recording medium
- 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
Links
Images
Landscapes
- Power Sources (AREA)
Abstract
The invention relates to a method for setting a USB device which comprises the following steps when the USB device is suitable for being inserted in an electronic apparatus: the electronic apparatus judges whether the USB device is free; when the USB device is free, the electronic apparatus sets the USB device to be suspension state.
Description
Technical field
The invention relates to a kind of method of USB device and a kind of recording medium of embodied on computer readable set, be meant a kind of method of the state of setting USB device and a kind of recording medium of embodied on computer readable especially.
Background technology
USB (universal serial bus) (Universal Serial Bus, hereinafter to be referred as USB) be the interface standard between a kind of computer interface equipment and the computing machine, the apparatus connecting that to support USB as the user is during to computing machine, the user must be provided in computing machine by the service that the setting action of related system resources such as IRQ interruption, I/O address and DMA can use USB device to provide, and promotes the convenience that uses greatly.
When USB device was plugged in notebook computer, USB device promptly was in the state near maximum consumption of power always, and its use is the electric power of notebook computer battery.But it is limited not having the electric power of its battery of notebook computer of external power supply, so the power consumption of USB device directly has influence on the spendable time of notebook computer.
Fig. 1 is the duty transition diagram of a known USB device.USB device can be set at one: one of following three states inserting state 91, a duty 92 and (suspend) state 93 that suspends not, and be to see through following 4 actions USB device is changed between these three states, that is: remove USB device 81, grafting USB device 82, computing machine 83 and reply computing machine 84 suspends.
It should be noted that, by among Fig. 1 as can be known, only the suspend action of computing machine 83 just can make the driver of USB device that USB device is set to the lower state that suspends 93 of this power consumption, otherwise the driver of USB device can't be set on one's own initiative at this state 93 that suspends.That is to say, must all be in the state of suspending by whole notebook computer, be in the state of suspending separately and can't only set USB device.But for the notebook computer of often being operated by the user, just can't utilize the method to reduce the power consumption of USB device.
Another method that reduces the USB device power consumption is when need not using USB device it to be removed, and it is pegged graft when needing to use again and goes up notebook computer.But for the user, frequent removing/grafting USB device will be the thing of a trouble.In addition, its transmission of some USB device or receiving data is at random, when the user can need to use USB device if can't judging.Therefore this method is not suitable on all USB device.
In addition, ACPI (Advanced Configuration Power Interface) industrial standard has defined the pattern of 5 kinds of cpu power consumption and has been respectively C0~C4, when the CPU free time of notebook computer (idle), the operating system of version can be set in CPU the C3 pattern than power saving automatically after the Windows XP, but because the flaw (bug) of Windows XP operating system, when USB device is plugged on notebook computer, to make CPU can't enter the C3 pattern automatically, even if cause CPU at one's leisure its power consumption still can't reduce.Therefore, how setting USB device at the state of suspending 93, is a problem that haves much room for improvement so that the notebook computer CPU of grafting USB device can enter the C3 pattern of low power consumption automatically.
Summary of the invention
Therefore, purpose of the present invention is promptly providing a kind of method of setting the state of USB device, and this method can be set to USB device the power consumption of the state of suspending with the saving computing machine in good time, and further makes CPU can enter the C3 mode of operation.
So, the method for a kind of setting of the present invention one USB device, wherein this USB device is suitable is plugged in an electronic installation, and this method comprises the following step:
This electronic installation judges whether this USB device is idle; And
When this USB device was the free time, this electronic installation was set at the state of suspending with this USB device.
And the recording medium of a kind of embodied on computer readable of the present invention has write down and has used so that a computing machine is carried out a plurality of programs of setting a USB device, and these programs comprise:
One makes this computing machine judge first program that this USB device is whether idle: and
One makes this computing machine when judging that this USB device is the free time, this USB device is set at second program of the state of suspending.
Description of drawings
Fig. 1 is the state transition graph of a known USB device;
Fig. 2 is a synoptic diagram, and the driver that a USB device is described sees through the state that a core stack and a Root Hub driver are controlled this USB device;
Fig. 3 is the process flow diagram of an embodiment of the method for the present invention's state of setting USB device; And
Fig. 4 is the duty transition diagram of application according to the USB device 2 of the embodiment of Fig. 3.
Description of reference numerals:
11~19 steps
2 USB device
3 computing machines
31 driver stack
311 USB device drivers
312 Root Hub drivers
32 core stacks
The keeper is gone in 321 outputs
322 power management persons
81 remove USB device
82 grafting USB device
83 computing machines that suspend
84 reply computing machine
85 judge whether USB device is idle
86 access requirement/wake-up signal
91~93 states
Embodiment
About aforementioned and other technology contents, characteristics and effect of the present invention, in the detailed description of a following cooperation embodiment with reference to the accompanying drawings, can clearly present.
Consult Fig. 2~4, the present invention sets the method for the state of USB device, be applicable to a USB device 2 that is plugged in a computing machine 3 is set at the state 93 that suspends that this computing machine 3 sees through the execution that a Windows (figure does not show) is supported a USB driver stack 31 (driver stack).
This USB driver stack 31 comprises that the driver 311 and of USB device is positioned at the USB Root Hub driver 312 (root hubdriver) of these USB device driver 311 lower floors in logic.
This operating system comprises a USB core stack 32 (kernel mode driver stack), and this core stack 32 has an output and goes into a keeper 321 (I/O manager) and a power management person 322 (powermanager).This USB device driver 311 sees through this core stack 32 and this USB Root Hub driver 312 these USB device 2 of control.
Be to be platform in the following description, and see through the state that the driver stack 31 of supporting WDM (Windows Driver Model) in this Windows is set these USB device 2 with this Windows, but not as limit.
Among one embodiment of this method, after this USB device 2 is plugged to this computing machine 3, the beginning following steps:
Because the application program (application program) carried out in this operating system (figure does not show) must be via this USB device driver 311 to the access requirement (I/O request) of this USB device 2, so this USB device driver 311 can judge whether this USB device is idle in this Preset Time always.
In one embodiment of this invention, this function of tonic chord code (Major FunctionCode) and handle (I/O Control Code) that requires IRP that suspend is respectively IRP_MJ_INTERNAL_DEVICE_CONTROL and IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION.And the driver 311 of this USB device is to utilize this to export an IoCallDriver function (routine) into keeper 321 this is suspended to require IRP to send this core stack 32 to, this core stack 32 suspends this and requires IRP to send this USB Root Hub driver 312 to, can prepare to make this USB device 2 to enter this state 93 that suspends to notify this USB Root Hub driver 312.
This call back function is used for through the power management person 322 of this core stack 32 this USB device 2 being set to the power supply user mode of the state of suspending 93 correspondences.Owing to after this USB device 2 enters the state of suspending 93, also must detect and whether be operated, to prepare to get back to duty 92 by the user.Therefore whether this call back function also makes this USB device 2 can detect for 93 times at the state of suspending to be operated.
This finish function be used for this suspend require IRP to be done after, set the power supply user mode that this USB device 2 is got back to duty 92 correspondences.
If this USB device 2 supports Remote Wake Up function and this USB device 2 at the state of suspending 93, then the user is directly to these USB device 2 operational motions, for example when this USB device is a calculating punch, one is inserted or extracts the memory card action of (figure does not show), be input to the wake-up signal of this notebook computer 3 with being converted to one, and make the driver 311 of this USB device that this USB device 2 is transformed into duty 92.If this computing machine 3 is set to the off working state of the state that for example suspends etc., also convertible this notebook computer 3 of this wake-up signal is to duty.
If this USB device 2 is not supported Remote Wake Up, the user also can't change the state of this USB device 2 and this computing machine 3 to the action of this USB device 2, the user must see through the state that an access requirement to USB device 2 is changed this USB device 2, for example clicks the action of (click) this calculating punch icon (icon) when this USB device 2 is a calculating punch in an explorer (file manager) (figure does not show) or other application program.
When this USB device 2 was supported Remote Wake Up, this call back function must make the USB device 2 that enters the state of suspending 93 detect and whether produce wake-up signal, to prepare to get back to duty 92.
This wait wakes IRP up in order to receive this wake-up signal to change this USB device 2 to duty 92.
Whether this core stack 32 supports Remote Wake Up according to this USB device 2, makes this wait wake IRP and this up respectively and suspends and require the function of finishing of IRP to be performed, so that this USB device 2 is set to duty 92.
When if the driver 311 of this USB device receives access requirement, an IoCancelIrp function of keeper 321 is gone in the output that the driver 311 of this USB device sees through this core stack 32, notify these USB Root Hub driver 312 cancellations this suspend and require IRP.
This core stack 32 also suspends this to require the function of finishing of IRP to be performed.Finish in the function at this, the PoRequestPowerIrp function that this USB device driver 311 sees through this core stack 32 transmits one and sets current potential IRP to this core stack 32, to notify this core stack 32 this USB device 2 is set to duty 92.
If this USB device 2 is supported Remote Wake Up and receives this wake-up signal that then this USB device driver 311 wakes finishing in the function of IRP up in this wait this USB device 2 is set to duty 92.
Fig. 4 is the duty transition diagram of USB device 2 according to the abovementioned embodiments of the present invention.This USB device 2 also can be in this not inserting state 91, this duty 92 and this conversion between the state 93 that suspends, the places different with Fig. 1 are, the whether action of free time 85 that many drivers 311 that see through this USB device are judged this USB device 2, if, then this USB device driver 311 is set to this state 93 that suspends with this USB device 2, thereby makes the CPU of this computing machine 3 can enter the C3 mode of operation; If not, then keep this USB device 2 in this duty 92.And to the access requirement/wake-up signal 86 of this USB device 2, can make this USB device 2 break away from this and suspend state 93 and enter this duty 92.
In the embodiment of the invention described above, the driver 311 of this USB device is to judge according to this timer whether this USB device 2 is idle, or all input and output (I/O) request can be put into an I/O sequence, and when finishing, each I/O request all checks this I/O sequence, and when this I/O sequence is sky, judge that this USB device 2 is for idle.But whether idle mode is not limited to these examples to judge this USB device 2.
In addition, the method that the present invention sets the state of USB device is applicable to and can hinders CPU to enter the USB device of C3 pattern, for example dish (flash disk), calculating punch etc. with oneself.And the present invention also can be applied to and be plugged on the USB device that other has the electronic installation of USB interface, saves power consumption.
Comprehensively above-mentioned, the embodiment system of method that the present invention sets the state of USB device sees through the state of driver inspection its corresponding USB device that drives in one section Preset Time of USB device, and when USB device when this section is the free time in the period always, USB device is set to the state that suspends 93 than power saving, lower the power consumption of USB device, and the CPU that makes notebook computer 3 also can enter the C3 pattern of power saving, thereby prolong the service time of notebook computer 3, therefore can reach purpose of the present invention really.In addition, do not need whole notebook computer 3 all to be in the state of suspending yet, be in the state of suspending separately and can only set USB device.
Above-described only is one embodiment of the invention, can not limit scope of the invention process with this, so long as the simple equivalent of being done according to the present patent application claim and invention description content changes and modify, all still belong in the scope that patent of the present invention contains.
Claims (11)
1. method of setting a USB device, this method comprises the following step:
This USB device is plugged to an electronic installation;
Judge whether this USB device is idle; And
When this USB device is the free time, this USB device is set at the state of suspending.
2. the method for claim 1, other includes:
After this USB device is plugged to an electronic installation, use a timer to begin counting;
After counting a Preset Time, judge whether this USB device receives an access requirement.
3. method as claimed in claim 2 more includes:
When this USB device receives an access requirement, this USB device is set to duty.
4. establishing method as claimed in claim 1 more includes:
Judge whether this USB device supports a Remote Wake Up function.
5. the method for claim 1, wherein when this USB device and when busy, this USB device is set to duty.
6. after the method for claim 1, wherein this USB device entered the state of suspending, this electronic installation can enter a battery saving mode.
7. the method for claim 1 is wherein judged the step that this USB device is whether idle, more includes:
A sequence is put in all input and output (I/O) request;
When finishing, each I/O request all checks this sequence; And
When this I/O sequence is sky, judge that this USB device is for idle.
8. the recording medium of an embodied on computer readable, this recording medium with so that a computing machine is carried out the plural program of setting a USB device, these programs comprise:
One makes this computing machine judge first program that this USB device is whether idle; And
One makes this computing machine when judging that this USB device is the free time, this USB device is set at second program of the state of suspending.
9. the recording medium of embodied on computer readable as claimed in claim 8, wherein, this first program is to make this computing machine judge to the access requirement of this USB device whether this USB device is idle according to whether having in one section Preset Time.
10. the recording medium of embodied on computer readable as claimed in claim 8 also comprises the 3rd program after this second program, and the 3rd program is to make this computing machine when receiving access requirement, and this USB device is set to duty.
11. the recording medium of embodied on computer readable as claimed in claim 8, also comprise a program between this first program and this second program, this program is: if this USB device is supported Remote Wake Up, whether this USB device of this computer settings can be detected after entering the state of suspending has wake-up signal to produce, and more comprise the 3rd program after this second program, the 3rd program is to make this computing machine when this USB device detects the wake-up signal generation, and this USB device is set to duty.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710093700XA CN101281418B (en) | 2007-04-03 | 2007-04-03 | Method for setting general-purpose serial bus equipment as well as computer readable recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710093700XA CN101281418B (en) | 2007-04-03 | 2007-04-03 | Method for setting general-purpose serial bus equipment as well as computer readable recording medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101281418A true CN101281418A (en) | 2008-10-08 |
CN101281418B CN101281418B (en) | 2012-03-14 |
Family
ID=40013912
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200710093700XA Active CN101281418B (en) | 2007-04-03 | 2007-04-03 | Method for setting general-purpose serial bus equipment as well as computer readable recording medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101281418B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011022976A1 (en) * | 2009-08-26 | 2011-03-03 | 中兴通讯股份有限公司 | Power-saving device for universal serial bus modem apparatus and method thereof |
CN103279432A (en) * | 2013-04-27 | 2013-09-04 | 深圳市文鼎创数据科技有限公司 | Method for switching working modes of intelligent secrete key device and intelligent secrete key device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100563691B1 (en) * | 2003-06-09 | 2006-03-28 | 엘지전자 주식회사 | Apparatus and method for managing power in computer system |
-
2007
- 2007-04-03 CN CN200710093700XA patent/CN101281418B/en active Active
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011022976A1 (en) * | 2009-08-26 | 2011-03-03 | 中兴通讯股份有限公司 | Power-saving device for universal serial bus modem apparatus and method thereof |
US8738953B2 (en) | 2009-08-26 | 2014-05-27 | Zte Corporation | Power-saving device for universal serial bus modem apparatus and method thereof |
CN103279432A (en) * | 2013-04-27 | 2013-09-04 | 深圳市文鼎创数据科技有限公司 | Method for switching working modes of intelligent secrete key device and intelligent secrete key device |
Also Published As
Publication number | Publication date |
---|---|
CN101281418B (en) | 2012-03-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102789305B (en) | Postponing suspend | |
KR101029414B1 (en) | Method and apparatus for providing for detecting processor state transitions | |
CN1331065C (en) | Method and apparatus for power mode transition in a multi-theread processor | |
CN102057344B (en) | Sleep processor | |
TW460776B (en) | Software emulation of power management inactivity monitoring | |
US8612805B2 (en) | Processor system optimization supporting apparatus and supporting method | |
CN111625080B (en) | Server energy saving method and device, electronic equipment and storage medium | |
CN101581964B (en) | Computer system and peripheral equipment drive method | |
CN108536531B (en) | Task scheduling and power management method based on single chip microcomputer | |
CN106897133B (en) | Implementation method for managing cluster load based on PBS job scheduling | |
CN102437917A (en) | Network wake-up method, network wake-up device and computer | |
JP7493871B2 (en) | Electronic device and method for responding to a wake-up trigger - Patents.com | |
CN113986000A (en) | Server power-on method, system, device and medium | |
CN101281418B (en) | Method for setting general-purpose serial bus equipment as well as computer readable recording medium | |
US9128730B2 (en) | Method for executing bios tool program in non-SMI mechanism | |
CN1577213A (en) | Method for pci express power management using a pci pm mechanism in a computer system | |
CN116614362A (en) | SCA waveform creation and release optimization method and device based on component dormancy | |
CN111897581B (en) | Screen-off awakening method and device, storage medium and all-in-one machine equipment | |
CN115185769A (en) | Monitoring method, device, equipment and medium for server cluster | |
CN101349975A (en) | Method for implementing interrupt bottom semi-section mechanism and embedded system thereof | |
CN114123457A (en) | Power supply method, device and equipment | |
CN103123463A (en) | Method and device for controlling states of system | |
CN101281420B (en) | Operation method of high-grade allocation and power supply interface and computer system thereof | |
CN219162681U (en) | Electronic equipment | |
CN111176409B (en) | Universal power consumption control circuit, system and method capable of being programmed online |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |