CN107481376B - Three-dimensional code unlocking method based on intelligent application - Google Patents

Three-dimensional code unlocking method based on intelligent application Download PDF

Info

Publication number
CN107481376B
CN107481376B CN201710717447.4A CN201710717447A CN107481376B CN 107481376 B CN107481376 B CN 107481376B CN 201710717447 A CN201710717447 A CN 201710717447A CN 107481376 B CN107481376 B CN 107481376B
Authority
CN
China
Prior art keywords
dimensional code
serial number
key
scanning device
unlocking
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.)
Active
Application number
CN201710717447.4A
Other languages
Chinese (zh)
Other versions
CN107481376A (en
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.)
Three Dimensional Code (xiamen) Network Technology Co Ltd
Original Assignee
Three Dimensional Code (xiamen) Network 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 Three Dimensional Code (xiamen) Network Technology Co Ltd filed Critical Three Dimensional Code (xiamen) Network Technology Co Ltd
Priority to CN201710717447.4A priority Critical patent/CN107481376B/en
Publication of CN107481376A publication Critical patent/CN107481376A/en
Application granted granted Critical
Publication of CN107481376B publication Critical patent/CN107481376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code

Abstract

The invention discloses a three-dimensional code unlocking method based on intelligent application, which comprises the steps of firstly, carrying out deep learning on a plurality of three-dimensional code pattern information acquired by different angles and different light rays to obtain an accurate three-dimensional code comparison threshold value and weight parameters; then, in the unlocking process, the three-dimensional code scanning device verifies the user identity according to the internal authority setting, verifies the three-dimensional code according to the three-dimensional code comparison threshold and the weight parameter, and verifies the password and the serial number (or only the serial number) of the key area of the three-dimensional code, and in conclusion, the unlocking is executed after the three-layer verification is successful. In addition, when the variable key and the variable serial number are simultaneously arranged on the key area, the change algorithm of the serial number generally adopts an addition and subtraction algorithm such as adding one or subtracting one, so that the rapidness of unlocking can be ensured; the key does not need to be changed every time, and the key can be changed regularly, so that the unlocking time can be further shortened while the safety performance is improved, and a user can have a good experience.

Description

