Summary of the invention
In view of this, it is an object of the invention to provide the notes of a kind of safety improving notebookThis computer screen lock method, device and notebook computer.
To achieve these goals, the invention provides a kind of notebook computer screen locking method, bagInclude:
The state of the upper cover of detection notebook computer;
If the state of the upper cover of described notebook computer is closing lid state, then to described notebook electricityThe keyboard buffer of brain sends the scan code for screen locking;
Interrupt signal is sent to the central processing unit of described notebook computer, so that central processing unitKeyboard driver in call operation system performs the scanning for screen locking in keyboard bufferCode.
Preferably, upper cover and the base of described notebook computer is respectively arranged with the magnetic matchedSwitch, correspondingly, the state of the upper cover detecting described notebook computer includes:
Whether the magnetic switch detecting the magnetic switch of the upper cover of described notebook computer and base isClosure state.
Preferably, detect whether described magnetic switch is closure state, including:
Receive the signal of telecommunication that described magnetic switch sends;
According to the described signal of telecommunication, determine whether described magnetic switch is closure state.
Preferably, the wherein said scan code for screen locking includes the scan code corresponding to screen locking key,Described screen locking key includes WIN key and the hot key combination of L key.
Based on same inventive concept, the present invention also provides for a kind of note-book computer lock screen device, bagInclude:
Detection module, for detecting the state of the upper cover of notebook computer;
First sending module, the state for the upper cover when described notebook computer is closing lid stateTime, send the scan code for screen locking to the keyboard buffer of described notebook computer;
Second sending module, interrupts letter for sending to the central processing unit of described notebook computerNumber, so that the keyboard driver in central processing unit call operation system performs keyboard bufferIn the scan code for screen locking.
Preferably, upper cover and the base of described notebook computer is respectively arranged with the magnetic matchedSwitch, correspondingly, described detection module specifically for:
Whether the magnetic switch detecting the magnetic switch of the upper cover of described notebook computer and base isClosure state.
Preferably, described detection module, also particularly useful for:
Receive the signal of telecommunication that described magnetic switch sends;
According to the described signal of telecommunication, determine whether described magnetic switch is closure state.
Preferably, wherein said first sending module is further configured to: what it sent is used for lockingThe scan code of screen includes that the scan code corresponding to screen locking key, described screen locking key include WIN key and LThe hot key combination of key.
Based on same inventive concept, the present invention also provides for a kind of notebook computer, described notebookThe upper cover of computer and base are respectively arranged with the magnetic switch matched, including filling as abovePut, to realize method as above.
Compared with prior art, the method have the advantages that technical schemeWhether it is closing lid state by the upper cover state of detection notebook computer, if closing lid state, thenSend the scan code for screen locking to the keyboard buffer of described notebook computer, make notebook electricityWhen brain upper cover is closing lid state, automatically notebook computer is carried out the operation of screen locking, make unauthorizedUser cannot access notebook computer, thus improves the safety of notebook computer.
Detailed description of the invention
Below in conjunction with the accompanying drawings and embodiment, the detailed description of the invention of the present invention is made the most in detailDescribe.Following example are used for illustrating the present invention, but are not limited to the scope of the present invention.
Generally, the keyboard of notebook computer be internally provided with embedded controller (EmbeddedContrallor, EC), it controls whole work of keyboard, such as during booting computer startupThe self-inspection of keyboard, scanning, the buffering of scan code and with communication of main frame etc..When in keyboardKey when being pressed, EC is just according to the position of this key, by signal of telecommunication conversion corresponding for this keyBecome binary code, be sent to central processing unit (Central Processing Unit, CPU)And display.If the input speed of user is quickly or CPU is processing other task, justFirst the keyboard buffer that the binary code of conversion is delivered in internal memory is kept in, wait CPU idleShi Zaicong keyboard buffer takes out temporary binary code analysis and performs.General notebookIt is both provided with a lot of shortcut, such as, Win+R on the keyboard of computer, opens human window;Win+E, opens explorer;Win+F, opens search window;Win+M, minimizes allWindow;Win+D, performs " display desktop " order (effect is equal to Win+M);Win+L,Locking computer;Win+U, opens " utilman ".Wherein, Win+L, for notesThe screen locking key of this computer.Purpose for notebook computer screen locking is to make notebook computer in not suspensionIn the case of, prevent authorized user's not unauthorized user use computer when notebook computer is other,Thus affect the safety of notebook computer.Prior art is all to be manually pressed by screen locking by userShortcut carry out screen locking for notebook computer.User is in order to simply sometimes, onlyIt is that the upper cover of notebook computer is closed, but is so only capable of turning off the backlight of screen, not lockScreen, thus reduce the safety of notebook computer.
Fig. 1 is the flow chart of the embodiment one of the notebook computer screen locking method of the present invention, such as Fig. 1Shown in, the notebook computer screen locking method of the present embodiment, specifically can include following following steps:
S101, the state of the upper cover of detection notebook computer.
The executive agent of the present embodiment is EC.In the specific implementation, detection notebook computer is upperThe state of lid has a variety of method, such as, in one of them embodiment of the present invention, permissibleBy being respectively provided with the magnetic switch matched on the upper cover of notebook computer and base, according toHall effect principle, when magnetic switch produces the signal of telecommunication, it is known that notebook computer is upperLid is closing lid state;In other embodiments of the invention, detection screen back light modulation can be usedMode determine whether the upper cover of notebook computer is closing lid state.And it is not limited to this.
S102, if the state of the upper cover of notebook computer is closing lid state, then to notebook computerKeyboard buffer send for the scan code of screen locking.
Specifically, detect that the upper cover of notebook computer is closing lid state, then to notebook as ECKeyboard buffer in the internal memory of computer, specifically internal memory, sends the scan code for screen locking.Under normal circumstances, the hot key combination of WIN key+L key can be set to by the manufacturer of notebook computerThe screen locking key of acquiescence, but can also be using other shortcuts as screen locking key.
S103, sends interrupt signal to the central processing unit of described notebook computer, so that centralKeyboard driver in processor call operation system perform in keyboard buffer for screen lockingScan code.
Specifically, EC keyboard buffer in internal memory sends while the scan code of screen locking,Also send an interrupt signal to CPU, after CPU receives the interrupt signal that EC sends, startPerform the instruction of the screen locking corresponding to scan code in the keyboard driver in operating system, to reachThe purpose locked screen automatically for notebook computer.Those skilled in the art should be it is recognised that so-calledAlthough keyboard driver title is similar to hardware names, but be really made up of some codesSoftware, and when code is performed, it is referred to as instruction by CPU.Wherein keyboard driver comprisesThe instruction of the function performed by each key, the most just includes screen locking instruction.
Whether the technical scheme of the present embodiment is closing lid by the upper cover state of detection notebook computerState, if closing lid state, then sends for screen locking to the keyboard buffer of notebook computerScan code, when to make notebook computer upper cover be closing lid state, locks notebook computer automaticallyThe operation of screen, makes unauthorized user cannot access notebook computer, thus improves notebook electricityThe safety of brain.
Fig. 2 is the flow chart of the embodiment two of the notebook computer screen locking method of the present invention, this realityExecute the notebook computer screen locking method of example on the basis of above-described embodiment one, the most detailedCarefully introduce technical scheme.As in figure 2 it is shown, the note-book computer lock of the present embodimentScreen method, specifically may include steps of:
Whether S201, the magnetic switch of the upper cover of detection notebook computer and the magnetic switch of baseFor closure state, wherein, the upper cover of notebook computer and base are respectively arranged with the magnetic matchedProperty switch.
Further, the magnetic switch matched it is provided with at notebook upper cover and base.Such as,The magnetic switch of upper cover is magnet ring, and the magnetic switch of base is magnetic red sheet, when upper cover closing courseIn, the magnet ring set by upper cover, move closer to the magnetic red sheet set by base, imitate according to HallAnswering principle, magnet ring and magnetic red sheet mutual induction, can produce the signal of telecommunication, this signal of telecommunication is sent out by magnet ringDeliver to EC, EC according to receiving the signal of telecommunication that magnet ring is sent, it may be determined that on notebook computerLid for closing lid state.
The magnetic switch of the present invention can use magnetic switch of the prior art, in the present embodimentMagnetic switch circuit as it is shown on figure 3, include chip U21 at magnetic switch, chip U21'sOUTPUT pin connects EC, OUTPUT pin and is also connected with the first electric capacity C1The first end, firstElectric capacity C1The second end ground connection, the first electric capacity C1The second end be also connected with the second electric capacity C2FirstEnd, the first end of the second electric capacity is also connected with the GND pin of chip 21, the second electric capacity C2SecondEnd connects first end of resistance R, and the VCC pin of chip U21 connects first end of resistance R,Second end of resistance R connects running voltage, such as 3V power supply.Specifically, close at notebookDuring upper cover, the chip U21 in magnetic switch produces electric current according to changes of magnetic field, OUTPUT drawFoot exports, and sends to EC, so that EC detects that magnetic switch is closure state.
S202, if the magnetic switch of the magnetic switch of the upper cover of notebook computer and base is Guan BiState, then send WIN key and the hot key combination institute of L key to the keyboard buffer of notebook computerCorresponding scan code.
Such as, when user makes to be finished notebook computer, and when leaving computer, often will notesThe upper cover of this computer closes, and now EC detects set by upper cover and the base of notebook computerWhether magnetic switch is closure state, if magnetic switch is closure state, then EC by WIN key andThe keyboard buffer that screen locking scan code corresponding to the hot key combination of L key is sent in internal memory.
S203, sends interrupt signal to the central processing unit of described notebook computer, so that centralKeyboard driver in processor call operation system perform in keyboard buffer for screen lockingScan code.
Specifically, EC keyboard buffer in internal memory sends while the scan code of screen locking,Also send an interrupt signal to CPU, after CPU receives the interrupt signal that EC sends, startPerform the instruction of the screen locking corresponding to scan code in the keyboard driver in operating system, to reachThe purpose locked screen automatically for notebook computer.Those skilled in the art should be it is recognised that so-calledAlthough keyboard driver title is similar to hardware names, but be really made up of some codesSoftware, and when code is performed, it is referred to as instruction by CPU.Wherein keyboard driver comprisesThe instruction of the function performed by each key, the most just includes screen locking instruction.
Whether the technical scheme of the present embodiment is Guan Bi by the magnetic switch of detection notebook computerState, if closure state, then sends the scanning of screen locking to the keyboard buffer of notebook computerCode, makes CPU perform the instruction of the screen locking corresponding to keyboard driver in operating system, to realizeAutomatically notebook computer is carried out the operation of screen locking, thus improves the safety of notebook computer.
Fig. 4 is the schematic diagram of the embodiment one of the note-book computer lock screen device of the present invention, such as Fig. 4Shown in, the note-book computer lock screen device of the present embodiment, specifically can include detection module 41 HeSending module 42.
Detection module 41, for detecting the state of the upper cover of notebook computer;
First sending module 42, is used for when the state of the upper cover of notebook computer is closing lid state,The scan code for screen locking is sent to the keyboard buffer of notebook computer;
Second sending module, interrupts letter for sending to the central processing unit of described notebook computerNumber, so that the keyboard driver in central processing unit call operation system performs keyboard bufferIn the scan code for screen locking.
The note-book computer lock screen device of the present embodiment, by using above-mentioned module to notebook electricityBrain carries out the realization mechanism of screen locking and the notebook computer screen locking method of above-mentioned embodiment illustrated in fig. 1Realization mechanism identical, be referred to the record of above-mentioned embodiment illustrated in fig. 1 in detail, at this notRepeat again.
The schematic diagram of the embodiment two of the note-book computer lock screen device of the present invention is consistent with Fig. 4,Specifically referring to Fig. 4, the note-book computer lock screen device of the present embodiment is in enforcement as shown in Figure 4On the basis of example one, introduce technical scheme the most in further detail.Such as Fig. 4 instituteShow that the note-book computer lock screen device of the present embodiment can include as follows further.
The upper cover of notebook computer and base are respectively arranged with the magnetic switch matched, correspondingly,Detection module 41 specifically for:
Whether the magnetic switch of upper cover and the magnetic switch of base of detection notebook computer are Guan BiState.
Detection module 41 also particularly useful for:
Receive the signal of telecommunication that magnetic switch sends;
According to the signal of telecommunication, determine whether magnetic switch is closure state.
Wherein, the first sending module is further configured to: its scan code for screen locking sentIncluding the scan code corresponding to screen locking key, described screen locking key includes the hot key group of WIN key and L keyClose.
The note-book computer lock screen device of the present embodiment, by using above-mentioned module to notebook electricityBrain carries out the realization mechanism of screen locking and the notebook computer screen locking method of above-mentioned embodiment illustrated in fig. 2Realization mechanism identical, be referred to the record of above-mentioned embodiment illustrated in fig. 2 in detail, at this notRepeat again.
The present invention also provides for a kind of notebook computer, and upper cover and base at this notebook computer setBeing equipped with the magnetic switch matched, this notebook computer also includes reality as shown in Figure 3 or Figure 4Execute the device of example, it is possible to the method for realization embodiment as shown in Figure 1 or 2.
Above example is only the exemplary embodiment of the present invention, is not used in the restriction present invention, thisThe protection domain of invention is defined by the claims.Those skilled in the art can be the present invention'sIn essence and protection domain, the present invention is made various amendment or equivalent, this amendment orEquivalent also should be regarded as being within the scope of the present invention.