Voice authentication method and device, storage medium, and electronic device
Through the voice authentication method, by comparing the similarity between the left and right channels of the voice data, the problem of stability and high management costs of password management in multi-person shared tax control equipment is solved, and simple and secure identity authentication is achieved.
Patent Information
- Application Number
- CN202111284601.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-11-01
AI Technical Summary
In the field of information security, in the prior art, the password management of multi-person shared tax control equipment lacks an independent authentication mechanism, resulting in reduced stability and higher management costs of multiple digital certificates.
The voice authentication method is adopted to compare the authenticated voice data with the left and right channel data of the preset sample voice data, calculate the similarity and determine whether it is greater than or equal to the preset threshold to achieve identity authentication.
It realizes the simplicity and security of identity authentication through voice, reducing management costs.
Smart Images

Figure CN113903343B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of information security technology, and in particular to a voice authentication method and device, storage medium, and electronic device. Background Art
[0002] In the field of information security, digital certificates or password verification are often used for security authentication. For example, embedded tax control devices used in the tax field achieve security management between taxation, enterprises, and devices through the management of digital certificates or passwords. However, because enterprises generally share tax control devices with multiple people and multiple businesses, passwords are generally shared by multiple people. There is no independent authentication mechanism for key businesses. In addition, the password is entered and authenticated in the device. The application needs to pop up the password interaction interface for key businesses. This method affects many links and has reduced stability. Using multiple digital certificates will increase management costs for the tax industry with a large application scale. Summary of the invention
[0003] In view of this, an embodiment of the present application provides a data processing method and device to at least partially solve the above-mentioned problem.
[0004] According to a first aspect of an embodiment of the present application, a voice authentication method is provided, comprising: collecting authentication voice data; reading preset sample voice data; splitting the authentication voice data to obtain left channel data and right channel data of the authentication voice data, and splitting the sample voice data to obtain left channel data and right channel data of the sample voice data; comparing the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain left channel similarity, and comparing the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain right channel similarity; judging whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; if the left channel similarity and the right channel similarity are both greater than or equal to the preset threshold, the authentication is passed.
[0005] Optionally, the left channel data of the authentication voice data and the left channel data of the sample voice data are compared to obtain the left channel similarity, and the right channel data of the authentication voice data and the right channel data of the sample voice data are compared to obtain the right channel similarity, including: intercepting the left / right channel data of the authentication voice data and the left / right channel data of the sample voice data to obtain two groups of initial left / right channel data sequences; performing convolution calculation on the two groups of initial left / right channel data sequences to obtain a group of convolution values; respectively obtaining the positions corresponding to the convolution values with the largest absolute values in a group of convolution values in the two groups of initial left / right channel data sequences; intercepting the channel data after the position in the two groups of initial left / right channel data sequences to obtain two groups of left / right channel sequences to be processed; and calculating the left / right channel similarity according to the two groups of left / right channel sequences to be processed.
[0006] Optionally, the left / right channel comparison similarity is calculated based on two groups of left / right channel sequences to be processed, including: performing Pearson linear correlation calculation on the two groups of left / right channel sequences to be processed to obtain the correlation of the two groups of left / right channel sequences to be processed; judging whether the absolute value of the correlation is greater than or equal to a preset threshold; if the absolute value of the correlation is greater than or equal to the preset threshold, performing a secondary calculation on the two groups of left / right channel sequences to be processed to obtain the left / right channel comparison similarity.
[0007] Optionally, if the absolute value of the correlation is greater than or equal to a preset threshold, a secondary calculation is performed on the two groups of left / right channel sequences to be processed to obtain the left / right channel comparison similarity, including: if the absolute value of the correlation is greater than or equal to the preset threshold, Mel-cephalogram calculations are performed on the two groups of left / right channel sequences to be processed respectively, and eigenvalues are extracted respectively; and cosine similarity calculation is performed on the eigenvalues to obtain the left / right channel comparison similarity.
[0008] Optionally, the method further includes: collecting and storing sample voice data.
[0009] According to a second aspect of an embodiment of the present application, a voice authentication device is provided, which includes: a collection module for collecting authentication voice data; a data processing module for comparing the authentication voice data with sample voice data to obtain similarity; a judgment module for judging whether the similarity is greater than or equal to a preset threshold; and a result output module for passing the authentication if the similarity is greater than or equal to the preset threshold.
[0010] Optionally, the data processing module is also used to read the sample voice data, split the left channel data and right channel data of the authentication voice data and the sample voice data, compare the left channel data of the authentication voice data and the sample voice data to obtain the left channel comparison similarity, and compare the right channel data of the authentication voice data and the sample voice data to obtain the right channel comparison similarity.
[0011] Optionally, the collection module is also used to collect sample voice data.
[0012] According to a third aspect of an embodiment of the present application, a storage medium is provided, which stores a computer program. When a processor executes the computer program stored on the storage medium, any one of the voice authentication methods of claims 1 to 5 of the present application can be implemented.
[0013] According to the fourth aspect of the embodiment of the present application, an embedded tax control device is provided, which includes a memory and a processor. An executable program is stored in the memory. When the processor runs the executable program, it can implement any one of the voice authentication methods of claims 1-5 of the present application.
[0014] The voice authentication method and its device, storage medium, and electronic device of the embodiment of the present application collect authentication voice data; read preset sample voice data; split the authentication voice data to obtain the left channel data and right channel data of the authentication voice data, split the sample voice data to obtain the left channel data and right channel data of the sample voice data; compare the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain the left channel similarity, and compare the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain the right channel similarity; determine whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; if the left channel similarity and the right channel similarity are both greater than or equal to the preset threshold, the authentication is passed. This realizes identity authentication through voice, and the authentication method is simple, safe, and has low management costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0016] Figure 1 A flowchart of an embodiment of a voice authentication method of the present application;
[0017] Figure 2 A flowchart of an application scenario of a voice authentication method for this application;
[0018] Figure 3 This is a structural diagram of a voice authentication device for this application. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0020] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0021] Embodiment 1
[0022] See also Figure 1 , the voice authentication method comprises:
[0023] S101, collecting authentication voice data.
[0024] Specifically, the authentication voice data refers to the voice data of the user who needs to be authenticated. Voice data can be collected by voice recording. Voice recording realizes audio capture based on the ALSA (Advanced Linux Sound Architecture) architecture. By creating an audio handle to obtain the resources for capturing audio, and then setting the hardware parameters and software parameters of the audio, the audio handle can be read to realize the audio pickup encoding function from the microphone. Because the audio input is continuous, it runs in the background in the form of another thread. The execution function loop of the thread is controlled by the start and stop commands sent by the front end, thereby determining the effective time of audio recording. After completing the audio recording, the audio data is saved to a file.
[0025] Exemplarily, the specific process of recording voice may be as follows:
[0026] Step 1001, set the PCM device node, open the audio, and capture the handle;
[0027] Step 1002, apply for a hardware parameter structure to configure the underlying ALSA hardware parameters;
[0028] Step 1003, configure data interleaving storage mode, sampling rate, bit width, stereo, number of cycles, etc.;
[0029] Step 1004, set the hardware parameter structure to the specified handle;
[0030] Step 1005, applying for a software parameter structure;
[0031] Step 1006: configure the start / stop threshold to the software parameter structure;
[0032] Step 1007, setting the software parameter structure to the specified handle;
[0033] Step 1008, start the enable switch for recording to start;
[0034] Step 1009, create an audio reading thread, and execute a loop function that reads data every 10 milliseconds;
[0035] Step 1010, stop the recording enable switch;
[0036] Step 1011, record the audio data to a specified file.
[0037] Optionally, the method further includes: collecting and storing sample voice data.
[0038] It should be noted that the sample data refers to the voice data used as a sample for subsequent voice authentication for comparison and to serve as an authentication standard. The method of collecting the sample voice data is the same as the method of collecting the authentication voice data described above, and will not be described in detail.
[0039] By collecting and storing sample voice data, it is possible to collect, replace and store sample voice data according to customer needs, making it more convenient to manage users with authentication qualifications and replace users with authentication qualifications.
[0040] S102: Read preset sample voice data.
[0041] Specifically, the preset sample voice data refers to the voice data recorded in advance by the above-mentioned voice recording method and stored in the specified voice file. When performing this step, the sample voice data is read from the specified voice file into the memory for comparison with the above-mentioned collected authentication voice data.
[0042] S103, split the authentication voice data to obtain left channel data and right channel data of the authentication voice data, and split the sample voice data to obtain left channel data and right channel data of the sample voice data.
[0043] Specifically, by collecting the on-site authentication voice as mentioned above, and storing the authentication voice data in the memory, the sample voice data is read from the specified voice file into the memory, and the sample voice data and the authentication voice data in the memory are split to obtain the left channel data and the right channel data of the authentication voice data, and the left channel data and the right channel data of the sample voice data, respectively, and 48000 integer multiples of bytes of the left channel data and the right channel data of the above authentication voice data are intercepted respectively, and 48000 integer multiples of bytes of the left channel data and the right channel data of the above sample voice data are intercepted respectively.
[0044] S104, comparing the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain the left channel similarity, and comparing the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain the right channel similarity;
[0045] Specifically, the left channel similarity can be calculated by performing convolutional neural network calculation on the left channel data of the authentication voice data and the left channel data of the sample voice data, and then using the Pearson linear correlation and Mel cepstrum feature extraction method; the calculation method for the right channel similarity is the same as above.
[0046] It should be noted that convolutional neural network is a feedforward neural network. Artificial neurons can respond to surrounding units. Convolutional neural network includes convolution layer and pooling layer. Convolutional neural network includes one-dimensional convolutional neural network, two-dimensional convolutional neural network and three-dimensional convolutional neural network. One-dimensional convolutional neural network is often used for sequence data processing; two-dimensional convolutional neural network is often used for image text recognition; three-dimensional convolutional neural network is mainly used for medical image and video data recognition.
[0047] It should be noted that the Pearson correlation coefficient (Pearson correlation coefficient), also known as the Pearson product-moment correlation coefficient (Pearson product-moment correlation coefficient), is a linear correlation coefficient calculated by the Pearson linear correlation. The Pearson correlation coefficient is a statistic used to reflect the degree of linear correlation between two variables.
[0048] The specific calculation formula of Pearson correlation coefficient is as follows:
[0049]
[0050] Among them, the Pearson correlation coefficient is represented by r, where n is the sample size, X i , Y i are the observed values of the two variables, are the means of the two variables respectively. r describes the strength of the linear correlation between the two variables. The value of r is between -1 and +1. If r>0, it indicates that the two variables are positively correlated, that is, the larger the value of one variable, the larger the value of the other variable; if r<0, it indicates that the two variables are negatively correlated, that is, the larger the value of one variable, the smaller the value of the other variable. The larger the absolute value of r, the stronger the correlation. If r=0, it indicates that the two variables are not linearly correlated, but may be related in other ways, such as curves.
[0051] It should be noted that the Mel frequency cepstral coefficient (MFCC) can be calculated by the Mel frequency cepstral coefficient (MFCC) feature extraction method. The Mel frequency cepstral coefficient (MFCC) is a feature widely used in automatic speech and speaker recognition. MFCC feature extraction includes two key steps: Mel frequency analysis and cepstral analysis. Mel frequency analysis is based on human auditory perception experiments. Experimental observations have found that the human ear is like a filter bank, which only focuses on certain specific frequency components (human hearing is selective to frequency). It only allows signals of certain frequencies to pass. However, these filters are not uniformly distributed on the frequency coordinate axis. There are many filters in the low-frequency area, and the distribution is relatively dense, but in the high-frequency area, the number of filters becomes relatively small and the distribution is very sparse. Cepstrum is a spectrum obtained by performing Fourier transform of a signal after logarithmic operation and then Fourier inverse transform. Cepstrum analysis can be used to decompose signals and convert the convolution of two signals into the addition of two signals. The Mel Frequency Cepstrum Coefficient (MFCC) takes into account the auditory characteristics of humans. It first maps the linear spectrum to the Mel nonlinear spectrum based on auditory perception, and then converts it to the cepstrum.
[0052] Optionally, the left channel data of the authentication voice data and the left channel data of the sample voice data are compared to obtain the left channel similarity, and the right channel data of the authentication voice data and the right channel data of the sample voice data are compared to obtain the right channel similarity, including: intercepting the left / right channel data of the authentication voice data and the left / right channel data of the sample voice data to obtain two groups of initial left / right channel data sequences; performing convolution calculation on the two groups of initial left / right channel data sequences to obtain a group of convolution values; respectively obtaining the positions corresponding to the convolution values with the largest absolute values in a group of convolution values in the two groups of initial left / right channel data sequences; intercepting the channel data after the position in the two groups of initial left / right channel data sequences to obtain two groups of left / right channel sequences to be processed; and calculating the left / right channel similarity according to the two groups of left / right channel sequences to be processed.
[0053] Exemplarily, to calculate the left channel similarity, the left channel data of the intercepted authentication voice data and the left channel data of the sample voice data can be used to obtain a set of initial left channel data sequences, which are respectively recorded as: initial sample voice left channel sequence A0_L, initial authentication voice left channel sequence A1_L; the above-mentioned intercepted set of initial left channel data sequences A0_L and A1_L are calculated using a one-dimensional convolutional neural network to obtain a set of convolution values recorded as F0; find the convolution value with the largest absolute value in the set of convolution values in the initial sample voice left channel sequence A0_L, The corresponding positions A0_L-P0 and A1_L-P0 in the initial authentication voice left channel sequence A1_L; respectively intercept the position A0_L-P0 point in the initial sample voice left channel sequence A0_L and the initial authentication voice left channel sequence A1_L, and all voice data after the A1_L-P0 point are saved as the sample voice left channel sequence B0_L to be processed and the authentication voice left channel sequence B1_L to be processed, and the left channel similarity is calculated according to the sample voice left channel sequence B0_L to be processed and the authentication voice left channel sequence B1_L to be processed.
[0054] Similarly, to calculate the right channel similarity, the right channel data of the intercepted authentication voice data and the right channel data of the sample voice data can be used to obtain a set of initial right channel data sequences, which can be recorded as: initial sample voice right channel sequence A0_R, initial authentication voice right channel sequence A1_R; the above intercepted set of initial right channel data sequences A0_L and A1_L are calculated using a one-dimensional convolutional neural network to obtain a set of convolution values recorded as F1; find the convolution value with the largest absolute value in the set of convolution values in the initial sample voice right channel sequence A0_R, The corresponding positions A0_R-P1 and A1_R-P1 in the initial authentication voice right channel sequence A1_R; the position A0_R-P1 point is intercepted in the initial sample voice right channel sequence A0_R and the initial authentication voice right channel sequence A1_R respectively, and all voice data after the A1_R-P1 point is saved as the sample voice right channel sequence B0_R to be processed and the authentication voice right channel sequence B1_R to be processed, and the right channel similarity is calculated according to the sample voice right channel sequence B0_R to be processed and the authentication voice right channel sequence B1_R to be processed.
[0055] The present application does not restrict the order of obtaining the two sets of left / right channel sequences to be processed by the above calculations. By performing convolution calculations on the two sets of initial left / right channel data sequences, corresponding features can be effectively obtained from a large number of samples, avoiding a complex feature extraction process.
[0056] Optionally, the left / right channel comparison similarity is calculated based on two groups of left / right channel sequences to be processed, including: performing Pearson linear correlation calculation on the two groups of left / right channel sequences to be processed to obtain the correlation of the two groups of left / right channel sequences to be processed; judging whether the absolute value of the correlation is greater than or equal to a preset threshold; if the absolute value of the correlation is greater than or equal to the preset threshold, performing a secondary calculation on the two groups of left / right channel sequences to be processed to obtain the left / right channel comparison similarity.
[0057] Exemplarily, the left channel similarity is calculated based on the left channel sequence B0_L of the sample speech to be processed and the left channel sequence B1_L of the authentication speech to be processed. The Pearson linear correlation calculation can be performed on the left channel sequence B0_L of the sample speech to be processed and the left channel sequence B1_L of the authentication speech to be processed to obtain the correlation R0 of the left channel sequence B0_L of the sample speech to be processed and the left channel sequence B1_L of the authentication speech to be processed; it is determined whether the absolute value of the correlation R0 is greater than or equal to a preset threshold; the preset threshold can be 0.6, if the absolute value of the correlation R0 is less than the preset threshold, the authentication fails, if the absolute value of the correlation R0 is greater than or equal to the preset threshold, the left channel sequence B0_L of the sample speech to be processed and the left channel sequence B1_L of the authentication speech to be processed are calculated twice to obtain the left channel comparison similarity.
[0058] Similarly, the right channel similarity is calculated based on the right channel sequence B0_R of the sample speech to be processed and the right channel sequence B1_R of the authentication speech to be processed. The Pearson linear correlation calculation can be performed on the right channel sequence B0_R of the sample speech to be processed and the right channel sequence B1_R of the authentication speech to be processed to obtain the correlation R1 between the right channel sequence B0_R of the sample speech to be processed and the right channel sequence B1_R of the authentication speech to be processed; it is determined whether the absolute value of the correlation R1 is greater than or equal to a preset threshold; the preset threshold can be 0.6, if the absolute value of the correlation R1 is less than the preset threshold, the authentication fails, if the absolute value of the correlation R1 is greater than or equal to the preset threshold, the right channel sequence B0_R of the sample speech to be processed and the right channel sequence B1_R of the authentication speech to be processed are calculated twice to obtain the right channel comparison similarity.
[0059] The present application does not restrict the order of calculating the correlation of the left / right channel sequences to be processed. By performing Pearson linear correlation calculation on the two groups of left / right channel sequences to be processed in advance, and comparing the correlation of the two groups of left / right channel sequences to be processed with a preset threshold, it is determined whether the authentication can be passed, so that the efficiency of identity authentication is higher.
[0060] Optionally, if the absolute value of the correlation is greater than or equal to a preset threshold, performing secondary calculation on the two groups of left / right channel sequences to be processed to obtain the left / right channel comparison similarity, including: if the absolute value of the correlation is greater than or equal to the preset threshold, performing Mel-cepstral calculation on the two groups of left / right channel sequences to be processed respectively, and extracting eigenvalues respectively; performing cosine similarity calculation on the eigenvalues to obtain the left / right channel comparison similarity;
[0061] Exemplarily, if the absolute value of the correlation is greater than or equal to a preset threshold, a secondary calculation is performed on the left channel sequence B0_L of the sample speech to be processed and the left channel sequence B1_L of the authentication speech to be processed to obtain the left channel comparison similarity. Mel-cepstrum calculation can be performed on the left channel sequence B0_L of the sample speech to be processed and the left channel sequence B1_L of the authentication speech to be processed to extract the eigenvalues S0_L and S1_L; cosine similarity calculation is performed on the eigenvalues S0_L and S1_L to obtain the left channel comparison similarity DO.
[0062] Similarly, if the absolute value of the correlation is greater than or equal to the preset threshold, the right channel sequence B0_R of the sample speech to be processed and the right channel sequence B1_R of the authentication speech to be processed are calculated twice to obtain the right channel comparison similarity. The right channel sequence B0_R of the sample speech to be processed and the right channel sequence B1_R of the authentication speech to be processed can be calculated by Mel cepstrum to extract the eigenvalues S0_R and S1_R; the cosine similarity calculation is performed on the eigenvalues S0_R and S1_R to obtain the right channel comparison similarity D1. The present application does not limit the order of the above calculations to obtain the left / right channel comparison similarity.
[0063] It should be noted that cosine similarity evaluates the similarity of two vectors by calculating the cosine value of the angle between them. The smaller the angle, the closer the cosine value is to 1, and the more consistent their directions are, the more similar they are. Assuming that the coordinates of vectors a and b are (x1, y1) and (x2, y2) respectively, the formula for calculating cosine similarity is:
[0064]
[0065] The eigenvalues are extracted by further performing Mel-cepstral calculation on the two groups of left / right channel sequences to be processed; the cosine similarity is calculated on the eigenvalues to obtain the left / right channel comparison similarity, and the left / right channel comparison similarity is compared with the preset one to determine whether the authentication is passed, so that the identity authentication is more accurate and secure.
[0066] S105, determining whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold;
[0067] Specifically, it is determined whether the absolute values of the left channel similarity D0 and the right channel similarity D1 are both greater than or equal to a preset threshold, and the preset threshold may be 0.6.
[0068] S106: If the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold, the authentication is successful.
[0069] Specifically, if the absolute values of the left channel similarity D0 and the right channel similarity D1 are both greater than or equal to the preset threshold, the authentication is successful; if one of the absolute values of the left channel similarity D0 and the right channel similarity D1 is less than the preset threshold, the authentication fails.
[0070] The voice authentication method of the embodiment of the present application collects authentication voice data; reads preset sample voice data; splits the authentication voice data to obtain the left channel data and the right channel data of the authentication voice data, splits the sample voice data to obtain the left channel data and the right channel data of the sample voice data; compares the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain the left channel similarity, and compares the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain the right channel similarity; determines whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; if the left channel similarity and the right channel similarity are both greater than or equal to the preset threshold, the authentication is passed. This realizes identity authentication through voice, and the authentication method is simple, safe, and has low management costs.
[0071] Embodiment 2
[0072] See also Figure 2 For example, the voice authentication method described in the above embodiment has the following specific process in an application scenario:
[0073] S201, collecting and storing sample voice data;
[0074] S202, collecting authentication voice data;
[0075] S203, reading preset sample voice data;
[0076] S204, split the authentication voice data to obtain left channel data and right channel data of the authentication voice data, and split the sample voice data to obtain left channel data and right channel data of the sample voice data;
[0077] S205, intercepting the left / right channel data of the authentication voice data and the left / right channel data of the sample voice data to obtain two sets of initial left / right channel data sequences;
[0078] S206, performing convolution calculation on the two groups of initial left / right channel data sequences to obtain a group of convolution values;
[0079] S207, respectively obtaining positions corresponding to the convolution values with the largest absolute values in a group of convolution values in the two groups of initial left / right channel data sequences;
[0080] S208, intercepting the channel data in the latter position in the two groups of initial left / right channel data sequences to obtain two groups of left / right channel sequences to be processed;
[0081] S209, performing Pearson linear correlation calculation on the two groups of left / right channel sequences to be processed to obtain the correlation between the two groups of left / right channel sequences to be processed;
[0082] S210, determining whether the absolute value of the correlation is greater than or equal to a preset threshold;
[0083] S211, if the absolute value of the correlation is greater than or equal to a preset threshold, performing Mel-cepstrum calculations on the two groups of left / right channel sequences to be processed, and extracting eigenvalues respectively;
[0084] S212, performing cosine similarity calculation on the eigenvalues to obtain left / right channel comparison similarity;
[0085] S213, determining whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold;
[0086] S214: If the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold, the authentication is successful.
[0087] The voice authentication method of the embodiment of the present application realizes identity authentication through voice through the above steps, and the authentication method is simple, safe and has low management cost.
[0088] Embodiment 3
[0089] In combination with the voice authentication method described in the above embodiment, embodiment 3 of the present application provides a voice authentication device for executing any of the voice authentication methods described in embodiment 1 above.
[0090] See also Figure 3 , the voice authentication device 30 comprises:
[0091] The collection module 301 is used to collect authentication voice data;
[0092] The data processing module 302 is used to compare the authentication voice data with the sample voice data to obtain similarity;
[0093] A determination module 303 is used to determine whether the similarity is greater than or equal to a preset threshold;
[0094] The result output module 304 is used to pass the authentication if the similarity is greater than or equal to a preset threshold.
[0095] Optionally, the data processing module 302 is also used to read the sample voice data, split the left channel data and the right channel data of the authentication voice data and the sample voice data, compare the left channel data of the authentication voice data and the sample voice data to obtain the left channel comparison similarity, and compare the right channel data of the authentication voice data and the sample voice data to obtain the right channel comparison similarity.
[0096] Optionally, the collection module 301 is also used to collect sample voice data.
[0097] The voice authentication device of the embodiment of the present application collects authentication voice data; reads preset sample voice data; splits the authentication voice data to obtain the left channel data and the right channel data of the authentication voice data, splits the sample voice data to obtain the left channel data and the right channel data of the sample voice data; compares the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain the left channel similarity, compares the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain the right channel similarity; determines whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; if the left channel similarity and the right channel similarity are both greater than or equal to the preset threshold, the authentication is passed. This realizes identity authentication through voice, and the authentication method is simple, safe, and has low management costs.
[0098] Embodiment 4:
[0099] In combination with the voice authentication method described in the above embodiments, a storage medium is provided in Embodiment 4 of the present application.
[0100] The storage medium stores a computer program, and when the processor executes the computer program stored on the storage medium, any of the above-mentioned voice authentication methods can be implemented.
[0101] The storage medium of the embodiment of the present application collects authentication voice data; reads preset sample voice data; splits the authentication voice data to obtain the left channel data and the right channel data of the authentication voice data, splits the sample voice data to obtain the left channel data and the right channel data of the sample voice data; compares the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain the left channel similarity, compares the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain the right channel similarity; determines whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; if the left channel similarity and the right channel similarity are both greater than or equal to the preset threshold, the authentication is passed. This realizes identity authentication through voice, and the authentication method is simple, safe, and has low management costs.
[0102] Embodiment 5
[0103] In combination with the voice authentication method described in the above embodiments, Embodiment 5 of the present application provides an embedded tax control device.
[0104] The device includes a memory and a processor. An executable program is stored in the memory. When the processor runs the executable program, any of the above-mentioned voice authentication methods can be implemented.
[0105] The electronic device of the embodiment of the present application collects authentication voice data; reads preset sample voice data; splits the authentication voice data to obtain the left channel data and the right channel data of the authentication voice data, splits the sample voice data to obtain the left channel data and the right channel data of the sample voice data; compares the left channel data of the authentication voice data with the left channel data of the sample voice data to obtain the left channel similarity, compares the right channel data of the authentication voice data with the right channel data of the sample voice data to obtain the right channel similarity; determines whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; if the left channel similarity and the right channel similarity are both greater than or equal to the preset threshold, the authentication is passed. This realizes identity authentication through voice, and the authentication method is simple, safe, and has low management costs.
[0106] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0107] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0108] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A voice authentication method, characterized in that: include: Collect authentication voice data; Read the preset sample voice data; Splitting the authentication voice data to obtain left channel data and right channel data of the authentication voice data, and splitting the sample voice data to obtain left channel data and right channel data of the sample voice data; intercepting the left / right channel data of the authentication voice data and the left / right channel data of the sample voice data to obtain two sets of initial left / right channel data sequences; Performing convolution calculation on the two groups of initial left / right channel data sequences to obtain a group of convolution values; Respectively obtaining the positions of the convolution values with the largest absolute values in the group of convolution values in the two groups of initial left / right channel data sequences; intercepting the channel data after the position in the two groups of initial left / right channel data sequences to obtain two groups of left / right channel sequences to be processed; Calculating the left / right channel similarity according to the two groups of left / right channel sequences of the to-be-processed sounds; Determine whether the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold; If the left channel similarity and the right channel similarity are both greater than or equal to a preset threshold, the authentication is successful.
2. The voice authentication method according to claim 1, characterized in that: The calculating the left / right channel comparison similarity according to the two groups of left / right channel sequences to be processed includes: Performing Pearson linear correlation calculation on the two groups of left / right channel sequences to be processed to obtain correlation between the two groups of left / right channel sequences to be processed; Determining whether the absolute value of the correlation is greater than or equal to a preset threshold; If the absolute value of the correlation is greater than or equal to a preset threshold, a secondary calculation is performed on the two groups of left / right channel sequences to be processed to obtain the left / right channel comparison similarity.
3. The voice authentication method according to claim 2, characterized in that: If the absolute value of the correlation is greater than or equal to a preset threshold, performing a secondary calculation on the two groups of left / right channel sequences to be processed to obtain the left / right channel comparison similarity, including: If the absolute value of the correlation is greater than or equal to a preset threshold, performing Mel-cepstrum calculation on the two groups of left / right channel sequences to be processed respectively, and extracting eigenvalues respectively; The cosine similarity is calculated for the eigenvalues to obtain the left / right channel comparison similarity.
4. The voice authentication method according to claim 1, characterized in that: The method further comprises: Collect sample voice data and store it.
5. A voice authentication device, characterized in that: include: A collection module, used to collect authentication voice data; A data processing module, used for reading sample voice data, splitting the authentication voice data and the left channel data and the right channel data of the sample voice data, intercepting the left / right channel data of the authentication voice data and the left / right channel data of the sample voice data, and obtaining two sets of initial left / right channel data sequences; [HZTC-HXJSBB211004][HS2110540CCN] performs convolution calculation on the two groups of initial left / right channel data sequences to obtain a group of convolution values; Respectively obtaining the positions of the convolution values with the largest absolute values in the group of convolution values in the two groups of initial left / right channel data sequences; intercepting the channel data after the position in the two groups of initial left / right channel data sequences to obtain two groups of left / right channel sequences to be processed; Calculating the left / right channel similarity according to the two groups of left / right channel sequences of the to-be-processed sounds; A judging module, used to judge whether the similarity is greater than or equal to a preset threshold; The result output module is used to verify that the authentication is successful if the similarity is greater than or equal to a preset threshold.
6. The voice authentication device according to claim 5, characterized in that: The acquisition module is also used to acquire sample voice data.
7. A storage medium, characterized in that: The storage medium stores a computer program, and when the processor executes the computer program stored on the storage medium, any one of the voice authentication methods described in claims 1 to 4 of the present application can be implemented.
8. An embedded tax control device, characterized in that: The device includes a memory and a processor, wherein an executable program is stored in the memory, and when the processor runs the executable program, any one of the voice authentication methods described in claims 1 to 4 of the present application can be implemented.
Citation Information
Patent Citations
Earphone quality inspection method and apparatus, and computer readable storage medium
CN109379690A
Voiceprint comparison method, device and equipment for automobile whistling and storage medium
CN115116232A