Facial payment method and device, computer device, storage medium and product
Patent Information
- Application Number
- CN202111402850.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2041-11-24
AI Technical Summary
[0003]在对相关技术的研究和实践过程中,本申请的发明人发现,脸部支付设备可以对采集到的脸部图像进行签名处理,以提高脸部支付过程中的数据安全性,由于脸部支付过程中,所采集的图像流数据中可以包括有多张脸部图像,这使得待进行签名处理的数据量较大,加之脸部支付设备中针对数据的输入/输出能力有限,导致脸部支付设备针对图像流数据进行签名处理的效率有待提高
[0018] This solution supports the industry in implementing facial payment data stream signatures using existing low-performance, low-cost, and low-bandwidth facial recognition devices. Specifically, when applied to facial recognition cameras, facial payment systems, or other facial payment scenarios, the solution can acquire the original facial image for facial payment through the main control processing module, compress the original facial image, and then perform hash processing on the compressed image to obtain the corresponding digest information. In this way, the data processing capability of the main control processing module can be used to compress the image data to be signed by the security encryption module. This allows the security encryption module to sign the facial payment stream data while meeting its input/output throughput requirements, thereby preventing data tampering, ensuring business security, and improving the efficiency of facial payment.
Smart Images

Figure CN116167761B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a facial payment method, device, computer equipment, storage medium, and product. Background Technology
[0002] Facial payment is a payment method based on facial recognition. Facial recognition refers to the technology of identifying faces using computer analysis and comparison. Facial recognition technology belongs to biometric identification technology, which distinguishes individuals based on their biological characteristics (generally referring to humans). In practical applications, facial payment devices can work together to implement the facial payment process.
[0003] In the process of researching and practicing related technologies, the inventors of this application discovered that facial payment devices can perform signature processing on the collected facial images to improve data security during the facial payment process. Since the collected image stream data during the facial payment process may include multiple facial images, the amount of data to be signed is large. In addition, the input / output capabilities of facial payment devices are limited, which means that the efficiency of facial payment devices in performing signature processing on image stream data needs to be improved. Summary of the Invention
[0004] This application provides a facial payment method, apparatus, computer device, storage medium, and product, which can improve the efficiency of signature processing of original facial images during facial payment and enhance data security management during facial payment, thereby improving the efficiency of facial payment.
[0005] This application provides a facial payment method applicable to a terminal, the terminal including a main control processing module and a security encryption module, including: The main control processing module obtains the original image sequence for facial payment, wherein the original image sequence includes at least one original facial image; The original facial image is compressed to obtain a compressed image; The compressed image is hashed to obtain a summary of the compressed image. The digest information is sent to the secure encryption module, and the secure encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information; Facial payment is processed based on the digital signature.
[0006] Accordingly, embodiments of this application also provide a facial payment device, including: The acquisition unit is used to acquire the original image sequence of face payment through the main control processing module, wherein the original image sequence includes at least one original face image; A compression unit is used to compress the original facial image to obtain a compressed image; A hash unit is used to perform hash processing on the compressed image to obtain summary information of the compressed image; The signature unit is used to send the digest information to the security encryption module, and the security encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information; A payment unit is used to process facial payment based on the digital signature.
[0007] In one embodiment, the payment unit includes: An image determination subunit is used to determine the target face image for face payment from the original image sequence; An identifier determination subunit is used to determine the image identifier information of the target face image; A generation subunit is used to generate target data required for facial payment based on the image identification information and the digital signature corresponding to the target face image; The sending subunit is used to send the target data to the server to trigger the server to perform facial payment processing based on the target data.
[0008] In one embodiment, the identifier determining subunit is used for: Historical image identification records for facial payment are read from the storage unit, wherein the storage unit is configured with a data update cycle for the historical image identification records; based on the data update cycle and the historical image identification records, image identification information of the target facial image is calculated.
[0009] In one embodiment, the storage unit includes a non-volatile storage unit and a volatile storage unit. The volatile storage unit is used to store a first image identifier record for facial payment, and the non-volatile storage unit is used to store a second image identifier record for facial payment. The identifier determination subunit is specifically used for: When the first image identifier record in the volatile storage unit is detected to meet the preset conditions, the second image identifier record stored in the non-volatile storage unit is updated according to the data update cycle of the second image identifier record in the non-volatile storage unit; the updated second image identifier record is read from the non-volatile storage unit and used as the historical image identifier record for facial payment.
[0010] In one embodiment, the storage unit includes a non-volatile storage unit for storing a second image identification record for facial payment; the identification determination subunit is specifically used for: According to the data update cycle of the second image identifier record in the non-volatile storage unit, the historical image identifier record is reset; based on the processing result, the image identifier information of the target face image is determined.
[0011] In one embodiment, the storage unit includes a volatile storage unit for storing a first image identifier record for facial payment; the identifier determination subunit is specifically used for: Based on the data update cycle of the first image identifier record in the volatile storage unit, the historical image identifier record is incremented; based on the processing result, the image identifier information of the target face image is determined.
[0012] In one embodiment, the transmitting subunit is configured to: The server is triggered to verify the data signature based on a preset public key to obtain a first verification result; the target identification information is verified based on the historical identification information stored by the server to obtain a second verification result; and facial payment processing is performed on the target facial image based on the first verification result and the second verification result.
[0013] In one embodiment, the compression unit includes: The transformation subunit is used to perform data transformation on the pixel information in the original face image to obtain the transformed image; A quantization subunit is used to quantize the pixel information in the transformed image to obtain a quantized image. The compression subunit is used to compress the pixel information in the quantized image to obtain a compressed image.
[0014] In one embodiment, the signature unit includes: The function determination subunit is used to determine the encryption function required to encrypt the digest information; The encryption subunit is used to encrypt the digest information based on the preset private key using the encryption function to obtain the encrypted ciphertext of the digest information, and to use the encrypted ciphertext as the digital signature of the digest information.
[0015] Accordingly, this application also provides a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the face payment method as shown in this application embodiment.
[0016] Accordingly, this application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the face payment method as shown in the embodiments of this application.
[0017] This application embodiment can be applied to a terminal, which includes a main control processing module and a security encryption module. Specifically, this application embodiment can obtain the original image sequence for facial payment through the main control processing module, wherein the original image sequence includes at least one original facial image; compress the original facial image to obtain a compressed image; perform hash processing on the compressed image to obtain digest information of the compressed image; send the digest information to the security encryption module, and perform signature processing on the digest information based on a preset private key through the security encryption module to obtain a digital signature of the digest information; and perform facial payment processing based on the digital signature.
[0018] This solution supports the industry in implementing facial payment data stream signatures using existing low-performance, low-cost, and low-bandwidth facial recognition devices. Specifically, when applied to facial recognition cameras, facial payment systems, or other facial payment scenarios, the solution can acquire the original facial image for facial payment through the main control processing module, compress the original facial image, and then perform hash processing on the compressed image to obtain the corresponding digest information. In this way, the data processing capability of the main control processing module can be used to compress the image data to be signed by the security encryption module. This allows the security encryption module to sign the facial payment stream data while meeting its input / output throughput requirements, thereby preventing data tampering, ensuring business security, and improving the efficiency of facial payment. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram illustrating a scenario of the facial payment method provided in this application embodiment; Figure 2 This is a flowchart of the facial payment method provided in the embodiments of this application; Figure 3 This is another schematic diagram of the facial payment method provided in the embodiments of this application; Figure 4This is another schematic diagram of the facial payment method provided in the embodiments of this application; Figure 5 This is a schematic diagram of a facial payment device for the facial payment method provided in this application embodiment; Figure 6 This is another schematic diagram of the facial payment method provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the facial payment device provided in the embodiments of this application; Figure 8 This is another structural schematic diagram of the facial payment device provided in the embodiments of this application; Figure 9 This is another structural schematic diagram of the facial payment device provided in the embodiments of this application; Figure 10 This is another structural schematic diagram of the facial payment device provided in the embodiments of this application; Figure 11 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] This application provides a facial payment method, apparatus, computer device, storage medium, and product. Specifically, this application provides a facial payment device suitable for computer devices. The computer device can be a terminal or similar device. Specifically, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle computer, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations.
[0023] This application will use a facial payment device as an example to introduce the facial payment method.
[0024] refer to Figure 1The facial payment device may include a main control processing module 10 and a security encryption module 20. The main control processing module 10 can acquire the original image sequence for facial payment, wherein the original image sequence may include at least one original facial image; compress the original facial image to obtain a compressed image; and perform hash processing on the compressed image to obtain a digest of the compressed image. Further, the digest information can be sent to the security encryption module 20, and the security encryption module 20 can perform signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information, so that the facial payment device can perform facial payment processing based on the generated digital signature.
[0025] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0026] This application provides a facial payment method, which can be executed by a terminal. This application embodiment illustrates the facial payment method executed by a terminal as an example. Specifically, the computer device can be a terminal or other similar device. Specifically, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle computer, etc., but is not limited to these. In this application embodiment, the method can be executed by a facial payment device integrated into the terminal, such as... Figure 2 The specific process of this facial payment method can be described as follows: 101. Obtain the original image sequence for face payment through the main control processing module, wherein the original image sequence includes at least one original face image.
[0027] Facial recognition payment is a payment method based on facial feature information; for example, facial recognition payment is a type of facial recognition payment. Facial recognition payment is a new payment method based on technologies such as artificial intelligence, machine vision, 3D sensing, and big data, offering advantages such as greater convenience, security, and a better user experience.
[0028] The main control processing module is responsible for coordinating and controlling the steps involved in the facial payment process. For example, it could be a module for coordinating and controlling image processing involved in the facial payment process. As an example, the main control processing module can be integrated into a chip, such as a System-on-Chip (SoC). Generally speaking, an SoC, also known as a system-on-a-chip, refers to a product, a dedicated integrated circuit containing a complete system and all embedded software. It is also a technology used to implement the entire design process, from defining system functions to hardware / software partitioning.
[0029] In one embodiment, the main control processing module may include the SoC in the facial payment device. Specifically, the chip may be referred to as the main control chip, which may be able to support image processing during the facial payment process, such as compression processing, hash processing, etc.
[0030] In practical applications, images used for facial payment can include color images, depth maps, and infrared images. Color images can be images captured by a color sensor under natural light; in facial payment, color images can be used for face selection and comparison recognition. Depth maps can be images captured by an infrared sensor using speckle-structured infrared light, and then analyzed by depth cells. In 3D computer graphics and computer vision, a depth map is an image or image channel containing information related to the distance from the surface of a scene object to the viewpoint. Each pixel in the depth map represents the vertical distance between the depth camera plane and the plane of the object being photographed, typically represented by 16 bits in millimeters. In facial payment, depth maps can be used for liveness detection to assist in comparison recognition. Infrared images can be images captured by an infrared sensor using pan-infrared light; in facial payment, infrared images can be used for liveness detection.
[0031] In facial recognition payment, face selection refers to choosing a set of color images, depth images, and infrared images that meet the prerequisites for liveness detection and comparison recognition algorithms. This set of images can be called the preferred payment frame, which can be used for liveness detection and comparison recognition. Specifically, face selection can optimize color images based on evaluation metrics such as face angle, face size, face centering, and color image clarity; optimize infrared images based on evaluation metrics such as infrared image brightness; and optimize depth images based on evaluation metrics such as depth image completeness.
[0032] In facial payment, liveness detection is a method to determine whether the person using the face scan is a real person, a photo, or a head model. For example, depth maps can be used to determine whether the person using the face scan is a photo, and the brightness information of infrared images can be used to determine whether the person using the face scan is wearing a silicone headgear. This can be combined with other technical means to perform liveness detection.
[0033] In facial recognition payment, comparison recognition refers to comparing and identifying which user is using facial recognition. For example, five-point special similarity can be extracted from a color image, and three-point special similarity can be compared with a depth image. Other technical means can be combined to perform comparison recognition.
[0034] The original image sequence refers to a set of images consisting of at least one frame of original facial images, wherein the original images may include original color images, original depth images, and original infrared images.
[0035] In one embodiment, the main control processing module can acquire aligned original color images, original depth images, and original infrared images. Furthermore, the main control processing module can use the acquired original color images as the original image sequence for facial payment. Correspondingly, the original image sequence includes at least one frame of original color image. For example, the facial payment device can acquire a color image stream for facial payment at a frequency of 25 frames per second. The color image stream acquired per second can include 25 frames of original color images. The main control processing module can acquire this color image stream, use it as the original image sequence for facial payment, and execute the facial payment method of this application.
[0036] 102. Compress the original face image to obtain the compressed image.
[0037] In one embodiment, considering that the main control processing module has better data throughput and data computation capabilities than the security encryption module, it is more suitable for performing processing with larger data throughput and computational load, such as image compression of original face images in the original image sequence. It is worth noting that this application implements image compression for at least one original face image in the original image sequence; for example, it performs image compression on 25 frames per second of original color images in a color image stream. Therefore, this application can achieve stream processing and has a better real-time experience.
[0038] In this application, there are various methods for compressing the original face image. For example, considering that the original face image can be composed of at least one pixel and each pixel can have corresponding pixel information, image compression can be achieved by processing the pixel information.
[0039] As an example, image compression of raw facial images can be performed based on the Run Length Encoding (RLE) mechanism. Specifically, adjacent pixels with identical pixel information in a scan line can be replaced with a count value and the pixel information of those pixels. RLE compression is very effective for images with large areas of the same color. In practical applications, many specific run-length compression methods are derived from the RLE principle, such as PCX run-length compression, BI_RLE8 compression, BI_RLE compression, and compact bit compression.
[0040] As another example, the original face image can be compressed based on the Huffman coding compression mechanism. Specifically, since the probability of each pixel information in the original face image is different, the pixel information with high probability can be represented by a shorter code, and the pixel information with low probability can be represented by a longer code, and the code for each pixel information is different.
[0041] As another example, image compression of the original face image can be performed based on an arithmetic compression mechanism. Specifically, different sequences of pixel information can be mapped to a region between 0 and 1, which is represented as a binary fraction with variable precision (number of bits). The less common the pixel information, the higher the precision (more bits) required.
[0042] In one embodiment, the main control processing module may integrate a Video Processing Unit (VPU) module. The main control processing module can use the VPU module to compress the original facial image. For example, it can process the pixel information in the original facial image, such as performing data transformation and data quantization on the pixel information, and then perform image compression. Specifically, the step "compressing the original facial image to obtain a compressed image" may include: The pixel information in the original face image is transformed to obtain the transformed image; The pixel information in the transformed image is quantized to obtain the quantized image. The pixel information in the quantized image is compressed to obtain the compressed image.
[0043] In this context, a pixel refers to a small square that makes up an image. Each square has a specific location and an assigned color value, and the color and position of the square determine the appearance of the image. Therefore, in this application, the pixel information corresponding to a pixel can include pixel location information and pixel color value.
[0044] It is worth noting that, in practical applications, before the step of "data transformation of pixel information in the original face image," image segmentation can be performed on the original face image to divide it into at least one sub-original face image. For example, the original face image can be divided into 8×8 sub-original face images. Each sub-original face image is then used as a new original face image, and the steps described in this application—"data transformation of pixel information in the original face image to obtain a transformed image; data quantization of pixel information in the transformed image to obtain a quantized image; image compression of pixel information in the quantized image to obtain a compressed image"—can be performed, thereby reducing the difficulty of data processing and improving data processing efficiency.
[0045] Optionally, before performing the step "data transformation of pixel information in the original face image", if the color space corresponding to the original face image is not suitable for image processing, the original face image can be color space converted. For example, when the original face image is a raw color image and the color space corresponding to the original face image is RGB, the color space corresponding to the original face image can be converted from RGB to YCbCr. Further, the original face image after color space conversion can be used as a new original face image, and the steps described in this application—"data transformation of pixel information in the original face image to obtain a transformed image; data quantization of pixel information in the transformed image to obtain a quantized image; image compression of pixel information in the quantized image to obtain a compressed image"—can be performed.
[0046] Data transformation is used to transform pixel information to further perform image compression steps based on the transformation results. For example, pixel information, as a spatial domain signal, can be transformed from a spatial domain signal to a frequency domain signal through data transformation. This allows the original facial image to be transformed from the spatial domain to the frequency domain. There are various methods for data transformation. For instance, it can be implemented using the Discrete Cosine Transform (DCT). DCT is a transformation related to the Fourier Transform, similar to the Discrete Fourier Transform, but using only real numbers. A DCT is essentially a Discrete Fourier Transform approximately twice its length, performed on a real even function (because the Fourier transform of a real even function is still a real even function). In some variations, the input or output position needs to be shifted by half a unit (there are 8 standard types of DCT, 4 of which are common).
[0047] Data quantization is used to approximate the values of a signal, thereby reducing the complexity of the quantized signal. There are various methods of data quantization. For example, pixel information can be quantized based on a quantization table; for instance, pixel information can be quantized by dividing the pixel information by the corresponding value in the quantization table.
[0048] As an example, image segmentation, color space conversion, and DCT processing can be performed on the original face image. This transforms each original face image into three floating-point matrices representing the Y, Cr, and Cb data, respectively. Furthermore, the quantization tables required for quantization can be obtained. For example, the quantization coefficient matrices required for processing the luminance data Y and the quantization coefficient matrices required for processing the color difference data Cr and Cb can be obtained. The floating-point matrices corresponding to the Y, Cr, and Cb channels are then divided and rounded with their corresponding quantization coefficient matrices to achieve data quantization of the transformed image.
[0049] There are various ways to compress the quantized image. For example, image compression can be achieved based on the Huffman compression mechanism, which can compress the original face image into an image in the Joint Photographic Experts Group (JPEG) format. It is worth noting that this application only uses compressing the original face image into JPEG format as an example. In practical applications, the original face image can also be compressed into other formats, and this application does not limit this.
[0050] 103. Perform hash processing on the compressed image to obtain the summary information of the compressed image.
[0051] The hashing process transforms an input of arbitrary length into a fixed-length output using a digest algorithm. This output is the digest information corresponding to the input. The digest algorithm refers to an algorithm capable of converting data of arbitrary length into a fixed-length data string. Therefore, in this application, hashing the compressed image yields the digest information corresponding to it.
[0052] In this application, the main control processing module can perform hash processing on the compressed image in various ways. For example, it can select a desired digest algorithm and apply the selected digest algorithm to the compressed image through the main control processing module to perform hash processing on the compressed image and obtain the digest information of the compressed image. Alternatively, it can combine multiple digest algorithms, that is, apply multiple digest algorithms to the compressed image through the main control processing module to perform hash processing on the compressed image and obtain the digest information of the compressed image. Or, the main control processing module can send the compressed image to other terminals or servers with idle computing resources and trigger the terminals or servers to perform hash processing on the compressed image and send the digest information of the compressed image to the main control processing module so that the main control processing module can obtain the digest information of the compressed image; and so on.
[0053] As examples, hash algorithms may include Secure Hash Algorithm 2 (SHA-2), MD5, SHA-512, etc.
[0054] It is worth noting that this application implements image compression on at least one original face image in the original image sequence to obtain at least one compressed image. For example, image compression is performed on all original color images at 25 frames per second in a color image stream to obtain compressed images corresponding to each original color image. Based on this, hash processing is then performed on each compressed image to obtain summary information for each compressed image. In other words, this application performs image compression and hash processing steps on image stream data.
[0055] 104. Send the digest information to the security encryption module, and the security encryption module performs signature processing on the digest information based on the preset private key to obtain the digital signature of the digest information.
[0056] Among them, the security encryption module refers to the module used to encrypt data. For example, the security encryption module can encrypt data based on a preset private key.
[0057] As an example, a security encryption module may include a secure element (SE) in a facial payment device. Specifically, the SE is typically provided in the form of a chip, and to prevent external malicious parsing attacks and protect data security, the chip may have encryption / decryption logic circuitry.
[0058] In asymmetric encryption, the key pair specifically includes a public key and a private key. The public and private keys are a pair; specifically, if data is encrypted using the public key, only the corresponding private key can decrypt it; if data is signed using the private key, the corresponding public key can be used to verify the signature. Because encryption and decryption use two different keys, this type of algorithm is called an asymmetric encryption algorithm.
[0059] In practical applications, the basic process of using asymmetric encryption algorithms to exchange confidential information is as follows: Party A generates a key pair and publishes the public key. Other parties (Party B) who need to send information to Party A use this key (Party A's public key) to encrypt the confidential information before sending it to Party A. Party A then decrypts the encrypted information using its own private key. Conversely, when Party A wants to reply to Party B, it encrypts the data using Party B's public key, and similarly, Party B decrypts it using its own private key. Furthermore, Party A can sign the confidential information using its private key before sending it to Party B. Correspondingly, Party B can verify the signature on the data sent back by Party A using Party A's public key.
[0060] Signature processing is a method for identifying digital information. Specifically, signing a data unit refers to the process of generating a data signature corresponding to that data unit.
[0061] A digital signature is a unique string of numbers that only the sender of a message can generate and that cannot be forged by others. This string also serves as valid proof of the authenticity of the message sent by the sender. For example, a digital signature can be data appended to a data unit or a cryptographic transformation of that data unit. This data or transformation allows the recipient of the data unit to verify its origin and integrity, and to protect the data from forgery by others (such as the recipient). It is a method of signing electronic messages, and a signed message can be transmitted over a communication network.
[0062] It is worth noting that this application implements image compression for at least one original face image in the original image sequence, thereby obtaining at least one compressed image. For example, image compression is performed on all original color images at 25 frames per second in a color image stream, resulting in compressed images corresponding to each original color image. Based on this, each compressed image is hashed to obtain a digest of the compressed image. This digest is then sent to a secure encryption module, which uses a preset private key to sign the digest, obtaining a digital signature for each digest. In other words, this application performs image compression, hashing, and signing on image stream data.
[0063] In this application, the main control processing module can send digest information to the security encryption module, and the security encryption module can perform signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information. Specifically, the step "the security encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information" can include: Determine the encryption function required to encrypt the digest information; Based on a pre-set private key, the digest information is encrypted using an encryption function to obtain the encrypted ciphertext of the digest information, and the encrypted ciphertext is used as the digital signature of the digest information.
[0064] The encryption function refers to the function obtained based on the digital signature algorithm, which can be used to perform signature processing. For example, digital signature algorithms can include RSA (Rivest Shamir Adleman) algorithm, Digital Signature Algorithm (DSA), Elliptic Curve Digital Signature Algorithm (ECDSA), etc. In this application, there are several ways to determine the encryption function required to encrypt the digest information. For example, the required encryption function can be built into the security encryption module when it is generated, so that the security encryption module can directly call the encryption function to perform the encryption process of the digest information; another example is that an instruction can be sent to the security encryption module, which can indicate the encryption function required to encrypt the digest information, so that the security encryption module can determine the encryption function required to encrypt the digest information by parsing the instruction; and so on.
[0065] Once the digest function is determined, the security encryption module can use the preset private key to encrypt the digest information by applying the encryption function, and use the resulting encrypted ciphertext as the digital signature of the digest information.
[0066] In one embodiment, the main control processing module can be integrated into the main control chip, the security encryption module can be integrated into the SE chip, and the original face image can be the original color image. See also Figure 3 The key pair corresponding to the SE chip can be generated in a secure environment, and the public key can be uploaded to the backend server. Specifically, the SE chip is manufactured in a secure factory, and the key pair can be generated in the secure environment inside the SE chip. The private key can be kept by the SE chip and stored inside the SE chip, while the public key can be exported and uploaded to the backend server for data stream signing and verification.
[0067] Furthermore, the main control chip can acquire the original image sequence for facial payment, i.e., the color image stream, and call the VPU module to compress the color image into a JPEG image. Specifically, the main control chip can acquire three aligned images, which may include a color image in YUV format, a depth image in RAW DATA format, and an infrared image in YUV format. Moreover, the main control chip can call the VPU module to compress the YUV format color image to obtain a compressed image in JPEG format.
[0068] Furthermore, the main control chip can work with the SE chip to sign compressed images in JPEG format. Specifically, the main control chip can perform hash processing on the compressed image to obtain a digest of the compressed image, and send this digest to the security encryption module. The security encryption module can then use a preset private key to sign the digest, obtaining a digital signature of the digest.
[0069] 105. Process facial payment based on digital signature.
[0070] In this application, a secure encryption module is used to sign the original facial image in the original image sequence based on a pre-set private key, which effectively prevents data tampering and ensures business security. However, considering that in practical applications, such as facial payment, replay attacks are also a means of reducing data security, specifically, the basic principle of a replay attack is to resend previously stolen data to the recipient unchanged. For example, in facial payment, if there is no defense against replay attacks, hackers can steal the user's signed image and impersonate that user to make facial payments, which would pose a significant security risk.
[0071] Therefore, in addition to designing an SE-level stream signature mechanism, this application further sets up a mechanism to defend against replay attacks. This ensures that when applied to facial payment, it can effectively resist data tampering risks and data replay attacks, thereby improving data security in facial payment. Specifically, the step "facial payment processing based on digital signature" may include: Identify the target face image for face payment from the original image sequence; Determine the image identification information of the target face image; Based on the image identification information and the digital signature corresponding to the target face image, the target data required for face payment is generated; Send the target data to the server to trigger the server to process the facial payment based on the target data.
[0072] Determining the target face image for face payment from the original image sequence refers to identifying the image to be sent to the server from the signed image corresponding to the original face image, so that the server can perform subsequent steps of face payment processing based on the received image. The image to be sent to the server here is the target face image.
[0073] In this application, there are various methods for determining the target face image. For example, all signed images can be used as the target face image; or, a preferred payment frame can be determined from the signed images and used as the target face image; and so on.
[0074] The image identification information is used to uniquely identify the target facial image. In this application, the acquired facial image can also be referred to as a frame; therefore, the image identification information can be a Frame Identity Document (FID).
[0075] In practical applications, the server can receive facial payment requests, which may include the target facial image required to execute the payment. The server can determine whether the target facial image is a replay attack image by verifying whether the image identifier information corresponding to the target facial image is incrementing. Specifically, the server can store the latest image identifier information (for distinction, it can be simply referred to as the current image identifier information). If the image identifier information of the received target facial image (for distinction, it can be simply referred to as the target image identifier information) is less than or equal to the current image identifier information, the server can determine that the target facial image is a replay attack image, thereby rejecting the payment request and initiating an alarm.
[0076] In this application, after the facial payment device determines the target facial image from the original image sequence, it can determine the image identifier information corresponding to the target facial image before sending the target facial image to the server. It is worth noting that the facial payment device must ensure that the image identifier information is incremented. In one embodiment, the historical image identifier record of the facial payment device can be read, and the identifier can be incremented based on the historical image identifier record to obtain the incremented target image identifier information, thus ensuring that the image identifier information of the facial payment device is incremented. Specifically, the step "determine the image identifier information of the target facial image" may include: Read historical image identification records for facial payment from the storage unit, wherein the storage unit is configured with a data update cycle for the historical image identification records; Based on the data update cycle and historical image identification records, calculate the image identification information of the target face image.
[0077] In this context, a storage unit refers to a structure capable of storing data; optionally, a storage unit may also have data read and write capabilities. There can be various types of storage units, including, for example, non-volatile storage units and volatile storage units.
[0078] Non-volatile memory cells are storage cells within non-volatile memory (NVM). NVM refers to computer memory where stored data is retained even when power is turned off. Typically, to ensure optimal operation, NVMs in practical applications often have read / write restrictions. For example, NVMs can include read-only memory (ROM) and flash memory. Among them, volatile memory cells are storage cells in Random Access Memory (RAM). RAM can be read and written at any time, and it is usually used as a temporary storage medium for the operating system or other running programs. However, RAM cannot retain data when the power is off; if data needs to be saved, it must be written to a long-term memory.
[0079] The data update cycle refers to the interval at which data updates are performed. For example, the data update cycle may include a time interval, in which case a data update operation is performed every preset time interval, such as every 10 minutes; or the data update cycle may include a counting interval, in which case a data update operation is performed every preset counting interval, such as when the count increment of image identification information reaches 10,000.
[0080] The historical image identifier record refers to the relevant data obtained by recording the historical image identifier information of the facial payment device. Specifically, since the facial payment device needs to ensure that the image identifier information of the target face image is incremented, in this application, the historical image identifier record of facial payment can be read from the storage unit so that the image identifier information of the target face image can be obtained by incrementing based on the historical image identifier record. It is worth noting that in this application, since different storage units may have different data update cycles for the historical image identifier record, the historical image identifier records in different storage units may also be different.
[0081] In this application, the data update cycle for historical image identification records can be different for different storage units. For example, for volatile storage units, since they can be read and written at any time, each time the image identification information is incremented, such as when the FID is incremented by 1, it can be read and written in the volatile storage unit. Therefore, the data update cycle for historical image identification records in the volatile storage unit can be a counting interval of 1. For non-volatile storage units, although the data will not be lost after power failure, the non-volatile storage units have read and write restrictions. Therefore, a larger data update cycle can be set for the non-volatile storage units. For example, when the increment count of the image identification information is detected to meet a preset value, such as when the FID increment count is 10,000 times, it can be read and written in the non-volatile storage unit.
[0082] In practical applications, image identification information is typically stored in the internal memory of a secure encryption module such as the SE, powered by a battery. This ensures that the image identification information increments with each frame of the target face image. Even if the camera loses power, the battery power prevents the historical image identification information in memory from being cleared or reset. Therefore, simply incrementing the historical image identification information in memory ensures that the information is incremental. However, in low-cost, small-size solutions, cost and size limitations prevent the use of batteries and hardware tamper-proof designs. In other words, it's impossible to ensure the incremental increase of image identification information in a facial payment device by integrating a battery. To address this issue, this application designs and applies different types of storage units with varying data update cycles. After reading historical image identification records from the storage units, the image identification information of the target face image is calculated based on the data update cycle and the historical image identification records. A specific example will be provided below.
[0083] In one embodiment, the storage unit may include a non-volatile storage unit and a volatile storage unit. The volatile storage unit may be used to store a first image identifier record for facial payment, and the non-volatile storage unit may be used to store a second image identifier record for facial payment. Specifically, the step of "reading historical image identifier records for facial payment from the storage unit" may include: When the first image identifier record in the volatile storage unit is detected to meet the preset conditions, the second image identifier record stored in the non-volatile storage unit is updated according to the data update cycle of the second image identifier record in the non-volatile storage unit. The updated second image identifier record is read from the non-volatile storage unit and used as the historical image identifier record for face payment.
[0084] In this application, since different storage units can have different data update cycles for historical image identification records, the historical image identification records recorded in different storage units can also be different. Specifically, the first image identification record refers to the historical image identification record recorded in the volatile storage unit. The second image identification record refers to the historical image identification record recorded in the non-volatile storage unit.
[0085] The preset condition is a condition set for updating the data of the second image identifier record in the non-volatile storage unit. For example, the preset condition can be that 10000 is used as the counting unit. Whenever the first image identifier record is detected to have reached a new counting unit, it is determined that the preset condition is met. As an example, the second image identifier record can increment at a counting interval of 1. The second image identifier record can increment from 1 to 2, 3, ..., 9999. When the second image identifier record is detected to have incremented to 10000, it is determined that the preset condition is met. Similarly, the second image identifier record can continue to increment from 10000 to 10001, 10002, 10003, ..., 19999. When the second image identifier record is detected to have incremented to 20000, it is determined that the preset condition is met...
[0086] When the first image identifier record in the volatile storage unit is detected to meet the preset conditions, the second image identifier record stored in the non-volatile storage unit can be updated according to the data update cycle of the second image identifier record in the non-volatile storage unit.
[0087] As an example, the data update period for the first image identifier record in the volatile storage unit can be a counting interval, specifically 1; the data update period for the second image identifier record in the non-volatile storage unit can also be a counting interval, specifically 10000. Therefore, when the first image identifier record in the volatile storage unit is detected to increase from 9999 to 10000, the second image identifier record stored in the non-volatile storage unit can be updated to 10000; when the first image identifier record in the volatile storage unit is detected to increase from 19999 to 20000, the second image identifier record stored in the non-volatile storage unit can be updated to 20000; when the first image identifier record in the volatile storage unit is detected to increase from 29999 to 30000, the second image identifier record stored in the non-volatile storage unit can be updated to 30000…
[0088] Furthermore, the updated second image identifier record can be read from the non-volatile storage unit and used as the historical image identifier record for facial payment. For example, if the updated second image identifier record is 10000, the value 10000 can be read from the non-volatile storage unit and used as the historical image identifier record for facial payment; if the updated second image identifier record is 20000, the value 20000 can be read from the non-volatile storage unit and used as the historical image identifier record for facial payment; if the updated second image identifier record is 30000, the value 30000 can be read from the non-volatile storage unit and used as the historical image identifier record for facial payment… It is worth noting that since volatile storage units cannot retain data when power is lost, it is possible to configure the device to directly read the latest second image identifier record from the non-volatile storage unit each time it is restarted after a power outage or each time the facial payment device is powered on, and use this second image identifier record as the historical image identifier record for facial payment. For example, since volatile storage units cannot retain data when power is lost, it can be configured to execute the step "read the latest second image identifier record from the non-volatile storage unit and use this second image identifier record as the historical image identifier record for facial payment" every time it is restarted after a power outage or each time the facial payment device is powered on. In another embodiment, the storage unit may include a non-volatile storage unit and a volatile storage unit. The volatile storage unit may be used to store a first image identifier record for facial payment, and the non-volatile storage unit may be used to store a second image identifier record for facial payment. Specifically, the step of "reading historical image identifier records for facial payment from the storage unit" may include: The first image identifier record stored in the volatile storage unit is read and used as the historical image identifier record for face payment.
[0089] It is worth noting that although the volatile storage unit cannot retain data when power is lost, it can still stably store and read / write data when the power supply is stable or the facial payment device does not need to be restarted. Therefore, the first image identifier record stored in the volatile storage unit can be directly read and used as the historical image identifier record for facial payment. For example, if the first image identifier record stored in the volatile storage unit is 8999 when the power supply is stable or the facial payment device does not need to be restarted, the value 8999 can be read from the volatile storage unit and used as the historical image identifier record for facial payment.
[0090] The above describes the step "reading historical image identification records for facial payment from the storage unit, wherein the storage unit is set with a data update cycle for the historical image identification records". The following will further explain the step "calculating image identification information of the target facial image based on the data update cycle and the historical image identification records".
[0091] As mentioned earlier, in practical applications, the following two application scenarios can be included: when the power supply is stable or the facial payment device does not need to be restarted, and when the power supply is unstable (e.g., restarting after a power outage) or the facial payment device needs to be restarted. For these two application scenarios, the step "calculate the image identification information of the target facial image based on the data update cycle and historical image identification records" can be implemented in different ways.
[0092] In one embodiment, in cases of unstable power supply (e.g., power outage and restart) or restart of the facial payment device, the read historical image identifier records can be reset to ensure that the image identifier information of the target facial image is incremented. In this embodiment, the storage unit may include a non-volatile storage unit for storing the second image identifier record of facial payment. Specifically, the step of "calculating the image identifier information of the target facial image based on the data update cycle and the historical image identifier records" may include: The historical image identification records are reset according to the data update cycle of the second image identification record in the non-volatile storage unit; Based on the processing results, the image identification information of the target face image is determined.
[0093] Among them, reset processing is a type of data update processing, which is specifically achieved by resetting the data to other data.
[0094] Based on the data update cycle of the second image identifier record in the non-volatile storage unit, there are various ways to reset the historical image identifier record. For example, the value of the data update cycle can be taken, and the value can be operated on with the historical image identifier record to reset the historical image identifier record to the operation result. As an example, the type of operation can include addition, multiplication, weighting, and compound operations of multiple operations, and this application does not limit this.
[0095] As an example, the data update period of the second image identifier record in the non-volatile storage unit can be a counting interval, specifically 10000. The historical image identifier record read can be 20000. Then, the reset process can be achieved by adding the historical image identifier record with the value of the data update period, that is, by executing 20000+10000=30000.
[0096] Furthermore, based on the processing result, the image identification information of the target face image can be determined. For example, the numerical value corresponding to the processing result can be used as the image identification information of the target face image. In the example above, the image identification information of the target face image is determined to be 30000. This ensures that even in cases of unstable power supply (e.g., power outage and restart) or when the facial payment device restarts, the image identification information of the target face image will still increment.
[0097] In another embodiment, for situations where the power supply is stable or the facial payment device does not require restarting, the read historical image identifier records can be incremented to ensure that the image identifier information of the target facial image is incremented. In this embodiment, the storage unit may include a volatile storage unit, which can be used to store the first image identifier record of facial payment. Specifically, the step "calculating the image identifier information of the target facial image based on the data update cycle and historical image identifier records" may include: Based on the data update cycle of the first image identifier record in the volatile storage unit, the historical image identifier records are incremented. Based on the processing results, the image identification information of the target face image is determined.
[0098] Increment processing is a type of data update processing, specifically achieved by incrementing the data.
[0099] Based on the data update cycle of the first image identifier record in the volatile storage unit, there are several ways to increment the historical image identifier record. For example, the value of the data update cycle can be taken and the historical image identifier record can be incremented by this value, thereby realizing the incrementing of the historical image identifier record.
[0100] As an example, the data update period of the first image identifier record in the volatile storage unit can be a counting interval, which can specifically be 1. The historical image identifier record read can be 15712. The incrementing process can be achieved by adding this value to the historical image identifier record, that is, by executing 15712+1=15713.
[0101] Furthermore, based on the processing result, the image identification information of the target face image can be determined. For example, the numerical value corresponding to the processing result can be used as the image identification information of the target face image. In the example above, the image identification information of the target face image is determined to be 15713. This not only ensures that the image identification information of the target face image is incremental when the power supply is stable or the face payment device does not need to be restarted, but also makes good use of the unlimited read / write cycles of volatile memory units, improving resource utilization.
[0102] The above describes the steps of "determining the target face image for face payment from the original image sequence; determining the image identification information of the target face image". In this application, after determining the image identification information of the target face image, the target data required for face payment can be generated based on the digital signature corresponding to the image identification information and the target face image. The target data is then sent to the server to trigger the server to perform face payment processing based on the target data.
[0103] For example, the target facial image, the corresponding digital signature, and the image identification information of the target facial image can be appended to the target data sent to the server, and the target data can be sent to the server to trigger the server to perform facial payment processing based on the target data. It is worth noting that the generation of target data may also include conventional data processing procedures such as data encryption and data compression, which will not be elaborated here.
[0104] Because this application uses a secure encryption module to sign the compressed image based on a pre-set private key, and because it effectively defends against replay attacks by designing a processing mechanism that ensures the image identification information is incremented, when the server performs facial payment processing, it can correspondingly verify the digital signature to detect whether data tampering has occurred, and verify the image identification information of the target facial image to detect whether a data replay attack has occurred. Specifically, the step "triggering the server to perform facial payment processing based on the target data" may include: The trigger server verifies the data signature based on the preset public key and obtains the first verification result; Based on the historical identification information stored on the server, the target identification information is verified to obtain a second verification result; Based on the first and second verification results, facial payment processing is performed on the target facial image.
[0105] It is worth noting that the preset private key and preset public key in this application are a key pair. Therefore, after the facial payment device signs the digest information of the compressed image based on the preset private key and sends the generated digital signature to the server, the server can use the preset public key to verify the signature and obtain the first verification result. Specifically, if the first verification result is successful, it means that the server has verified the signature, which can prove that the data sent by the facial payment device to the server has not been tampered with.
[0106] The target identification information refers to the image identification information of the target face image sent by the face payment device to the server. In practical applications, after receiving the image identification information corresponding to the historical face images sent by the face payment device, the server can store the image identification information. In this application, the image identification information stored by the server can be referred to as the historical identification information stored by the server.
[0107] To defend against replay attacks, facial payment devices need to ensure that the image identifier information of the target face image is incremented. Correspondingly, the server can also detect whether a received facial payment request is a replay attack by verifying whether the received target identifier information is incremented. Therefore, the server can verify the target identifier information based on stored historical identifier information to obtain a second verification result.
[0108] For example, the server can select the maximum value from historical identifier information and compare the target identifier information with this maximum value to determine whether the target identifier information is increasing. Specifically, if the target identifier information is less than or equal to the maximum value, it can be determined that the target identifier information is not increasing, that is, the second verification result is verification failure, and it can be further determined that the currently received face payment request belongs to a replay attack and an alert is issued accordingly; if the target identifier information is greater than the maximum value, it can be determined that the target identifier information is increasing, that is, the second verification result is verification success, and the relevant steps required for face payment can be further executed.
[0109] After determining the first and second verification results, facial payment processing can be further performed on the target facial image based on these results. For example, if both the first and second verification results pass, the server can determine the relevant steps for facial payment processing on the target facial image; otherwise, the server will issue an alarm and refuse to perform the relevant steps for facial payment processing on the target facial image.
[0110] As can be seen from the above, this embodiment can obtain the original image sequence for face payment through the main control processing module, wherein the original image sequence includes at least one original face image; compress the original face image to obtain a compressed image; perform hash processing on the compressed image to obtain the digest information of the compressed image; send the digest information to the security encryption module, and perform signature processing on the digest information based on a preset private key through the security encryption module to obtain a digital signature of the digest information; and perform face payment processing based on the digital signature.
[0111] This solution supports the industry's implementation of facial payment data stream signing using existing low-performance, low-cost, and low-bandwidth facial recognition devices. Specifically, when applied to facial recognition cameras, facial payment systems, or other facial payment scenarios, the solution can acquire the original facial image for facial payment through the main control processing module, compress the original facial image, and then perform hash processing on the compressed image to obtain the corresponding digest information. In this way, the data processing capability of the main control processing module can be used to compress the image data to be signed by the security encryption module. This allows the security encryption module to sign the facial payment stream data while meeting its input / output throughput requirements, thereby preventing data tampering, ensuring business security, and improving the efficiency of facial payment.
[0112] Furthermore, the embodiments of this application can implement an SE-level stream signature method, which can be applied to facial recognition payment cameras and facial recognition payment systems to defend against data tampering and data replay attacks, ensuring business security. Moreover, based on the current industry practice of using low-performance, low-cost, and low-bandwidth SEs, it can achieve business security at a low cost when applied to facial recognition payment cameras and facial recognition payment systems.
[0113] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.
[0114] In this embodiment, the integration of a facial payment device into a server and a terminal will be used as an example. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal may include a main control processing module and a security encryption module. For example, the terminal may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle computer, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0115] like Figure 4 As shown, a facial recognition payment method has the following specific process: 201. The terminal obtains the original image sequence for face payment through the main control processing module, wherein the original image sequence includes at least one original face image.
[0116] In one embodiment, the terminal may specifically be a facial payment device, which may include a main control processing module and a security encryption module. As an example, the main control processing module may include a System-on-a-Chip (SoC) in the facial payment device; specifically, this chip may be referred to as the main control chip. This main control chip may be able to support image processing during the facial payment process, such as compression processing and hash processing. The security encryption module may be integrated into the SE chip.
[0117] In practical applications, facial payment devices can be devices that support facial payment, including at least one camera, at least one screen, a barcode scanner, a keyboard, sensors, and other components. Optionally, the facial payment device can also support multiple payment methods such as barcode payment and password payment. For example, a facial recognition device may include a 3D (three-dimensional) camera, analogous to a traditional camera, which adds liveness-related hardware and software, including a depth camera and an infrared camera, to help ensure information security. As an example, Figure 5 A facial recognition device was demonstrated.
[0118] 202. The terminal compresses the original facial image to obtain the compressed image.
[0119] In one embodiment, taking the original face image specifically as an original color image as an example, see [link to example]. Figure 3 The main control chip can acquire a color image stream, which may include at least one frame of original color image. After acquiring the color image stream, the main control chip can use the VPU module to compress the original color image into a JPEG format image, obtaining the compressed image.
[0120] 203. The terminal performs hash processing on the compressed image to obtain the summary information of the compressed image.
[0121] In one embodiment, see Figure 6 The hash module integrated in the main control chip can be used to perform hash processing on the compressed JPEG color image to obtain the summary information of the compressed image.
[0122] 204. The terminal sends digest information to the security encryption module, and the security encryption module performs signature processing on the digest information based on the preset private key to obtain the digital signature of the digest information.
[0123] In one embodiment, see Figure 6The main control chip can transmit the JPEG color image hash to the SE chip, that is, send the summary information of the compressed image to the SE chip. The SE chip encrypts the color image hash using a preset private key. The encrypted ciphertext of the JPEG color image hash in the SE chip is the SE key signature of the JPEG color image, that is, the summary information is signed to obtain the digital signature of the summary information.
[0124] 205. The terminal determines the target face image for face payment from the original image sequence and determines the image identification information of the target face image.
[0125] In one embodiment, the terminal can determine the target facial image through face selection and store the FID in a 64-bit integer memory variable, incrementing it every time a color image is signed. The increment count is written to the FLASH memory every 10,000 increments, and the FID is read from the FLASH memory and incremented by 10,000 each time the device is powered on. This allows the FID to increment even when power is off, without the need for a battery, thus preventing replay attacks.
[0126] 206. The terminal generates the target data required for facial payment based on the image identification information and the digital signature corresponding to the target face image.
[0127] In one embodiment, the terminal may attach a target face image, a digital signature of the target face image, and image identification information of the target face image to the target data to generate the target data required for face payment.
[0128] 207. The terminal sends target data to the server to trigger the server to perform facial payment processing based on the target data.
[0129] As can be seen from the above, the embodiments of this application can support the industry in implementing facial payment data stream signature based on existing low-performance, low-cost, and low-bandwidth facial recognition devices. Specifically, when applied to facial recognition cameras, facial payment systems, or other facial payment scenarios, this solution can obtain the original facial image for facial payment through the main control processing module, compress the original facial image, and then perform hash processing on the compressed image to obtain the digest information corresponding to the compressed image. In this way, the data processing capability of the main control processing module can be used to compress the image data to be signed by the security encryption module. Thus, while meeting the input / output throughput capability of the security encryption module, the security encryption module can sign the facial payment stream data, thereby resisting data tampering, ensuring business security, and improving the efficiency of facial payment.
[0130] Furthermore, the embodiments of this application can implement an SE-level stream signature method, which can be applied to facial recognition payment cameras and facial recognition payment systems to defend against data tampering and data replay attacks, ensuring business security. Moreover, based on the current industry practice of using low-performance, low-cost, and low-bandwidth SEs, it can achieve business security at a low cost when applied to facial recognition payment cameras and facial recognition payment systems.
[0131] To better implement the above methods, this application also provides a facial payment device, which can be integrated into a terminal. This terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle computer, etc., but is not limited to these.
[0132] For example, such as Figure 7 As shown, the facial payment device may include an acquisition unit 301, a compression unit 302, a hashing unit 303, a signature unit 304, and a payment unit 305, as follows: The acquisition unit 301 can be used to acquire the original image sequence of face payment through the main control processing module, wherein the original image sequence includes at least one original face image; The compression unit 302 can be used to compress the original face image to obtain a compressed image; The hash unit 303 can be used to perform hash processing on the compressed image to obtain the summary information of the compressed image; The signature unit 304 can be used to send the digest information to the security encryption module, and the security encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information; Payment unit 305 can be used to perform facial payment processing based on the digital signature.
[0133] In one embodiment, reference Figure 8 The payment unit 305 may include: The image determination subunit 3051 can be used to determine the target face image for face payment from the original image sequence; The identifier determination subunit 3052 can be used to determine the image identifier information of the target face image; The generation subunit 3053 can be used to generate target data required for face payment based on the image identification information and the digital signature corresponding to the target face image; The sending subunit 3054 can be used to send the target data to the server to trigger the server to perform face payment processing based on the target data.
[0134] In one embodiment, the identifier determination subunit 3052 can be used for: Historical image identification records for facial payment are read from the storage unit, wherein the storage unit is configured with a data update cycle for the historical image identification records; based on the data update cycle and the historical image identification records, image identification information of the target facial image is calculated.
[0135] In one embodiment, the storage unit includes a non-volatile storage unit and a volatile storage unit. The volatile storage unit is used to store a first image identifier record for facial payment, and the non-volatile storage unit is used to store a second image identifier record for facial payment. The identifier determination subunit 3052 can specifically be used for: When the first image identifier record in the volatile storage unit is detected to meet the preset conditions, the second image identifier record stored in the non-volatile storage unit is updated according to the data update cycle of the second image identifier record in the non-volatile storage unit; the updated second image identifier record is read from the non-volatile storage unit and used as the historical image identifier record for facial payment.
[0136] In one embodiment, the storage unit includes a non-volatile storage unit for storing a second image identifier record for facial payment; the identifier determination subunit 3052 can specifically be used for: According to the data update cycle of the second image identifier record in the non-volatile storage unit, the historical image identifier record is reset; based on the processing result, the image identifier information of the target face image is determined.
[0137] In one embodiment, the storage unit includes a volatile storage unit for storing a first image identifier record for facial payment; the identifier determination subunit 3052 can specifically be used for: Based on the data update cycle of the first image identifier record in the volatile storage unit, the historical image identifier record is incremented; based on the processing result, the image identifier information of the target face image is determined.
[0138] In one embodiment, the transmitting subunit 3054 can be used for: The server is triggered to verify the data signature based on a preset public key to obtain a first verification result; the target identification information is verified based on the historical identification information stored by the server to obtain a second verification result; and facial payment processing is performed on the target facial image based on the first verification result and the second verification result.
[0139] In one embodiment, reference Figure 9The compression unit 302 may include: The transformation subunit 3021 can be used to perform data transformation on the pixel information in the original face image to obtain the transformed image; The quantization subunit 3022 can be used to quantize the pixel information in the transformed image to obtain the quantized image. The compression subunit 3023 can be used to compress the pixel information in the quantized image to obtain a compressed image.
[0140] In one embodiment, reference Figure 10 The signature unit 304 may include: The function determination subunit 3041 can be used to determine the encryption function required to encrypt the digest information; The encryption subunit 3042 can be used to encrypt the digest information based on the preset private key using the encryption function to obtain the encrypted ciphertext of the digest information, and use the encrypted ciphertext as the digital signature of the digest information.
[0141] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0142] As can be seen from the above, in the facial payment device of this embodiment, the acquisition unit 301 acquires the original image sequence for facial payment through the main control processing module, wherein the original image sequence includes at least one original facial image; the compression unit 302 compresses the original facial image to obtain a compressed image; the hash unit 303 performs hash processing on the compressed image to obtain digest information of the compressed image; the signature unit 304 sends the digest information to the security encryption module, and the security encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information; and the payment unit 305 performs facial payment processing based on the digital signature.
[0143] This solution supports the industry in implementing facial payment data stream signatures using existing low-performance, low-cost, and low-bandwidth facial recognition devices. Specifically, when applied to facial recognition cameras, facial payment systems, or other facial payment scenarios, the solution can acquire the original facial image for facial payment through the main control processing module, compress the original facial image, and then perform hash processing on the compressed image to obtain the corresponding digest information. In this way, the data processing capability of the main control processing module can be used to compress the image data to be signed by the security encryption module. This allows the security encryption module to sign the facial payment stream data while meeting its input / output throughput requirements, thereby preventing data tampering, ensuring business security, and improving the efficiency of facial payment.
[0144] Furthermore, this application also provides a computer device, which can be a terminal or other similar device. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle computer, etc., but is not limited to these. Figure 11 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically: The computer device may include a memory 401 having one or more computer-readable storage media, an input unit 402, a processor 403 including one or more processing cores, and a power supply 404, etc. Those skilled in the art will understand that... Figure 11 The computer device structure shown does not constitute a limitation on the computer device and may include, but is not limited to, computer devices. Figure 11 This indicates more or fewer components, a combination of certain components, or different arrangements of components. Among them: The memory 401 can be used to store software programs and modules. The processor 403 executes various functional applications and data processing by running the software programs and modules stored in the memory 401. The memory 401 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device (such as audio data, telephone directory, etc.). In addition, the memory 401 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 401 may also include a memory controller to provide access to the memory 401 by the processor 403 and the input unit 402.
[0145] Input unit 402 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, in one embodiment, input unit 402 may include a touch-sensitive surface and other input devices. A touch-sensitive surface, also known as a touch display or touchpad, can collect user touch operations on or near it (e.g., user operations using fingers, styluses, or any suitable object or accessory on or near the touch-sensitive surface) and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. The touch detection device detects the user's touch orientation and the signal generated by the touch operation, transmitting the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 403, and can receive and execute commands from the processor 403. Furthermore, various types of touch-sensitive surfaces, such as resistive, capacitive, infrared, and surface acoustic wave, can be used. In addition to the touch-sensitive surface, input unit 402 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc. The processor 403 is the control center of the computer device. It connects various parts of the mobile phone via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 401, and by calling data stored in the memory 401, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the mobile phone. Optionally, the processor 403 may include one or more processing cores; preferably, the processor 403 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 403.
[0146] The computer device also includes a power supply 404 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 403 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 404 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0147] Although not shown, the computer device may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 403 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 401 according to the following instructions, and the processor 403 runs the applications stored in the memory 401 to realize various functions, as follows: The main control processing module obtains the original image sequence for facial payment, wherein the original image sequence includes at least one original facial image; the original facial image is compressed to obtain a compressed image; the compressed image is hashed to obtain a digest information of the compressed image; the digest information is sent to the security encryption module, and the security encryption module signs the digest information based on a preset private key to obtain a digital signature of the digest information; facial payment is processed based on the digital signature.
[0148] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0149] As can be seen from the above, the computer device in this embodiment can support the industry's implementation of facial recognition devices with existing low performance, low cost, and low bandwidth to achieve data stream signature for facial payment. Specifically, when applied to facial recognition cameras, facial recognition payment systems, or other facial payment scenarios, this solution can obtain the original facial image for facial payment through the main control processing module, compress the original facial image, and then perform hash processing on the compressed image to obtain the digest information corresponding to the compressed image. In this way, the data processing capability of the main control processing module can be used to compress the image data to be signed by the security encryption module. Thus, while meeting the input / output throughput capability of the security encryption module, the security encryption module can sign the facial payment stream data, thereby resisting data tampering, ensuring business security, and improving the efficiency of facial payment.
[0150] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0151] To this end, embodiments of this application provide a storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the facial payment methods provided in embodiments of this application. For example, the instructions can execute the following steps: The main control processing module obtains the original image sequence for facial payment, wherein the original image sequence includes at least one original facial image; the original facial image is compressed to obtain a compressed image; the compressed image is hashed to obtain a digest information of the compressed image; the digest information is sent to the security encryption module, and the security encryption module signs the digest information based on a preset private key to obtain a digital signature of the digest information; facial payment is processed based on the digital signature.
[0152] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0153] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0154] Since the instructions stored in the storage medium can execute the steps of any of the facial payment methods provided in the embodiments of this application, the beneficial effects that any of the facial payment methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0155] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations of the facial payment aspect described above.
[0156] The foregoing has provided a detailed description of a facial payment method, apparatus, computer device, storage medium, and product provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A facial payment method, applicable to a terminal, said terminal comprising a main control processing module and a security encryption module, comprising: The main control processing module obtains the original image sequence for facial payment, wherein the original image sequence includes at least one original facial image; The original facial image is compressed to obtain a compressed image; The compressed image is hashed to obtain a summary of the compressed image. The digest information is sent to the secure encryption module, and the secure encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information; The target face image for face payment is determined from the original image sequence; The image identification information of the target face image is determined. The image identification information is maintained by a storage unit, which includes a non-volatile storage unit and a volatile storage unit. The volatile storage unit is used to store the first image identification record for face payment, and the non-volatile storage unit is used to store the second image identification record for face payment. When the first image identifier record in the volatile storage unit is detected to meet the preset conditions, the second image identifier record stored in the non-volatile storage unit is updated; the image identifier information is determined based on the first image identifier record or the second image identifier record. Based on the image identification information and the digital signature corresponding to the target face image, target data required for face payment is generated; The target data is sent to the server to trigger the server to perform facial payment processing based on the target data.
2. The facial payment method according to claim 1, characterized in that, Determining the image identification information of the target face image includes: Read historical image identification records for facial payment from the storage unit, wherein the storage unit is configured with a data update cycle for the historical image identification records; Based on the data update cycle and the historical image identification records, the image identification information of the target face image is calculated.
3. The facial payment method according to claim 2, characterized in that, Read historical image identification records for facial payment from the storage unit, including: When it is detected that the first image identifier record in the volatile storage unit meets the preset conditions, the second image identifier record stored in the non-volatile storage unit is updated according to the data update cycle of the second image identifier record in the non-volatile storage unit; The updated second image identifier record is read from the non-volatile storage unit and used as the historical image identifier record for face payment.
4. The facial payment method according to claim 2, characterized in that, The storage unit includes a non-volatile storage unit, which is used to store a second image identification record for facial payment. Based on the data update cycle and the historical image identification records, the image identification information of the target face image is calculated, including: The historical image identification record is reset according to the data update cycle of the second image identification record in the non-volatile storage unit; Based on the processing results, the image identification information of the target face image is determined.
5. The facial payment method according to claim 2, characterized in that, The storage unit includes a volatile storage unit, which is used to store the first image identification record for facial payment. Based on the data update cycle and the historical image identification records, the image identification information of the target face image is calculated, including: The historical image identifier record is incremented according to the data update cycle of the first image identifier record in the volatile storage unit; Based on the processing results, the image identification information of the target face image is determined.
6. The facial payment method according to claim 1, characterized in that, Triggering the server to perform facial payment processing based on the target data includes: The server is triggered to verify the data signature based on a preset public key, and a first verification result is obtained; Based on the historical identification information stored on the server, the target identification information is verified to obtain a second verification result; Based on the first verification result and the second verification result, facial payment processing is performed on the target facial image.
7. The facial payment method according to claim 1, characterized in that, The original facial image is compressed to obtain a compressed image, including: The pixel information in the original face image is transformed to obtain the transformed image; The pixel information in the transformed image is quantized to obtain a quantized image. The pixel information in the quantized image is compressed to obtain a compressed image.
8. The facial payment method according to claim 1, characterized in that, The secure encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information, including: Determine the encryption function required to encrypt the digest information; Based on the preset private key, the digest information is encrypted using the encryption function to obtain the encrypted ciphertext of the digest information, and the encrypted ciphertext is used as the digital signature of the digest information.
9. A facial payment device, characterized in that, include: The acquisition unit is used to acquire the original image sequence of face payment through the main control processing module, wherein the original image sequence includes at least one original face image; A compression unit is used to compress the original facial image to obtain a compressed image; A hash unit is used to perform hash processing on the compressed image to obtain summary information of the compressed image; The signature unit is used to send the digest information to the security encryption module, and the security encryption module performs signature processing on the digest information based on a preset private key to obtain a digital signature of the digest information; A payment unit is configured to: determine the target facial image for facial payment from the original image sequence; determine the image identification information of the target facial image, the image identification information being maintained by a storage unit, the storage unit including a non-volatile storage unit and a volatile storage unit, the volatile storage unit storing a first image identification record for facial payment, and the non-volatile storage unit storing a second image identification record for facial payment; update the second image identification record stored in the non-volatile storage unit when the first image identification record in the volatile storage unit is detected to meet a preset condition; determine the image identification information based on either the first or second image identification record; generate target data required for facial payment based on the digital signature corresponding to the image identification information and the target facial image; and send the target data to the server to trigger the server to perform facial payment processing based on the target data.
10. An electronic device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor runs the application program within the memory to perform the operations in the facial payment method according to any one of claims 1 to 8.
11. A storage medium, characterized in that, The storage medium stores a plurality of instructions adapted for loading by a processor to execute the steps of the facial payment according to any one of claims 1 to 8.
12. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the face payment method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Face image transmission method and device, numerical value transfer method and device and electronic equipment
CN111062323A
Face payment method, device and system, and computer readable storage medium
CN111062725A
Method and terminal for digitally signing picture
WO2019061185A1