CN105788039A - Remote door opening control method based on mobile phone - Google Patents

Remote door opening control method based on mobile phone Download PDF

Info

Publication number
CN105788039A
CN105788039A CN201610082459.XA CN201610082459A CN105788039A CN 105788039 A CN105788039 A CN 105788039A CN 201610082459 A CN201610082459 A CN 201610082459A CN 105788039 A CN105788039 A CN 105788039A
Authority
CN
China
Prior art keywords
value
password
image
encrypting module
region
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.)
Pending
Application number
CN201610082459.XA
Other languages
Chinese (zh)
Inventor
杨垚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Biaobo Science And Technology Co Ltd
Original Assignee
Chongqing Biaobo Science And Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chongqing Biaobo Science And Technology Co Ltd filed Critical Chongqing Biaobo Science And Technology Co Ltd
Priority to CN201610082459.XA priority Critical patent/CN105788039A/en
Publication of CN105788039A publication Critical patent/CN105788039A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00182Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with unidirectional data transmission between data carrier and locks
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • G07C2009/00412Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks the transmitted data signal being encrypted

Abstract

The invention discloses a remote door opening control method based on a mobile phone, and belongs to the field of security and protection.The method comprises the steps that a user image is acquired in advance and stored; an encrypted image from the mobile phone terminal is received; a password is input through a keyboard module, a controller decrypts the received encrypted image according to the received password, and an image to be matched is obtained; the image to be matched is matched with the stored user image; when the image to be matched and the stored user image are matched successfully, an electronic door lock is controlled to be opened.According to the method, the password can be generated in a self-adaption mode according to the provided image, generation speed is high, and the image can be encrypted in combination with the generated password to protect the stored image.A user transmits the image to entrance guard equipment and tells a guest the password, and remote door opening control can be achieved.According to the method, double insurance is achieved, better safety is achieved, meanwhile, the user does not need to run back to open the door, and therefore greater convenience is achieved.

Description

