Encryption method, apparatus and device, and readable storage medium
Through voiceprint feature verification and feature data analysis, combined with the sensitivity of voice data for double encryption, the problem of voice data leakage in voice control devices is solved, and the accuracy of user identity verification and data security are improved.
Patent Information
- Application Number
- CN202411371036.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art lacks encryption processing of user voice data when voice control devices, resulting in the risk of voice data leakage and affects user experience.
By verifying the user's voiceprint features, extract voice data and feature data in user registration information, calculate the feature vector and enter the classification model to determine the degree of information sensitivity. Perform the second encryption when it contains sensitive data.
It improves the accuracy and encryption efficiency of verifying the identity of the user, and reduces the risk of voice data leakage. Especially when the voice data contains sensitive data, it has further enhanced security through dual encryption.
Smart Images

Figure CN119342461A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of voice and command information processing, and in particular, relates to an encryption method, device, equipment and readable storage medium. Background Art
[0002] With the advent of the artificial intelligence era and the rapid development of the Internet of Things technology, voice control has been widely used. Many devices today have voice control functions, such as home appliances with voice control functions, voice calls, voice messages, voice reminders and other voice control functions. Users can use these voice control functions to make voice messages, voice reminders, voice calls and other interactive behaviors.
[0003] However, the prior art lacks encryption of user voice data in the process of using voice data to control the device. If the voice data is leaked during the control process, it may have a negative impact on the user, thereby reducing the user experience of the user using the device voice control function. Summary of the invention
[0004] The embodiments of the present invention provide an encryption method, an apparatus, an electronic device and a readable storage medium, which can reduce the risk of voice data leakage during the operation of an electronic device controlled by voice data.
[0005] In order to solve the above problem, an embodiment of the present invention discloses an encryption method, which includes:
[0006] When receiving voice data input by the user, verifying the user's identity according to the voiceprint feature corresponding to the voice data;
[0007] If the user identity authentication is successful, extracting feature data corresponding to the user based on the voice data and the user registration information; the feature data includes feature information of at least two dimensions;
[0008] Determine a feature vector according to the feature values of the feature information in each dimension;
[0009] Inputting the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user;
[0010] When the information sensitivity is within a preset range, encrypting the voice data for the first time according to the feature vector and the voiceprint feature;
[0011] In the case where the voice data contains sensitive data, a second encryption is performed based on the first encryption result.
[0012] Optionally, when the information sensitivity is within a preset range, encrypting the voice data for the first time according to the feature vector and the voiceprint feature includes:
[0013] When the information sensitivity is within a preset range, encoding the feature vector and the voiceprint feature according to a preset encoding rule;
[0014] A key is set according to the character string obtained by encoding, and the key is used to encrypt the voice data for the first time.
[0015] Optionally, when the information sensitivity is within a preset range, encoding the feature vector and the voiceprint feature according to a preset encoding rule includes:
[0016] When the information sensitivity is within a preset range, the feature vector is converted into a binary string having a first preset length, and the voiceprint feature is converted into a binary string having a second preset length.
[0017] Optionally, determining a feature vector according to feature values of the feature information in each dimension includes:
[0018] Calculate the product of the eigenvalue and the weight value of the dimension to which the eigenvalue belongs, and obtain the final value of the factor of each dimension;
[0019] Combine the final values of the factors of each dimension into a feature vector.
[0020] Optionally, inputting the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user includes:
[0021] Inputting the feature vector into a pre-trained classification model to obtain a target category identifier corresponding to the feature vector;
[0022] Determine the target sensitivity coefficient interval corresponding to the target category identifier according to the corresponding relationship between the preset category identifier and the sensitivity coefficient interval;
[0023] The information sensitivity level corresponding to the user is determined according to the information sensitivity level corresponding to the target sensitivity coefficient interval.
[0024] Optionally, when the voice data contains sensitive data, performing a second encryption based on the first encryption result includes:
[0025] In the case where verification of the user's identity based on the voiceprint feature fails, receiving a system password input by the user;
[0026] When the system password is received, the user identity is verified according to the system password.
[0027] Optionally, when the voice data contains sensitive data, performing a second encryption based on the first encryption result includes:
[0028] According to the keywords of the voice data, the type of the voice data is identified; the types include: voice data including only control instructions, voice data including control instructions and sensitive data, and unidentifiable voice data;
[0029] In the case where the voice data contains sensitive data, a second encryption is performed based on the first encryption result.
[0030] Optionally, the method further comprises:
[0031] The characteristic data and the user identification are stored in a tree structure, and an association relationship between the characteristic data and the user identification is established;
[0032] When the voice data and the user registration information are updated, the feature data stored in the tree structure is updated.
[0033] On the other hand, an embodiment of the present invention provides an encryption device, the device comprising:
[0034] A verification module, configured to verify the user's identity based on the voiceprint features corresponding to the voice data when receiving the voice data input by the user;
[0035] An extraction module, used to extract feature data corresponding to the user based on the voice data and user registration information when the user identity authentication is successful; the feature data includes feature information of at least two dimensions;
[0036] A first determination module, used to determine a feature vector according to the feature values of the feature information in each dimension;
[0037] A second determination module is used to input the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user;
[0038] A first encryption module, configured to perform a first encryption on the voice data according to the feature vector and the voiceprint feature when the information sensitivity is within a preset range;
[0039] The second encryption module is used to perform a second encryption based on the first encryption result when the voice data contains sensitive data.
[0040] An embodiment of the present invention also discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned verification method.
[0041] The embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned verification method.
[0042] The embodiments of the present invention include the following advantages:
[0043] The encryption method provided by the embodiment of the present invention verifies the identity of the user according to the voiceprint features corresponding to the user's voice data. The voiceprint features corresponding to each user are different. The identity of the user is verified according to the voiceprint features, thereby improving the accuracy of verifying the user's identity. In the case of successful user identity authentication, the feature data corresponding to the user is extracted based on the voice data and the user registration information; the feature vector corresponding to the feature data is input into the classification model to obtain the information sensitivity corresponding to the user, thereby improving the efficiency of determining the user's information sensitivity. Compared with the method in which the user manually sets the password, since each user corresponds to a unique feature vector and voiceprint feature, the method of encrypting the voice data for the first time according to the feature vector and voiceprint feature not only improves the efficiency of encryption, but also reduces the risk of voice data leakage. In the case that the voice data contains sensitive data, a second encryption is performed based on the first encryption result. The method of double encrypting the voice data containing sensitive data further reduces the risk of voice data containing sensitive data leakage. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flowchart of a step encryption method provided by an embodiment of the present invention;
[0045] Figure 2 It is a logic block diagram of an encryption device provided by an embodiment of the present invention;
[0046] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0048] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0049] Method Embodiment
[0050] The encryption method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0051] Reference Figure 1 , shows a flowchart of the steps of an encryption method provided by an embodiment of the present application, such as Figure 1 As shown, the method specifically comprises the following steps:
[0052] Step S101: upon receiving voice data input by a user, verify the user's identity according to the voiceprint features corresponding to the voice data.
[0053] The encryption method provided by the embodiment of the present invention can be applied to the fields of smart home, smart car, smart terminal, etc. For example, in the field of smart home, users can control various smart devices in the home through voice, such as smart lights, smart home appliances, smart air conditioners, smart curtains, etc.; in the field of smart car, users can complete navigation settings, music playback, phone calls, etc. through voice; in the field of smart terminal, users can wake up voice assistants through voice and control terminals through voice to achieve various functions. The encryption method provided by the embodiment of the present invention can encrypt the voice data of users in these fields.
[0054] Among them, voiceprint is the sound wave spectrum that carries speech information realized by electroacoustic instruments. It is a biological feature composed of more than 100 characteristic dimensions such as wavelength frequency and intensity.
[0055] In an embodiment of the present invention, a user's voiceprint template is pre-stored in a memory. When a user controls an electronic device by voice, voice data is collected by a microphone or other sensor, and pre-processing operations such as denoising are performed on the collected voice data. A voiceprint recognition algorithm is used to extract voiceprint features from the pre-processed voice signal; the voiceprint features are compared with the pre-stored voiceprint template. If the voiceprint features are consistent with the voiceprint template, the user identity verification is successful; if the voiceprint features are inconsistent with the voiceprint template, the user identity verification fails.
[0056] Step S102: When the user identity authentication is successful, extract the feature data corresponding to the user based on the voice data and the user registration information; the feature data includes feature information of at least two dimensions.
[0057] User registration information refers to the identity information reserved by a user when using an electronic device for the first time, which may include: name, occupation, date of birth, etc.
[0058] Among them, at least two dimensions may include: user preferences, occupation, identity, behavioral habits and other dimensions. The characteristic information of the dimension refers to the specific characteristics of a certain dimension. For example, if the dimension is occupation, the characteristic information of the dimension is teacher.
[0059] It should be noted that, when the user identity authentication is successful, the voice data input by the user is obtained, the voice data is converted into text, and the feature data corresponding to the user is extracted based on the text and the user registration information.
[0060] Step S103: determining a feature vector according to the feature values of the feature information in each dimension.
[0061] The eigenvalue refers to the value obtained after quantifying the feature information, and the eigenvalue can reflect the degree of correlation between the feature information and the user's identity sensitivity. The sum of the eigenvalues corresponding to each dimension is 1. For example, the dimension is occupation, and the feature information can be: teacher, doctor, lawyer, and the corresponding eigenvalues are 0.1, 0.3, and 0.6 respectively. If the current user's occupation is doctor, the user's eigenvalue in the occupation dimension is 0.3.
[0062] In the embodiment of the present invention, the mapping relationship between the feature information and the feature value is preset by the user, and the user can set the corresponding feature value for the feature information based on experience summary, or can set the corresponding feature value for the feature information based on relevant experimental data. After extracting the feature information of at least two dimensions corresponding to the user, the feature value corresponding to the feature information of at least two dimensions of the user is determined according to the mapping relationship between the feature information and the feature value.
[0063] The feature values of the feature information of the user in each dimension are combined together as the feature vector corresponding to the user. For example, when the feature data includes feature information of four dimensions, the feature vector includes four feature values of [0.05, 0.1, 0.2, 0.3].
[0064] Step S104: input the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user.
[0065] The input of the pre-trained classification model is a feature vector, and the output is the category to which the feature vector belongs. Different categories correspond to different information sensitivities, so the information sensitivity corresponding to the user can be determined according to the category to which the feature vector belongs.
[0066] It should be noted that the training process of the classification model includes the following steps:
[0067] Step 11: Acquire feature data of a large number of users. The data can be acquired through the information filled in by the user during registration or the voice recording during daily use of the air conditioner.
[0068] Step 12: construct a training set, set corresponding output labels for the multidimensional data, the output label is the category to which the data belongs, and the training set is composed of label pairs consisting of the multidimensional data and the corresponding output labels.
[0069] Step 13: Select a deep learning model and use the training set to train and optimize the model parameters.
[0070] It should be noted that the training set may be existing or constructed by the user. Exemplarily, an embodiment of the present invention provides a method for constructing a training set. Exemplarily, the interval [0, 1] is further divided into 100 intervals according to the same interval, namely [0, 0.01], [0.01, 0.02], ..., [0.43, 0.44], ..., [0.99, 1], and the 100 intervals correspond to 100 categories respectively, and the category identifiers may be in digital or alphabetic form. Obtain feature data of a large number of users, determine the feature vector corresponding to the user based on the mapping relationship between the feature data and the feature value, multiply the features of each dimension in the corresponding feature vector of the user, and obtain a numerical value. According to which interval the numerical value is within, it belongs to which category. In the above manner, a label pair consisting of the feature vector of each user and the category corresponding to the feature vector can be obtained, and the label pair is used as a training set.
[0071] The deep learning model may include the fuzzy C-means algorithm, which can cluster the feature vectors corresponding to users according to the distance between the feature vectors. In the process of classifying the user's feature vector into which category based on the algorithm, if there is a missing feature value of a dimension in the feature vector, the average, mode or median of the feature values of the corresponding dimensions of all other users can be used as the feature value of the feature vector to complete the feature.
[0072] Step S105: When the information sensitivity is within a preset range, encrypt the voice data for the first time according to the feature vector and the voiceprint feature.
[0073] The information sensitivity is expressed by a numerical value. When the numerical value is within a preset range, an encryption key is set according to the feature vector and the voiceprint feature, and the voice data is encrypted for the first time by the encryption key. It should be noted that the encryption key is set according to the information contained in the feature vector and the voiceprint feature by analyzing the feature vector and the voiceprint feature. Exemplarily, the encryption key is set according to the feature vector itself and the voiceprint feature itself, or according to the average value of the numerical value in the feature vector and the average value of the numerical value in the voiceprint feature.
[0074] Step S106: When the voice data contains sensitive data, a second encryption is performed based on the first encryption result.
[0075] Among them, sensitive data refers to data including the user's personal information, financial data, etc. For example, sensitive data includes the user's bank card number, mobile phone number, and ID card number.
[0076] It should be noted that, by using a pre-set determination rule to determine whether the voice data contains sensitive data, for example, a sensitive data identifier for distinguishing sensitive data is obtained, and the voice data contains sensitive data according to the sensitive data identifier. The sensitive data identifier may be the name of sensitive data, such as an ID card, mobile phone, and bank card.
[0077] The second encryption refers to encryption based on the first encryption using an encryption algorithm different from the first encryption algorithm. For example, common encryption algorithms include: symmetric encryption algorithm and asymmetric encryption, wherein the encryption key and decryption key of the symmetric encryption algorithm are the same, and the encryption key and decryption key of the asymmetric encryption algorithm are different.
[0078] In an embodiment of the present invention, when voice data input by a user is received, the user's identity is verified according to the voiceprint features corresponding to the voice data; when the user's identity is successfully authenticated, the feature data corresponding to the user is extracted based on the voice data and the user registration information; the feature vector is determined according to the feature values of the feature information in each dimension; the feature vector is input into a pre-trained classification model to obtain the information sensitivity corresponding to the user; when the information sensitivity is within a preset range, the voice data is encrypted for the first time according to the feature vector and the voiceprint features; when the voice data contains sensitive data, a second encryption is performed based on the first encryption result. The present invention solves the problem of voice data leakage in the process of voice controlling electronic devices by encrypting according to user feature data and voiceprint data.
[0079] Optionally, in step S105, when the information sensitivity is within a preset range, encrypting the voice data for the first time according to the feature vector and the voiceprint feature includes:
[0080] Step S21: When the information sensitivity is within a preset range, encode the feature vector and the voiceprint feature according to a preset encoding rule.
[0081] Step S22: setting a key according to the encoded character string, and using the key to perform a first encryption on the voice data.
[0082] Encoding refers to the act of converting one form into another, and preset encoding rules refer to the rules to be followed when converting one form into another.
[0083] In the embodiment of the present invention, the encoding rule followed in converting the feature vector into a character string and the encoding rule followed in converting the voiceprint feature into a character string may be the same or different.
[0084] The key can be a combination of numbers, letters, special characters, or a string consisting of binary characters.
[0085] Setting a key based on the encoded string may include: using the encoded string directly as the key, setting an additional string based on the encoded string, the additional string may be a unified string pre-set by the user, the unified string may be encoded based on the user's identity information, and the identity information may include the user's date of birth.
[0086] It should be noted that by encoding the feature vector and the voiceprint feature according to the encoding rules, two character strings can be obtained respectively. The two character strings and the additional character string are combined in a specified order to obtain a final character string, and the final character string is used as the key.
[0087] Exemplarily, the feature vector corresponding to the user is [0.1, 0.2, 0.3, 0.4], and the corresponding voiceprint feature is [0.05, 0.1, 0.03, 0.4]. When the encoding rules for converting the feature vector and the voiceprint feature into a string are the same, the preset encoding rule is to convert a value less than 0.1 into the letter a, convert a value between 0.1 and 0.2 (excluding 0.2) into the letter b, convert a value between 0.2 and 0.25 (excluding 0.25) into the letter c, convert a value between 0.25 and 0.35 (excluding 0.35) into the letter d, convert a value between 0.35 and 0.45 (excluding 0.45) into the letter e, ..., convert a value between 0.85 and 0.95 (excluding 0.95) into the letter j, and convert a value between 0.95 and 1 into the letter k. Set xvdcs as an additional string, and a string can be obtained: bcdeabaexvdcs.
[0088] In the embodiment of the present invention, by identifying whether the user's information sensitivity is within a preset range, the voice data is encrypted for the first time according to the feature vector and the voiceprint feature. Specifically, when the information sensitivity is within the preset range, the feature vector and the voiceprint feature are encoded according to a preset encoding rule, a key is set according to the encoded character string, and the voice data is encrypted for the first time using the key. When the user's information sensitivity is within the preset range, a key is set according to the feature vector and the voiceprint feature, which solves the problem of voice data leakage in the process of voice control of electronic devices by users with high information sensitivity.
[0089] Optionally, in step S21, when the information sensitivity is within a preset range, encoding the feature vector and the voiceprint feature according to a preset encoding rule includes:
[0090] When the information sensitivity is within a preset range, the feature vector is converted into a binary string having a first preset length, and the voiceprint feature is converted into a binary string having a second preset length.
[0091] It should be noted that there is a one-to-one correspondence between each eigenvalue and the binary string, and the length of the binary string is related to the number of eigenvalues, that is, 2 第一预设长度 = the number of all possible eigenvalues in the eigenvector. According to the pre-set mapping relationship between the eigendata and the eigenvalues, the number of eigenvalues is fixed. Therefore, the first preset length for converting the eigenvector into a binary string can be determined according to the number of eigenvalues. Similarly, the second preset length for converting the voiceprint features into a binary string can be determined according to the number of voiceprint features.
[0092] For example, the user's feature vector [0.05, 0.1, 0.2, 0.3, 0.4], assume that we choose each feature value to be represented by 4 bits of binary. The extracted voiceprint feature is also a vector, such as [0.1, 0.2, 0.3, 0.4, 0.5]. For example, the feature value 0.05 can be converted to binary "0000", 0.1 to "0001", 0.2 to "0010", 0.3 to "0011", and 0.4 to "0100". Connect the binary representations of all feature values to get a long binary string. The binary string corresponding to [0.05, 0.1, 0.2, 0.3, 0.4] is "00000001001000110100". Convert each value of the voiceprint feature vector to a fixed-length binary representation. Assume that each value is represented by 4 bits of binary. The binary string corresponding to the voiceprint feature [0.1, 0.2, 0.3, 0.4, 0.5] is "00010010001101000101". Concatenate the binary string of the eigenvalue vector and the binary string of the voiceprint feature to form a binary string. Concatenate the binary string of the eigenvector "00000001001000110100" and the binary string of the voiceprint feature "00010010001101000101" to get "0000000100100011010000010010001101000101". Convert the final binary string into an encryption key.
[0093] In the embodiment of the present invention, when the information sensitivity is within a preset range, the feature vector is converted into a binary string with a first preset length, and the voiceprint feature is converted into a binary string with a second preset length. A key is set according to the binary string, thereby solving the problem of voice data leakage in the process of voice control of electronic devices by users with high information sensitivity.
[0094] Optionally, the step of determining a feature vector according to feature values of the feature information in each dimension includes:
[0095] Step S31, calculating the product of the eigenvalue and the weight value of the dimension to which the eigenvalue belongs, to obtain the final value of the factor of each dimension;
[0096] Step S32: Combine the final values of the factors of each dimension into a feature vector.
[0097] It should be noted that the weight values of the feature values and the dimensions to which the feature values belong are pre-set by the user based on the dimension, the correlation between the feature information in each dimension and the user's identity sensitivity. The higher the correlation between a dimension and the user's identity sensitivity, the greater the weight value of the dimension. The sum of the weight values of each dimension is 1, and the sum of the feature values included in each dimension is 1.
[0098] Exemplarily, the user contains feature information of four dimensions, namely, preference, occupation, identity, and behavior habits. Each dimension includes three specific forms. For example, occupations include teachers, doctors, and lawyers. Based on experience, the user concludes that the order of correlation between these four dimensions and the user's identity sensitivity from large to small is: occupation, identity, preference, and behavior habits. Therefore, the weight values pre-set for the four dimensions of preference, occupation, identity, and behavior habits are: 0.2, 0.4, 0.3, and 0.1, respectively. Further, based on experience, the user concludes that the order of user identity sensitivity corresponding to different occupations in the occupation dimension from high to low is: lawyer, doctor, and teacher. Therefore, in the occupation dimension, the feature values pre-set for teachers, doctors, and lawyers are: 0.2, 0.3, and 0.5, respectively. The final value of the factor of each dimension is obtained by multiplying the feature value corresponding to the user feature information and the weight value of the dimension to which the feature information belongs. If the current user's occupation is a doctor, the factor value corresponding to the user's occupation dimension is the product of the weight value of the occupation dimension 0.4 and the feature value 0.3 corresponding to the doctor, which is 0.12.
[0099] When the user contains feature information of four dimensions, the final value of the factors of each dimension is calculated respectively, and the final values of the factors of each dimension are combined as a feature vector.
[0100] As an example, if voice control technology is applied to air conditioners, users have characteristic information in four dimensions: preferences, occupations, identities, and behavioral habits. Preferences refer to the air conditioner temperatures that users like, including: 18°C, 20°C, and 26°C; occupations refer to the work that individuals do to serve the society and is the main source of income, including: teachers, doctors, and lawyers; identities refer to family identities, including: fathers, mothers, and children; behavioral habits refer to the frequency of users turning on and off the air conditioner and the duration of the air conditioner on, including: controlling the air conditioner to turn on 4 times in 24 hours, each time for 30 minutes; controlling the air conditioner to turn on 2 times in 24 hours, each time for 60 minutes. The user sets weight values and characteristic values for each dimension and characteristic information in the dimension in advance. The weight values corresponding to the four dimensions of preferences, occupations, identities, and behavioral habits are 0.2, 0.4, 0.3, and 0.1, respectively. In the preference dimension, the eigenvalues corresponding to 18℃, 20℃, and 26℃ are 0.2, 0.3, and 0.5 respectively; in the occupation dimension, the eigenvalues corresponding to teachers, doctors, and lawyers are 0.1, 0.4, and 0.5 respectively; in the identity dimension, the eigenvalues corresponding to fathers, mothers, and children are 0.1, 0.3, and 0.6 respectively; in the behavior habit dimension, the air conditioner is turned on 4 times in 24 hours, and each time it is turned on for 30 minutes; the air conditioner is turned on 2 times in 24 hours, and each time it is turned on for 60 minutes, and the corresponding eigenvalues are 0.3 and 0.7 respectively. When there is a user controlling the air conditioner by voice, according to the voice data and registration information input by the user, the user's characteristic data is extracted as follows: the favorite air conditioner temperature is 26℃, the occupation is doctor, the identity is mother, and the behavior habit is to turn on the air conditioner twice in 24 hours, and each time it is turned on for 60 minutes. According to the weight values and feature values pre-set by the user for each dimension and each feature information contained in the dimension, the final value of the factor corresponding to the user's preference dimension is the product of 0.2 and 0.5, which is 0.10; the final value of the factor corresponding to the occupation dimension is the product of 0.4 and 0.4, which is 0.16; the final value of the factor corresponding to the identity dimension is the product of 0.3 and 0.3, which is 0.09; and the final value of the factor corresponding to the behavior dimension is the product of 0.1 and 0.7, which is 0.07. Therefore, the final feature vector of the user is [0.10, 0.16, 0.09, 0.07].
[0101] In an embodiment of the present invention, the final value of the factor of each dimension is obtained by calculating the product of the eigenvalue and the weight value of the dimension to which the eigenvalue belongs, and the final value of the factor of each dimension is combined into a eigenvector. The eigenvector is used to input a classification model to obtain the user's information sensitivity, thereby providing a method for determining the user's information sensitivity based on multiple dimensional data.
[0102] Optionally, the step of inputting the feature vector into a pre-trained classification model to obtain the information sensitivity corresponding to the user includes:
[0103] Step S41, inputting the feature vector into a pre-trained classification model to obtain a target category identifier corresponding to the feature vector;
[0104] Step S42: determining the target sensitivity coefficient interval corresponding to the target category identifier according to the preset correspondence relationship between the category identifier and the sensitivity coefficient interval;
[0105] Step S43: Determine the information sensitivity level corresponding to the user according to the information sensitivity level corresponding to the target sensitivity coefficient interval.
[0106] The input of the classification model is a multidimensional feature vector, and the output is the identifier of the category to which the feature vector belongs, wherein the identifier can be in digital form or in alphabetical form. For example, in the case of two categories, the identifiers of the two categories can be numbers 1 and 2, or letters A and B, or other names, and the present invention does not limit this.
[0107] Before inputting the feature vector into the pre-trained classification model, the user sets the number of categories and the sensitivity coefficient interval corresponding to each category. After inputting the feature vector into the pre-trained classification model, the model outputs the identifier of the category to which the feature belongs. For example, the user sets two categories A and B, and the corresponding sensitivity coefficient intervals are [0, 0.3] and [0.3, 1] respectively. The feature vector corresponding to the user is [0.10, 0.16, 0.09, 0.07] and is input into the pre-trained classification model, and the target category identifier A corresponding to the feature vector is output.
[0108] Among them, each category corresponds to a sensitivity coefficient interval. After the feature vector is input into the classification model, the identifier of the target category to which the feature vector belongs is output. According to the correspondence between the category identifier and the sensitivity coefficient interval, the sensitivity coefficient interval corresponding to the feature vector can be obtained. For example, the user sets two categories A and B, and the corresponding sensitivity coefficient intervals are [0, 0.3] and [0.3, 1] respectively. When the output target category identifier is A, the corresponding target sensitivity coefficient interval is [0, 0.3].
[0109] It should be noted that the sensitivity coefficient interval can reflect the user's information sensitivity. The information sensitivity can be the sensitivity coefficient interval itself, or a parameter that has a mapping relationship with the sensitivity coefficient interval. In the case where the user's information sensitivity is the sensitivity coefficient interval itself, after determining the sensitivity coefficient interval according to the target category identifier, the user's information sensitivity can be determined; in the case where there is a mapping relationship between the user's information sensitivity and the sensitivity coefficient interval, the user's information sensitivity can be determined based on the mapping relationship between the sensitivity coefficient interval and the user's information sensitivity. Exemplarily, the mapping relationship between the user's information sensitivity and the sensitivity coefficient interval is that when the sensitivity coefficient interval is [0.43, 0.44], the corresponding information sensitivity is 43, and when the sensitivity coefficient interval is [0.45, 0.46], the corresponding information sensitivity is 45.
[0110] In the embodiment of the present invention, the feature vector is input into a pre-trained classification model to obtain a target category identifier corresponding to the feature vector; the target sensitivity coefficient interval corresponding to the target category identifier is determined according to the correspondence between the preset category identifier and the sensitivity coefficient interval; the information sensitivity corresponding to the user is determined according to the information sensitivity corresponding to the target sensitivity coefficient interval. Compared with calculating the user information sensitivity according to the feature vector each time, using the pre-trained classification model to determine the user information sensitivity improves the efficiency of determining the user information sensitivity.
[0111] Optionally, in step S101, when receiving voice data input by the user, verifying the user identity according to the voiceprint feature corresponding to the voice data includes:
[0112] Step S51: receiving a system password input by a user when the user identity verification based on the voiceprint feature fails;
[0113] Step S52: When the system password is received, verify the user identity according to the system password.
[0114] When the voiceprint feature fails to verify the user's identity, the user is prompted that the identity verification failed, and the user is asked to enter the system password in the password filling area for further verification. For example, if the user's voice changes due to a cold, the air conditioner does not recognize the user, and the user's identity verification fails, a voice prompt will be given to indicate whether password verification is required. The user can enter the system password for verification according to the password verification prompt.
[0115] It should be noted that the electronic device not only pre-stores the voiceprint template, but also pre-stores the system password. When receiving the system password input by the user, the system password is matched with the pre-stored system password to verify the identity of the user. If the system password input by the user matches the pre-stored system password successfully, the user identity verification is successful; if the system password input by the user fails to match the pre-stored system password, the user identity verification fails. Exemplarily, in the case where the user identity verification based on the voiceprint feature fails, the system password input by the user is: sdgchgw123. The system password input by the user is matched with the pre-stored system password. If the system password input by the user is consistent with the pre-stored system password, the user identity verification is successful; if the system password input by the user is inconsistent with the pre-stored system password, the user identity verification fails.
[0116] Optionally, a threshold of the number of system password verification times is preset, the initial value of the number of system password verification times is zero, and after the user enters the system password, the number of system password verification times increases by one until the number of system password verification times is greater than or equal to the threshold, and then the electronic device is locked.
[0117] In the embodiment of the present invention, when the user identity verification based on the voiceprint feature fails, the system password input by the user is received; when the system password is received, the user identity is verified based on the system password. The user identity is verified by multiple factors of voiceprint feature and system password, which improves the security of verifying the user identity.
[0118] Optionally, in the case where the voice data contains sensitive data, performing a second encryption based on the first encryption result comprises:
[0119] Step S61, identifying the type of the voice data according to the keywords of the voice data; the types include: voice data including only control instructions, voice data including control instructions and sensitive data, and unrecognizable voice data;
[0120] Step S62: When the voice data contains sensitive data, a second encryption is performed based on the first encryption result.
[0121] Among them, keywords refer to the name of sensitive data, the content of sensitive data, the format of sensitive data, etc.
[0122] It should be noted that control instruction templates and keywords are pre-stored in the electronic device. Voice data is obtained, and the voice data is converted into text to match the pre-stored control instruction templates and keywords; the type of voice data is identified according to the presence of keywords and control instructions in the voice data. In the case where the voice data only contains control instructions, the type of voice data is voice data that only includes control instructions; in the case where the voice data contains control instructions and keywords, the type of voice data is voice data that only includes control instructions; in the case where it is impossible to identify whether the voice data contains control instructions, the type of voice data is unrecognizable voice data. Exemplarily, the user's voice data includes turning on the machine, setting the temperature to 25°C, and the keyword is the bank card number. By matching the content of the voice data with the pre-stored control instruction templates and keywords, it can be seen that the voice data is voice data that includes control instructions and sensitive data.
[0123] The situation where the voice data contains sensitive data refers to the situation where the voice data includes control instructions and sensitive data.
[0124] It should be noted that the encryption key can be obtained through the first encryption, and the second encryption refers to transforming the key based on the key obtained by the first encryption using an encryption algorithm different from the first encryption algorithm, and using the transformed key as the final key. For example, the second encryption algorithm uses the MD5 algorithm, which is a digest algorithm. A piece of information generates a message digest. The key obtained after the first encryption is used as input. MD5 will output a string of 128 bits in length, and the 128-bit string is used as the final key.
[0125] In the embodiment of the present invention, the type of voice data is identified according to the keywords of the voice data; the types include: voice data including only control instructions, voice data including control instructions and sensitive data, and unrecognizable voice data; in the case where the voice data contains sensitive data, a second encryption is performed based on the result of the first encryption. By identifying the type of voice data, the voice data containing sensitive data is encrypted twice, thereby improving the security of encryption.
[0126] Optionally, the method further comprises:
[0127] Step S71, storing the characteristic data and the user identification in a tree structure, and establishing an association relationship between the characteristic data and the user identification;
[0128] Step S72: When the voice data and the user registration information are updated, the feature data stored in the tree structure is updated.
[0129] The tree structure includes two levels, one level stores the user ID, and the other level stores the feature data. The feature data includes feature information of at least two dimensions, and the feature information of all dimensions is in the same level. The nodes of the tree structure are used to store the user ID and feature data. The user ID is an ID that can represent the uniqueness of the user, such as the user's name.
[0130] The tree structure is a dynamic data structure, and the feature data is obtained based on the voice data and user registration information. When the voice data and user registration information are updated, the feature data stored in the tree structure is updated to reflect changes in user behavior.
[0131] In the embodiment of the present invention, the characteristic data and the user identification are stored in a tree structure, and an association relationship between the characteristic data and the user identification is established; when the voice data and the user registration information are updated, the characteristic data stored in the tree structure is updated. By establishing a corresponding relationship between the user and the characteristic data through the tree structure, the user's information sensitivity can be determined based on the user's multi-dimensional data.
[0132] Optionally, the method may further include:
[0133] Automatically adjust the control parameters of electronic devices according to user habits and preferences.
[0134] The user's characteristic data is obtained, and the control parameters of the electronic device are automatically adjusted according to the characteristic information of the behavioral habits and preference dimensions included in the characteristic data. For example, for users who like to exercise at home, the system can adjust the temperature of the air conditioner to a lower value.
[0135] In the embodiment of the present invention, the control parameters of the electronic device are automatically adjusted according to the habits and preferences of the user, and an exclusive control plan is formulated for the user, thereby improving the personalized experience of the user when using the electronic device.
[0136] In summary, the encryption method provided by the embodiment of the present invention verifies the identity of the user according to the voiceprint features corresponding to the user's voice data. The voiceprint features corresponding to each user are different. The identity of the user is verified according to the voiceprint features, thereby improving the accuracy of verifying the user's identity. In the case of successful user identity authentication, the feature data corresponding to the user is extracted based on the voice data and the user registration information; the feature vector corresponding to the feature data is input into the classification model to obtain the information sensitivity corresponding to the user, thereby improving the efficiency of determining the user's information sensitivity. Compared with the method in which the user manually sets the password, since each user corresponds to a unique feature vector and voiceprint feature, the method of encrypting the voice data for the first time according to the feature vector and voiceprint feature not only improves the efficiency of encryption, but also improves the security of the voice data. In the case that the voice data contains sensitive data, a second encryption is performed on the basis of the first encryption result. The method of double encrypting the voice data containing sensitive data further reduces the risk of leakage of the voice data containing sensitive data.
[0137] Device Embodiment
[0138] like Figure 2 As shown, Figure 2 A logic block diagram of an encryption device provided by an embodiment of the present invention is shown, and the device may include:
[0139] The verification module 210 is used to verify the user's identity according to the voiceprint feature corresponding to the voice data when receiving the voice data input by the user;
[0140] Extraction module 220, used to extract feature data corresponding to the user based on the voice data and user registration information when the user identity verification is successful; the feature data includes feature information of at least two dimensions;
[0141] A first determination module 230, configured to determine a feature vector according to the feature values of the feature information in each dimension;
[0142] A second determination module 240 is used to input the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user;
[0143] A first encryption module 250, configured to perform a first encryption on the voice data according to the feature vector and the voiceprint feature when the information sensitivity is within a preset range;
[0144] The second encryption module 260 is used to perform a second encryption based on the first encryption result when the voice data contains sensitive data.
[0145] Optionally, the first encryption module includes:
[0146] An encoding module, used for encoding the feature vector and the voiceprint feature according to a preset encoding rule when the information sensitivity is within a preset range;
[0147] The first encryption submodule is used to set a key according to the character string obtained by encoding, and use the key to perform a first encryption on the voice data.
[0148] Optionally, the encoding module includes:
[0149] The conversion module is used to convert the feature vector into a binary string with a first preset length and convert the voiceprint feature into a binary string with a second preset length when the information sensitivity is within a preset range.
[0150] Optionally, the first determining module includes:
[0151] The calculation module is used to calculate the product of the characteristic value and the weight value of the dimension to which the characteristic value belongs, so as to obtain the final value of the factor of each dimension.
[0152] The combination module is used to combine the final values of the factors of each dimension into a feature vector.
[0153] Optionally, the second determining module includes:
[0154] The first determination submodule is used to input the feature vector into a pre-trained classification model to obtain a target category identifier corresponding to the feature vector.
[0155] The second determination submodule is used to determine the target sensitivity coefficient interval corresponding to the target category identifier according to a preset correspondence relationship between the category identifier and the sensitivity coefficient interval.
[0156] The third determination submodule is used to determine the information sensitivity level corresponding to the user according to the information sensitivity level corresponding to the target sensitivity coefficient interval.
[0157] Optionally, the device further comprises:
[0158] The receiving module is used to receive the system password input by the user when the user identity verification based on the voiceprint feature fails.
[0159] The first verification submodule is used to verify the user identity according to the system password when the system password is received.
[0160] Optionally, the second encryption module includes:
[0161] The recognition module is used to identify the type of the voice data according to the keywords of the voice data; the types include: voice data including only control instructions, voice data including control instructions and sensitive data, and unrecognizable voice data.
[0162] The second encryption submodule is used to perform a second encryption based on the first encryption result when the voice data contains sensitive data.
[0163] Optionally, the device further comprises:
[0164] The establishing module is used to store the characteristic data and the user identification in a tree structure and establish an association relationship between the characteristic data and the user identification.
[0165] The updating module is used to store the characteristic data and the user identification in a tree structure and establish an association relationship between the characteristic data and the user identification.
[0166] In summary, an encryption device provided by an embodiment of the present invention is used to verify the identity of a user according to the voiceprint features corresponding to the voice data, thereby improving the accuracy of identity verification. Feature data corresponding to the user is extracted based on the voice data and user registration information, feature vectors are determined according to the feature values of the feature information in each dimension, and the feature vectors are input into a pre-trained classification model to obtain the information sensitivity corresponding to the user. Compared with the method in which the user manually calculates the information sensitivity each time, the efficiency of determining the information sensitivity corresponding to the user is improved. Since each user corresponds to a feature vector and a voiceprint feature one by one, the method of encrypting the voice data for the first time according to the feature vector and the voiceprint feature improves the encryption efficiency and reduces the risk of voice data leakage compared to the method in which the user manually sets a password for the voice data. In the case that the voice data contains sensitive data, a second encryption is performed based on the result of the first encryption. The method of double encrypting the voice data containing sensitive data further reduces the risk of voice data leakage containing sensitive data.
[0167] The encryption device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0168] The encryption device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0169] Alternatively, if Figure 3 As shown, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the various steps of the above-mentioned encryption method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0170] In an embodiment of the present application, the memory may be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0171] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.
[0172] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned encryption method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0173] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0174] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned encryption method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0175] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0176] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0177] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An encryption method, characterized in that: Applied to electronic equipment, the method comprises: When receiving voice data input by the user, verifying the user's identity according to the voiceprint feature corresponding to the voice data; If the user identity authentication is successful, extracting feature data corresponding to the user based on the voice data and the user registration information; the feature data includes feature information of at least two dimensions; Determine a feature vector according to the feature values of the feature information in each dimension; Inputting the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user; When the information sensitivity is within a preset range, encrypting the voice data for the first time according to the feature vector and the voiceprint feature; In the case where the voice data contains sensitive data, a second encryption is performed based on the first encryption result.
2. The method according to claim 1, characterized in that When the information sensitivity is within a preset range, encrypting the voice data for the first time according to the feature vector and the voiceprint feature includes: When the information sensitivity is within a preset range, encoding the feature vector and the voiceprint feature according to a preset encoding rule; A key is set according to the character string obtained by encoding, and the key is used to encrypt the voice data for the first time.
3. The method according to claim 2, characterized in that When the information sensitivity is within a preset range, encoding the feature vector and the voiceprint feature according to a preset encoding rule includes: When the information sensitivity is within a preset range, the feature vector is converted into a binary string having a first preset length, and the voiceprint feature is converted into a binary string having a second preset length.
4. The method according to claim 1, characterized in that: The determining of the feature vector according to the feature values of the feature information in each dimension includes: Calculate the product of the eigenvalue and the weight value of the dimension to which the eigenvalue belongs, and obtain the final value of the factor of each dimension; Combine the final values of the factors of each dimension into a feature vector.
5. The method according to claim 1, characterized in that The step of inputting the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user includes: Inputting the feature vector into a pre-trained classification model to obtain a target category identifier corresponding to the feature vector; Determine the target sensitivity coefficient interval corresponding to the target category identifier according to the corresponding relationship between the preset category identifier and the sensitivity coefficient interval; The information sensitivity level corresponding to the user is determined according to the information sensitivity level corresponding to the target sensitivity coefficient interval.
6. The method according to claim 1, characterized in that The method further comprises: In the case where verification of the user's identity based on the voiceprint feature fails, receiving a system password input by the user; When the system password is received, the user identity is verified according to the system password.
7. The method according to claim 1, characterized in that When the voice data contains sensitive data, performing a second encryption based on the first encryption result includes: According to the keywords of the voice data, the type of the voice data is identified; the types include: voice data including only control instructions, voice data including control instructions and sensitive data, and unidentifiable voice data; In the case where the voice data contains sensitive data, a second encryption is performed based on the first encryption result.
8. The method according to claim 1, characterized in that The method further comprises: The characteristic data and the user identification are stored in a tree structure, and an association relationship between the characteristic data and the user identification is established; When the voice data and the user registration information are updated, the feature data stored in the tree structure is updated.
9. An encryption device, characterized in that: include: A verification module, configured to verify the user's identity based on the voiceprint features corresponding to the voice data when receiving the voice data input by the user; An extraction module, used to extract feature data corresponding to the user based on the voice data and user registration information when the user identity authentication is successful; the feature data includes feature information of at least two dimensions; A first determination module, used to determine a feature vector according to the feature values of the feature information in each dimension; A second determination module is used to input the feature vector into a pre-trained classification model to obtain the information sensitivity level corresponding to the user; A first encryption module, configured to perform a first encryption on the voice data according to the feature vector and the voiceprint feature when the information sensitivity is within a preset range; The second encryption module is used to perform a second encryption based on the first encryption result when the voice data contains sensitive data.
10. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the encryption method as claimed in any one of claims 1 to 8 is implemented when the processor executes the program.
11. A readable storage medium, characterized in that: When the instructions or transactions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the encryption method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises instructions or transactions, which, when executed by a processor in an electronic device, cause the electronic device to execute the encryption method according to any one of claims 1 to 8.