Data encryption method, device, computer device and computer program
By encrypting facial and audio signal features with a reference public key, the method enhances data security in electronic transactions, addressing vulnerabilities in existing encryption methods.
Patent Information
- Application Number
- JP2023548554
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-05-17
- Filing Date
- 2022-04-08
- Publication Date
- 2024-10-16
- Estimated Expiration
- 2042-04-08
AI Technical Summary
Existing data encryption methods, particularly in electronic payments, are vulnerable to decryption and lack sufficient security measures, especially when using time stamps, which are easily compromised.
A data encryption method that collects facial images and audio signals, extracts features using AI technologies, determines the category of the object, and encrypts these features with a reference public key to create a complex security factor, enhancing the encryption of target data.
The method significantly improves data security by making it difficult to decrypt the encrypted data, ensuring secure transactions through complex facial and audio signal features.
Smart Images

Figure 0007568200000006 
Figure 0007568200000007 
Figure 0007568200000008
Abstract
Description
[Technical field]
[0001] This application claims priority based on a Chinese patent application filed with the China Patent Office on May 17, 2021, bearing application number 202110536368.X and titled "Data encryption method, apparatus, computer equipment and storage medium", the entire contents of which are incorporated herein by reference.
[0002] TECHNICAL FIELD The embodiments of the present application relate to the field of computer technology, and in particular to a data encryption method, apparatus, computer device and storage medium. [Background technology]
[0003] With the development of computer technology, electronic payment has become a common payment method, and payment methods are becoming more and more diverse. Usually, when making a payment, the computer device collects data to be verified, and transmits the collected data to a background server for verification before making the payment. In this process, the data needs to be encrypted to ensure the security of the data. Summary of the Invention [Problem to be solved by the invention]
[0004] The embodiments of the present application provide a data encryption method, an apparatus, a computer device and a storage medium, and improve the security of encrypted data. [Means for solving the problem]
[0005] In one aspect, a method of encrypting data is provided, the method comprising: collecting target data to be encrypted of a target object and object information corresponding to the target object, the object information including at least one of a facial image or an audio signal of the target object; encrypting an object feature corresponding to the object information according to a reference public key, and determining the encrypted object feature as a security factor of the target data; encrypting the target data based on the security factor to obtain encrypted data corresponding to the target data.
[0006] Optionally, the step of performing feature extraction on each of the plurality of second audio segments to obtain second segment features for each second audio segment comprises: for each of the second audio segments, Fourier transforming the second audio segment to obtain a transformed second audio segment; converting the converted second audio segment into spectral features corresponding to the second audio segment, and determining the spectral features as second segment features of the second audio segment.
[0007] Optionally, said step of encrypting an object feature corresponding to said object information according to a reference public key and determining the encrypted object feature as a security factor of said target data comprises: The step includes a step of respectively encrypting the object feature and the reference feature according to the reference public key and determining the encrypted object feature and the encrypted reference feature as security factors of the target data, the reference feature including at least a timestamp or a counter.
[0008] Optionally, the process of training the first classification model comprises: obtaining sample image features and a sample category to which a sample face image corresponding to the sample image features belongs, the sample category including a biometric category or a non-biometric category, the biometric category indicating that the sample face image is an image of a biometric object, and the non-biometric category indicating that the sample face image is an image of a non-biometric object; determining a predicted category to which the sample face image belongs according to the sample image features based on the first classification model; training the first classification model according to the sample categories and the predicted categories.
[0009] Optionally, the process of training the second classification model comprises: obtaining a sample category to which a sample audio signal corresponding to the sample audio feature belongs, the sample category including a biometric category or a non-biometric category, the biometric category indicating that the sample audio signal is an audio signal of a biometric object, and the non-biometric category indicating that the sample audio signal is an audio signal of a non-biometric object; determining a predicted category to which the sample audio signal belongs according to the sample audio features based on the second classification model; training the second classification model according to the sample categories and the predicted categories.
[0010] In another aspect, there is provided a data encryption apparatus, the apparatus comprising: an information collecting module for collecting target data to be encrypted of a target object and object information corresponding to the target object, the object information including at least one of a facial image or an audio signal of the target object; a security factor acquisition module for encrypting an object feature corresponding to the object information according to a reference public key, and determining the encrypted object feature as a security factor of the target data; a data encryption module for encrypting the target data based on the security factor to obtain encrypted data corresponding to the target data.
[0011] Optionally, said object information comprises said face image and said audio signal, and said apparatus further comprises: further comprising an object feature acquisition module for acquiring image features of the face image and audio features of the audio signal, respectively; The object feature acquisition module further stitches the image feature and the audio feature together, and determines the stitched feature as the object feature.
[0012] Optionally, the data encryption module encrypts the target data based on an encryption format corresponding to the target data and the security factor to obtain the encrypted data, wherein the encryption format indicates a relative positional relationship between the security factor and the target data in the encrypted data.
[0013] Optionally, the security factor acquisition module encrypts the object feature according to the reference public key and determines the encrypted object feature as the security factor if the object information belongs to a biometric category, and the biometric category indicates that the object information is information of a biometric object.
[0014] Optionally, said object information comprises said face image, and said apparatus further comprises: a first category determination module for obtaining image features of the face image and dividing the image features into a plurality of first region features, the face image including a plurality of first face regions, each first region feature corresponding to one of the first face regions in the face image; The first category determination module further determines, based on each of the first region features, a category to which a first face region corresponding to each of the first region features belongs; The first category determination module further determines a first ratio of first face regions in the plurality of first face regions that belong to the biometric category; The first category determination module further determines that the face image belongs to the biometric category in response to the first proportion being greater than a first reference proportion.
[0015] Optionally, said object information comprises said audio signal, and said apparatus further comprises: a second category determination module for obtaining audio features of the audio signal and dividing the audio features into a plurality of first segment features, the audio signal including a plurality of first audio segments, each first segment feature corresponding to one first audio segment in the audio signal; The second category determination module further determines, based on each of the first segment features, a category to which a first audio segment corresponding to each of the first segment features belongs; The second category determination module further determines a second proportion of the first audio segments in the plurality of first audio segments that belong to the biometric category; The second category determination module further determines that the audio segment belongs to the biometric category in response to the second proportion being greater than a second reference proportion.
[0016] Optionally, the second category determination module further determines, for each of the first segment features, a category to which a first audio segment corresponding to the first segment feature belongs based on the first segment feature and the audio feature.
[0017] Optionally, said object information comprises said face image, and said object features comprise image features of said face image, and said apparatus further comprises: further comprising an image feature acquisition module for segmenting the facial image into a plurality of second facial regions; The image feature acquisition module further performs feature extraction on each of the second face regions to acquire second region features for each of the second face regions; The image feature acquisition module is further used in a feature acquisition module for stitching the acquired second region features to obtain the image feature.
[0018] Optionally, the image feature acquisition module further performs, for each of the second face regions, edge detection on the second face regions, obtains image gradients corresponding to the second face regions, and determines the image gradients as second region features of the second face regions, wherein the image gradients indicate a rate of change between any two adjacent pixels in the second face regions.
[0019] Optionally, said object information comprises said audio signal and said object features comprise audio features of said audio signal, and said apparatus further comprises: further comprising an audio feature acquisition module for dividing the audio signal into a plurality of second audio segments; The audio feature acquisition module further performs feature extraction on each of the plurality of second audio segments to acquire second segment features for each second audio segment; The audio feature acquisition module further stitches the acquired second segment features to obtain the audio feature.
[0020] Optionally, the audio feature acquisition module further comprises: For each of the second audio segments, Fourier transforming the second audio segment to obtain a transformed second audio segment; The transformed second audio segment is converted into a spectral feature corresponding to the second audio segment, and the spectral feature is determined as a second segment feature of the second audio segment.
[0021] Optionally, the security factor acquisition module further encrypts the object feature and the reference feature respectively according to the reference public key, and determines the encrypted object feature and the encrypted reference feature as a security factor of the target data, where the reference feature includes at least a timestamp or a counter.
[0022] Optionally, said object information comprises said face image, and said apparatus further comprises: The apparatus further includes a first category determination module for classifying image features of the face image based on a first classification model to obtain a category to which the face image belongs.
[0023] Optionally, the apparatus further comprises: A first training module for obtaining sample image features and a sample category to which a sample face image corresponding to the sample image features belongs; the sample category includes a biometric category or a non-biometric category, the biometric category indicating that the sample face image is an image of a biometric object, and the non-biometric category indicating that the sample face image is an image of a non-biometric object; The first training module further determines a predicted category to which the sample face image belongs according to the sample image features based on the first classification model; The first training module further trains the first classification model according to the sample categories and the predicted categories.
[0024] Optionally, said object information comprises said audio signal, and said apparatus further comprises: The audio signal processing device further includes a second category determination module for classifying an audio feature of the audio signal based on a second classification model to obtain a category to which the audio signal belongs.
[0025] Optionally, the apparatus further comprises: a second training module for obtaining a sample category to which a sample audio feature and a sample audio signal corresponding to the sample audio feature belong; the sample category includes a biometric category or a non-biometric category, the biometric category indicating that the sample audio signal is an audio signal of a biometric object, and the non-biometric category indicating that the sample audio signal is an audio signal of a non-biometric object; The second training module further determines a predicted category to which the sample audio signal belongs according to the sample audio features based on the second classification model; The second training module further trains the second classification model according to the sample categories and the predicted categories.
[0026] In another aspect, a computer device is provided that includes a processor and a memory, the memory having at least one computer program stored therein, the at least one computer program, when loaded and executed by the processor, implementing the operations performed in the data encryption method according to the aspect above.
[0027] In another aspect, a computer-readable storage medium is provided, the computer-readable storage medium storing at least one computer program, the at least one computer program realizing, when loaded and executed by a processor, the operations performed in the data encryption method described in the above aspect.
[0028] In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer program code, the computer program code being stored in a computer readable storage medium, a processor of a computing device reading the computer program code from the computer readable storage medium, and the processor executing the computer program code to cause the computing device to perform the operations performed in the data encryption method according to the above aspect.
[0029] The method, apparatus, computer device, and storage medium provided in the embodiments of the present application include, when collecting target data to be encrypted, collecting at least one of a facial image or an audio signal of a target object, and encrypting at least one of the facial image features or the audio signal features, so that the encrypted features are used as a security factor for encrypting the target data; in this encryption method, the security factor for encrypting the target data includes at least one of the facial image features or the audio signal features, and the facial image or audio signal features become more complex and difficult to decipher, thereby improving the security of the encrypted data. [Brief description of the drawings]
[0030] In order to more clearly describe the technical solutions in the embodiments of the present application, the following briefly introduces the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without making creative efforts. [Figure 1] 1 is a schematic diagram of an implementation environment according to an embodiment of the present application; [Diagram 2] 2 is a flow chart of a data encryption method according to an embodiment of the present application. [Diagram 3] 4 is a flowchart of another data encryption method according to an embodiment of the present application. [Figure 4] 1 is a schematic diagram of an image acquisition interface according to an embodiment of the present application. [Diagram 5] FIG. 2 is a schematic diagram of an audio signal according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of model training according to an embodiment of the present application. [Figure 7] FIG. 2 is a schematic diagram of determining a category based on a model according to an embodiment of the present application; [Figure 8] FIG. 2 is a structural schematic diagram of a first classification model according to an embodiment of the present application; [Figure 9] FIG. 2 is a structural schematic diagram of a first classification network according to an embodiment of the present application; [Figure 10] FIG. 2 is a structural schematic diagram of a classification layer according to an embodiment of the present application. [Figure 11] FIG. 2 is a structural schematic diagram of a second classification model according to an embodiment of the present application; [Figure 12] FIG. 13 is a structural schematic diagram of another second classification model according to an embodiment of the present application. [Figure 13] 1 is a structural schematic diagram of a data encryption device according to an embodiment of the present application; [Figure 14] FIG. 2 is a structural schematic diagram of another data encryption device according to an embodiment of the present application; [Figure 15] FIG. 2 is a structural schematic diagram of a terminal according to an embodiment of the present application; [Figure 16]FIG. 2 is a structural schematic diagram of a server according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0031] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following describes the embodiments of the present application in more detail with reference to the drawings.
[0032] As used in this application, terms such as "first", "second", etc. may be used herein to describe various concepts, but these concepts are not limited by these terms unless otherwise specified. These terms are used only to distinguish one concept from another. For example, a first audio segment can be referred to as a second audio segment and a second audio segment can be referred to as a first audio segment without departing from the scope of this application.
[0033] For the terms "at least one," "multiple," "each," and "any" as used in this application, at least one includes one or more, multiple includes more than one, each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, the multiple audio segments include three audio segments, each audio segment refers to each of these three audio segments, and any refers to any one of these three audio segments, which may be the first audio segment, the second audio segment, or the third audio segment.
[0034] The technical solution provided in the embodiments of the present application performs feature extraction on a facial image or audio signal according to artificial intelligence computer vision technology, voice recognition technology, machine learning and other technologies, and determines whether the facial image or audio signal is collected from a biological object.
[0035] Blockchain is a new application mode of computer technology, including distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a series of data blocks that are linked together using encryption methods, and each data block contains information about a batch of network transactions, which are used to verify the validity of the information (anti-counterfeiting) and generate the next block. Blockchain includes a blockchain foundation platform, a platform product service layer, and an application service layer.
[0036] In a possible implementation form, a computer program according to an embodiment of the present application may be located and executed on one computer device, or may be executed on multiple computer devices located at one location, or may be executed on multiple computer devices distributed at multiple locations and interconnected via a communication network, and multiple computer devices distributed at multiple locations and interconnected via a communication network can constitute a blockchain system.
[0037] In a possible implementation, the terminal and the server in the embodiments of the present application are nodes in a blockchain, and the node corresponding to the terminal obtains a face image or an audio signal, encrypts the target data, and stores the encrypted encrypted data in the blockchain, and then the node corresponding to the server in the blockchain can decrypt the encrypted data.
[0038] In order to facilitate understanding of the embodiments of the present application, we will first interpret some keywords related to the embodiments of the present application. Supervised Learning: Supervised learning is machine learning using a training dataset that includes labels, where each example in the training dataset includes an input object and a desired output for that input object. Multimodal fusion: Multimodal fusion is Multimodal Machine Learning (MMML), which realizes the ability to process and understand multi-source modal information through machine learning methods, such as multimodal learning between images, videos, audio, and semantics. Single-modal representation learning can represent information as a numerical vector that can be processed by computer equipment, or even abstract information as a higher-level feature vector, while multimodal representation learning can learn better feature representations by taking advantage of the complementarity between multimodals and removing redundancy between different modalities. Multimodal representation learning includes two main research directions: Joint Representations and Coordinated Representations. Facial Recognition Data: Facial data collected by your device when you conduct a facial recognition transaction.
[0039] The data encryption method provided in the embodiments of the present application is executed by a computer device, and the computer device is a terminal or a server. The following method embodiments take the data encryption method executed by a terminal as an example, and in another embodiment, the data encryption method is executed by a server, and the execution process is similar to the following embodiments, and will not be repeated here.
[0040] 1 is a schematic diagram of an implementation environment provided in an embodiment of the present application. Referring to FIG. 1, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
[0041] The terminal 101 installs a target application for which the server 102 provides services, and the target application can realize functions such as data collection, data transmission, message interaction, payment, etc. Optionally, the target application is a target application in the operating system of the terminal 101 or a target application provided by a third party. For example, the target application is a payment application, which has a payment function, and of course the payment application can also have other functions, such as a data transmission function, a shopping function, a message interaction function, etc.
[0042] Optionally, the terminal 101 is, but not limited to, a smartphone, a tablet computer, a laptop, a desktop computer, a smart speaker, a smart watch, a face recognition device, etc. Optionally, the server 102 is an independent physical server, or a server cluster or distributed system consisting 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 communications, middleware services, domain services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0043] Based on the implementation environment shown in Figure 1, a payment scenario by facial recognition is provided. When a user goes shopping, he or she makes a payment to a merchant by facial recognition payment. In this case, the terminal obtains the amount to be paid, the account information of the user making the payment, the account information of the merchant receiving the payment, and the user's facial data, collects the user's facial image and the voice emitted by the user as the target data to be encrypted (facial recognition data), encrypts the image features of the facial image and the audio features of the voice, takes the encrypted image features and the encrypted audio features as security factors, employs the security factors to encrypt the target data to obtain encrypted data, and then the terminal sends the encrypted data to a server, and the server decrypts the encrypted data to verify whether the payment is authorized, and if the verification is passed, returns the payment information to the terminal, and completes the payment after confirmation by the user.
[0044] 2 is a flow chart of a data encryption method provided in an embodiment of the present application. The execution subject of the embodiment of the present application is a terminal. Referring to FIG. 2, the method includes the following steps:
[0045] 201, a terminal collects target data to be encrypted of a target object and object information corresponding to the target object. The target object is any object, the target data is data to be encrypted, the object information is information describing the target object, and the object information is used to encrypt the target data, the target data includes at least one of face data, payment data, or fingerprint data, and the object information includes at least one of a facial image or an audio signal of the target object. In addition, any data or information collected by the terminal is collected with sufficient permission from the user. For example, the terminal displays a confirmation collection option and suggests that the terminal is allowed to collect data by triggering the confirmation collection option. After a target object triggers the confirmation collection option, the terminal collects the target data and object information of the target object upon confirming that permission has been obtained in response to the trigger operation for the confirmation collection option.
[0046] 202, the terminal encrypts the object feature corresponding to the object information according to the reference public key, and determines the encrypted object feature as a security factor of the target data. The reference public key is a public key stored in the terminal and used to encrypt the object information, for example, the reference public key is sent from a server corresponding to the terminal, and the security factor is used to encrypt the target data. The object feature includes at least one of an image feature of a face image or an audio feature of an audio signal. Optionally, when the object feature includes an image feature and an audio feature, the image feature and the audio feature are encrypted respectively according to the reference public key, or the image feature and the audio feature are stitched first, and the feature obtained by stitching is determined as an object feature, and the object feature is encrypted according to the reference public key.
[0047] 203, the terminal encrypts the target data according to the security factor, and obtains encrypted data corresponding to the target data. In the embodiment of the present application, after the terminal obtains the security factor, it encrypts the target data based on the security factor, and the security factor and the target data can be combined in any manner, and the embodiment of the present application does not limit this.
[0048] Related techniques usually employ time stamps to perform asymmetric encryption on data, but such encrypted data is easily decrypted and is less secure.
[0049] The method provided in the embodiment of the present application includes: when collecting target data to be encrypted, collecting at least one of a facial image or an audio signal of a target object, and encrypting at least one of the facial image features or the audio signal features, so that the encrypted features are used as security factors for encrypting the target data; in this encryption method, the security factors for encrypting the target data include at least one of the facial image features or the audio signal features, and the facial image or audio signal features become more complex and difficult to decipher, thereby improving the security of the encrypted data.
[0050] 3 is a flow chart of a data encryption method provided in an embodiment of the present application. The execution subject of the embodiment of the present application is a terminal. Referring to FIG. 3, the method includes the following steps:
[0051] 301, the terminal collects target data to be encrypted of the target object, a face image of the target object, and an audio signal. The target object is any object, for example, the target object is a user requiring a payment. The target data is data to be encrypted, the object information is information describing the target object and the object information is used to encrypt the target data, the target data includes at least one of face data, payment data, or fingerprint data, and the object information includes at least one of a facial image or an audio signal of the target object. The payment data includes an amount to be paid, account information to make the payment, account information to receive the payment, or other information.
[0052] In one possible implementation, the terminal collects a facial image of the target object by a camera and collects an audio signal of the target object by a microphone. In one case, the facial image and audio signal of the target object are obtained by collecting a biometric object, for example, the target object stands in front of the camera, the terminal collects a facial image by the camera, the target object speaks into the microphone, and the terminal collects what the target object says by the microphone; or in another case, the facial image and audio signal of the target object are obtained by collecting a non-biometric object, for example, another computer device is placed in front of the camera, the facial image of the target object is displayed on the screen of the computer device, and the terminal collects the facial image by the camera, or the computer device plays the audio of the target object, and the terminal collects the audio signal by the microphone.
[0053] In one possible implementation, a target application is installed on the terminal, and the terminal collects target data, face images, and audio signals through the target application. For example, the target application is a payment application, the target data is face data, and when a user makes a face recognition payment through the target application, the target application collects face data, face images, and audio signals of a target object.
[0054] In one possible implementation, the terminal collects face images through an image collection interface. The image collection interface includes an image collection area and presentation information, the presentation information is used to present an action that the user needs to perform, and the collected face images are RGB (Red Green Blue) three-color images or images in other formats. For example, referring to the image collection interface 401 shown in FIG. 4, the image collection interface displays the presentation information "Please stand in the middle", displays a circular image collection area below the presentation information, displays the presentation information "Processing" during the process of collecting face images, and displays the recognized face images in the image collection area.
[0055] In one possible implementation, the sampling rate and sampling depth when the terminal collects the audio signal are any value, and the collected audio signal may be mono or double. For example, referring to the audio signal shown in FIG. 5, the sampling rate of the audio signal is 16k, and the sampling depth is 16bit. In addition, the embodiment of the present application does not limit the time length of the collected audio signal, and the audio signal may be any time length, for example, the audio signal is 5 seconds, 10 seconds, or other time length. Regarding the content of the audio signal, optionally, the target object issues an audio signal according to the reference content, and the content of the audio signal is the reference content, for example, the reference content is "please identify my voice", or the content of the audio signal may be any content.
[0056] In addition, when the target data includes face data, there is overlapping content between the face data and the face image. The terminal may collect the face data included in the target data and the face image for encrypting the target data in different ways, or may collect them in the same way, and the embodiment of the present application does not limit this. Alternatively, the terminal may collect face data and the face image for encrypting the target data, or collect the face image of the target object, and then directly determine the face image as the face data to be encrypted, thereby obtaining the face image and the face data at one time, and the embodiment of the present application does not limit this.
[0057] In addition, in the embodiments of the present application, there is no restriction on the order of collecting facial images and audio signals. Optionally, the terminal collects facial images and audio signals simultaneously, or the terminal first collects facial images and then collects audio signals, or the terminal first collects audio signals and then collects facial images.
[0058] 302, the terminal performs feature extraction on the face image to obtain image features of the face image, and performs feature extraction on the audio signal to obtain audio features of the audio signal. Image features are used to describe face images, which may be vectors, matrices, or other forms of features, and audio features are used to describe audio signals, which may be vectors, matrices, or other forms of features.
[0059] The terminal extracts features from face images and audio signals using different methods. The face image feature extraction method and the audio signal feature extraction method are described below.
[0060] 1. Extraction of image features In one possible implementation form, the terminal divides the face image into a plurality of second face regions, performs feature extraction for each of the plurality of second face regions, obtains a second region feature for each second face region, and stitches the obtained plurality of second region features to obtain an image feature. Any two second face regions have no overlapping region, and stitching the plurality of second region features means sequentially connecting the plurality of second region features according to the positional relationship in the face image of the second face regions corresponding to the plurality of second region features to obtain an image feature.
[0061] Optionally, the terminal divides the face image according to the resolution, and the resolution of each second face region may be the same or different, that is, the size of any two second face regions may be the same or different. For example, the resolution of the face image is 1920*1080, and the face image is divided by the resolution of 60*60 to obtain a plurality of second face regions, and the resolution of each second face region is 60*60.
[0062] For each second face region feature extraction scheme, in one possible implementation, the terminal performs edge detection on the second face region, obtains image gradients corresponding to the second face region, and determines the image gradients as second region features of the second face region, where the image gradients indicate a rate of change of any two adjacent pixels in the second face region. Optionally, the image gradients include a gradient amplitude and a gradient direction. The terminal employs a Sobel operator, a Scharr operator, a Laplace operator, or other schemes to perform edge detection on the second face region.
[0063] For example, the Sobel algorithm employs the following formula to determine the image gradient:
number
number
number
number
number
[0064] In another possible implementation, the terminal directly performs feature extraction on the collected face image to obtain image features of the face image, and does not segment the face image.
[0065] In another possible implementation form, the terminal performs feature extraction on the face image based on the image feature extraction model to obtain image features of the face image. The image feature extraction model may be trained and stored by the terminal, or may be sent to the terminal from another device, and the embodiment of the present application is not limited thereto.
[0066] 2. Audio feature extraction In one possible implementation form, the terminal divides the audio signal into a plurality of second audio segments, performs feature extraction on each of the plurality of second audio segments, obtains a second segment feature of each second audio segment, and stitches the obtained plurality of second segment features to obtain an audio feature. Any two second audio segments have no overlapping parts, and stitching the plurality of second segment features means sequentially connecting the plurality of second segment features according to the forward and backward order in the audio signal of the second audio segments corresponding to the plurality of second audio features to obtain an audio feature.
[0067] Optionally, the audio signal is divided according to a time length, and the terminal divides the audio signal into a plurality of second audio segments according to a reference time length, and the time length of each second audio segment is the reference time length, for example, the reference time length is 1 second, 2 seconds, or other time length; or the audio signal is divided according to a number of sampling points included in the audio signal, and the terminal divides the audio signal into a plurality of second audio segments according to a reference number, and each second audio segment includes a reference number of sampling points, for example, the reference sampling points are 40, 80, or other numbers.
[0068] For the feature extraction scheme of each second audio segment, in one possible implementation form, the terminal Fourier transforms the second audio segment to obtain a transformed second audio segment, converts the transformed second audio segment into spectral features corresponding to the second audio segment, and determines the spectral features as second segment features of the second audio segment.
[0069] Optionally, the terminal extracts a Mel-Frequency Spectrum (MFC) of the second audio segment, employs a triangular overlapping window to map the transformed second audio segment to a Mel scale, takes a logarithm of the result, and performs a discrete cosine transform on the logarithmic result to obtain Mel-Frequency Cepstral Coefficients (MFCCs), and determines the obtained Mel-Frequency Cepstral Coefficients as the second segment features.
[0070] In another possible implementation, the terminal performs feature extraction directly on the collected audio signal to obtain audio features of the audio signal, and does not segment the audio signal.
[0071] In another possible implementation form, the terminal performs feature extraction on the audio signal based on an audio feature extraction model to obtain audio features of the audio signal. The audio feature extraction model may be trained and stored by the terminal, or may be transmitted to the terminal from another device, and the embodiments of the present application are not limited thereto.
[0072] It should be noted that the embodiment of the present application does not limit the order of extracting image features and audio features. Optionally, the terminal extracts image features and audio features simultaneously, or the terminal first extracts image features and then extracts audio features, or the terminal first extracts audio features and then extracts image features.
[0073] 303, the terminal determines a category to which the face image belongs based on the image features, and determines a category to which the audio signal belongs based on the audio features. The categories include a biometric category and a non-biometric category, and the object information belonging to the biometric category indicates that the object information is information of a biometric object, and the object information belonging to the non-biometric category indicates that the object information is information of a non-biometric object. That is, the face image belonging to the biometric category indicates that the face image is an image of a biometric target object, and the face image belonging to the non-biometric category indicates that the face image is an image of a non-biometric target object, the audio signal belonging to the biometric category indicates that the audio signal is an audio signal of a biometric target object, and the audio signal belonging to the non-biometric category indicates that the audio signal is an audio signal of a non-biometric target object. For example, when the terminal collects what the target object says in front of a microphone, the collected audio signal belongs to the biometric category.
[0074] For the image features of the face image, in one possible implementation form, the terminal divides the acquired image features into a plurality of first region features, the face image includes a plurality of first face regions, each of the first region features corresponds to one first face region in the face image, and determines a category to which the first face region corresponding to each first region feature belongs based on each first region feature, determines a first ratio of the first face regions in the plurality of first face regions whose category is a biometric category, and determines that the face image belongs to the biometric category according to the first ratio being greater than the first reference ratio, and determines that the face image belongs to the non-biometric category according to the first ratio not being greater than the reference ratio. The first reference ratio is any ratio, for example, the first reference ratio is 80%, 85%, or other ratio, and the first face region may be the same as or different from the second face region in the above step 302.
[0075] For the audio features of the audio signal, in one possible implementation, the terminal divides the acquired audio features into a plurality of first segment features, the audio signal includes a plurality of first audio segments, each of the first segment features corresponds to one first audio segment in the audio signal, and determines a category to which the first audio segment corresponding to each first segment feature belongs based on each first segment feature, determines a second proportion of the first audio segments in the plurality of first audio segments whose category is a biometric category, and determines that the audio segment belongs to the biometric category according to the second proportion being greater than the second reference proportion, and determines that the audio segment belongs to the non-biometric category according to the second proportion not being greater than the second reference proportion. The second reference proportion is any proportion, for example, the second reference proportion is 80%, 85%, or other proportion, and the first audio segment may be the same as or different from the second audio segment in the above step 302.
[0076] For each first segment feature, in one possible implementation form, the terminal determines a category to which the first audio segment corresponding to the first segment feature belongs based on the first segment feature and the audio features. That is, when determining a category to which the first audio segment belongs, the category to which the first audio segment belongs can be more accurately determined by considering the first segment feature of the first audio segment and the audio features of the audio signal.
[0077] In another possible implementation form, the terminal classifies the image features of the face image based on the first classification model, and obtains the category to which the face image belongs. The terminal classifies the audio features of the audio signal based on the second classification model, and obtains the category to which the audio signal belongs. The detailed process and model structure of the terminal classifying based on the first classification model and the second classification model will not be repeated here, but will be described with reference to the embodiments shown in Figures 6-12 below.
[0078] 304, the terminal respectively encrypts the image feature and the audio feature according to the reference public key if the face image and the audio signal belong to the biometric category, and determines the encrypted image feature and the encrypted audio feature as security factors.
[0079] In the embodiment of the present application, the image features and audio features are encrypted only when the facial image and audio signal belong to the biometric category, and when subsequently decrypting, it is also necessary to employ the image features of the facial image belonging to the biometric category and the audio features of the audio signal belonging to the biometric category for decryption, which further improves the safety of the security factor.
[0080] In one possible implementation, the terminal encrypts the reference feature, and the encrypted reference feature can also be the security factor. The reference feature includes at least one of a timestamp, a counter, or a random number. For example, the format of the security factor is as follows: {magic_num}{device_info}{sign_version}{timestamp}{counter}{random}{multimodal learning security factor} where magic_num indicates the overall format of the security factor, device_info indicates device information that determines the security factor, sign_version indicates the signature at the time of encryption, timestamp indicates a timestamp, counter indicates a counter, random indicates a random number, and the multimodal learning security factor indicates the encrypted image features and the encrypted audio features.
[0081] In addition, the embodiment of the present application has been described as an example of encrypting image features and audio features only if both the facial image and the audio signal belong to the biometric category. In another embodiment, the terminal does not perform the above step 303, that is, the terminal does not determine the category to which the facial image and the audio signal belong, and directly encrypts the image features and audio features after obtaining them; or in another embodiment, it is not necessary for both the facial image and the audio signal to belong to the biometric category, and as long as either the facial image or the audio signal belongs to the biometric category, the image features and audio features can be encrypted.
[0082] 305, the terminal encrypts the target data according to the security factor to obtain encrypted data corresponding to the target data.
[0083] The terminal pre-sets an encryption format corresponding to the target data, and encrypts according to the encryption format, that is, encrypts the target data according to the encryption format corresponding to the target data and the security factor to obtain encrypted data. The encryption format indicates the relative position relationship between the security factor and the target data in the encrypted data, for example, the security factor is before the target data, or the security factor is after the target data. The security factor includes features such as image features, audio features, counters, and timestamps, and the different features are arranged in the order of image features, audio features, counters, and timestamps, but of course the different features in the security factor can be arranged in other orders, and this application is not limited thereto. For example, the format of the encrypted data is as follows: {magic_num}{device_info}{sign_version}{timestamp}{counter}{parallel multimodal learning security factor}{random}{payload} where magic_num indicates the overall format of the security factor, device_info is the device information that determines the security factor, sign_version is the signature at the time of encryption, timestamp indicates a timestamp, counter indicates a counter, random indicates a random number, payload indicates the target data, and the parallel multimodal learning security factor indicates an object feature obtained by stitching the encrypted image feature and the encrypted audio feature.
[0084] Also, in one possible implementation, after the terminal obtains the encrypted data, it sends the encrypted data to the server, and the server decrypts the encrypted data, obtains the target data and the security factor, and analyzes the target data and the security factor from the encrypted data, for example, according to the relative positional relationship between the security factor and the target data in the encrypted data indicated by the encryption format. However, at this time, the target data is not directly determined as the decrypted data, but the security factor needs to be verified first. Therefore, according to the reference private key corresponding to the reference public key, the security factor is decrypted to obtain the image feature and the audio feature included in the security factor, and the face image and the audio signal of the target object stored in advance are obtained, and it is determined whether the image feature and the audio feature included in the security factor are consistent with the image feature of the face image and the audio feature of the audio signal stored in the server. If there is a match, the verification is passed and the target data is determined as the decoded data, i.e., the server determines at least one of the face data, the payment data, or the fingerprint data currently used for payment, and returns verification passing information to the terminal, and the terminal displays a payment confirmation interface, and the target object confirms the payment through the payment confirmation interface, thereby completing the payment based on the target data. When the server obtains the image features of the pre-stored face image and the audio features of the audio signal, the server adopts the same feature acquisition method as in step 302, so as to avoid differences in the acquired features due to different feature acquisition methods that affect the verification.
[0085] Optionally, if the image features included in the security factor do not match the image features of the face image stored in the server, or the audio features included in the security factor do not match the audio features of the audio signal stored in the server, the verification fails, the server returns verification failure information to the terminal, and the terminal displays a verification failure interface to suggest re-verification to the target object.
[0086] Optionally, the facial image and audio signal of the target object stored in the server are obtained by collecting a biometric target object and belong to the biometric category. Based on the above step 304, if the facial image and audio signal belong to the biometric category, the terminal can only encrypt them to ensure that the image features and audio features included in the security factor are consistent with the image features of the facial image and the audio features of the audio signal stored in the server, and thus pass the verification.
[0087] In the embodiment shown in Figure 3, only the object information including a facial image and an audio signal has been described as an example, but in another embodiment, the object information includes a facial image, image features of the facial image are encrypted according to a reference public key, the encrypted image features are determined as a security factor of the target data, and the target data is encrypted based on the security factor to obtain encrypted data, or the object information includes an audio signal, audio features of the audio signal are encrypted according to a reference public key, the encrypted audio features are determined as a security factor of the target data, and the target data is encrypted based on the security factor to obtain encrypted data.
[0088] The method provided in the embodiment of the present application includes the following steps: when collecting target data to be encrypted, collect at least one of a facial image or an audio signal of a target object, encrypt at least one of the features of the facial image or the features of the audio signal, and take the encrypted features as a security factor for encrypting the target data. In this encryption method, the security factor for encrypting the target data includes at least one of the features of the facial image or the features of the audio signal, and the features of the facial image or the audio signal are more complex and difficult to decipher, thus improving the security of the encrypted data.
[0089] In the embodiment of the present application, the categories to which the facial image and audio signal belong are determined, and if the facial image belongs to the biometric category and the audio signal belongs to the biometric category, the encrypted image features and audio features are determined as security factors, so that when it is necessary to decrypt it later, when the facial image and audio signal collected this time are verified according to the facial image and audio signal belonging to the pre-stored biometric category, only the facial image and audio signal belonging to the biometric category can pass the verification, and the facial image and audio signal not belonging to the biometric category cannot pass the verification, thereby further improving the security of the security factor and improving the security of the encrypted data.
[0090] In the embodiment of the present application, a face image is divided into a plurality of face regions, a category to which each face region belongs is determined, a proportion of the face regions belonging to the biometric category is determined by voting, and a category to which the face image belongs is determined according to the obtained proportion. This makes it possible to make the classification more accurate without significantly affecting the determination of the category to which the face image belongs even if the individual classification is incorrect. Similarly, by dividing an audio signal into a plurality of audio segments, a category to which each audio segment belongs is determined, a proportion of the audio segments belonging to the biometric category is determined by voting, and a category to which the audio signal belongs is determined according to the obtained proportion, it makes it possible to make the classification more accurate without significantly affecting the determination of the category to which the audio signal belongs even if the individual classification is incorrect.
[0091] Next, a process for determining a category of a face image based on a first classification model and a process for determining a category of an audio signal based on a second classification model will be described.
[0092] Before determining a category based on the first classification model and the second classification model, the first classification model and the second classification model need to be trained respectively first. Referring to the training process shown in FIG. 6 , the terminal includes a training module and a model evaluation module, in which the terminal obtains a sample face image and a sample category to which the sample face image belongs, extracts sample image features of the sample face image, determines a first classification model, inputs the sample image features into the determined first classification model by the training module, outputs a predicted category to which the sample face image belongs based on the first classification model, and sends it to the model evaluation module, and adjusts model parameters in the first classification model based on the difference between the sample category and the predicted category by the model evaluation module to obtain a trained first classification model. Similarly, the terminal obtains a sample audio signal and a sample category to which the sample audio signal belongs, extracts sample audio features of the sample audio signal, determines a second classification model, inputs the sample audio features into the determined second classification model by the training module, outputs a predicted category to which the sample audio signal belongs based on the second classification model, and sends it to a model evaluation module, and adjusts model parameters in the second classification model by the model evaluation module based on the difference between the sample category and the predicted category to obtain a trained second classification model.
[0093] Optionally, the terminal obtains sample image features and a sample category to which a sample face image corresponding to the sample image features belongs, the sample category including a biometric category or a non-biometric category, the biometric category indicating that the sample face image is an image of a biometric object, and the non-biometric category indicating that the sample face image is an image of a non-biometric object, and determines a predicted category to which the sample face image belongs according to the sample image features based on the first classification model, and trains the first classification model according to the sample category and the predicted category.
[0094] The terminal obtains a sample category to which the sample audio signal corresponding to the sample audio features belongs, where the sample category includes a biometric category or a non-biometric category, where the biometric category indicates that the sample audio signal is an audio signal of a biometric object, and the non-biometric category indicates that the sample audio signal is an audio signal of a non-biometric object, and determines a predicted category to which the sample audio signal belongs according to the sample audio features based on a second classification model, and trains the second classification model according to the sample category and the predicted category.
[0095] In one possible implementation, before training the models, the hyperparameters of the first classification model and the second classification model, such as the number of iterations (epoch), the number of segmented face regions or audio segments (batch), and the learning rate (learning rate), are preset. For example, the hyperparameters of the first classification model are batch(128), epoch(1000), and learning rate(0.0001), and the hyperparameters of the second classification model are batch(128), epoch(5000), and learning rate(0.0001).
[0096] In an embodiment of the present application, when the number of iterative training of the first classification model and the second classification model reaches the reference number, or when the training time length of the first classification model and the second classification model reaches the reference time length, the training of the first classification model and the second classification model is terminated, and the trained first classification model and the second classification model are stored as files in pb (file extension) format.
[0097] 7, the terminal further includes a model application module and an output module, and the terminal collects a face image and an audio signal of a target object, and determines a category to which the face image belongs and a category to which the audio signal belongs based on the trained first classification model and second classification model, respectively. That is, the terminal collects a face image and an audio signal, extracts image features of the face image and audio features of the audio signal, respectively, inputs the image features and the audio features into the model application module, classifies the image features based on the first classification model by the model application module, and outputs a category to which the face image corresponding to the image features belongs by the output module, classifies the audio features based on the second classification model by the model application module, and outputs a category to which the audio signal corresponding to the audio features belongs by the output module.
[0098] In one possible implementation form, referring to FIG. 8 for the structure of the first classification model, the first classification model includes a first input network 801, a plurality of first classification networks 802, and a first output network 803, where the first input network 801 divides the input image features into a plurality of second region features, each second classification network 802 classifies a second face region corresponding to one second region feature, and the first output network 803 outputs a category to which the face image belongs.
[0099] Referring to FIG. 9 , each classification network 802 includes an input layer 901, a dimensionality adjustment layer 902, a first classification layer 903, a first dimensionality reduction layer 904, a second classification layer 905, a second dimensionality reduction layer 906, a third classification layer 907, an average pooling layer 908, an activation layer (Dropout) 909, and a normalization layer (Softmax) 910. For example, the dimension of the feature input to the first classification model is 299*299*3, the dimension of the feature output through the dimension adjustment layer 902 is 35*35*256, the feature is initially classified through the first classification layer 902, and the dimension of the output feature remains 35*35*256, the dimension of the feature output by the first dimensionality reduction layer 903 is 17*17*896, and then processed through the second classification layer 905, the second dimensionality reduction layer 906, and the third classification layer 907, and the dimension of the output feature is 8*8*1792, and then processed through the average pooling layer 908, a number is output, and the number is processed through the activation layer 909 and the normalization layer 910, and the classification result is output. Optionally, for the first classification layer 903, the second classification layer 905, and the third classification layer 907, the classification network 802 includes a plurality of first classification layers 903, a plurality of second classification layers 905, and a plurality of third classification layers 907. Of course, in another embodiment, the network structure of the classification network 802 may be in other forms, and this application is not limited thereto.
[0100] Optionally, for any classification layer, the structure of the classification layer may be as shown in FIG. 10 , in which the input layer inputs the second region features, and the second region features are processed through three 3*3 convolutional layers with three convolutional cores, the processed second region features are respectively processed again through a 3*3 convolutional layer with a convolutional core and one max pooling layer, the features processed by the convolutional layers and the features processed by the max pooling layer are stitched through a first fully connected layer, and the stitched first features are processed again through a 1*1 convolutional layer with a convolutional core and a 3*3 convolutional layer with a convolutional core to obtain second features, which are stitched together. The first feature obtained by the above-mentioned method is again processed by one convolutional core with a 1*1 convolutional layer, one convolutional core with a 7*1 convolutional layer, one convolutional core with a 1*7 convolutional layer, and one convolutional core with a 3*3 convolutional layer to obtain a third feature, the second feature and the third feature are stitched in a second fully connected layer, the stitched fourth feature is processed by one convolutional core with a 3*3 convolutional layer to obtain a fifth feature, the second feature is processed by a max pooling layer to obtain a sixth feature, and the fifth feature and the sixth feature are stitched in a third fully connected layer to obtain a category to which the second face region corresponding to the second region feature belongs. Of course, in another embodiment, the network structure of any of the classification layers may be in other forms, and this application is not limited thereto.
[0101] In one possible implementation, referring to FIG. 11 for the structure of the second classification model, the second classification model includes a second input network 1101, a plurality of second classification networks 1102, and a second output network 1103, where the second input network 1101 divides the input audio features into a plurality of second segment features, each second segment network 1102 classifies a second audio segment corresponding to one second segment feature, and the second output network 1103 outputs a category to which the audio signal belongs.
[0102] Optionally, refer to FIG. 12 for a detailed classification process of the second classification model, inputting audio features and a plurality of second segment features, processing the audio features through one convolution layer and a depth processing layer, for each second segment feature, processing the processed audio features and the second segment features through a plurality of convolution layers and a depth processing layer again to obtain a processed second segment feature, selecting the maximum second segment feature from the plurality of processed second segment features in the feature selection layer, and further inputting the selected feature and the feature output from the previous convolution layer into the next convolution layer after the feature selection layer, and similarly obtaining a category to which the second audio segment corresponding to each second segment feature belongs through the feature selection layer and a plurality of convolution layers again, inputting the processing result of the audio features and the categories to which the plurality of second audio segments belong into the output layer, and outputting the category to which the audio signal belongs after processing by the output layer.
[0103] In a possible implementation, in order to further improve the classification accuracy of the first classification model and the second classification model, the first classification model and the second classification model need to include a residual network structure and a batch normalization structure. The residual network structure can prevent the occurrence of network degradation problem in the feature processing process and increase the processing speed of the model, and the batch normalization can accelerate the convergence speed of the model to avoid the vanishing of gradient.
[0104] In a possible implementation, the outputs of the above first and second classification models are 0 or 1, where an output of 0 indicates belonging to the non-living category and an output of 1 indicates belonging to the living category.
[0105] FIG. 13 is a structural schematic diagram of a data encryption device provided in an embodiment of the present application. Referring to FIG. 13, the device includes: An information collecting module 1301 for collecting target data to be encrypted of a target object and object information corresponding to the target object, the object information including at least one of a face image or an audio signal of the target object; a security factor obtaining module 1302 for encrypting an object feature corresponding to the object information according to a reference public key and determining the encrypted object feature as a security factor of the target data; a data encryption module 1303 for encrypting the target data based on the security factor to obtain encrypted data corresponding to the target data.
[0106] When collecting target data to be encrypted, the device provided in the embodiment of the present application collects at least one of a facial image or an audio signal of a target object, encrypts at least one of the features of the facial image or the features of the audio signal, and takes the encrypted feature as a security factor for encrypting the target data. In this encryption method, the security factor for encrypting the target data includes at least one of the features of the facial image or the features of the audio signal, and the features of the facial image or the audio signal become more complex and difficult to decipher, thus improving the security of the encrypted data.
[0107] Optionally, the object information includes a face image and an audio signal, and referring to FIG. 14 , the apparatus comprises: and an object feature acquisition module 1304 for acquiring image features of the face image and audio features of the audio signal, respectively; The object feature acquisition module 1304 further stitches the image features and the audio features together, and determines the stitched features as object features.
[0108] Optionally, the data encryption module 1303 encrypts the target data to obtain encrypted data based on an encryption format and a security factor corresponding to the target data, where the encryption format indicates a relative position relationship between the security factor and the target data in the encrypted data.
[0109] Optionally, the security factor acquisition module 1302 encrypts the object feature according to the reference public key, and determines the encrypted object feature as a security factor, if the object information belongs to a biometric category, and the biometric category indicates that the object information is information of a biometric object.
[0110] Optionally, the object information includes a face image, and referring to FIG. 14 , the device further comprises: The first category determination module 1305 further includes: a first category determination module 1305 for obtaining image features of a face image and dividing the image features into a plurality of first region features, where the face image includes a plurality of first face regions, and each first region feature corresponds to one first face region in the face image; The first category determination module 1305 further determines, based on each first region feature, a category to which the first face region corresponding to each first region feature belongs; The first category determination module 1305 further determines a first proportion of the first face regions in the plurality of first face regions that belong to a category that is a biometric category; The first category determination module 1305 further determines that the face image belongs to a biometric category in response to the first proportion being greater than the first reference proportion.
[0111] Optionally, the object information comprises an audio signal, and referring to FIG. 14 , the apparatus further comprises: The second category determination module 1306 further includes a second category determination module 1306 for obtaining audio features of the audio signal and dividing the audio features into a plurality of first segment features, where the audio signal includes a plurality of first audio segments, and each first segment feature corresponds to one first audio segment in the audio signal; The second category determination module 1306 further determines, based on each first segment feature, a category to which a first audio segment corresponding to each first segment feature belongs; The second category determination module 1306 further determines a second proportion of the first audio segments in the plurality of first audio segments that belong to the category of the biometric category; The second category determination module 1306 further determines that the audio segment belongs to a biometric category in response to the second proportion being greater than the second reference proportion.
[0112] Optionally, referring to FIG. 14, the second category determination module 1306 further determines, for each first segment feature, a category to which a first audio segment corresponding to the first segment feature belongs based on the first segment feature and the audio feature.
[0113] Optionally, the object information includes a face image, and the object features include image features of the face image, and with reference to FIG. 14 , the apparatus further comprises: and an image feature acquisition module 1307 for segmenting the face image into a plurality of second face regions; The image feature acquisition module 1307 further performs feature extraction on each of the second face regions to acquire second region features for each of the second face regions; The image feature acquisition module 1307 further stitches the acquired second region features to obtain an image feature.
[0114] Optionally, referring to FIG. 14 , for each second face region, the image feature acquisition module 1307 further performs edge detection on the second face region, obtains an image gradient corresponding to the second face region, and determines the image gradient as a second region feature of the second face region, where the image gradient indicates a rate of change between any two adjacent pixels in the second face region.
[0115] Optionally, the object information comprises an audio signal, and the object features comprise audio features of the audio signal, and with reference to FIG. 14 , the apparatus further comprises: an audio feature acquisition module 1308 for dividing the audio signal into a plurality of second audio segments; The audio feature acquisition module 1308 further performs feature extraction on each of the plurality of second audio segments to obtain second segment features for each second audio segment; The audio feature acquisition module 1308 further stitches the acquired second segment features to obtain an audio feature.
[0116] Optionally, referring to FIG. 14 , the audio feature acquisition module 1308 further comprises: For each second audio segment, Fourier transform the second audio segment to obtain a transformed second audio segment; The transformed second audio segment is transformed into a spectral feature corresponding to the second audio segment, and the spectral feature is determined as a second segment feature of the second audio segment.
[0117] Optionally, the security factor acquisition module 1302 further encrypts the object feature and the reference feature respectively according to the reference public key, and determines the encrypted object feature and the encrypted reference feature as the security factor of the target data, where the reference feature includes at least a timestamp or a counter.
[0118] Optionally, the object information includes a face image, and referring to FIG. 14 , the device further comprises: It further includes a first category determination module 1305 for classifying image features of the face image based on the first classification model and obtaining a category to which the face image belongs.
[0119] Optionally, with reference to FIG. 14 , the apparatus further comprises: The first training module 1309 further includes: a first training module 1309 for obtaining a sample category to which the sample image features and the sample face image corresponding to the sample image features belong, the sample category including a biometric category or a non-biometric category, the biometric category indicating that the sample face image is an image of a biometric object, and the non-biometric category indicating that the sample face image is an image of a non-biometric object; The first training module 1309 further determines a predicted category to which the sample face image belongs according to the sample image features based on the first classification model; The first training module 1309 further trains a first classification model according to the sample category and the predicted category.
[0120] Optionally, the object information comprises an audio signal, and referring to FIG. 14 , the apparatus further comprises: It further includes a second category determination module 1306 for classifying audio features of the audio signal based on the second classification model and obtaining a category to which the audio signal belongs.
[0121] Optionally, with reference to FIG. 14 , the apparatus further comprises: The second training module 1310 further includes: a second training module 1310 for obtaining a sample category to which the sample audio features and the sample audio signal corresponding to the sample audio features belong, the sample category including a biometric category or a non-biometric category, the biometric category indicating that the sample audio signal is an audio signal of a biometric object, and the non-biometric category indicating that the sample audio signal is an audio signal of a non-biometric object; The second training module 1310 further determines a predicted category to which the sample audio signal belongs according to the sample audio features based on the second classification model; The second training module 1310 further trains a second classification model according to the sample categories and the predicted categories.
[0122] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, and the description thereof will be omitted here.
[0123] In addition, the data encryption device provided in the above embodiment is described as an example only for dividing each of the above functional modules when encrypting data, and in actual application, the above functions can be assigned to different functional modules to be completed as necessary, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the above-described functions. In addition, the data encryption device and the data encryption method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
[0124] An embodiment of the present application further provides a computer device, the computer device including a processor and a memory, and at least one computer program stored in the memory, which, when loaded and executed by the processor, realizes the operations performed in the data encryption method of the above embodiment.
[0125] Optionally, the computer device is provided as a terminal. Figure 15 is a structural schematic diagram of a terminal 1500 provided in an embodiment of the present application. The terminal 1500 may be a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a face recognition device, etc. The terminal 1500 may also be called other names such as a user device, a mobile terminal, a laptop terminal, a desktop terminal, etc.
[0126] The terminal 1500 includes a processor 1501 and a memory 1502 .
[0127] The processor 1501 may include one or more processing cores, such as, for example, a 4-core processor, an 8-core processor, etc. The processor 1501 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), or a PLA (Programmable Logic Array). In some embodiments, the processor 1501 may include an AI (Artificial Intelligence) processor, which processes computational operations related to machine learning.
[0128] The memory 1502 may include one or more computer-readable storage media, which may be non-transitory. In some embodiments, the non-transitory computer-readable storage media in the memory 1502 is used to store at least one computer program that is executed by the processor 1501 to implement the data encryption method provided in the method embodiments of the present application.
[0129] In some embodiments, the terminal 1500 may further include a peripheral interface 1503 and at least one peripheral. The processor 1501, the memory 1502, and the peripheral interface 1503 may be connected via a bus or signal lines. Each peripheral may be connected to the peripheral interface 1503 via a bus, signal line, or circuit board. Specifically, the peripheral includes at least one of a camera component 1504 and an audio circuit 1505.
[0130] The peripheral interface 1503 is used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1501 and the memory 1502. In some embodiments, the processor 1501, the memory 1502, and the peripheral interface 1503 are integrated on the same chip or circuit board, and in some other embodiments, any one or two of the processor 1501, the memory 1502, and the peripheral interface 1503 may be realized on separate chips or circuit boards, which is not a limitation in this embodiment.
[0131] The camera component 1504 collects images or videos. Optionally, the camera component 1504 includes a front camera and a back camera. The front camera is installed on the front panel of the terminal, and the back camera is installed on the back of the terminal. In some embodiments, there are at least two back cameras, each of which is a main camera, a depth of field camera, a wide-angle camera, or a telephoto camera, thereby realizing a background blur function by fusing the main camera and the depth of field camera, a panoramic shooting by fusing the main camera and the wide-angle camera, and a VR (Virtual Reality) shooting function or other fusion shooting function.
[0132] The audio circuit 1505 includes a microphone and a speaker. The microphone collects sound waves of the user and the environment, converts the sound waves into electrical signals and inputs them to the processor 1501 for processing, or to the radio frequency circuit 1504 for voice communication. There may be multiple microphones, each installed in different parts of the terminal 1500, for stereo sound pickup or noise reduction. The speaker converts the electrical signals from the processor 1501 or the radio frequency circuit 1504 into sound waves. The speaker may be a conventional thin-film speaker or a piezoelectric ceramic speaker.
[0133] In some embodiments, terminal 1500 also includes one or more sensors 1506, including, but not limited to, an acceleration sensor 1511, a gyro sensor 1512, a pressure sensor 1513, an optical sensor 1514, and a proximity sensor 1515.
[0134] Those skilled in the art will appreciate that the structure shown in FIG. 15 does not constitute a limitation of terminal 1500, and that terminal 1500 may include more or fewer components than those shown, may combine some components, or may employ a different component arrangement.
[0135] Optionally, the computer device is provided as a server. Figure 16 is a structural schematic diagram of a server provided in the embodiment of the present application, the server 1600 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1601 and one or more memories 1602, at least one computer program is stored in the memory 1602, and the at least one computer program realizes the method provided in each of the above embodiment of the method when loaded and executed by the processor 1601. Of course, the server may further include components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output, and the server may include components for realizing other device functions, which will not be described in detail here.
[0136] An embodiment of the present application further provides a computer-readable storage medium, in which at least one computer program is stored, and which, when loaded and executed by a processor, realizes the operations performed in the data encryption method of the above embodiment.
[0137] An embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including a computer program code, the computer program code being stored in a computer readable storage medium. A processor of a computing device reads the computer program code from the computer readable storage medium, and the processor executes the computer program code to cause the computing device to realize the operations performed in the data encryption method of the above embodiment.
[0138] In addition, in the embodiments of the present application, with regard to related data such as facial images, audio signals, etc., when the above embodiments of the present application are applied to specific products or technologies, user permission or consent must be obtained, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0139] Those skilled in the art can understand that all or part of the steps for realizing the above embodiments may be completed by hardware, or may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium such as a read-only memory, a magnetic disk, or an optical disk.
[0140] The above are merely preferred embodiments of the present application and are not used to limit the embodiments of the present application. Any amendments, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. 1. A method of data encryption implemented by a computer device, comprising: collecting target data to be encrypted of a target object and object information corresponding to the target object, the object information including at least one of a facial image or an audio signal of the target object; encrypting an object feature corresponding to the object information according to a reference public key, and determining the encrypted object feature as a security factor of the target data; encrypting the target data based on the security factor to obtain encrypted data corresponding to the target data; The method includes:
2. the object information includes the face image and the audio signal; before the step of encrypting an object feature corresponding to the object information according to a reference public key and determining the encrypted object feature as a security factor of the target data; obtaining image features of the face image and audio features of the audio signal, respectively; stitching the image features and the audio features and determining the stitched features as the object features; The method of claim 1 further comprising:
3. The step of encrypting the target data based on the security factor and obtaining encrypted data corresponding to the target data includes: encrypting the target data based on an encryption format corresponding to the target data and the security factor to obtain the encrypted data, the encryption format indicating a relative positional relationship between the security factor and the target data in the encrypted data; 2. The method of claim 1, comprising:
4. said step of encrypting an object feature corresponding to said object information according to a reference public key and determining the encrypted object feature as a security factor of said target data; encrypting the object feature according to the reference public key and determining the encrypted object feature as the security factor if the object information belongs to a biometric category, the biometric category indicating that the object information is information of a biometric object; 2. The method of claim 1, comprising:
5. the object information includes the face image, If the object information belongs to a biometric category, before the step of encrypting the object feature according to the reference public key and determining the encrypted object feature as the security factor, acquiring image features of the face image and dividing the image features into a plurality of first region features, the face image including a plurality of first face regions, each first region feature corresponding to one first face region in the face image; determining, based on each of the first region features, a category to which a first face region corresponding to each of the first region features belongs; determining a first ratio of first face regions whose category is the biometric category among the plurality of first face regions; determining that the face image belongs to the biometric category in response to the first proportion being greater than a first reference proportion; The method of claim 4 further comprising:
6. the object information includes the audio signal; If the object information belongs to a biometric category, before the step of encrypting the object feature according to the reference public key and determining the encrypted object feature as the security factor, obtaining audio features of the audio signal and dividing the audio features into a plurality of first segment features, the audio signal including a plurality of first audio segments, each first segment feature corresponding to one first audio segment in the audio signal; determining, based on each of the first segment features, a category to which a first audio segment corresponding to each of the first segment features belongs; determining a second percentage of the first audio segments that belong to the biometric category; determining that the audio segment belongs to the biometric category in response to the second proportion being greater than a second reference proportion; The method of claim 4 further comprising:
7. The step of determining, based on each of the first segment features, a category to which a first audio segment corresponding to each of the first segment features belongs, comprises: determining, for each of the first segment features, a category to which a first audio segment corresponding to the first segment feature belongs based on the first segment feature and the audio features; 7. The method of claim 6, comprising:
8. the object information includes the face image, and the object features include image features of the face image; before the step of encrypting an object feature corresponding to the object information according to a reference public key and determining the encrypted object feature as a security factor of the target data; Segmenting the facial image into a plurality of second facial regions; performing feature extraction on each of the plurality of second face regions to obtain second region features of each of the second face regions; stitching the acquired second region features to obtain the image feature; The method of claim 1 further comprising:
9. The step of extracting features from each of the second face regions and obtaining second region features for each of the second face regions includes: for each of the second face regions, performing edge detection on the second face region to obtain an image gradient corresponding to the second face region, and determining the image gradient as a second region feature of the second face region, the image gradient indicating a rate of change between any two adjacent pixels in the second face region; 9. The method of claim 8, comprising:
10. the object information comprises the audio signal, and the object features comprise audio features of the audio signal; before the step of encrypting an object feature corresponding to the object information according to a reference public key and determining the encrypted object feature as a security factor of the target data; dividing the audio signal into a plurality of second audio segments; performing feature extraction on each of the plurality of second audio segments to obtain second segment features for each second audio segment; stitching the acquired second segment features to obtain the audio feature; The method of claim 1 further comprising:
11. the object information includes the face image, If the object information belongs to a biometric category, before the step of encrypting the object feature according to the reference public key and determining the encrypted object feature as the security factor, classifying image features of the face image based on a first classification model to obtain a category to which the face image belongs; The method of claim 4 further comprising:
12. the object information includes the audio signal; If the object information belongs to a biometric category, before the step of encrypting the object feature according to the reference public key and determining the encrypted object feature as the security factor, classifying audio features of the audio signal based on a second classification model to obtain a category to which the audio signal belongs; The method of claim 4 further comprising:
13. 1. A data encryption device, comprising: A processor configured to carry out the data encryption method according to any one of claims 1 to 12.
4. A data encryption device comprising:
14. A computer device including a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to realize the operations performed in the data encryption method according to any one of claims 1 to 12.
15. A computer program comprising computer program code, said computer program code causing a processor of a computing device to carry out the data encryption method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Device and method for managing personal information
JP1999215119A
Encryption key generator, encryption / Decoding device and encryption key generating method, encryption / decoding method, and program service medium
JP2001168854A
Data recorder and data recording method, data reproducing device and data reproducing method, data delivery server, data reception terminal and data recording medium
JP2003196921A