A kind of control method of remotely opening the door based on mobile phone
Technical field
The invention belongs to safety-security area, particularly relate to a kind of control method of remotely opening the door based on mobile phone.
Background technology
Anti-theft security is always up the problem that modern society can not be ignored, and the reliable switch problem of gate inhibition is considered as a technology that can not be ignored by manufacturers.With regard to the current state of the art, although gate inhibition's switch of a great variety, but, what great majority adopted is mechanically or electrically cryptographic technique.Have been reported display, make stolen articles because the password of electronic access lock is cracked, of common occurrence.Therefore, have a set of intelligent switch gate inhibition and be obviously increasingly becoming the reality that it is desirable to.
In prior art, common are and utilize cipher inputting keyboard and door trip key switch as input pickup, and coordinate with error code identification circuit, spoon control identification circuit, enabling delay trigger circuit etc., add door opening timing alarm, report to the police by cryptographic key, misplug the functions such as car key warning, damage preventing alarm, anti-robbery warning by mistake.The prior art is only that " add door opening timing alarm, report to the police by cryptographic key, misplug the functions such as car key warning, damage preventing alarm, anti-robbery warning by mistake ", in order to improve " anti-theft feature ", does not have real intelligent anti-theft function.Prior art can't solve to work as user and not exist, and when having guest to visit, guest usually can not be allowed to enter house the problem waited, be inconvenient for.
Summary of the invention
Because the drawbacks described above of prior art, the technical problem to be solved is to provide a kind of gate inhibition of being capable of and opens the control method of safe ready more.
For achieving the above object, the invention provides a kind of control method of remotely opening the door based on mobile phone, including for sending the mobile phone terminal of information and for receiving the gate terminal of information, described gate terminal includes controller, GPRS module, memory module, electronic lock and Keysheet module;Described GPRS module, memory module are bi-directionally connected with described controller respectively, and the control signal input of described controller connects the control signal input of described electronic lock, and the signal output part of described Keysheet module connects the signal input part of described controller;The present invention comprises the following steps:
Step one, controller obtain user images and store;
Step 2, gate terminal receive the encrypted image from mobile phone terminal by GPRS module;
Step 3, user input password by Keysheet module, and the encrypted image received is decrypted by controller according to the password received, and obtain image to be matched;
Step 4, image to be matched is mated with the user images of storage;When the user images of image to be matched Yu storage carries out that the match is successful, controller sends control signal and turns on to described electronic lock;Terminate when image to be matched carries out mate unsuccessful with the user images of storage;
Described in step 2, encrypted image is encrypted according to the following steps:
Step A1, by image capture device obtain resolution be the square-shaped image of a*a, described a is positive integer;
Step A2, set in described facial image any one pixel as Pij, obtain pixel PijRgb value, described i, j are positive integer and 1≤i≤a, 1≤j≤a;
Step A3, by pixel PijR value, G-value and B value be respectively converted into the hexadecimal values of correspondence;
Judge pixel PijHexadecimal R value, hexadecimal G-value and hexadecimal B value whether reach two;
As pixel PijHexadecimal R value, hexadecimal G-value or hexadecimal B value less than two time, add a character G on this hexadecimal value left side less than two, to form pixel PijTwo R value character strings, two G-value character strings and two B value character strings, then perform step A4;As pixel PijHexadecimal R value, hexadecimal G-value or hexadecimal B value be when reaching two, performs step A4;
Step A4, by pixel PijTwo R value character strings, two G-value character strings and two B value character strings be arranged in order formation first order string from left to right;
Step A5, i and j is respectively converted into correspondence hexadecimal values;
Judge whether the hexadecimal value of i or the hexadecimal value of j reach four;When the hexadecimal value of i or the hexadecimal value of j are less than four, add character G, four character strings of four character strings and j to form i on this hexadecimal value left side less than four, then perform step A6;When the hexadecimal value of i or the hexadecimal value of j reach four, perform step A6;
Step A6 to, the four of j character strings are added the left side of described first order string, and the four of i character strings are added to the left side of four character strings of described j, to form second level string;
Step A7, described facial image is divided into 16*16 square area T 1 , 1 T 1 , 2 ... ... T 1 , 16 T 2 , 1 T 2 , 2 ... ... T 2 , 16 ... ... ... ... ... ... ... ... T 16 , 1 T 16 , 2 ... ... T 16 , 16 , Choose described pixel PijThe region T at placeM, n, m, n are positive integer and 1≤m≤16,1≤n≤16;
Step A8, judge whether second level string has character G;When the second string comprises character G, the character G in the string of the second level is replaced with 0, then perform step A9;When the second string does not have character G, perform step A9;
Step A9, set the figure place last of described second level string as Q1, set the figure place second from the bottom of described second level string as Q2
By Q1And Q2It is respectively converted into decimal value;Calculate Q11=Q1+ 1 obtains Q11, calculate Q21=Q2+ 1 obtains Q21;Described 1≤Q11≤ 16, described 1≤Q21≤16;
Calculate T x , y = T m + 1 , n + 1 i f m &GreaterEqual; Q 11 a n d n &GreaterEqual; Q 21 T m + 1 , n - 1 i f m &GreaterEqual; Q 11 a n d n < Q 21 T m - 1 , n + 1 i f m < Q 11 a n d n &GreaterEqual; Q 21 T m - 1 , n - 1 i f m < Q 11 a n d n < Q 21 Obtain first object region TX, y
By TM, nWith TX, yIt is replaced;
Step A10, the first row region and the third line region are replaced;Second row region and fourth line region are replaced;Fifth line region and the 7th row region are replaced;6th row region and the 8th row region are replaced;9th row region and the tenth a line region are replaced;Tenth row region and the 12nd row region are replaced;Tenth territory, zone and the tenth five elements region are replaced;Ariadne region and the 16th row region are replaced;
In described step 3, the password of user's input is described second level string;
The encrypted image received is decrypted by step 3 and sequentially includes the following steps:
S1, encrypted image is divided into 16*16 square area T 1 , 1 T 1 , 2 ... ... T 1 , 16 T 2 , 1 T 2 , 2 ... ... T 2 , 16 ... ... ... ... ... ... ... ... T 16 , 1 T 16 , 2 ... ... T 16 , 16 , First to walk to fourth line region be the first encrypting module, and fifth line is the second encrypting module to the 8th row region, and the 9th to walk to the 12nd row region be the 3rd encrypting module, and the 13rd to walk to the 16th row region be the 4th encrypting module;
The password that S2, reception user input;
S3, judge whether the password that described user inputs is 14 figure place strings;When the password of user's input is 14 figure place string, perform step S4;When the password of user's input is not 14 figure place string, returns and perform step S2;
S4, judge input password in whether have character G;When password comprises character G, the character G in password is replaced with 0, then perform step S5;When password does not have character G, perform step S5;
S5, parallel carry out region determine and rgb value conversion;
Described region is determined and is sequentially included the following steps:
B1, the 1st to 4 figure place extracting password from left to right form third level string, and convert thereof into decimal value U1;The 5th to 8 figure place extracting password from left to right forms fourth stage string, and converts thereof into decimal value U2
Extract the 14th figure place of password from left to right, and convert thereof into decimal value U3;Extract the 13rd figure place of password from left to right, and convert thereof into decimal value U4
B2, choose region T to be changedR, t, r, t are positive integer and 1≤r≤16,1≤t≤16:
CalculateObtain r, calculateObtain t;Value according to r and t chooses region T to be changedR, t
B3, calculating U31=U3+ 1 obtains U31, calculate U41=U4+ 1 obtains U41;Described 1≤U31≤ 16, described 1≤U41≤16;
Calculate T p , q = T r + 1 , t + 1 i f r &GreaterEqual; U 31 a n d t &GreaterEqual; U 41 T r + 1 , t - 1 i f r &GreaterEqual; U 31 a n d t < U 41 T r - 1 , t + 1 i f r < U 31 a n d t &GreaterEqual; U 41 T r - 1 , t - 1 i f r < U 31 a n d t < U 41 Obtain the second target area TP, q;Described 1≤p≤16, described 1≤q≤16;
B4, selection TP, qCorresponding encrypting module, and this encrypting module is decrypted: the third line of the first row of this encrypting module Yu this encrypting module is replaced, the fourth line of the second row of this encrypting module Yu this encrypting module is replaced;
B5, judgementWhether with TP, qIt is positioned at same encrypting module;WhenWith TP, qWhen being positioned at same encrypting module, perform step B6;WhenWith TP, qNot when same encrypting module, willPlace encrypting module is decrypted: willThe first row of place encrypting module and the third line of this encrypting module are replaced, willSecond row of place encrypting module and the fourth line of this encrypting module are replaced, and then perform step B6;
B6, by TR, tWith TP, qIt is replaced;
The conversion of described rgb value sequentially includes the following steps:
The the 9th and the 10th figure place extracting password from left to right forms level V string, and converts thereof into decimal value U5;The the 11st and the 12nd figure place extracting password from left to right forms the 6th grade of string, and converts thereof into decimal value U6;The the 13rd and the 14th figure place extracting password from left to right forms the 7th grade of string, and converts thereof into decimal value U7
S6, carry out rgb value coupling:
Selected pixels point1≤i≤a, 1≤j≤a, and i, j, a be positive integer;WillR value, G-value and B value respectively with U5、U6And U7Contrast;JudgeR value whether equal to U5, whenR value be not equal to U5Time, terminate deciphering;WhenR value equal to U5Time, it is judged thatG-value whether equal to U6;WhenG-value be not equal to U6Time, terminate deciphering;WhenG-value equal to U6Time, it is judged thatB value whether equal to U7;WhenB value be not equal to U7Time, terminate deciphering;WhenB value whether equal to U7Time, perform step S7;
S7, judge that the first encrypting module is to the 4th encrypting module successively, if having be carried out deciphering;The encrypting module not being decrypted is decrypted:
The third line of the first row Yu this encrypting module of not deciphering encrypting module is replaced, the fourth line of the second row Yu this encrypting module of not deciphering encrypting module is replaced.
Adopt above technical scheme, it is possible to generate password according to the image adaptive provided, and formation speed is fast, and in conjunction with the password of generation, image can be encrypted, protect with the image to storage.Image is sent to access control equipment by user, and tells guest password, can realize control of remotely opening the door, technical scheme provided by the invention needs user remotely to send image and guest scene input password, it is achieved that dual fail-safe, safer, come back enabling also without user simultaneously, convenient.Even if the data of the data on backstage or user's transmission are stolen, also can guarantee that whole system and the safety of gate inhibition's method for controlling opening and closing.
It is also preferred that the left described step A7 chooses described pixel PijThe region T at placeM, nSequentially include the following steps:
CalculateObtain m, calculateObtain n;Value chosen area T according to m and nM, n
It is also preferred that the left in step A1, obtain, by image capture device, the square facial image that resolution is a*a and sequentially include the following steps:
Obtaining resolution by image capture device is the facial image of a*b, and a is the pixel quantity of horizontal direction, and b is the pixel quantity of vertical direction;
Judge whether a > b;
As a > b time, calculate W1=a-b, obtains number W to be increased1, then vertically add W1Individual rgb value is the pixel of 0,0,0, then performs step A2;
When a < during b, calculates W2=b-a, obtains number W to be increased2, then add W in the horizontal direction2Individual rgb value is the pixel of 0,0,0, and the numerical value of b is assigned to a, then performs step A2;
As a=b, perform step A2.
The invention has the beneficial effects as follows: password can be generated according to the image adaptive provided, and formation speed is fast, and in conjunction with the password of generation, image can be encrypted, protect with the image to storage.Image is sent to access control equipment by user, and tells guest password, can realize control of remotely opening the door, technical scheme provided by the invention needs user remotely to send image and guest scene input password, it is achieved that dual fail-safe, safer, come back enabling also without user simultaneously, convenient.Even if the data of the data on backstage or user's transmission are stolen, also can guarantee that whole system and the safety of gate inhibition's method for controlling opening and closing.Image additionally need not be carried out artificial setting code by the present invention, but the image set according to user automatically generates unique password, high and with image the restructuring of this cryptosecurity degree adapts, during later stage deciphering, image decryption can be made directly according to password, compared with traditional image decryption mode, the present invention need not retrodict according to ciphering process, improves the safety of image encryption.
Accompanying drawing explanation
Fig. 1 is the circuit theory diagrams of hardware system of the present invention.
Detailed description of the invention
Below in conjunction with drawings and Examples, the invention will be further described:
As it is shown in figure 1, the present invention is based on being used for sending the mobile phone terminal 1 of information and for receiving the gate terminal 2 of information, described gate terminal 2 includes controller 3, GPRS module 4, memory module 5, electronic lock 6 and Keysheet module 7;Described GPRS module 4, memory module 5 are bi-directionally connected with described controller 3 respectively, the control signal input of described controller 3 connects the control signal input of described electronic lock 6, and the signal output part of described Keysheet module 7 connects the signal input part of described controller 3;In the present embodiment, electronic lock 6 includes electrical switch, relay and machinery knocker, the control signal input port of electrical switch and the input interface of electronic lock, the control signal outfan of described controller connects the control signal input of described electrical switch, the source electrode of electrical switch and anode are connected with the positive pole of power supply, the drain electrode of electrical switch, and namely negative electrode is connected with the positive pole of relay, the negative pole of relay is connected with the negative pole of power supply, the action of relay iron servounit knocker.It is prior art that described controller controls electronic lock unlatching, does not repeat them here.
A kind of long-range enabling control method based on mobile phone sequentially includes the following steps:
Step one, controller 3 obtain user images and store;
Step 2, gate terminal 2 receive the encrypted image from mobile phone terminal 1 by GPRS module 4;
Step 3, user input password by Keysheet module 7, and the encrypted image that step 2 is received by controller 3 according to the password received is decrypted, and obtains image to be matched;
Step 4, image to be matched is mated with the user images of storage;When the user images of image to be matched Yu storage carries out that the match is successful, controller 3 sends control signal and turns on to described electronic lock 6;Terminate when image to be matched carries out mate unsuccessful with the user images of storage.In the present embodiment, the user images of image to be matched and storage carries out that the match is successful for image to be matched and the user images same pixel point of storage and reaches the half of user images pixel number of storage or above be successfully, in other embodiments, the match is successful can also be that image to be matched is identical etc. with the user images of storage for image to be matched and the user images of storage, image to be matched mates for ripe prior art with the user images of storage, it is not the inventive point of the present invention, does not repeat them here.
Described in step 2, encrypted image is encrypted according to the following steps:
Step A1, by image capture device obtain resolution be the square-shaped image of a*a, described a is positive integer;
Step A2, set in described facial image any one pixel as Pij, obtain pixel PijRgb value, described i, j are positive integer and 1≤i≤a, 1≤j≤a;
Step A3, by pixel PijR value, G-value and B value be respectively converted into the hexadecimal values of correspondence;
Judge pixel PijHexadecimal R value, hexadecimal G-value and hexadecimal B value whether reach two;
As pixel PijHexadecimal R value, hexadecimal G-value or hexadecimal B value less than two time, add a character G on this hexadecimal value left side less than two, to form pixel PijTwo R value character strings, two G-value character strings and two B value character strings, then perform step A4;As pixel PijHexadecimal R value, hexadecimal G-value or hexadecimal B value be when reaching two, performs step A4;
Step A4, by pixel PijTwo R value character strings, two G-value character strings and two B value character strings be arranged in order formation first order string from left to right;
Step A5, i and j is respectively converted into correspondence hexadecimal values;
Judge whether the hexadecimal value of i or the hexadecimal value of j reach four;When the hexadecimal value of i or the hexadecimal value of j are less than four, add character G, four character strings of four character strings and j to form i on this hexadecimal value left side less than four, then perform step A6;When the hexadecimal value of i or the hexadecimal value of j reach four, perform step A6;
Step A6 to, the four of j character strings are added the left side of described first order string, and the four of i character strings are added to the left side of four character strings of described j, to form second level string;
Step A7, described facial image is divided into 16*16 square area T 1 , 1 T 1 , 2 ... ... T 1 , 16 T 2 , 1 T 2 , 2 ... ... T 2 , 16 ... ... ... ... ... ... ... ... T 16 , 1 T 16 , 2 ... ... T 16 , 16 , Choose described pixel PijThe region T at placeM, n, m, n are positive integer and 1≤m≤16,1≤n≤16;
Step A8, judge whether second level string has character G;When the second string comprises character G, the character G in the string of the second level is replaced with 0, then perform step A9;When the second string does not have character G, perform step A9;
Step A9, set the figure place last of described second level string as Q1, set the figure place second from the bottom of described second level string as Q2
By Q1And Q2It is respectively converted into decimal value;Calculate Q11=Q1+ 1 obtains Q11, calculate Q21=Q2+ 1 obtains Q21;Described 1≤Q11≤ 16, described 1≤Q21≤16;
Calculate T x , y = T m + 1 , n + 1 i f m &GreaterEqual; Q 11 a n d n &GreaterEqual; Q 21 T m + 1 , n - 1 i f m &GreaterEqual; Q 11 a n d n < Q 21 T m - 1 , n + 1 i f m < Q 11 a n d n &GreaterEqual; Q 21 T m - 1 , n - 1 i f m < Q 11 a n d n < Q 21 Obtain first object region TX, y
By TM, nWith TX, yIt is replaced;
Step A10, the first row region and the third line region are replaced;Second row region and fourth line region are replaced;Fifth line region and the 7th row region are replaced;6th row region and the 8th row region are replaced;9th row region and the tenth a line region are replaced;Tenth row region and the 12nd row region are replaced;Tenth territory, zone and the tenth five elements region are replaced;Ariadne region and the 16th row region are replaced;
In described step 3, the password of user's input is described second level string;
The encrypted image received is decrypted by step 3 and sequentially includes the following steps:
S1, encrypted image is divided into 16*16 square area T 1 , 1 T 1 , 2 ... ... T 1 , 16 T 2 , 1 T 2 , 2 ... ... T 2 , 16 ... ... ... ... ... ... ... ... T 16 , 1 T 16 , 2 ... ... T 16 , 16 , First to walk to fourth line region be the first encrypting module, and fifth line is the second encrypting module to the 8th row region, and the 9th to walk to the 12nd row region be the 3rd encrypting module, and the 13rd to walk to the 16th row region be the 4th encrypting module;
The password that S2, reception user input;
S3, judge whether the password that described user inputs is 14 figure place strings;When the password of user's input is 14 figure place string, perform step S4;When the password of user's input is not 14 figure place string, returns and perform step S2;
S4, judge input password in whether have character G;When password comprises character G, the character G in password is replaced with 0, then perform step S5;When password does not have character G, perform step S5;
S5, parallel carry out region determine and rgb value conversion;
Described region is determined and is sequentially included the following steps:
B1, the 1st to 4 figure place extracting password from left to right form third level string, and convert thereof into decimal value U1;The 5th to 8 figure place extracting password from left to right forms fourth stage string, and converts thereof into decimal value U2
Extract the 14th figure place of password from left to right, and convert thereof into decimal value U3;Extract the 13rd figure place of password from left to right, and convert thereof into decimal value U4
B2, choose region T to be changedR, t, r, t are positive integer and 1≤r≤16,1≤t≤16:
CalculateObtain r, calculateObtain t;Value according to r and t chooses region T to be changedR, t
B3, calculating U31=U3+ 1 obtains U31, calculate U41=U4+ 1 obtains U41;Described 1≤U31≤ 16, described 1≤U41≤16;
Calculate T p , q = T r + 1 , t + 1 i f r &GreaterEqual; U 31 a n d t &GreaterEqual; U 41 T r + 1 , t - 1 i f r &GreaterEqual; U 31 a n d t < U 41 T r - 1 , t + 1 i f r < U 31 a n d t &GreaterEqual; U 41 T r - 1 , t - 1 i f r < U 31 a n d t < U 41 Obtain the second target area TP, q;Described 1≤p≤16, described 1≤q≤16;
B4, selection TP, qCorresponding encrypting module, and this encrypting module is decrypted: the third line of the first row of this encrypting module Yu this encrypting module is replaced, the fourth line of the second row of this encrypting module Yu this encrypting module is replaced;
B5, judgementWhether with TP, qIt is positioned at same encrypting module;WhenWith TP, qWhen being positioned at same encrypting module, perform step B6;WhenWith TP, qNot when same encrypting module, willPlace encrypting module is decrypted: willThe first row of place encrypting module and the third line of this encrypting module are replaced, willSecond row of place encrypting module and the fourth line of this encrypting module are replaced, and then perform step B6;
B6, by TR, tWith TP, qIt is replaced;
The conversion of described rgb value sequentially includes the following steps:
The the 9th and the 10th figure place extracting password from left to right forms level V string, and converts thereof into decimal value U5;The the 11st and the 12nd figure place extracting password from left to right forms the 6th grade of string, and converts thereof into decimal value U6;The the 13rd and the 14th figure place extracting password from left to right forms the 7th grade of string, and converts thereof into decimal value U7
S6, carry out rgb value coupling:
Selected pixels point1≤i≤a, 1≤j≤a, and i, j, a be positive integer;WillR value, G-value and B value respectively with U5、U6And U7Contrast;JudgeR value whether equal to U5, whenR value be not equal to U5Time, terminate deciphering;WhenR value equal to U5Time, it is judged thatG-value whether equal to U6;WhenG-value be not equal to U6Time, terminate deciphering;Work as PU1, U2G-value equal to U6Time, it is judged thatB value whether equal to U7;WhenB value be not equal to U7Time, terminate deciphering;WhenB value whether equal to U7Time, perform step S7;
S7, judge that the first encrypting module is to the 4th encrypting module successively, if having be carried out deciphering;The encrypting module not being decrypted is decrypted:
The third line of the first row Yu this encrypting module of not deciphering encrypting module is replaced, the fourth line of the second row Yu this encrypting module of not deciphering encrypting module is replaced.
In the present embodiment, described step A7 chooses described pixel PijThe region T at placeM, nSequentially include the following steps:
CalculateObtain m, calculateObtain n;Value chosen area T according to m and nM, n
In the present embodiment, in step A1, obtain, by image capture device, the square facial image that resolution is a*a and sequentially include the following steps:
Obtaining resolution by image capture device is the facial image of a*b, and a is the pixel quantity of horizontal direction, and b is the pixel quantity of vertical direction;
Judge whether a > b;
As a > b time, calculate W1=a-b, obtains number W to be increased1, then vertically add W1Individual rgb value is the pixel of 0,0,0, then performs step A2;
When a < during b, calculates W2=b-a, obtains number W to be increased2, then add W in the horizontal direction2Individual rgb value is the pixel of 0,0,0, and the numerical value of b is assigned to a, then performs step A2;
As a=b, perform step A2.
The preferred embodiment of the present invention described in detail above.Should be appreciated that those of ordinary skill in the art just can make many modifications and variations according to the design of the present invention without creative work.Therefore, all technical staff in the art, all should in the protection domain being defined in the patent claims under this invention's idea on the basis of existing technology by the available technical scheme of logical analysis, reasoning, or a limited experiment.

Claims (3)

1. the control method of remotely opening the door based on mobile phone, including the mobile phone terminal (1) for sending information with for receiving the gate terminal (2) of information, described gate terminal (2) includes controller (3), GPRS module (4), memory module (5), electronic lock (6) and Keysheet module (7);Described GPRS module (4), memory module (5) are bi-directionally connected with described controller (3) respectively, the control signal input of described controller (3) connects the control signal input of described electronic lock (6), and the signal output part of described Keysheet module (7) connects the signal input part of described controller (3);It is characterized in that comprising the following steps:
Step one, controller (3) obtain user images and store;
Step 2, gate terminal (2) receive the encrypted image from mobile phone terminal (1) by GPRS module (4);
Step 3, user are by Keysheet module (7) input password, and the encrypted image received is decrypted by controller (3) according to the password received, and obtains image to be matched;
Step 4, image to be matched is mated with the user images of storage;When the user images of image to be matched Yu storage carries out that the match is successful, controller (3) sends control signal and turns on to described electronic lock (6);Terminate when image to be matched carries out mate unsuccessful with the user images of storage;
Described in step 2, encrypted image is encrypted according to the following steps:
Step A1, by image capture device obtain resolution be the square-shaped image of a*a, described a is positive integer;
Step A2, set in described facial image any one pixel as Pij, obtain pixel PijRgb value, described i, j are positive integer and 1≤i≤a, 1≤j≤a;
Step A3, by pixel PijR value, G-value and B value be respectively converted into the hexadecimal values of correspondence;
Judge pixel PijHexadecimal R value, hexadecimal G-value and hexadecimal B value whether reach two;
As pixel PijHexadecimal R value, hexadecimal G-value or hexadecimal B value less than two time, add a character G on this hexadecimal value left side less than two, to form pixel PijTwo R value character strings, two G-value character strings and two B value character strings, then perform step A4;As pixel PijHexadecimal R value, hexadecimal G-value or hexadecimal B value be when reaching two, performs step A4;
Step A4, by pixel PijTwo R value character strings, two G-value character strings and two B value character strings be arranged in order formation first order string from left to right;
Step A5, i and j is respectively converted into correspondence hexadecimal values;
Judge whether the hexadecimal value of i or the hexadecimal value of j reach four;When the hexadecimal value of i or the hexadecimal value of j are less than four, add character G, four character strings of four character strings and j to form i on this hexadecimal value left side less than four, then perform step A6;When the hexadecimal value of i or the hexadecimal value of j reach four, perform step A6;
Step A6 to, the four of j character strings are added the left side of described first order string, and the four of i character strings are added to the left side of four character strings of described j, to form second level string;
Step A7, described facial image is divided into 16*16 square area T 1 , 1 T 1 , 2 ... ... T 1 , 16 T 2 , 1 T 2 , 2 ... ... T 2 , 16 ... ... ... ... ... ... ... ... T 16 , 1 T 16 , 2 ... ... T 16 , 16 , Choose described pixel PijThe region T at placeM, n, m, n are positive integer and 1≤m≤16,1≤n≤16;
Step A8, judge whether second level string has character G;When the second string comprises character G, the character G in the string of the second level is replaced with 0, then perform step A9;When the second string does not have character G, perform step A9;
Step A9, set the figure place last of described second level string as Q1, set the figure place second from the bottom of described second level string as Q2
By Q1And Q2It is respectively converted into decimal value;Calculate Q11=Q1+ 1 obtains Q11, calculate Q21=Q2+ 1 obtains Q21;Described 1≤Q11≤ 16, described 1≤Q21≤16;
Calculate T x , y = T m + 1 , n + 1 i f m &GreaterEqual; Q 11 a n d n &GreaterEqual; Q 21 T m + 1 , n - 1 i f m &GreaterEqual; Q 11 a n d n < Q 21 T m - 1 , n + 1 i f m < Q 11 a n d n &GreaterEqual; Q 21 T m - 1 , n - 1 i f m < Q 11 a n d n < Q 21 Obtain first object region TX, y
By TM, nWith TX, yIt is replaced;
Step A10, the first row region and the third line region are replaced;Second row region and fourth line region are replaced;Fifth line region and the 7th row region are replaced;6th row region and the 8th row region are replaced;9th row region and the tenth a line region are replaced;Tenth row region and the 12nd row region are replaced;Tenth territory, zone and the tenth five elements region are replaced;Ariadne region and the 16th row region are replaced;
In described step 3, the password of user's input is described second level string;
The encrypted image received is decrypted by step 3 and sequentially includes the following steps:
S1, encrypted image is divided into 16*16 square area T 1 , 1 T 1 , 2 ... ... T 1 , 16 T 2 , 1 T 2 , 2 ... ... T 2 , 16 ... ... ... ... ... ... ... ... T 16 , 1 T 16 , 2 ... ... T 16 , 16 , First to walk to fourth line region be the first encrypting module, and fifth line is the second encrypting module to the 8th row region, and the 9th to walk to the 12nd row region be the 3rd encrypting module, and the 13rd to walk to the 16th row region be the 4th encrypting module;
The password that S2, reception user input;
S3, judge whether the password that described user inputs is 14 figure place strings;When the password of user's input is 14 figure place string, perform step S4;When the password of user's input is not 14 figure place string, returns and perform step S2;
S4, judge input password in whether have character G;When password comprises character G, the character G in password is replaced with 0, then perform step S5;When password does not have character G, perform step S5;
S5, parallel carry out region determine and rgb value conversion;
Described region is determined and is sequentially included the following steps:
B1, the 1st to 4 figure place extracting password from left to right form third level string, and convert thereof into decimal value U1;The 5th to 8 figure place extracting password from left to right forms fourth stage string, and converts thereof into decimal value U2
Extract the 14th figure place of password from left to right, and convert thereof into decimal value U3;Extract the 13rd figure place of password from left to right, and convert thereof into decimal value U4
B2, choose region T to be changedR, t, r, t are positive integer and 1≤r≤16,1≤t≤16:
CalculateObtain r, calculateObtain t;Value according to r and t chooses region T to be changedR, t
B3, calculating U31=U3+ 1 obtains U31, calculate U41=U4+ 1 obtains U41;Described 1≤U31≤ 16, described 1≤U41≤16;
Calculate T p , q = T r + 1 , t + 1 i f r &GreaterEqual; U 31 a n d t &GreaterEqual; U 41 T r + 1 , t - 1 i f r &GreaterEqual; U 31 a n d t < U 41 T r - 1 , t + 1 i f r < U 31 a n d t &GreaterEqual; U 41 T r - 1 , t - 1 i f r < U 31 a n d t < U 41 Obtain the second target area TP, q;Described 1≤p≤16, described 1≤q≤16;
B4, selection TP, qCorresponding encrypting module, and this encrypting module is decrypted: the third line of the first row of this encrypting module Yu this encrypting module is replaced, the fourth line of the second row of this encrypting module Yu this encrypting module is replaced;
B5, judgementWhether with TP, qIt is positioned at same encrypting module;WhenWith TP, qWhen being positioned at same encrypting module, perform step B6;WhenWith TP, qNot when same encrypting module, willPlace encrypting module is decrypted: willThe first row of place encrypting module and the third line of this encrypting module are replaced, willSecond row of place encrypting module and the fourth line of this encrypting module are replaced, and then perform step B6;
B6, by TR, tWith TP, qIt is replaced;
The conversion of described rgb value sequentially includes the following steps:
The the 9th and the 10th figure place extracting password from left to right forms level V string, and converts thereof into decimal value U5;The the 11st and the 12nd figure place extracting password from left to right forms the 6th grade of string, and converts thereof into decimal value U6;The the 13rd and the 14th figure place extracting password from left to right forms the 7th grade of string, and converts thereof into decimal value U7
S6, carry out rgb value coupling:
Selected pixels point1≤i≤a, 1≤j≤a, and i, j, a be positive integer;WillR value, G-value and B value respectively with U5、U6And U7Contrast;Judge PU1, U2R value whether equal to U5, whenR value be not equal to U5Time, terminate deciphering;WhenR value equal to U5Time, it is judged thatG-value whether equal to U6;WhenG-value be not equal to U6Time, terminate deciphering;WhenG-value equal to U6Time, it is judged thatB value whether equal to U7;WhenB value be not equal to U7Time, terminate deciphering;WhenB value whether equal to U7Time, perform step S7;
S7, judge that the first encrypting module is to the 4th encrypting module successively, if having be carried out deciphering;The encrypting module not being decrypted is decrypted:
The third line of the first row Yu this encrypting module of not deciphering encrypting module is replaced, the fourth line of the second row Yu this encrypting module of not deciphering encrypting module is replaced.
2. a kind of control method of remotely opening the door based on mobile phone as claimed in claim 1, is characterized in that: choose described pixel P in described step A7ijThe region T at placeM, nSequentially include the following steps:
CalculateObtain m, calculateObtain n;Value chosen area T according to m and nM, n
3. a kind of control method of remotely opening the door based on mobile phone as claimed in claim 1, is characterized in that: in step A1, obtains, by image capture device, the square facial image that resolution is a*a and sequentially includes the following steps:
Obtaining resolution by image capture device is the facial image of a*b, and a is the pixel quantity of horizontal direction, and b is the pixel quantity of vertical direction;
Judge whether a > b;
As a > b time, calculate W1=a-b, obtains number W to be increased1, then vertically add W1Individual rgb value is the pixel of 0,0,0, then performs step A2;
When a < during b, calculates W2=b-a, obtains number W to be increased2, then add W in the horizontal direction2Individual rgb value is the pixel of 0,0,0, and the numerical value of b is assigned to a, then performs step A2;
As a=b, perform step A2.
CN201610082459.XA 2016-02-05 2016-02-05 Remote door opening control method based on mobile phone Pending CN105788039A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610082459.XA CN105788039A (en) 2016-02-05 2016-02-05 Remote door opening control method based on mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610082459.XA CN105788039A (en) 2016-02-05 2016-02-05 Remote door opening control method based on mobile phone

Publications (1)

Publication Number Publication Date
CN105788039A true CN105788039A (en) 2016-07-20

Family

ID=56402225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610082459.XA Pending CN105788039A (en) 2016-02-05 2016-02-05 Remote door opening control method based on mobile phone

Country Status (1)

Country Link
CN (1) CN105788039A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090041619A (en) * 2007-10-24 2009-04-29 주식회사 두올테크 Entrance and exit control system
US20130138968A1 (en) * 2006-05-24 2013-05-30 Confident Technologies, Inc. Graphical encryption and display of codes and text
CN103413269A (en) * 2013-08-20 2013-11-27 宁波大学 Image steganography method and secret information extraction method
CN104766350A (en) * 2015-04-16 2015-07-08 大连大学 Image encryption method based on splicing model and hyper-chaotic system
CN104899953A (en) * 2015-06-26 2015-09-09 杜晓通 High-security door access control system and method based on image association
CN104967521A (en) * 2015-08-04 2015-10-07 杨炳 High-safety distribution box with keyless entrance guard

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130138968A1 (en) * 2006-05-24 2013-05-30 Confident Technologies, Inc. Graphical encryption and display of codes and text
KR20090041619A (en) * 2007-10-24 2009-04-29 주식회사 두올테크 Entrance and exit control system
CN103413269A (en) * 2013-08-20 2013-11-27 宁波大学 Image steganography method and secret information extraction method
CN104766350A (en) * 2015-04-16 2015-07-08 大连大学 Image encryption method based on splicing model and hyper-chaotic system
CN104899953A (en) * 2015-06-26 2015-09-09 杜晓通 High-security door access control system and method based on image association
CN104967521A (en) * 2015-08-04 2015-10-07 杨炳 High-safety distribution box with keyless entrance guard

Similar Documents

Publication Publication Date Title
CN105644500B (en) Car door opening control method based on wireless security system
CN104167029B (en) A kind of intelligent lock and its operating method
CN107578511A (en) A kind of smart lock and its Intelligent key
CN100387798C (en) Electric key and electric lock device and realization method thereof
CN108055235A (en) A kind of control method of smart lock, relevant device and system
CN106056713B (en) A kind of remote-authorization method of coded lock
CN105303651A (en) Bluetooth based two-way communication automatic locking system and method
CN109410396B (en) Intelligent lock data encryption transmission method and leasing equipment applying same
CN204631968U (en) Intelligent door lock
KR101238804B1 (en) Vehicle remote control system and method using voice or text via wirelees communication terminal
JP2010166486A5 (en)
CN107564159A (en) A kind of smart bluetooth locks group&#39;s management control system
CN204463267U (en) A kind of intelligent access control system
CN205788363U (en) A kind of multiple authentication Gate-ban Monitoring System of Home House
CN110932951B (en) Intelligent household control method and device
CN111127710B (en) Intelligent lock safe off-line unlocking password generation method
CN113971849A (en) Dynamic coded lock with management system
CN103106714B (en) Based on method for unlocking and the system of hand-held terminal device PDA and fingerprint identification technology
CN102542647A (en) Method and system for opening safe or entrance guard device by utilizing mobile terminal
CN207909222U (en) Smart bluetooth is locked and smart bluetooth lock system
CN112738052B (en) Authentication method between devices, storage medium and electronic device
CN105787576A (en) Hotel reservation realization method and system based on intelligent glasses door lock
CN106934264A (en) A kind of intelligent unlocking method, device and lock device
CN105788039A (en) Remote door opening control method based on mobile phone
CN112425116A (en) Intelligent door lock wireless communication method, intelligent door lock, gateway and communication equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160720

WD01 Invention patent application deemed withdrawn after publication