A kind of unlocking method and tripper of terminal
Technical field
The present invention relates to terminal unlocking technical field more particularly to the unlocking methods and its tripper of a kind of terminal.
Background technique
With popularizing for terminal, terminal is increasingly becoming most one of the tool of people's daily life contact frequency, a people
The safety of privacy information is self-evident.Terminal unwarranted outside access in order to prevent is being typically necessary user and is providing just
True check information could solve lock screen.Check information can be password, the types such as fingerprint.
Existing unlocking technology has the unlocking methods such as password, figure, fingerprint, iris, vocal print.Biological decryption method is easy quilt
It captures or copies, the unlocking methods such as password, figure, which are easily stolen, peeps, all leaky in safety.
The patent of invention of Chinese Patent Application No. 201310742439.7 proposes a kind of electronic device, including earphone interface
Module, the electronic device further include cryptographic verification module and unlocked state, and the earphone interface module includes for exporting electricity
The power supply unit and detection unit of source signal, when the earphone jack of the earphone interface module does not have earphone insertion, the inspection
Unit is surveyed to be connected with the power supply unit so as to export a high level signal, when the earphone jack has earphone insertion, institute
It states detection unit and the power supply unit disconnects so as to export a low level signal;The cryptographic verification module with it is described
Detection unit is connected with the output signal of detection unit described in real-time monitoring, the unlocked state and the cryptographic verification module phase
It even, and is the electronic device solution when the cryptographic verification module monitors to the detection unit export the low level signal
Lock.The invention further discloses a kind of unlocking method of electronic device.
But foregoing invention only judges earphone insertion, extracts two states, does not judge the section of earphone insertion, unlock
Method is too simple.
The patent of invention of Chinese Patent Application No. 201410730166.9 proposes a kind of hardware intelligence for intelligent terminal
Energy key, including Intelligent key ontology, the Intelligent key ontology include headset plug and key, and the key is arranged in earphone
At the top of plug.The present invention completes the encryption to intelligent terminal application program in the method for hardware and locks, not only at low cost, Er Qiean
Quan Xinggao solves privacy of user and safety problem;By the earphone jack of Intelligent key insertion intelligent terminal when needing to unlock, press
Lower key can start the APP application for needing Intelligent key matching that could use, without frequently repeatedly inputting password, operation letter
Folk prescription is just.
The hardware Intelligent key for intelligent terminal that foregoing invention proposes answers intelligent terminal with the method completion of key
It is locked with the encryption of program, it is not only at low cost but also highly-safe, solve privacy of user and safety problem;It will when needing to unlock
Intelligent key is inserted into the earphone jack of intelligent terminal, and the APP that pressing the button can start and need to change Intelligent key and could use is answered
With simple to operate without frequently repeatedly inputting password.In addition to this, which further discloses a kind of hardware Intelligent key
Application method, but how not implementing further to be specifically described for this method.
Summary of the invention
It is not easy to be hacked or copies the purpose of the present invention is to provide one kind, without bright screen and be not easy to be peeped, pacifies
The unlocking method and its tripper of the terminal of Quan Xinggao
The present invention adopts the following technical scheme that:
A kind of unlocking method of terminal, comprising the following steps:
It will be in the earphone interface of the plug insertion terminal of multisection type earphone;
It is inserted into the depth of terminal according to the plug of the multisection type earphone, exports unlocking pin;
Examine whether the unlocking pin matches with presetting cipher;It is then to unlock terminal.
Further, it is inserted into the depth of terminal according to the plug of the multisection type earphone, exports unlocking pin, it is specific to wrap
It includes:
The depth for being inserted into the earphone interface of terminal by detecting the plug, connects corresponding circuit, and generates corresponding
Electric signal output;
The sequencing exported according to the electric signal forms the unlocking pin.
Further, the depth of the plug insertion terminal of the multisection type earphone is that the plug of the multisection type earphone is inserted into
The connection of terminal is segmented.
Further, the presetting cipher includes at least 6 electric signals.
Further, the multisection type earphone includes: three-section earphone, four-section type headset, five-part form earphone.
A kind of unlocking method of terminal, which comprises the following steps:
It will be in the earphone interface of the plug insertion terminal of multisection type earphone;Plug is adjusted by insertion and/or pull action
The depth in earphone interface;
According to the movement of insertion and/or extraction of the plug of the multisection type earphone in earphone interface, output unlock is close
Code;
Examine whether the unlocking pin matches with presetting cipher;It is then to unlock terminal.
Further, the movement of the insertion and/or extraction according to the plug of the multisection type earphone in earphone interface, it is defeated
Unlocking pin out specifically includes:
During plug is inserted into the earphone interface of terminal, whenever circuit connection, then a corresponding electric signal is generated
Output;
During plug extracts the earphone interface of terminal, whenever circuit disconnection, then a corresponding electric signal is generated
Output;
According to the electric signal successively exported, the unlocking pin is formed.
Further, the presetting cipher includes at least 6 electric signals.
Further, the multisection type earphone includes: three-section earphone, four-section type headset or five-part form earphone.
Based on the above method, present invention further propose that a kind of terminal unlocking device, comprising: the earphone in terminal is arranged in
Interface module, secret generation module, cryptographic verification module, unlocked state, and the earphone interface with the earphone interface module
Matched multisection type earphone;
What the plug that the earphone interface module is used to export multisection type earphone generated during plug in earphone interface
Electric signal;
The secret generation module is connect with earphone interface module, is generated according to the electric signal of earphone interface module output close
Code sequence simultaneously exports;
The cryptographic verification module is connect with secret generation module, for comparing the keying sequence of secret generation module output
And presetting cipher, and export comparing result;
The unlocked state is connect with cryptographic verification module, when the comparing result of cryptographic verification module output affirmative, solution
Lock terminal device.
Further, the multisection type earphone includes: three-section earphone, four-section type headset or five-part form earphone.
It further, further include password setup module, the password setup module is connect with secret generation module, according to close
The keying sequence that code generation module generates sets presetting cipher.
Further, it is necessary first to which presetting cipher is set to terminal unlocking device;It is close when there is earphone to be inserted into earphone interface
Whether code setup module detection presetting cipher is empty, is then to set presetting cipher.
The present invention provides a kind of method and devices locked and unlocked to terminal with hardware.Using side of the invention
Method or device technique scheme, are not easy to be hacked or copy, and without bright screen and are not easy to be peeped, highly-safe, can be with
Specific customization is carried out to earphone.
Detailed description of the invention
Fig. 1 is common headset plug segmental structure schematic diagram.
Fig. 2 is the electric signal schematic diagram generated during four-section type headset inserts or pull out.
The flow diagram of Fig. 3 terminal unlock method of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those skilled in the art's every other embodiment obtained, shall fall within the protection scope of the present invention.
Terminal in the embodiment of the present invention may include PC, smart phone, tablet computer, electronic reader, pen
Remember this computer, car-mounted terminal, Worn type portable equipment etc..
It also should be noted that only the parts related to the present invention are shown for ease of description, in attached drawing rather than
Full content.
Referring to Fig.1, common headset plug mainly has two kinds of three-stage, four-part form, and wherein three-section earphone plug more passes
System, only single earpiece function, three sections of contacts are respectively L channel (L), and right channel (R) is grounded (G).Four-section type headset plug master
It is used for mobile phone, L channel (L) to be removed in four sections of contacts, and right channel (R), ground connection (G) is microphone there are one contact outside
(MIC).The sequence of each contact is not quite similar in four-section type headset plug.
The present invention makes full use of the characteristics of multistage contact of headset plug, proposes the terminal unlocking based on headset plugging process
Method, flow diagram are as shown in Figure 3.
Specifically, when there is headset plug to be inserted into earphone interface, system judges whether that earphone was used to unlock, if so,
Prompt input password is verified password, is verified, be unlocked to terminal device, test after user inputs password
Card failure, then it prompts to input password again.
If earphone unlock was not used, enters unlocking pin and program is set.
Earphone unlocking pin is arranged in prompt for the first time;
Second of confirmation earphone unlocking pin of prompt;
Judgement unlocking pin setting twice is consistent, if so, password is arranged successfully, prompt unlock again;If it is not, then another
Secondary the step of being configured unlocking pin.
Embodiment one (the present embodiment is by taking four-section type headset as an example):
By taking the plug of the most commonly used four-section type headset as an example, during being inserted into earphone interface, electric signal is generated
It is described in detail below:
The plug of four-section type headset is gradually inserted the process of the earphone interface of terminal:
When plug insertion 1/4, connection is L channel (L) circuit, generates an electric signal;
When plug insertion 2/4, connection is right channel (R) circuit, generates an electric signal;
When plug insertion 3/4, connection is ground connection (G) circuit, generates an electric signal;
When plug is entirely insertable, connection is microphone (MIC) circuit, generates an electric signal.
Referring to Fig. 3, a kind of terminal unlock method is as follows:
S101: by the earphone interface of the plug insertion terminal of four-section type headset.
S102: judge whether that earphone was used to unlock.It is no, then execute the step S103 of unlocking pin arranged below;It is, then
Execute following steps S104.
Specifically, whether password setup module detection presetting cipher is empty, is that earphone was not used to unlock.
S103:1) earphone unlocking pin is set for the first time.The wherein earphone interface that the plug of four-section type headset is inserted into every time
Length be one segmentation.
Such as: the plug of four-section type headset is first inserted into 1/4, generates a L signal;When being inserted into 2/4 position, a R is generated
Signal;When being inserted into 3/4 position, a G-signal is generated;When extracting to 2/4 position, a R signal is generated;It is inserted into 3/4
When position, a G-signal is generated;When being entirely insertable, a M signal is generated.Earphone interface module by the signal of generation, export to
The sequencing of secret generation module, the electric signal that secret generation module is exported according to earphone interface module generates unlocking pin
LRGRGM。
Whether detection signal is less than 6, if being less than 6 signals, user password is prompted to need 6 signals or more, if
It is greater than and is equal to 6 signals, then second of confirmation earphone unlocking pin.
2) judgement unlocking pin setting twice is consistent.If so, password is arranged successfully;If it is not, then executing setting again
The step S103 of unlocking pin.
Specifically, whether the unlocking pin that cryptographic verification module check is arranged twice is consistent.
Such as: the unlocking pin whether inputted twice is all LRGRGM.
In the step, user can the corresponding unlocking pin of fancy setting according to their own needs.
User setting can also be prompted to unlock prompt information simultaneously, prevent user from leading to inconvenience because forgetting unlocking pin.
The prompt information can be such that picture and text prompt, and be also possible to voice prompting, can also be the prompt of other forms.
S104: being inserted into the depth of terminal according to the plug of the multisection type earphone, exports unlocking pin;
Specifically, the depth that earphone interface module is inserted into terminal by detecting the plug of the four-section type headset, connects phase
The circuit answered, and generate corresponding electric signal output;The sequencing that secret generation module exports according to the electric signal is formed
The unlocking pin.The unlocking pin of formation is exported and gives cryptographic verification module by the secret generation module.
Wherein, the depth of the earphone interface of the plug insertion terminal of the multisection type earphone is inserting for the multisection type earphone
The connection segmentation of the earphone interface of head insertion terminal.
S105: examine whether the unlocking pin matches with presetting cipher;It is then to unlock terminal.It is no, then prompt user again
Secondary input unlocking pin.
Specifically, the cryptographic verification module compares the keying sequence and presetting cipher of secret generation module output, compares
Correctly, then unlocked state is controlled to be unlocked for terminal.
Embodiment two:
By taking the most commonly used four-section type headset plug of current mobile phone as an example, insertion and/or the process for extracting earphone jack
In, generated electric signal is as shown in Fig. 2, be described in detail below:
The plug of four-section type headset is gradually inserted the process of the earphone interface of terminal:
What it is when connection is L channel (L) circuit, generates the high level of 1 position of signal, is denoted as L1;
What it is when connection is right channel (R) circuit, generates the high level of 2 position of signal, is denoted as R1;
What it is when connection is ground connection (GND) circuit, generates the high level of 3 position of signal, is denoted as G1;
What it is when connection is microphone (MIC) circuit, generates the high level of 4 position of signal, is denoted as M1.
The plug of four-section type headset gradually extracts the process of the earphone interface of terminal:
What it is when disconnection is L channel (L) circuit, generates the low level of 1 position of signal, is denoted as L2;
What it is when disconnection is right channel (R) circuit, generates the low level of 2 position of signal, is denoted as R2;
What it is when disconnection is ground connection (GND) circuit, generates the low level of 3 position of signal, is denoted as G2;
What it is when disconnection is microphone (MIC) circuit, generates the low level of 4 position of signal, is denoted as M2.
Referring to Fig. 3, a kind of terminal unlock method is as follows:
S201: by the earphone interface of the plug insertion terminal of multisection type earphone.
S202: judge whether that earphone was used to unlock;
It is no, then execute the step S203 of unlocking pin arranged below;It is then to execute following steps S204.
Specifically, whether password setup module detection presetting cipher is empty, is that earphone was not used to unlock.
S203:1) earphone unlocking pin is set for the first time.Pass through insertion of the plug of multisection type earphone in earphone interface
And/or the movement extracted, password is set.The length for the movement that wherein plug of the multisection type earphone inserts or pull out every time is
One segmentation.
Such as: password is arranged in three-section earphone, and earphone is first inserted into 1/3, generates a L1 signal, and record;It is inserted into 2/3
When setting, a R1 signal is generated, and record;It is entirely insertable the plug of earphone, generates a G1 signal, and record;It extracts to 2/3
When position, a G2 signal is generated, and record;When extracting to 1/3 position, a R2 signal is generated, and record;It is inserted into 2/3
When position, a R1 signal is generated, and record;It is entirely insertable the plug of earphone, generates a G1 signal, and record;It extracts
When 2/3 position, a G2 signal is generated, and record;When extracting to 1/3 position, a R2 signal is generated, and record;All pull out
Out when earphone, a L2 signal is generated, and record.Earphone interface module exports the signal of generation to secret generation module, close
The sequencing for the electric signal that code generation module is exported according to earphone interface module generates unlocking pin
L1R1G1G2R2R1G1G2R2L2。
Password is arranged in four-section type headset, and earphone is first inserted into 1/4, generates a L1 signal, and record;It is inserted into 2/4 position
When, a R1 signal is generated, and record;When being inserted into 3/4 position, a G1 signal is generated, and record;Headset plug is entirely insertable
When, a M1 signal is generated, and record;When extracting to 3/4 position, a M2 signal is generated, and record;It extracts to 2/4 position
When, a G2 signal is generated, and record;When extracting to 1/4 position, a R2 signal is generated, and record;It is inserted into 2/4 position
When, a R1 signal is generated, and record;When being inserted into 3/4 position, a G1 signal is generated, and record;When extracting to 2/4 position,
A G2 signal is generated, and is recorded;When extracting to 1/4 position, a R2 signal is generated, and record;When all extracting earphone, produce
A raw L2 signal, and record.Earphone interface module exports the signal of generation to secret generation module, secret generation module
Unlocking pin L1R1G1M1M2G2R2R1G1G2R2L2 is generated according to the sequencing of the electric signal of earphone interface module output.
Even earphone can also be changed to five-part form earphone to a circuit definitions more than earphone.More settings in the present embodiment
One Q circuit, i.e., what is connected when the plug of five-part form earphone is entirely insertable is Q circuit, generates the height electricity of 5 position of signal
It is flat, it is denoted as Q1;When all extracting, disconnection is M circuit, generates the low level of 5 position of signal, is denoted as Q2.
Password is arranged in five-part form earphone, and earphone is first inserted into 1/5, generates a L1 signal, and record;It is inserted into 2/5 position
When, a R1 signal is generated, and record;When being inserted into 3/5 position, a G1 signal is generated, and record;It extracts to 2/5 position
When, a G2 signal is generated, and record;When being inserted into 3/5 position, a G1 signal is generated, and record;It is inserted into 4/5 position
When, a M1 signal is generated, and record;When extracting to 3/5 position, a M2 signal is generated, and record;It is inserted into 4/5 position
When, a M1 signal is generated, and record;When headset plug is entirely insertable, a Q1 signal is generated, and record;It extracts to 4/5
When setting, a Q2 signal is generated, and record;When extracting to 3/5 position, a M2 signal is generated, and record;It extracts to 2/5
When setting, a G2 signal is generated, and record;When being inserted into 3/5 position, a G1 signal is generated, and record;It extracts to 2/5
When setting, a G2 signal is generated, and record;When extracting to 1/5 position, a R2 signal is generated, and record;All extract earphone
When, a L2 signal is generated, and record.Earphone interface module generates the signal of generation, output to secret generation module, password
The sequencing for the electric signal that module is exported according to earphone interface module generates unlocking pin
L1R1G1G2G1M1M2M1Q1Q2M2G2G1G2R2L2。
The five-part form earphone generates a unique signal position, generates unique keying sequence, other people can not
Simulation, can not copy, compared to three-section earphone and four-section type headset, its privacy degrees is higher.
Whether detection signal is less than 6, if being less than 6 signals, user password is prompted to need 6 signals or more, if
It is greater than and is equal to 6 signals, then second of confirmation earphone unlocking pin.
2) judgement unlocking pin setting twice is consistent.If so, password is arranged successfully;If it is not, then executing setting again
The step S203 of unlocking pin.
Specifically, whether the unlocking pin that cryptographic verification module check is arranged twice is consistent.
Such as: the unlocking pin whether three-section earphone inputs twice is all L1R1G1G2R2R1G1G2R2L2;Four-part form ear
The unlocking pin whether machine inputs twice is all L1R1G1M1M2G2R2R1G1G2R2L2;What whether five-part form earphone inputted twice
Unlocking pin is all L1R1G1G2G1M1M2M1Q1Q2M2G2G1G2R2L2.
In the step, user can the corresponding unlocking pin of fancy setting according to their own needs.It can also prompt to use simultaneously
Family setting unlock prompt information, prevents user from leading to inconvenience because forgetting unlocking pin.
The prompt information can be such that picture and text prompt, and be also possible to voice prompting, can also be the prompt of other forms.
S204: according to the movement of insertion and/or extraction of the plug of the multisection type earphone in earphone interface, output solution
Lock cipher.
Specifically, during the earphone interface of plug insertion terminal, whenever circuit connection, then one is generated accordingly
Electric signal output.
During plug extracts the earphone interface of terminal, whenever circuit disconnection, then a corresponding electric signal is generated
Output.
Earphone interface module exports the signal of generation to secret generation module, secret generation module is according to earphone interface
The sequencing of the electric signal of module output generates unlocking pin.Secret generation module exports the unlocking pin of generation to password
Inspection module.
S205: examine whether the unlocking pin matches with presetting cipher;It is then to unlock terminal.It is no, then prompt user again
Secondary input unlocking pin.
Specifically, the cryptographic verification module compares the keying sequence and presetting cipher of secret generation module output, compares
Correctly, then unlocked state is controlled to be unlocked for terminal.
The purpose of the present embodiment is just to provide a kind of additional unlocking method.Earphone is regarded as the key to open a terminal
Spoon is converted to password by the electric signal that circuit on/off generates, and password meets preset unlocking pin and then unlocks terminal.
Whole process is similar to open door lock with key, meets mankind's habit.
A kind of preferred terminal unlocking device, including the earphone interface module, secret generation module, close being arranged in terminal
Code check module, unlocked state, and the matched multisection type earphone of earphone interface with the earphone interface module;
What the plug that the earphone interface module is used to export multisection type earphone generated during plug in earphone interface
Electric signal.
The secret generation module is connect with earphone interface module, is generated according to the electric signal of earphone interface module output close
Code sequence simultaneously exports.
The cryptographic verification module is connect with secret generation module, for comparing the keying sequence of secret generation module output
And presetting cipher, and export comparing result.
The unlocked state is connect with cryptographic verification module, when the comparing result of cryptographic verification module output affirmative, solution
Lock terminal device.
The multisection type earphone includes: three-section earphone, four-section type headset or five-part form earphone.
Further, above-mentioned terminal unlocking device further includes password setup module, the password setup module and password
Generation module connection sets presetting cipher according to the keying sequence that secret generation module generates.
Presetting cipher is set firstly the need of to terminal unlocking device;When there is earphone to be inserted into earphone interface, mould is arranged in password
Whether block detection presetting cipher is empty, is then to set presetting cipher.
Compared with prior art, the present invention provides a kind of approach that novel check information obtains, in the multisection type ear
The machine transplanting of rice enters, extracts in the period of earphone interface, and multisection type earphone rests on process i.e. corresponding one of different location in earphone interface
The process of a information input.It is produced during plug in earphone interface using the plug of earphone interface module output multisection type earphone
Raw electric signal, the sequencing that secret generation module exports according to the electric signal form unlocking pin.Secret generation module
The unlocking pin of formation is exported and gives cryptographic verification module.Cryptographic verification module compares the keying sequence of secret generation module output
And presetting cipher, it compares correctly, then controls unlocked state and be unlocked for terminal.Earphone is regarded as the key to open a terminal
Spoon is converted to password by the electric signal that circuit on/off generates, and password meets preset unlocking pin and then unlocks terminal.
Whole process is similar to open door lock with key.
The method that the present invention locks to terminal and unlocked with hardware, this method are not easy to be hacked or copy, nothing
It needs bright screen and is not easy to be peeped, it is highly-safe, specific customization, such as more circuit definitions can also be carried out to earphone, be changed to five
Segmentation earphone is then equivalent to a Physical key, hardware encryption, it more difficult to crack, to solve privacy of user and safety problem.
Although having been presented for some embodiments of the present invention herein, it will be appreciated by those of skill in the art that
Without departing from the spirit of the invention, the embodiments herein can be changed.Above-described embodiment is only exemplary, no
It should be using the embodiments herein as the restriction of interest field of the present invention.