Dynamic two-dimensional code data identity authentication method

Through the dynamic QR code data identity authentication method of face feature vector encryption and MD5 hash value verification, the identity impersonation and data security problems in dynamic QR code data transmission are solved, and the secure transmission of data is realized.

CN120277650APending Publication Date: 2025-07-08WUHAN INFOEARTH INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510303877.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

During the transmission of dynamic QR code data, there are problems of identity impersonation and poor data security, especially the data is easily stolen and tampered during transmission.

Method used

By obtaining the vector data of face features as keys, the target data is encrypted, a dynamic QR code is generated, and a hash value is generated in combination with the MD5 algorithm for data verification, and the data security is ensured with face identity verification.

Benefits of technology

Ensure the security of QR code data during transmission, prevent data theft and malicious tampering, and improve data integrity and real-timeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277650A_ABST
    Figure CN120277650A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic two-dimensional code data identity authentication method, which comprises the following steps: acquiring vector data of face features, and encrypting target data by taking the vector data as a key to obtain encrypted data; generating a dynamic two-dimensional code based on the encrypted data; obtaining two-dimensional code data by reading the dynamic two-dimensional code; and when the face verification is carried out, carrying out identity verification by using the vector data, and decrypting the two-dimensional code data when the identity verification is successful to obtain decrypted target data. According to the application, the data security when the dynamic two-dimensional code is used for data transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of two-dimensional codes, and particularly to a method for authenticating the identity of dynamic two-dimensional code data. Background Art

[0002] With the wide application of two-dimensional code technology, especially in the fields of identity authentication, Internet of Things, and intelligent devices, as a form of information carrier, the security and reliability of two-dimensional codes have become increasingly important issues. In the scenario of dynamic two-dimensional code data transmission, due to the high requirements for data timeliness, authenticity, and integrity, therefore, how to ensure the secure transmission of two-dimensional code data and prevent data from being tampered with, forged, or lost has become a major challenge in technical implementation.

[0003] The current main problems are reflected in the following two points. The first is identity impersonation and forgery: Identity authentication can verify the legitimacy of the data sender, but in some cases, attackers may forge identities by stealing the authentication information of legitimate users and then perform malicious operations. The second is poor data security: Data is not protected by encryption technology and verification methods to ensure its security, resulting in data being stolen and tampered with during transmission. Summary of the Invention

[0004] The present invention provides a method for authenticating the identity of dynamic two-dimensional code data to improve the data security when using dynamic two-dimensional codes for data transmission.

[0005] The present invention provides a method for authenticating the identity of dynamic two-dimensional code data, including: Obtaining vector data of facial features and using the vector data as a key to encrypt target data to obtain encrypted data; Generating a dynamic two-dimensional code based on the encrypted data; Obtaining two-dimensional code data by reading the dynamic two-dimensional code; When performing face verification, using the vector data for identity verification and decrypting the two-dimensional code data when the identity verification is successful to obtain the decrypted target data.

[0006] In some embodiments, the generating a dynamic two-dimensional code based on the encrypted data includes: Invoking the MD5 algorithm to generate a first hash value of the encrypted data; Performing string splicing processing on the encrypted data and the first hash value to obtain spliced data; Generating a dynamic two-dimensional code according to the spliced data.

[0007] In some embodiments, after obtaining two-dimensional code data by reading the dynamic two-dimensional code, the method further includes: Separate and confirm the split encrypted data and the first hash value from the two-dimensional code data; Call the MD5 algorithm to calculate the second hash value of the split encrypted data; Verify the first hash value and the second hash value.

[0008] In some embodiments, the verifying the first hash value and the second hash value includes: When the first hash value is equal to the second hash value, use the split encrypted data as the two-dimensional code data for decryption; When the first hash value is not equal to the second hash value, discard the split encrypted data.

[0009] In some embodiments, when performing face verification, using the vector data for identity verification includes: Obtain the vector to be verified of the face features extracted during face verification; Compare the vector to be verified with the vector data; When the comparison is consistent, determine that the identity verification is successful; When the comparison is inconsistent, determine that the identity verification fails.

[0010] In some embodiments, before using the vector data as a key, the method further includes: Perform identity authorization on the vector data; Call the PCA dimensionality reduction algorithm to compress the vector data after identity authorization.

[0011] The present invention also provides a dynamic two-dimensional code data identity authentication device, including: An encryption module, configured to obtain vector data of face features, and use the vector data as a key to encrypt target data to obtain encrypted data; A generation module, configured to generate a dynamic two-dimensional code based on the encrypted data; A reading module, configured to obtain two-dimensional code data by reading the dynamic two-dimensional code; A decryption module, configured to use the vector data for identity verification during face verification, and decrypt the two-dimensional code data when the identity verification is successful to obtain the decrypted target data.

[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the dynamic two-dimensional code data identity authentication method as described in any one of the above.

[0013] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the dynamic two-dimensional code data identity authentication method as described in any one of the above.

[0014] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the dynamic two-dimensional code data identity authentication method as described in any one of the above.

[0015] In the dynamic two-dimensional code data identity authentication method provided by the present invention, when using a dynamic two-dimensional code to perform data transmission of target data, by combining technical means such as encryption, decryption, and face identity authentication, it can ensure the security of two-dimensional code data during the transmission process and avoid the target data from being stolen and maliciously tampered with. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art one by one. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0017] Figure 1 It is a flowchart of the dynamic two-dimensional code data identity authentication method provided by the present invention.

[0018] Figure 2 It is a structural schematic diagram of the dynamic two-dimensional code data identity authentication device provided by the present invention.

[0019] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are some, rather than all, of the embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.

[0021] The following describes the dynamic two-dimensional code data identity authentication method of the present invention in conjunction with the drawings. Figure 1 It is a flowchart of the dynamic two-dimensional code data identity authentication method provided by the present invention. As Figure 1 shown, the method includes the following steps 101 to 104.

[0022] Step 101: Obtain the vector data of the face features, and use the vector data as the key to encrypt the target data to obtain the encrypted data.

[0023] In some embodiments, before transmitting the target data, obtain the vector data of the face features. Here, a face image can be input through a collection platform or device, and then an image processing model is called to extract the corresponding face features, and the vector data of the face features is stored. For example, it is stored in a smart terminal or locally using the Web API of the collection platform or device.

[0024] When it is necessary to transmit the target data, at this time, use the vector data in the smart terminal or locally as the key to encrypt the target data to obtain the encrypted data. The encryption process can be implemented using a symmetric encryption algorithm, and the target data is the data that needs to be transmitted, that is, the real-time measurement data or running data collected in the smart terminal or locally, such as the driving speed, driving distance of a vehicle or ship, longitude, latitude, regional coordinates of vehicle positioning, temperature, humidity of the natural environment, etc.

[0025] Step 102: Generate a dynamic QR code based on the encrypted data.

[0026] Next, use the dynamic QR code to perform the data transmission of the target data. Here, generate a dynamic QR code based on the encrypted data, and the generation method can adopt the commonly used Dynamsoft Barcode Reader technology in the prior art. Since the target data is collected in real time, the QR code generated from the encrypted data is a dynamic QR code to ensure real-time synchronization and update with the target data.

[0027] Step 103: Obtain the QR code data by reading the dynamic QR code.

[0028] After generating the dynamic QR code in Step 102, at this time, the mobile terminal or mobile device where the destination of the target data needs to be transmitted can be used to scan the dynamic QR code to read the QR code data, and obtain the QR code data by reading the dynamic QR code for subsequent data decoding to obtain the target data.

[0029] Step 104: When performing face verification, use the vector data for identity verification, and decrypt the QR code data when the identity verification is successful to obtain the decrypted target data.

[0030] Here, since the QR code data is generated from encrypted data, and the encrypted data is encrypted using the vector data of facial features, during decryption, facial verification is required, and identity verification is performed using the vector data. Only when the identity verification is successful can the vector data corresponding to the facial features be used to decrypt the QR code data, thereby obtaining the decrypted target data and realizing the data transmission of the target data.

[0031] In the embodiment of the present invention, when using the dynamic QR code to perform the data transmission of the target data, by combining technical means such as encryption, decryption, and facial identity verification, the security of the QR code data during the transmission process can be ensured, and the target data can be prevented from being stolen and maliciously tampered with.

[0032] In some embodiments, generating a dynamic QR code based on encrypted data includes: calling the MD5 algorithm to generate the first hash value of the encrypted data; performing string splicing processing on the encrypted data and the first hash value to obtain spliced data; generating a dynamic QR code according to the spliced data.

[0033] Here, after the target data is successfully encrypted, the MD5 algorithm can be called to generate the first hash value of the encrypted data. This hash value can be used as a label for the encrypted data to verify whether there is data loss and affect the integrity of the data after the QR code data is generated.

[0034] When generating the dynamic QR code, the encrypted data and the first hash value are subjected to string splicing processing to obtain spliced data. Specifically, the strings of the encrypted data and the first hash value are spliced together through the "|" delimiter to form a new spliced string. Finally, by using the Dynamsoft Barcode Reader technology, the spliced string can be used to generate the corresponding dynamic QR code.

[0035] In the embodiment of the present invention, when generating a dynamic QR code from encrypted data, the MD5 algorithm is used to generate the hash value of the encrypted data, and a dynamic QR code is generated together with the encrypted data, which is convenient for subsequent verification of the integrity of data transmission and timely discovery of data loss.

[0036] In some embodiments, after obtaining the QR code data by reading the dynamic QR code, it further includes: respectively identifying the split encrypted data and the first hash value from the QR code data; calling the MD5 algorithm to calculate the second hash value of the split encrypted data; verifying the first hash value and the second hash value.

[0037] Specifically, after obtaining the QR code data by reading the dynamic QR code, the target data transmission process is completed through the dynamic QR code. At this time, the integrity of the target data needs to be determined before decryption. First, the encrypted data and the first hash value after splitting are respectively confirmed from the read QR code data. Here, the "|" separator in the QR code data is identified through string detection, and the string of the QR code data is split to obtain the encrypted data and the first hash value after splitting.

[0038] Next, the MD5 algorithm is called again to calculate a hash value for the split encrypted data, and then the calculated hash value is compared with the original first hash value obtained after the split to verify the integrity of the encrypted data.

[0039] In the embodiment of the present invention, when completing data transmission through a dynamic two-dimensional code, the MD5 algorithm is used again to generate a hash value of the encrypted data, and the integrity verification of the target data is implemented through hash value comparison, thereby ensuring the effectiveness of the data integrity verification.

[0040] On the basis of the above embodiment, when verifying the first hash value and the second hash value, when the first hash value is equal to the second hash value, the encrypted data after splitting is used as the two-dimensional code data for decryption. Here, when the hash values ​​generated twice are the same, it means that the target data is complete when the dynamic two-dimensional code is used for data transmission, and there is no data loss phenomenon. Then, the encrypted data after splitting can be used as the two-dimensional code data for decryption, and the subsequent decryption process of the target data is executed.

[0041] When the first hash value is not equal to the second hash value, the encrypted data after splitting is discarded. Here, when the hash values ​​generated twice are different, it means that the target data is lost when the dynamic QR code is used for data transmission, the data is incomplete, and the data is no longer suitable for data transmission. In this case, the encrypted data after splitting is discarded, and there is no need to perform the next step of data decryption process.

[0042] When executing data transmission of target data, the embodiment of the present invention determines the integrity of data transmission by comparing hash values. When the verification is incomplete, the data decryption process is decisively discarded and terminated, thereby ensuring the data transmission quality and the real-time and validity of the target data.

[0043] In some embodiments, when performing face verification, vector data is used for identity authentication, including: obtaining a vector to be verified of facial features extracted during face verification; comparing the vector to be verified with the vector data; when the comparison is consistent, determining that the identity authentication is successful; when the comparison is inconsistent, determining that the identity authentication has failed.

[0044] Here, face verification can be performed at the destination of the target data transmission because the target data is encrypted with vector data of facial features. After obtaining the QR code data by reading the dynamic QR code, identity verification must be performed through facial features to complete the decryption of the QR code data and obtain the target data.

[0045] During face verification, the corresponding face image can be directly obtained, and then the corresponding facial features can be extracted using the corresponding image processing model, so that the vector to be verified of the facial features can be obtained. Then, the vector to be verified is compared with the vector data for identity verification. The comparison method can be to calculate the similarity of the two vectors. When the similarity is greater than the similarity threshold (e.g., 99%), it indicates that the comparison is consistent; otherwise, the comparison is inconsistent.

[0046] When the comparison is consistent, it is determined that the identity verification is successful and it is determined to be the same person. In this way, the encrypted data in the QR code data can be decrypted using the vector to be verified of the facial features to obtain the target data. If the comparison is inconsistent, it is determined that the identity verification fails and it cannot be determined to be the same person. At this time, the vector to be verified of the facial features cannot perform the decryption of the encrypted data, and thus the target data cannot be obtained.

[0047] In the embodiments of the present invention, when performing data transmission of target data through a dynamic QR code, the biometric information of the face is used as a key to perform encryption and decoding of the target data, which can effectively prevent traditional passwords and keys from being stolen, copied, or cracked, provide a more secure identity authentication method than traditional authentication methods, and further enhance the security of the target data.

[0048] In some embodiments, before using the vector data as a key, it further includes: performing identity authorization on the vector data; and calling the PCA dimensionality reduction algorithm to perform compression processing on the vector data after identity authorization.

[0049] Here, before encrypting with the vector data of facial features, identity authorization is first performed on the vector data so that it can be used as a key for data encryption, which can ensure the effectiveness of identity verification before data decryption and ensure the successful execution of data decryption to obtain the target data. And calling the PCA dimensionality reduction algorithm to perform compression processing on the vector data after identity authorization can map the facial feature information from high-dimensional data to a low-dimensional space, reduce the dimension of the data, thereby simplifying the data structure, making data processing and analysis more efficient, and at the same time reducing information loss and ensuring the accuracy of identity verification.

[0050] Next, the dynamic QR code data identity authentication device provided by the present invention will be described. The dynamic QR code data identity authentication device described below can be mutually referred to the dynamic QR code data identity authentication device method described above.

[0051] As Figure 2 shown, the dynamic QR code data identity authentication device provided by the present invention includes: an encryption module 201, configured to obtain vector data of a face feature, and use the vector data as a key to encrypt target data to obtain encrypted data; a generation module 202, configured to generate a dynamic QR code based on the encrypted data; a reading module 203, configured to obtain QR code data by reading the dynamic QR code; a decryption module 204, configured to perform identity authentication using the vector data during face verification, and decrypt the QR code data when the identity authentication is successful to obtain the decrypted target data.

[0052] It should be noted that the beneficial effects of the dynamic QR code data identity authentication device here correspond to those of the dynamic QR code data identity authentication method in the above text. Therefore, the beneficial effects of the dynamic QR code data identity authentication device are not elaborated here.

[0053] Figure 3 An example of a schematic physical structure diagram of an electronic device is shown, as Figure 3 shown. The electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340. Among them, the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call logic instructions in the memory 330 to execute the dynamic QR code data identity authentication method, which includes: obtaining vector data of a face feature, and using the vector data as a key to encrypt target data to obtain encrypted data; generating a dynamic QR code based on the encrypted data; obtaining QR code data by reading the dynamic QR code; during face verification, performing identity authentication using the vector data, and decrypting the QR code data when the identity authentication is successful to obtain the decrypted target data.

[0054] In addition, when the logical instructions in the above-mentioned memory 330 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0055] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the dynamic two-dimensional code data identity authentication method provided by the above-mentioned various methods. The method includes: obtaining vector data of facial features, and using the vector data as a key to encrypt target data to obtain encrypted data; generating a dynamic two-dimensional code based on the encrypted data; obtaining two-dimensional code data by reading the dynamic two-dimensional code; when performing facial verification, using the vector data for identity verification, and decrypting the two-dimensional code data when the identity verification is successful to obtain the decrypted target data.

[0056] On yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes the execution of the dynamic two-dimensional code data identity authentication method provided by the above-mentioned various methods. The method includes: obtaining vector data of facial features, and using the vector data as a key to encrypt target data to obtain encrypted data; generating a dynamic two-dimensional code based on the encrypted data; obtaining two-dimensional code data by reading the dynamic two-dimensional code; when performing facial verification, using the vector data for identity verification, and decrypting the two-dimensional code data when the identity verification is successful to obtain the decrypted target data.

[0057] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative work.

[0058] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for authenticating the identity of dynamic two-dimensional code data, characterized in that Including: Obtain vector data of a face feature, and use the vector data as a key to encrypt target data to obtain encrypted data; Generate a dynamic QR code based on the encrypted data; Obtain QR code data by reading the dynamic QR code; When performing face verification, use the vector data for identity verification, and decrypt the QR code data when the identity verification is successful to obtain the decrypted target data.

2. The dynamic two-dimensional code data identity authentication method according to claim 1, wherein The generating the dynamic QR code based on the encrypted data includes: Call the MD5 algorithm to generate a first hash value of the encrypted data; Perform string splicing processing on the encrypted data and the first hash value to obtain spliced data; Generate a dynamic QR code according to the spliced data.

3. The dynamic two-dimensional code data identity authentication method according to claim 1, characterized in that, After obtaining the QR code data by reading the dynamic QR code, the method further includes: Respectively confirm the split encrypted data and the first hash value from the QR code data; Call the MD5 algorithm to calculate a second hash value of the split encrypted data; Verify the first hash value and the second hash value.

4. The dynamic two-dimensional code data identity authentication method according to claim 3, characterized in that The verifying the first hash value and the second hash value includes: When the first hash value is equal to the second hash value, use the split encrypted data as the QR code data for decryption; When the first hash value is not equal to the second hash value, discard the split encrypted data.

5. The dynamic two-dimensional code data identity authentication method according to claim 1, characterized in that, The using the vector data for identity verification when performing face verification includes: Obtain a vector to be verified of a face feature extracted during face verification; Compare the vector to be verified with the vector data; When the comparison is consistent, determine that the identity verification is successful; When the comparison is inconsistent, determine that the identity verification fails.

6. The dynamic two-dimensional code data identity authentication method according to claim 1, characterized in that, Before using the vector data as a key, the method further includes: Perform identity authorization on the vector data; Call the PCA dimensionality reduction algorithm to compress the vector data after identity authorization.

7. A dynamic two-dimensional code data identity authentication device, characterized in that, Including: An encryption module, configured to obtain vector data of a face feature, and use the vector data as a key to encrypt target data to obtain encrypted data; A generation module, configured to generate a dynamic QR code based on the encrypted data; A reading module, configured to obtain QR code data by reading the dynamic QR code; A decryption module, configured to use the vector data for identity verification when performing face verification, and decrypt the QR code data when the identity verification is successful to obtain the decrypted target data.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the dynamic QR code data identity authentication method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the dynamic QR code data identity authentication method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the dynamic QR code data identity authentication method according to any one of claims 1 to 6.