Three-dimensional code unlocking method based on intelligent application
Technical Field
The invention relates to a three-dimensional code unlocking method based on intelligent application.
Background
With the development of modern electronic technology, the lock and key device in the modern sense is not limited to the traditional pure mechanical lock, and in recent years, with the rise of two-dimensional codes, a two-dimensional code lock and key device also appears. The two-dimension code lock key device is used for a user to use a two-dimension code as a key or an auxiliary key, and the two-dimension code lock key device scans the two-dimension code displayed on the mobile terminal to unlock the mobile terminal. Compared with the traditional pure mechanical lock, the two-dimension code key device avoids the trouble that a user always needs to carry a key with him, and the unlocking process is more convenient. However, the two-dimension code is adopted as a key in the current two-dimension code key locking device, certain security holes exist, because the two-dimension code is very easy to copy, and the room door can be opened only by the correct two-dimension code in the current two-dimension code key locking device, so that great potential safety hazards can be brought by the loss or leakage of the two-dimension code.
The two-dimensional code is a symbol in which information is represented by a black-and-white pattern in both the horizontal and vertical directions of a plane. Compared with the one-dimensional bar code, the two-dimensional bar code has the advantages of larger information quantity and information density, higher reading speed, wider coding range, lower cost and strong fault-tolerant capability. In view of these advantages of two-dimensional barcodes, countries around the world compete for research and development, and two-dimensional barcodes are widely used. There are QR Code (Quick Response Code) developed by Denso Wave, Japan, PDF417 Code developed by Symbol, USA, and Hanxin Code developed by China, respectively.
The QR Code is a square two-dimensional Code formed by combining black and white grids. QR is an abbreviation for QuickResponse in english because the inventors expect QR Code to have its content decoded quickly. QR Code was first applied to automotive parts management, and then to warehouse management in various industries. Nowadays, people rely more and more on obtaining required information through smart phones due to the development of network media and the popularization of smart phones. Due to good information tracking capability, the two-dimensional code is widely adopted by marketing and propaganda industries and is commonly used for advertisement media transmission, and a user can scan the two-dimensional code through a mobile phone camera. The two-dimensional Code refers to QR Code, and all technical parameters related to the two-dimensional Code adopt the standard manufacturing method.
Due to the limitation of the two-dimensional code encoding mode, the two-dimensional code cannot be randomly presented with various effects when beautified, so artists and researchers begin to challenge various methods for beautifying the two-dimensional code, and the purpose is to enable the two-dimensional code to have better visual effect and ensure decoding robustness. Two methods can be roughly classified based on whether the encoding method of the two-dimensional code module information is changed.
The first method changes the code of the two-dimensional code module information. In the methods proposed in the papers (s.ono, k.moringa, and s.nakayama, "Two-dimensional bar code resolution based on real-coded genetic algorithm," IEEE consistency on evolution calculation, pp.1068-1073,2008, and d.samretwit and t.wakahara, "Measurement of reading characteristics of multiplexed image in QR code," International reference on intelligent network and collectivity Systems, pp.552-557,2011), since a Two-dimensional code has a fault-tolerant capability, it can be correctly decoded even if a part of a module is replaced with an image or a flag. However, since superimposing an image on a positioning mark or a correction mark seriously degrades the correct decoding rate of a two-dimensional code, the most common method is to embed the image or mark in the center of the two-dimensional code (see Unitag: https:// www.unitag.io/qrcode). The method limits the position of the modification module area, and the image area only occupies a small part of the two-dimensional code, which is not particularly obvious and is far from enough for beautifying the two-dimensional code. In addition, the methods do not fully utilize the generation process of the code words, destroy the module of the two-dimensional code and reduce the reliability of decoding.
The second method does not change the code of the two-dimensional code module information, and directly modifies the brightness or color of the corresponding subject image pixel according to the module color. Some inventors have used the color of two-dimensional codes (e.g., A.T Communications: http:// logoq. net/logoq/index. html, and Get QR Code Generator Pro: http:// www.qr-Code-Generator. com) to achieve artistic effects. In a two-dimensional code production method of an on-line program Visualead (Visualead: http:// www.visualead.com), a pixel in the center of a block is selected to change the luminance. Because the sampling area of the decoder when decoding the two-dimensional code is the central area of the module, the method can better balance the decoding robustness and the image fidelity. However, the proportion of the modified central pixel in the module is relatively large, so that the connectivity of the picture is reduced. The method does not change the coding of the two-dimensional code module information, ensures the decoding robustness, but the decoding sampling points are scattered in the image, which can cause bad influence on the vision.
In summary, the main challenge of any two-dimensional code visualization method is to be able to be decoded by standard applications. The introduction of the pixel causes the brightness of the two-dimensional code to change, the binarization threshold value is distorted, and the probability of decoding errors is increased. The second challenge is the problem of optimizing vision using the entire area of the two-dimensional code. Since the two-dimensional code has a limited error correction capability, a module of the two-dimensional code cannot be simply replaced with pixels. The invention patent (application number 201710146047.2) previously applied by this company discloses a three-dimensional code generation method based on gaussian modulation function, which uses gaussian modulation function to make three-dimensional code, i.e. modify the brightness of the subject image pixel corresponding to the two-dimensional code module, make the change of pixel color decrease smoothly from the center to the periphery, and determine the decreasing speed according to the smooth degree of the module block, so that the module block after brightness adjustment is smoother, and conforms to the perception knowledge of human Visual system hvs (human Visual system) on color and brightness. In the method, although the reading quality of the three-dimensional code is improved, the decoding accuracy is improved, and the visual impression is optimized, the risk of loss or leakage still exists after the three-dimensional code is copied, so that great potential safety hazard is brought.
Disclosure of Invention
Therefore, aiming at the problems, the invention provides a three-dimensional code unlocking method based on intelligent application, wherein an improved three-dimensional code is adopted as a key, the improved three-dimensional code is difficult to copy, and is further encrypted, so that potential safety hazards caused by loss or leakage of the three-dimensional code are prevented.
In order to solve the technical problems, the invention adopts the technical scheme that a three-dimensional code unlocking method based on intelligent application is characterized in that a three-dimensional code scanning device is arranged in a lockset, a three-dimensional code is arranged on a mobile terminal, the unlocking method comprises a deep learning process and an unlocking process, wherein the deep learning process comprises the following steps:
process 1 a: a three-dimensional code scanning device in the lockset scans the three-dimensional code of the mobile terminal for multiple times to obtain a plurality of three-dimensional code pattern information;
process 1 b: screening the scanned three-dimensional code pattern information to obtain effective three-dimensional code pattern information sets, and preprocessing the effective three-dimensional code pattern information sets to obtain training samples with uniform formats; the preprocessing specifically comprises quantizing each component of sample vectors with different scales and belonging to different intervals into a unified interval, so that training samples have the same scale and subsequent processing is facilitated;
procedure 1 c: setting a preset three-dimensional code comparison threshold;
calculating a training sample to obtain a preliminary weight parameter, and adjusting the preliminary weight parameter and a preset three-dimensional code comparison threshold value in the training process to obtain the weight parameter and the three-dimensional code comparison threshold value; the method comprises the steps of firstly carrying out forward propagation calculation on a training sample to obtain a residual error and a weight parameter, and then carrying out adjustment on the weight parameter and a three-dimensional code comparison threshold value by minimizing the residual error to obtain the weight parameter and the three-dimensional code comparison threshold value;
the three-dimensional code comparison threshold is used for: after the three-dimensional code scanning device scans the three-dimensional code of the mobile terminal, calculating the obtained three-dimensional code pattern information and the weight parameter to obtain the three-dimensional code pattern deviation, and if the three-dimensional code pattern deviation is within the range of the three-dimensional code comparison threshold, determining that the three-dimensional code pattern information is qualified;
the unlocking process comprises the following steps:
process 2 a: the three-dimensional code scanning device in the lockset scans the three-dimensional code of the mobile terminal to acquire three-dimensional code information and user identity verification information, executes the following verification process and outputs a verification result signal:
procedure 2a 1: the three-dimensional code scanning device verifies the user identity verification information: the three-dimensional code scanning device traverses the identity information stored in the memory of the three-dimensional code scanning device, if the identity authentication information of the user exists, the identity authentication is passed, and the process 2a2 is executed; otherwise, the unlocking process is quitted, and the failure of identity authentication is prompted;
procedure 2a 2: the three-dimensional code scanning device calculates the obtained three-dimensional code pattern information and the weight parameter to obtain three-dimensional code pattern deviation, if the three-dimensional code pattern deviation is within the range of the three-dimensional code comparison threshold value, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted;
process 2 b: if the verification result signal output by the three-dimensional code scanning device is qualified, an unlocking command is sent to the lockset;
and 2 c: the lock receives the unlocking command and unlocks.
To prevent copying, the verification process further includes, as a possible solution, process 2a 3: the three-dimensional code is also provided with a key area, the key area is provided with a serial number, and the three-dimensional code scanning device is provided with a serial number corresponding to the serial number of the key area; after the three-dimensional code scanning device scans the three-dimensional code pattern information, the serial number in the key area is analyzed, the three-dimensional code scanning device verifies the serial number of the key area through the serial number of the three-dimensional code scanning device and the serial number in the key area, if the verification is successful, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted; and simultaneously, after the three-dimensional code scanning device successfully verifies the serial number of the key area, the serial number on the key area is changed according to a first preset algorithm and is simultaneously fed back to the mobile terminal, the mobile terminal changes the serial number of the key area according to a second preset algorithm, and the first preset algorithm corresponds to the second preset algorithm, so that the serial number of the key area and the serial number of the three-dimensional code scanning device are still in one-to-one correspondence.
To prevent copying, as another possible solution, the verification process further includes a process 2a 3: the three-dimensional code scanning device is provided with a key and a serial number corresponding to the key and the serial number of the key area; after the three-dimensional code scanning device scans the three-dimensional code pattern information, a key and a serial number in a key area are simultaneously analyzed, the three-dimensional code scanning device verifies the key and the serial number in the key area through the key and the serial number of the three-dimensional code scanning device, if the verification is successful, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted; meanwhile, after the key and the serial number of the key area are successfully verified by the three-dimensional code scanning device, the key on the key area is changed according to a first algorithm, the serial number is changed according to a second algorithm and simultaneously fed back to the mobile terminal, the key of the key area is changed by the mobile terminal according to a third algorithm, and the serial number of the key area is changed by the mobile terminal according to a fourth algorithm, wherein the first algorithm corresponds to the third algorithm (can be the same or matched), the second algorithm corresponds to the fourth algorithm (can be the same or matched), so that the key and the serial number of the key area and the key and the serial number of the three-dimensional code scanning device still keep one-to-one correspondence respectively.
By setting a key area on the three-dimensional code on the mobile terminal and setting a variable serial number on the key area, the security problem after copying can be prevented because: when the three-dimensional code scanning device scans the copied three-dimensional code, the serial number of the copied three-dimensional code cannot correspond to the serial number built in the three-dimensional code scanning device, the three-dimensional code pattern information is seriously unqualified, namely the three-dimensional code authentication fails, and the unlocking process cannot be further executed. In addition, the key area is simultaneously provided with the variable key and the variable serial number, so that the safety can be further ensured. The algorithm for changing the serial number generally adopts an addition and subtraction algorithm such as adding one or subtracting one, so that the rapidness of unlocking can be ensured. The user may set the use of a serial number only or a combination of a serial number and a key according to specific security level requirements. In addition, in order to ensure the unlocking speed, generally, the secret key does not need to be changed every time, the secret key can be changed regularly, and the serial number needs to be changed after the unlocking is successfully performed every time the scanning is performed.
Further, the key region is located at a non-central position of the three-dimensional code, the central position is generally used for placing the subject image, in order to avoid conflict with the subject image or incapability of quickly identifying the key region, the key region is generally arranged at a corner position of the three-dimensional code far away from the subject image, and the size of the key region is not larger than 1/8 of the whole area of the three-dimensional code.
Further, in the process 2a2, if the three-dimensional code pattern information is qualified, the weight parameter and the three-dimensional code comparison threshold are further adjusted in the training process, the training sample is first forward propagated and calculated to obtain a residual error and a weight parameter, and then the residual error is minimized to adjust the weight parameter and the three-dimensional code comparison threshold to obtain a new weight parameter and a new three-dimensional code comparison threshold, so as to replace the original weight parameter and the original three-dimensional code comparison threshold.
Further, the three-dimensional code is generated by the following steps:
step 1, generating a two-dimensional code containing embedded information;
step 2, zooming the image O according to the version of the two-dimensional code and the set size of the two-dimensional code module to obtain a square image S;
and step 3: generating a threshold layer T by using S;
and 4, step 4: overlapping the S and the two-dimension code to find out a block corresponding to the S by the two-dimension code module;
and 5: according to the color of the two-dimensional code module, comparing the average brightness value L and T of the central area of the corresponding module in the S with the set toughness value r, and judging whether the modification is needed;
step 6: if the modification is not needed, the corresponding module area of S is not modified; if the two-dimensional code needs to be modified, the brightness of the area is adjusted by using a Gaussian modulation function, so that the color of the two-dimensional code can be met after L is compared with T and r;
and 7: repeating the steps 5-6 until all the modules are processed;
and 8: mixing the S and the area corresponding to the two-dimensional code positioning mark to form a three-dimensional code;
and step 9: the key area is provided at a peripheral position of the three-dimensional code.
In step 2, the side length of the square image S is pixel (17+4 × V) × w, where w is the number of pixels of the side length of the two-dimensional code module, and V is the version of the two-dimensional code.
The specific content of the step 3 is as follows: and converting the RGB space of the S into a YUV color space, processing the gray-scale image G of the Y plane to generate a threshold layer T which is used as a threshold for adjusting the brightness of the S.
The content of the above processing is: the image converted into YUV color space is divided into non-repetitive blocks, the size of one window is set as 5 x 5 blocks, and the average brightness of all blocks in the window taking a certain block as the center is defined as the average brightness of the block.
In the step 4, sampling judgment is performed around the center of the module block, the module center area is black, the value of the module is set to 1, the value of the module is set to 0, and the average brightness of the c × c pixels corresponding to the center of the two-dimensional code module is used to replace the average brightness of the block corresponding to the whole module, wherein c is the number of the side length pixels in the center area of the three-dimensional code module.
In the step 6, the change amount of the adjusted brightness is:
Figure DEST_PATH_GDA0001399307210000081
wherein, (m, n) represents an index of the two-dimensional code module, lm,nAverage brightness value, t, of the center region of the module representing coordinate point (m, n)m,nT value, q, of the center region of the module representing coordinate point (m, n)m,nAnd the color of the coordinate point (m, n) two-dimensional code module is represented, wherein black is 0 and white is 1.
The step 8 further includes: and a white static area is added at the periphery of the three-dimensional code. The width of the added white static area is 4 x w pixels, wherein w is the number of the side length pixels of the two-dimensional code module.
By adopting the scheme, compared with the prior art, the invention also has the following advantages:
1. the method comprises the steps that firstly, deep learning is carried out on a plurality of three-dimensional code pattern information collected by different angles and different light rays, an accurate three-dimensional code comparison threshold value and weight parameters are obtained, and the verification speed of a three-dimensional code scanning device can be increased; meanwhile, the user still continues to learn in the subsequent scanning process, namely the longer the user uses the system, the higher the verification speed of the system is;
2. in the unlocking process, the three-dimensional code scanning device verifies the user identity according to the internal authority setting, verifies the three-dimensional code according to the three-dimensional code comparison threshold and the weight parameter, and verifies the password and the serial number (or only the serial number) of the key area of the three-dimensional code, and in conclusion, the unlocking is executed after the three-layer verification is successful, so that the three-dimensional code unlocking method has very good confidentiality and is very suitable for occasions with high security level;
3. when the variable key and the variable serial number are simultaneously arranged on the key area, the change algorithm of the serial number generally adopts an addition and subtraction algorithm such as adding one or subtracting one, so that the rapidness of unlocking can be ensured; the key does not need to be changed every time, and the unlocking time can be further reduced while the safety performance is improved by changing the key regularly, so that a user can experience a good feeling;
4. in addition, the three-dimensional code is manufactured by utilizing a Gaussian modulation function, namely, the brightness of the subject image pixel corresponding to the two-dimensional code module is modified, the change amount of the pixel color is smoothly decreased from the center to the periphery, and the decreasing speed is determined according to the smooth degree of the module block, so that the module block with the brightness adjusted is smoother, and the perception cognition of the human visual system HVS (human visual System) on the color and the brightness is met.
Detailed Description
The invention provides a three-dimensional code unlocking method based on intelligent application, wherein a three-dimensional code scanning device is arranged in a lockset, a three-dimensional code is arranged on a mobile terminal, and the unlocking method comprises a deep learning process and an unlocking process, wherein the deep learning process comprises the following steps:
process 1 a: a three-dimensional code scanning device in the lockset scans the three-dimensional code (different angles and different light rays) of the mobile terminal for multiple times to obtain a plurality of three-dimensional code pattern information;
process 1 b: screening the scanned three-dimensional code pattern information to obtain effective three-dimensional code pattern information sets, and preprocessing the effective three-dimensional code pattern information sets to obtain training samples with uniform formats; the preprocessing specifically comprises quantizing each component of sample vectors with different scales and belonging to different intervals into a uniform interval, so that training samples have the same scale and further facilitate subsequent processing;
procedure 1 c: setting a preset three-dimensional code comparison threshold;
calculating a training sample to obtain a preliminary weight parameter, and adjusting the preliminary weight parameter and a preset three-dimensional code comparison threshold value in the training process to obtain a weight parameter (an optimal value) and a three-dimensional code comparison threshold value (an optimal interval value); the method comprises the steps of firstly carrying out forward propagation calculation on a training sample to obtain a residual error and a weight parameter, and then carrying out adjustment on the weight parameter and a three-dimensional code comparison threshold value by minimizing the residual error to obtain the weight parameter and the three-dimensional code comparison threshold value;
the three-dimensional code comparison threshold is used for: after the three-dimensional code scanning device scans the three-dimensional code of the mobile terminal, calculating (in a preset calculation mode, such as convolution operation) the obtained three-dimensional code pattern information and the weight parameter to obtain a three-dimensional code pattern deviation, wherein if the three-dimensional code pattern deviation is within the range of a three-dimensional code comparison threshold, the three-dimensional code pattern information is qualified;
the unlocking process comprises the following steps:
process 2 a: the three-dimensional code scanning device in the lockset scans the three-dimensional code of the mobile terminal to acquire three-dimensional code information and user identity verification information, executes the following verification process and outputs a verification result signal:
procedure 2a 1: the three-dimensional code scanning device verifies the user identity verification information: the three-dimensional code scanning device traverses the identity information stored in the memory of the three-dimensional code scanning device, if the identity authentication information of the user exists, the identity authentication is passed, and the process 2a2 is executed; otherwise, the unlocking process is quitted, and the failure of identity authentication is prompted;
procedure 2a 2: the three-dimensional code scanning device calculates the obtained three-dimensional code pattern information and the weight parameter (a preset calculation mode) to obtain three-dimensional code pattern deviation, if the three-dimensional code pattern deviation is within the range of the three-dimensional code comparison threshold value, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted; if the three-dimensional code pattern information is qualified, further adjusting a weight parameter and a three-dimensional code comparison threshold in the training process, firstly performing forward propagation calculation on a training sample to obtain a residual error and a weight parameter, then adjusting the weight parameter and the three-dimensional code comparison threshold by minimizing the residual error to obtain a new weight parameter and a new three-dimensional code comparison threshold, and replacing the original weight parameter and the original three-dimensional code comparison threshold; when the three-dimensional code scanning device compares the new weight parameter with the new three-dimensional code comparison threshold value, the new weight parameter and the new three-dimensional code comparison threshold value are used as comparison parameters;
process 2 b: if the verification result signal output by the three-dimensional code scanning device is qualified, an unlocking command is sent to the lockset;
and 2 c: the lock receives the unlocking command and unlocks. The lock is internally provided with a control circuit and a driving motor for unlocking, when the control circuit receives an unlocking command sent by the three-dimensional code scanning device, the control circuit sends a signal to the driving motor, and the driving motor receives the signal and then controls the lock tongue of the lock to contract, so that unlocking is realized.
To prevent copying, the verification process further includes, as a possible solution, process 2a 3: the three-dimensional code is also provided with a key area, the key area is provided with a serial number, and the three-dimensional code scanning device is provided with a serial number corresponding to the serial number of the key area; after the three-dimensional code scanning device scans the three-dimensional code pattern information, the serial number in the key area is analyzed, the three-dimensional code scanning device verifies the serial number of the key area through the serial number of the three-dimensional code scanning device and the serial number in the key area, if the verification is successful, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted; meanwhile, after the three-dimensional code scanning device successfully verifies the serial number of the key area, the serial number on the key area is changed according to a first preset algorithm and is simultaneously fed back to the mobile terminal, the mobile terminal changes the serial number of the key area according to a second preset algorithm, and the first preset algorithm and the second preset algorithm can be the same or matched, so that the serial number of the key area and the serial number of the three-dimensional code scanning device still keep one-to-one correspondence.
In order to prevent copying, as another feasible scheme, a key and a sequence number are simultaneously arranged on the key area, and a key and a sequence number corresponding to the key and the sequence number of the key area are arranged on the three-dimensional code scanning device; after the three-dimensional code scanning device scans the three-dimensional code pattern information, a key and a serial number in a key area are simultaneously analyzed, the three-dimensional code scanning device verifies the key and the serial number in the key area through the key and the serial number of the three-dimensional code scanning device, if the verification is successful, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted; meanwhile, after the key and the serial number of the key area are successfully verified by the three-dimensional code scanning device, the key on the key area is changed according to a first algorithm, the serial number is changed according to a second algorithm and simultaneously fed back to the mobile terminal, the key of the key area is changed by the mobile terminal according to a third algorithm, and the serial number of the key area is changed by the mobile terminal according to a fourth algorithm, wherein the first algorithm corresponds to the third algorithm (can be the same or matched), the second algorithm corresponds to the fourth algorithm (can be the same or matched), so that the key and the serial number of the key area and the key and the serial number of the three-dimensional code scanning device still keep one-to-one correspondence respectively.
By setting a key area on the three-dimensional code on the mobile terminal and setting a variable serial number on the key area, the security problem after copying can be prevented because: when the three-dimensional code scanning device scans the copied three-dimensional code, the serial number of the copied three-dimensional code cannot correspond to the serial number built in the three-dimensional code scanning device, the three-dimensional code pattern information is seriously unqualified, namely the three-dimensional code authentication fails, and the unlocking process cannot be further executed. In addition, the key region is simultaneously provided with a variable key and a variable serial number, so that the security can be further ensured, the key generally adopts mainstream algorithms such as AES, DES, 3DES, RSA, DSA, ECC and the like (preferably AES or ECC with a shorter key length is used), and the algorithm can be customized by self. The algorithm for changing the serial number generally adopts an addition and subtraction algorithm such as adding one or subtracting one, so that the rapidness of unlocking can be ensured. The user may set the use of a serial number only or a combination of a serial number and a key according to specific security level requirements. In addition, in order to ensure the unlocking speed, generally, the secret key does not need to be changed every time, the secret key can be changed regularly, and the serial number needs to be changed after the unlocking is successfully performed every time scanning.
Generally, the key region is located at a non-central position of the three-dimensional code, the central position generally places the subject image, in order to avoid conflict with the subject image or incapability of quickly identifying the key region, the key region is generally arranged at a corner position of the three-dimensional code far away from the subject image, and the size of the key region is not larger than 1/8 of the whole area of the three-dimensional code.
The three-dimensional code is added with a dimension on the basis of the two-dimensional code, so that more data can be represented, and more information capacity is provided. The three-dimensional code used by the invention adopts color and brightness to represent the third dimension, thereby realizing the representation of the three-dimensional code on a plane. Since the collection of color and brightness in the reading device is determined by the number of bits of the a/D conversion, and the capability of the printing device is also considered, an appropriate standard method needs to be established in the process of manufacturing the three-dimensional code to ensure the reading quality. Further, in order to improve the reading quality, the three-dimensional code is generated by the following steps:
step 1, generating a two-dimensional code containing embedded information;
step 2, zooming the image O according to the version of the two-dimensional code and the set size of the two-dimensional code module to obtain a square image S;
and step 3: generating a threshold layer T by using S;
and 4, step 4: overlapping the S and the two-dimension code to find out a block corresponding to the S by the two-dimension code module;
and 5: according to the color of the two-dimensional code module, comparing the average brightness value L and T of the central area of the corresponding module in the S with the set toughness value r, and judging whether the modification is needed;
step 6: if the modification is not needed, the corresponding module area of S is not modified; if the two-dimensional code needs to be modified, the brightness of the area is adjusted by using a Gaussian modulation function, so that the color of the two-dimensional code can be met after L is compared with T and r;
and 7: repeating the steps 5-6 until all the modules are processed;
and 8: mixing the S and the area corresponding to the two-dimensional code positioning mark to form a three-dimensional code;
and step 9: the key area is provided at a peripheral position of the three-dimensional code.
In step 2, the side length of the square image S is pixel (17+4 × V) × w, where w is the number of pixels of the side length of the two-dimensional code module, and V is the version of the two-dimensional code.
The specific content of the step 3 is as follows: and converting the RGB space of the S into a YUV color space, processing the gray-scale image G of the Y plane to generate a threshold layer T which is used as a threshold for adjusting the brightness of the S.
The content of the above processing is: the image converted into YUV color space is divided into non-repetitive blocks, the size of one window is set as 5 x 5 blocks, and the average brightness of all blocks in the window taking a certain block as the center is defined as the average brightness of the block.
In the step 4, sampling judgment is performed around the center of the module block, the module center area is black, the value of the module is set to 1, the value of the module is set to 0, and the average brightness of the c × c pixels corresponding to the center of the two-dimensional code module is used to replace the average brightness of the block corresponding to the whole module, wherein c is the number of the side length pixels in the center area of the three-dimensional code module.
In the step 6, the change amount of the adjusted brightness is:
Figure DEST_PATH_GDA0001399307210000141
wherein, (m, n) represents an index of the two-dimensional code module, lm,nAverage brightness value, t, of the center region of the module representing coordinate point (m, n)m,nT value, q, of the center region of the module representing coordinate point (m, n)m,nAnd the color of the coordinate point (m, n) two-dimensional code module is represented, wherein black is 0 and white is 1.
The step 8 further includes: and a white static area is added at the periphery of the three-dimensional code. And the width of the increased white static area is 4 x w pixels, wherein w is the number of side length pixels of the two-dimensional code module.
According to the scheme, the method comprises the steps of firstly conducting deep learning on a plurality of three-dimensional code pattern information collected by different light rays at different angles to obtain an accurate three-dimensional code comparison threshold value and weight parameters, then, in the unlocking process, verifying the identity of a user according to internal authority setting by the three-dimensional code scanning device, verifying the three-dimensional code according to the three-dimensional code comparison threshold value and the weight parameters, and verifying the password and the serial number of the key area of the three-dimensional code. In addition, aiming at the three-dimensional code, the invention adopts a three-dimensional code generation method based on a Gaussian modulation function, firstly generates a two-dimensional code containing embedded information, obtains a threshold layer by using an image to be processed, judges the attribute of a module block, adjusts the brightness of the module block, and performs mixed processing on the processed image and the area corresponding to the two-dimensional code positioning mark to form the three-dimensional code. Because the three-dimensional code is manufactured by using the Gaussian modulation function, namely the brightness of the subject image pixel corresponding to the two-dimensional code module is modified, the change amount of the pixel color is smoothly decreased from the center to the periphery, and the decreasing speed is determined according to the smooth degree of the module block, so that the module block with the brightness adjusted is smoother, and the perception cognition of the human Visual system HVS (human Visual System) on the color and the brightness is met.
While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (7)

1. The utility model provides a three-dimensional sign indicating number unblanking method based on intelligent application sets up three-dimensional sign indicating number scanning device in the tool to lock, sets up the three-dimensional sign indicating number on the mobile terminal, its characterized in that: the unlocking method comprises a deep learning process and an unlocking process, wherein the deep learning process comprises the following steps:
process 1 a: a three-dimensional code scanning device in the lockset scans the three-dimensional code of the mobile terminal for multiple times to obtain a plurality of three-dimensional code pattern information;
process 1 b: screening the scanned three-dimensional code pattern information to obtain effective three-dimensional code pattern information sets, and preprocessing the effective three-dimensional code pattern information sets to obtain training samples with uniform formats;
procedure 1 c: setting a preset three-dimensional code comparison threshold;
calculating a training sample to obtain a preliminary weight parameter, and adjusting the preliminary weight parameter and a preset three-dimensional code comparison threshold value in the training process to obtain the weight parameter and the three-dimensional code comparison threshold value;
the three-dimensional code comparison threshold is used for: after the three-dimensional code scanning device scans the three-dimensional code of the mobile terminal, calculating the obtained three-dimensional code pattern information and the weight parameter to obtain the three-dimensional code pattern deviation, and if the three-dimensional code pattern deviation is within the range of the three-dimensional code comparison threshold, determining that the three-dimensional code pattern information is qualified;
the unlocking process comprises the following steps:
process 2 a: the three-dimensional code scanning device in the lockset scans the three-dimensional code of the mobile terminal to acquire three-dimensional code information and user identity verification information, executes the following verification process and outputs a verification result signal:
procedure 2a 1: the three-dimensional code scanning device verifies the user identity verification information: the three-dimensional code scanning device traverses the identity information stored in the memory of the three-dimensional code scanning device, if the identity authentication information of the user exists, the identity authentication is passed, and the process 2a2 is executed; otherwise, the unlocking process is quitted, and the failure of identity authentication is prompted;
procedure 2a 2: the three-dimensional code scanning device calculates the obtained three-dimensional code pattern information and the weight parameter to obtain three-dimensional code pattern deviation, if the three-dimensional code pattern deviation is within the range of the three-dimensional code comparison threshold value, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted;
process 2 b: if the verification result signal output by the three-dimensional code scanning device is qualified, an unlocking command is sent to the lockset;
and 2 c: the lock receives the unlocking command and unlocks.
2. The intelligent application-based three-dimensional code unlocking method according to claim 1, characterized in that: the verification process also includes process 2a 3: the three-dimensional code is also provided with a key area, the key area is provided with a serial number, and the three-dimensional code scanning device is provided with a serial number corresponding to the serial number of the key area;
after the three-dimensional code scanning device scans the three-dimensional code pattern information, the serial number in the key area is analyzed, the three-dimensional code scanning device verifies the serial number of the key area through the serial number of the three-dimensional code scanning device and the serial number in the key area, if the verification is successful, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted;
and simultaneously, after the three-dimensional code scanning device successfully verifies the serial number of the key area, the serial number on the key area is changed according to a first preset algorithm and is simultaneously fed back to the mobile terminal, the mobile terminal changes the serial number of the key area according to a second preset algorithm, and the first preset algorithm corresponds to the second preset algorithm, so that the serial number of the key area and the serial number of the three-dimensional code scanning device are still in one-to-one correspondence after being changed.
3. The intelligent application-based three-dimensional code unlocking method according to claim 1, characterized in that: the verification process also includes process 2a 3: the three-dimensional code scanning device is provided with a key and a serial number corresponding to the key and the serial number of the key area;
after the three-dimensional code scanning device scans the three-dimensional code pattern information, a key and a serial number in a key area are simultaneously analyzed, the three-dimensional code scanning device verifies the key and the serial number in the key area through the key and the serial number of the three-dimensional code scanning device, if the verification is successful, the three-dimensional code pattern information is qualified, and the next process is executed; otherwise, the code is unqualified, the unlocking process is quitted, and the failure of the three-dimensional code authentication is prompted;
meanwhile, after the key and the serial number of the key area are successfully verified by the three-dimensional code scanning device, the key on the key area is changed according to a first algorithm, the serial number is changed according to a second algorithm and simultaneously fed back to the mobile terminal, the key of the key area is changed by the mobile terminal according to a third algorithm, and the serial number of the key area is changed by the mobile terminal according to a fourth algorithm, wherein the first algorithm corresponds to the third algorithm, the second algorithm corresponds to the fourth algorithm, so that the key and the serial number of the key area and the key and the serial number of the three-dimensional code scanning device are still in one-to-one correspondence respectively.
4. The intelligent application-based three-dimensional code unlocking method according to claim 2 or 3, characterized in that: the key area is located in a non-central position of the three-dimensional code.
5. The intelligent application-based three-dimensional code unlocking method according to claim 2 or 3, characterized in that: the area of the key region is not more than 1/8 of the entire three-dimensional code area.
6. The intelligent application-based three-dimensional code unlocking method according to claim 1, 2 or 3, characterized in that: in the process 1c, the preliminary weight parameter and the preset three-dimensional code comparison threshold are adjusted in the training process, specifically, the training sample is subjected to forward propagation calculation to obtain a residual error and a weight parameter, and then the residual error is minimized to adjust the weight parameter and the three-dimensional code comparison threshold to obtain the weight parameter and the three-dimensional code comparison threshold.
7. The intelligent application-based three-dimensional code unlocking method according to claim 1, 2 or 3, characterized in that: in the process 2a2, if the three-dimensional code pattern information is qualified, the weight parameter and the three-dimensional code comparison threshold are further adjusted in the training process, first, the training sample is subjected to forward propagation calculation to obtain a residual error and a weight parameter, and then the residual error is minimized to adjust the weight parameter and the three-dimensional code comparison threshold, so as to obtain a new weight parameter and a new three-dimensional code comparison threshold.
CN201710717447.4A 2017-08-21 2017-08-21 Three-dimensional code unlocking method based on intelligent application Active CN107481376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710717447.4A CN107481376B (en) 2017-08-21 2017-08-21 Three-dimensional code unlocking method based on intelligent application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710717447.4A CN107481376B (en) 2017-08-21 2017-08-21 Three-dimensional code unlocking method based on intelligent application

Publications (2)

Publication Number Publication Date
CN107481376A CN107481376A (en) 2017-12-15
CN107481376B true CN107481376B (en) 2020-01-10

Family

ID=60601945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710717447.4A Active CN107481376B (en) 2017-08-21 2017-08-21 Three-dimensional code unlocking method based on intelligent application

Country Status (1)

Country Link
CN (1) CN107481376B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363937B (en) * 2018-03-23 2021-05-25 西安艾润物联网技术服务有限责任公司 Two-dimensional code scanning method and device and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012022636A (en) * 2010-07-16 2012-02-02 Chugoku Electric Power Co Inc:The In-and-out management system and in-and-out management method
CN105225314A (en) * 2015-09-18 2016-01-06 张福伟 A kind of dynamic two-dimension code door control system based on pseudo-random sequence
CN105490814B (en) * 2015-12-08 2018-10-26 中国人民大学 A kind of ticketing service real name identification method and system based on three-dimension code
CN106920310A (en) * 2017-03-06 2017-07-04 珠海习悦信息技术有限公司 Access control method, apparatus and system
CN106991462B (en) * 2017-03-13 2018-04-17 三维码(厦门)网络科技有限公司 Three-dimensional code generating method
CN106887071B (en) * 2017-04-20 2019-02-12 广东汇通信息科技股份有限公司 A kind of intelligent access control system based on two dimensional code identification

Also Published As

Publication number Publication date
CN107481376A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
CN106778995B (en) Artistic two-dimensional code generation method and device fused with image
US11630968B2 (en) Matrix barcode having a plurality of colors and a least prevalent color
US11720776B2 (en) System and method using a histogram and colorspaces to create a matrix barcode having a plurality of colors, an infrared layer, and an ultraviolet layer
US10762371B1 (en) Object detection techniques using colorspace conversions
US10509991B1 (en) Detection of images in relation to targets based on colorspace transformation techniques and utilizing infrared light
US10977462B2 (en) Detection of images in relation to targets based on colorspace transformation techniques and utilizing ultraviolet light
US10614635B1 (en) Augmented reality system with color-based fiducial marker
CN108229234B (en) Scannable image generation method fusing digital coding
US10755153B2 (en) Method of generating 3-dimensional code based on gaussian modulating function
CN107545277B (en) Model training, identity verification method and device, storage medium and computer equipment
CN105308944A (en) Classifying objects in images using mobile devices
CN113658032B (en) Image watermark encryption and decryption method and system based on deep learning and image processing
CN111783083A (en) Recommendation method and device for defense algorithm
CN108491747B (en) Method for beautifying QR (quick response) code after image fusion
CN107481376B (en) Three-dimensional code unlocking method based on intelligent application
CN108491913B (en) Method for authenticating QR (quick response) code with secret beautification function
CN114677722A (en) Multi-supervision human face in-vivo detection method integrating multi-scale features
CN116822548B (en) Method for generating high recognition rate AI two-dimensional code and computer readable storage medium
CN111046997B (en) Image security code generation method based on anti-counterfeiting encryption and visual identification
CN112465092B (en) Two-dimensional code sample generation method and device, server and storage medium
Li et al. The research of information hiding and extraction based on QR code positioning function
CN117649358B (en) Image processing method, device, equipment and storage medium
CN114117478B (en) Image vectorization hiding and recovering method and system based on point set sequence matching
CN113780028A (en) Verification method and device of novel three-dimensional code combined with picture
US20070297684A1 (en) Data Conversion Apparatus, Data Conversion Method, and Data Conversion System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant