The standard that connects the system bus of peripheral device at present has USB (Universal SerialBus), SSA, Fire Wire standards such as (IEEE 1394).That be usually used in PC at present is USB, or is called universal series bus standard.Universal series bus standard makes computer can connect various peripheral devices easily.When computer installs peripheral device additional now, normally after revising the operation default, must restart operating system, new setting is come into force.And because the expansion slot on the computer motherboard is limited, the peripheral equipment number that computer can install additional is also restricted.This is quite inconvenient for the user.The USB standard can be improved aforesaid drawbacks, and the attachable peripheral equipment number of computer is increased, and also can under the situation that computer does not shut down peripheral equipment be installed, and can use after installing, and must not restart operating system.Indication USB standard is Universal Serial Bus Specification (Revision1.0) herein.
In the following description, can cooperate the computer of USB interface standard to be called for short the USB computer, can cooperate the peripheral device of USB interface standard to be called for short the USB device, universal serial bus is called for short serial bus.Each USB device is connected in series with the four-core line, and wherein four connecting lines have two to be power lead, and two is data line.The USB computer is provided with a USB main control unit (HostController), as the usefulness of each USB device of control.USB is to use level shape bus structure, and bus-structured root level is by the USB main control unit, and each level of all the other of bus is made up of device maincenter (USB HUB) and peripheral device; The device maincenter can be connected to the device maincenter or the peripheral device of a time level again, makes several peripheral devices become dendroid to distribute and is serially connected; So several peripheral devices are connected in computer apparatus by this connecting interface.The USB main control unit can connect several USB device maincenters, and the device maincenter can connect several device maincenters and USB device again.Operating system is done data access by the USB main control unit to each USB device, also by the USB main control unit USB device is done setting.The USB main control unit is in charge of the power supply of USB device simultaneously and is supplied with, and the use right of priority of decision USB device.
Transmit information in packet (package) mode between USB main control unit and the USB device.The kind of package is divided into three kinds of signal package (token packet), data packet (datapacket), response packet (handshake packet) etc.The direction that signal package determination data transmits (the USB main control unit passes toward peripheral device, peripheral device and passes toward USB main control unit or transmitted in both directions); The data packet content comprises actual data; Response packet is then sent by an end of receiving data, and expression has received data, and perhaps data are wrong must retransfer.Each USB device connects in the serial connection mode, and the package that the USB main control unit sends can be sent to each peripheral device that is connected on the USB.The USB device that is connected on the serial bus respectively has its particular address, after the USB device is received the signal package, whether the address in the meeting explanation signal package matches with the address of itself, if coincide, data in the then subsequent interpret data package, it is whether complete to inform the data Data Receiving to send a response packet after receiving again.If the USB device is separated the address that translates and misfitted, it is not to send at this USB device that expression this time transmits data, can ignore this data packet.
The USB device that can be connected on the serial bus has a variety of: as keyboard, Venier controller, rocking bar, printer, scanning machine, digital camera or the like.The USB main control unit can constantly be inquired (polling) to the USB device, to detect number and the kind that is connected USB device on the serial bus at present.When universal serial bus is gone up in a new USB device connection, after this USB device is received the interrogating signal of USB main control unit, its kind class identification number can be passed to the USB main control unit, specify an address to the USB device by the USB main control unit.Then this USB device can be deposited in its pairing address code in the package when transmitting package, and so USB main control unit or other USB devices promptly judge that with this address code this package is sent by that USB device when receiving this package.
Use the USB standard that aforesaid advantage is arranged, but when computer apparatus enters battery saving mode, problem can take place.For making the USB device be connected or to separate with computer system at any time, the USB main control unit must constantly be informed the operating system state of each USB device at present.With existing computer system and can't inquire that initiatively the USB main control unit obtains the status data of USB device by CPU (central processing unit) (CPU), make second wafer set send look-at-me but constantly send signal to CPU (central processing unit) by the USB main control unit, by CPU (central processing unit) the USB main control unit is inquired again, to know the state of each USB device.It is after computer apparatus enters battery saving mode that this way produces a problem, and second wafer set is still constantly sent look-at-me and given CPU (central processing unit), wakes whole computer apparatus up, so that can't maintain the battery saving mode state.
It is when the USB computer enters battery saving mode the USB function to be cancelled that a kind of way is arranged, and so the USB main control unit just can periodically not send look-at-me to CPU (central processing unit); Just can without reason computer apparatus not waken up yet.But this shortcoming is after the USB function cancellation, and computer apparatus just can't be by the USB device state of resuming work.In other words, if computer apparatus uses the USB keyboard, then just enter behind the battery saving mode can't be by keyboard with the computer state that resumes operation for computer.
The objective of the invention is to improve above-mentioned shortcoming, provide a kind of when computer is in battery saving mode, can make the computer system of its pattern that resumes operation by the USB device.
Purpose of the present invention two when providing a kind of computer to enter battery saving mode, can make the method for its pattern that resumes operation by the USB device.
Three of purpose of the present invention is to make the computer apparatus that enters battery saving mode to avoid causing leaving battery saving mode because of the invalid signals of USB device, enters the method for normal operation pattern.
For achieving the above object, the present invention takes following measure:
After computer apparatus of the present invention enters battery saving mode, computer apparatus is resumed work, leave battery saving mode.
Method of the present invention is after computer enters battery saving mode, when CPU (central processing unit) receives the look-at-me that the USB main control unit sends, judges by bios software whether this look-at-me is effective, whether computer apparatus is replied the normal operation pattern with decision.This kind mode only CPU (central processing unit) is replied the normal operation pattern when carrying out bios program, and the computer apparatus remainder still maintains battery saving mode, like this, still plays province's electro ultrafiltration.
Concrete device and method of the present invention is as follows:
A kind of computer apparatus with electricity-saving function of the present invention comprises peripheral device and external bus, and first group of peripheral device is electrically connected on computer apparatus by external bus, it is characterized in that, comprising:
One CPU (central processing unit);
A machine bus;
One wafer set is electrically connected on CPU (central processing unit) by this machine bus, and wafer set comprises a main control unit, and main control unit is in order to coordinate the data transmission between CPU (central processing unit) and the first group of peripheral device;
One memory cell is electrically connected on wafer set, and in order to stocking system management interrupt program, memory cell comprises one group of peripheral device block, in order to store the data that transmit between first group of peripheral device and CPU (central processing unit);
One Power Management Unit is electrically connected on wafer set; And
One second group of peripheral device is electrically connected on Power Management Unit;
Described CPU (central processing unit) stops the power supply supply to second group of peripheral device after entering battery saving mode, then in response in a look-at-me executive system management interrupt program, the system management interrupt program may further comprise the steps:
(1) judges whether look-at-me is sent by main control unit;
(2) when look-at-me be not when being sent by main control unit, power supply to the second group peripheral device;
(3) when look-at-me is sent by main control unit, judge then whether first group of peripheral device transmits valid data to the peripheral device block;
(4) when transmitting valid data to the peripheral device block, then power supply to the second group peripheral device, and ends with system management interrupt program;
(5) when no valid data write the peripheral device block, then make computer apparatus maintain battery saving mode.
A kind of computer apparatus of the present invention enters the method for operating mode by battery saving mode, it is characterized in that, may further comprise the steps:
(a) in response in the triggering of described main control unit, described wafer set is periodically sent a look-at-me to CPU (central processing unit);
(b) in response in look-at-me, judge whether look-at-me is sent by main control unit;
(c) if look-at-me is not to be sent by main control unit, then make computer apparatus enter operating mode;
(d) whether if look-at-me is to be sent by main control unit, then checking has peripheral device that data are write described peripheral device block;
(e) if no datat writes the peripheral device block, then make computer apparatus continue to maintain battery saving mode;
(f) if there are data to write the peripheral device block, then make computer apparatus enter operating mode.
Reaching embodiment in conjunction with the accompanying drawings is described in detail as follows feature of the present invention:
First embodiment of the invention as shown in Figure 1, tool electricity-saving function of the present invention and possess the computer 100 that connects several peripheral devices with bus and mainly comprise a CPU (central processing unit) 102, one first wafer set 104, a random access memory (RAM) 106, a testing fixture 108, one second wafer set 110, a vga controller 114, an I/O controller 116, a ROM (read-only memory) (ROM) 126, a pci bus 206 and an isa bus 208.This computer apparatus is to cooperate uses such as a traditional data machine 118, a traditional magnetic disk machine 120, a USB keyboard 122, one the 2nd USB device 124 and USB device maincenter 128.
CPU (central processing unit) 102 is connected with first wafer set 104 by a machine bus (LocalBus) as Intel Pentium CPU; First wafer set 104 is in order to control random access memory 106, and device and the data access of control linkage on pci bus 206.Second wafer set 110 is electrically connected on pci bus 206 and isa bus 208, as the bridge between this two bus, in order to the peripheral device that is connected on the isa bus is carried out data access.Vga controller 114 is electrically connected on the pci bus, in order to connect screen display device.ROM (read-only memory) 126 is connected in isa bus and I/O controller, deposits bios program (basic output/input system program) etc.I/O controller 116 is electrically connected on isa bus 208, in order to be electrically connected traditional peripheral device (non-USB device) as traditional data machine 118, traditional disk drives 120 etc.
Second wafer set 110 comprises a USB main control unit 112, and USB main control unit 112 is in order to control each USB device.USB main control unit 112 is electrically connected to USB device maincenter 128 by bus D_1; USB device maincenter 128 is electrically connected to USB keyboard 122 by bus D_2; USB device maincenter 128 is electrically connected to the 2nd USB device 124 by bus D_3.Bus D_1, D_2, D_3 etc. are collectively referred to as usb bus.Bus D_1, D_2, D_3 are the four-core connecting line.During actual the use, the user can be installed the USB device according to need additional, is connected to USB device maincenter 128; USB device maincenter 128 also can connect other USB device maincenters again, to connect more USB device; Like this, all USB devices are branch difference shape and distribute and to be connected in series.
Bus D_4 is electrically connected to bus D-1 and testing fixture 108, and testing fixture 108 is by the look-at-me of data line INT_1 reception from second wafer set 110; After testing fixture 108 receives look-at-me, can judge whether the signal on the bus D_4 is effective, if effectively, then testing fixture 108 can transmit a SMI# look-at-me to CPU (central processing unit) 102 by signal wire 224, start relevant secondary program, make computer system leave battery saving mode, enter operating mode.
Testing fixture 108 be used to judge the USB device on the D_1 bus signal waveform and whether the look-at-me that determines second wafer set to send effective.With the USB keyboard is example, no matter whether the user presses keyboard, the USB keyboard all can feed signals to bus D_1.But the signal waveform of being sent when the user presses keyboard is different with the signal waveform that does not press keyboard and sent.Can judge by testing fixture 108 which kind of waveform is the signal waveform on the D_1 be, whether effective with the look-at-me that determines second wafer set to send.
Preferred embodiment of the present invention as shown in Figure 2, wherein the difference of the preferred embodiment and first embodiment is that preferred embodiment there is no testing fixture, the look-at-me that second wafer set is sent is directly delivered to CPU (central processing unit), whether effectively to judge look-at-me by program.
As shown in Figure 2, computer apparatus 300 comprises a CPU (central processing unit) 302, one first wafer set 304, a memory RAM 306, one second wafer set 310, a storer ROM312, a vga controller 314 and an I/O controller 316.Computer apparatus 300 cooperates first group of peripheral device, second group of peripheral device and a USB device maincenter 322 to use.First group of peripheral device comprises a USB keyboard 324 and a USB Venier controller 326; Second group of peripheral device comprises a Winchester disk drive 330, a traditional data machine 318, one traditional floppy drive 320 etc.Second group of peripheral device claims power consumer apparatus again.
CPU (central processing unit) 302 is connected with first wafer set 304 by a machine bus (Local Bus); First wafer set, 304 control ram sets 306 and other are electrically connected on the device on the PCIBus; Second wafer set 310 is electrically connected on PCI Bus and ISA Bus, as the signal bridge of the two; Vga controller 314 is electrically connected on PCI Bus; ROM device 312 is electrically connected on ISA Bus and I/O controller 316.I/O controller 316 is electrically connected on ISABus, has multiple control function, it comprises modem controller, disk drive controller, keyboard controller, Venier controller etc., in order to connecting traditional peripheral device such as traditional data machine 318, traditional magnetic disk machine 320, and conventional keyboard, traditional Venier controller etc.Winchester disk drive 330 is electrically connected on second wafer set 310.
Second wafer set 310 comprises a USB main control unit 328, and USB main control unit 328 is in order to control each USB device.USB main control unit 328 is electrically connected to USB device maincenter 322 by bus D_1; USB device maincenter 322 is electrically connected to USB keyboard 324 by bus D_2; USB device maincenter 322 is electrically connected to USB Venier controller 326 by data bus D_3.In fact the user can be installed the USB device according to need additional, is electrically connected on USB device maincenter 322; USB device maincenter 322 also can connect other USB device maincenters again, to connect more USB devices; So being the distribution of branch difference shape is connected in series.
First wafer set 304 comprises a power management modules, when responsible computer apparatus 300 enters battery saving mode, and enters the pattern relevant action.When computer 300 enters battery saving mode, will reduce or cut off power supply supply second group of peripheral device.First wafer set 304 also can be made as battery saving mode with USB device maincenter and second group of peripheral device etc. by USB main control unit 328, to reduce its electrical source consumption.CPU (central processing unit) 302, first wafer set 304, second wafer set 310 itself also can be set at battery saving mode, and closed portion circuit or reduction action clock pulse are to reduce power consumption.
USB main control unit 328 is periodically delivered to CPU (central processing unit) 302 with the SMI# signal by signal wire 330, makes CPU (central processing unit) 302 state of inquiry USB device regularly.USB main control unit 328 also can send the IRQ# look-at-me, and sends out SMI# or IRQ# is by program setting actually.USB main control unit 328 comprises a USB HC working storage (Host Controller Register).When USB main control unit 328 sends the SMI# signal, USB HC working storage can be set at " 1 ".When CPU (central processing unit) 302 is received a SMI# signal, carry out a system management interrupt program (SMI Handler).Whether the system management interrupt program is triggered by USB main control unit 328 or is triggered by other devices to judge a SMI# by the value that reads USB HC working storage.The system management interrupt program is the part of BIOS, is stored in ROM device 312, is written in the ram set 306 after computer 300 starts.Ram set 306 is deposited USB keyboard data structure (datastructure) 502a and USB Venier controller data structure 502b, uses as the related data of depositing USB keyboard 324 and USB Venier controller 326.
As shown in Figure 3, the data structure 502a of USB keyboard comprises index 504a and flag value 506a.USB keyboard data structure 502a still comprises other relevant steering orders (as the state of USB device, the direction of data transmission etc.).Index a 504 (pointer) points to the group of addresses of depositing usb data a, and (be called for short the data address group a), usb data a is the data of USB keyboard and 302 transmission of CPU (central processing unit).Flag value a 506a writes the storer of data address group a correspondence in order to judge whether data.If there are data to write the pairing storer of data address group a, then flag value a 506a will be set to " 0 ", otherwise flag value a 506a is " 1 ".Same, the data structure 502b of USB Venier controller comprises index 504b and flag value 506b.Index b 504b points to the group of addresses (being called for short data address group b) of depositing usb data b, and usb data b is the data of USB Venier controller and 302 transmission of CPU (central processing unit).Flag value b 506b writes the storer of data address group b correspondence in order to judge whether data.If there are data to write the pairing storer of data address group b, then flag value b 506a will be set to " 0 ", otherwise be set at " 1 ".If the user is installed a USB device additional, then system program or driver can increase by a usb data structure again.Each usb data structure is corresponding to a USB device, and different USB devices is corresponding to different usb data structures.
Do not supporting in the computer apparatus of USB keyboard, keyboard controller can triggering second wafer set 310 make it send IRQ1# to CPU (central processing unit) after receiving data in the past.Send SMI# when in the present embodiment, the system management interrupt program has been set at keyboard data with second wafer set 310.Same, the system management interrupt program setting makes second wafer set 310 when Venier controller receives data, sends the SMI# signal to CPU (central processing unit).The system management interrupt program implementation must cooperate hardware device, wherein the computer apparatus 300 front and back flow process that enters battery saving mode and enter pattern as shown in Figure 4, its step is described in detail as follows:
Step 402: computer apparatus 300 enters battery saving mode.
Step 404: stop CPU (central processing unit) 302 inner clock pulses,
Step 406: judged whether that the SMI# signal sends CPU (central processing unit) 302 to? when CPU (central processing unit) 302 enters battery saving mode, if do not receive the SMI# signal, CPU (central processing unit) 302 can maintain battery saving mode, when receiving the SMI# signal, CPU (central processing unit) 302 can be left battery saving mode, enters pattern and executive system management interrupt program.
Step 408: judge that this SMI# signal is USB SMI#? is judgment mode to check that the value of the USB HC working storage of USB main control unit 328 is to be " 1 " or " 0 "? " if 0 ", then this SMI# signal is not a USB SMI# signal, may be sent by other devices, therefore jump to step 410, make computer apparatus 302 leave battery saving mode, enter pattern.If USB HC working storage value then skips to step 414 for " 1 ".
Does step 414: checking have the USB keyboard data? its mode is the flag value a 506a of the USB keyboard data structure 502a of inspection USB keyboard 324 correspondences, sees that flag value a 506a still is " 1 " for " 0 "." if 0 ", expression has data, check further that then index a 504a usb data a 508a pointed is null value (being that numerical value is zero)? if not null value then skips to step 416; If usb data a 508a is null value (expression invalid data), or flag value a 506a is " 1 " (expression no datat), then skips to step 422.
Step 416: usb data a 508a is sent to keyboard controller in the I/O controller 316.Such way is compatible in order and not support the USB functional programs in the past, makes old program also can read the data of USB keyboard.
Step 418: after keyboard controller receives data, trigger making second wafer set 310 send the SMI# signal to CPU (central processing unit) 302.This moment, the SMI# signal was not a USB SMI# signal, therefore skipped to step 410 by step 408, made computer leave battery saving mode, entered pattern.
Step 422: judge to have or not effective USB Venier controller data? if no datat, rebound step 404 if data are arranged, skips to step 424.
Step 424: USB Venier controller data are delivered to controller, skip to step 418, make second wafer set send the SMI# signal, follow step 406, step 408, step 410 and make computer apparatus leave battery saving mode, enter pattern.
In a second embodiment, use existing on the market wafer set device to finish.The invention provides a new software BIOS flow process and reach and make the USB computer can enter battery saving mode, can the USB computer be recovered by the USB device again simultaneously, jump out of battery saving mode, enter the regular event pattern.
The present invention compared with prior art has following effect:
Because the present invention utilizes the electricity-saving mode management program, can be under the battery saving mode state, can cause computer to enter the normal operation pattern by the triggering of peripheral device, make the computer apparatus power consumption still less.
More than employed embodiment be in order to set forth the specific practice that the present invention checks USB main control unit look-at-me.Person skilled in the art scholar can replace by the peer to peer technology circuit under the situation that does not break away from the present invention's design.But this replacement also should belong to protection scope of the present invention.