Speech synthesis method and device and electronic equipment
By generating targeted and unique key information to encrypt and decrypt feature information in the speech synthesis process, the problem of data security in the field of speech synthesis is solved and the security of data in the speech synthesis process is ensured.
Patent Information
- Application Number
- CN202410346802.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2024-09-17
AI Technical Summary
In the field of speech synthesis, it is difficult for existing technologies to effectively ensure data security. Especially when using third-party TTS services, data leakage may cause immeasurable losses.
By extracting the characteristic information of the target phoneme data, targeted and unique key information is generated, and the characteristic information is encrypted and decrypted to ensure data security during the speech synthesis process.
Due to the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext. Even if the key information is stolen, only the characteristic information can be obtained and the real voice content cannot be restored, thus effectively ensuring data security.
Smart Images

Figure CN118658451A
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a speech synthesis method, device and electronic device. Background Art
[0002] With the development and progress of AIGC (AI-Generated Content, which uses artificial intelligence technology to automatically generate content), the content generated by machine learning models continues to penetrate into various industry services. At present, due to the high cost and scarcity of computing power resources and data resources, it is difficult for every AIGC user to train models and build services by themselves. Therefore, cloud-based AIGC services are one of the development trends of the future industry.
[0003] However, as users of AI generation technology, while paying attention to the quality of generated data, they are also more concerned about data security issues. Taking TTS (Text To Speech) technology as an example, if the speech synthesized by users using TTS services purchased from third-party manufacturers is leaked to competitors or malicious attackers, it will cause immeasurable losses to users. Therefore, how to ensure the security of data in the speech synthesis process is crucial in the field of speech synthesis. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a speech synthesis method, device and electronic device to improve data security during the speech synthesis process.
[0005] To solve the above technical problems, the embodiments of the present application are implemented as follows:
[0006] On the one hand, an embodiment of the present application provides a speech synthesis method, including:
[0007] Extracting first feature information of target phoneme data;
[0008] generating key information of the target phoneme data, and encrypting the first feature information by using the key information to obtain encrypted second feature information;
[0009] Decrypting the second characteristic information according to the key information to obtain the first characteristic information;
[0010] Speech synthesis is performed according to the first feature information to obtain audio data of the target phoneme data.
[0011] On the other hand, an embodiment of the present application provides a speech synthesis device, including:
[0012] An extraction module, used for extracting first feature information of target phoneme data;
[0013] an encryption module, used to generate key information of the target phoneme data, and use the key information to encrypt the first feature information to obtain encrypted second feature information;
[0014] a decryption module, configured to decrypt the second characteristic information according to the key information to obtain the first characteristic information;
[0015] A speech synthesis module is used to perform speech synthesis according to the first feature information to obtain audio data of the target phoneme data.
[0016] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being used to call and execute the computer program from the memory to implement the above-mentioned speech synthesis method.
[0017] On the other hand, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program can be executed by a processor to implement the above-mentioned speech synthesis method.
[0018] On the other hand, an embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the above-mentioned speech synthesis method.
[0019] The technical solution of the embodiment of the present application is adopted, by generating the key information of the target phoneme data, and using the key information to encrypt the first characteristic information of the target phoneme data, the encrypted second characteristic information is obtained, and then the second characteristic information is decrypted to obtain the first characteristic information, and then speech synthesis is performed according to the first characteristic information. Since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the information security of the next processing. In addition, since the technical solution is not limited to which encryption method is used (such as symmetric encryption method or asymmetric encryption method, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext without knowing the encryption method. Furthermore, since the key information is used to encrypt the first feature information of the target phoneme data rather than the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as a feature vector sequence) is obtained. The real speech content cannot be restored based on the feature information alone, thereby ensuring data security during the speech synthesis process. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate one or more 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 one or more embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 is a schematic flow chart of a speech synthesis method according to an embodiment of the present application;
[0022] Figure 2 is a schematic block diagram of a speech synthesis system according to an embodiment of the present application;
[0023] Figure 3 is a schematic flow chart of a method for constructing a speech synthesis system according to an embodiment of the present application;
[0024] Figure 4 is a schematic block diagram of a pre-trained speech synthesis model according to an embodiment of the present application;
[0025] Figure 5 is a schematic principle diagram of a preset encryption algorithm according to an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of a training process of a speech synthesis model according to an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of an application process of a speech synthesis model according to an embodiment of the present application;
[0028] Figure 8 is a schematic principle diagram of a speech synthesis method according to an embodiment of the present application;
[0029] Fig. 9 is a schematic block diagram of a speech synthesis device according to an embodiment of the present application;
[0030] Fig.10 It is a schematic block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application provide a speech synthesis method, device and electronic device to improve data security during the speech synthesis process.
[0032] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0033] At present, in the field of speech synthesis, asymmetric encryption is usually used to improve data security. Specifically, before information transmission, the two communicating parties exchange public keys in advance through the CA (Certificate Authority, electronic certificate certification body) certification center, and then exchange symmetric encryption keys used to encrypt data through an asymmetric encryption algorithm. The communicating party uses the symmetric encryption key to symmetrically encrypt its own data and send it to the other party. At the same time, the symmetric encryption key can also be used to decrypt the data sent by the other party to obtain plain text. Since the CA certification center often gives a digital certificate a longer validity period, such as one year, the certificate remains unchanged during the validity period. Therefore, the symmetric encryption key agreed upon by the two communicating parties in advance is fixed within the validity period. During the validity period of the symmetric encryption key, once the symmetric encryption key is stolen, the thief can use the symmetric encryption key to crack the ciphertext, and the longer the validity period, the greater the data loss caused. The speech synthesis method provided by the present application generates key information corresponding to the target phoneme data, and uses the key information to encrypt the first characteristic information of the target phoneme data to obtain the encrypted second characteristic information, and then decrypts the second characteristic information to obtain the first characteristic information, and then performs speech synthesis according to the first characteristic information. Since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the information security of the next processing. In addition, since the technical solution is not limited to the use of any encryption method (such as symmetric encryption or asymmetric encryption, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext when the encryption method is known. Furthermore, since the key information is used to encrypt the first feature information of the target phoneme data rather than the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as a feature vector sequence) is obtained. The real speech content cannot be restored based on the feature information alone, thereby ensuring data security during the speech synthesis process.
[0034] The speech synthesis method provided in the embodiment of the present application can be executed by an electronic device, or by software installed in the electronic device. Specifically, the electronic device can be a terminal device or a server device. Among them, the terminal device can include a smart phone, a laptop computer, a smart wearable device, a vehicle terminal, etc., and the server device can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.
[0035] Figure 1 is a schematic flow chart of a speech synthesis method according to an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0036] S102: extract first feature information of the target phoneme data.
[0037] The first feature information may be a frame-level feature vector sequence.
[0038] S104, generating key information of the target phoneme data, and using the key information to encrypt the first feature information to obtain encrypted second feature information.
[0039] The key information is generated for the target phoneme data and is unique and targeted. That is, different target phoneme data correspond to different key information. The encryption method used when encrypting the first feature information is not limited, and any existing encryption method can be used for encryption.
[0040] Optionally, after encrypting the first characteristic information, the encrypted second characteristic information and key information are transmitted to the other end, and the second characteristic information is decrypted by the other end. In one embodiment, the second characteristic information and key information can be transmitted by an information transmission channel, and after the second characteristic information and key information are received by the other end, the second characteristic information is decrypted using the key information. When transmitting the second characteristic information and key information in the information transmission channel, the second characteristic information and key information can be encapsulated into the sending information and sent to the decoding end as a whole. Among them, the other end refers to an end different from the end that performs the encryption action, and the "end" here can be one or more layers in a neural network model, or one or more modules in an electronic device.
[0041] S106: Decrypt the second characteristic information according to the key information to obtain the first characteristic information.
[0042] If the second characteristic information and the key information are encapsulated as a whole for transmission, assuming that the whole encapsulated second characteristic information and key information is called the sending information, then after the other end receives the sending information, it first strips the second characteristic information and key information from the sending information, and then decrypts the second characteristic information according to the key information.
[0043] S108, performing speech synthesis according to the first characteristic information to obtain audio data of the target phoneme data.
[0044] The technical solution of the embodiment of the present application is adopted, by generating key information corresponding to the target phoneme data, and using the key information to encrypt the first characteristic information of the target phoneme data, the encrypted second characteristic information is obtained, and then the second characteristic information is decrypted to obtain the first characteristic information, and then speech synthesis is performed according to the first characteristic information. Since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the information security of the next processing. In addition, since the technical solution is not limited to the use of any encryption method (such as symmetric encryption method or asymmetric encryption method, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext without knowing the encryption method. Furthermore, since the key information is used to encrypt the first feature information of the target phoneme data rather than the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as a feature vector sequence) is obtained. The real speech content cannot be restored based on the feature information alone, thereby ensuring data security during the speech synthesis process.
[0045] The speech synthesis method in the above embodiment can be applied to a speech synthesis system. The speech synthesis system includes a first end, a second end, and an information transmission channel. The information transmission channel is deployed between the first end and the second end. Figure 2 is a schematic block diagram of a speech synthesis system according to an embodiment of the present application, such as Figure 2 As shown, the speech synthesis system includes a first end, a second end and an information transmission channel, the first end includes: a feature extraction module, a key generation module and an encryption module, and the second end includes: a decryption module and a speech synthesis module.
[0046] Wherein, the feature extraction module is used to extract the first feature information of the target phoneme data.
[0047] The key generation module is used to generate key information corresponding to the target phoneme data.
[0048] The encryption module is used to encrypt the first characteristic information using the key information to obtain the encrypted second characteristic information; and transmit the second characteristic information and the key information to the second end.
[0049] The decryption module is used to decrypt the second characteristic information according to the key information to obtain the first characteristic information.
[0050] The speech synthesis module is used to perform speech synthesis according to the first feature information to obtain audio data.
[0051] Based on the above structure, the second characteristic information and key information can be transmitted to the information transmission channel through the first end of the speech synthesis system, and then the second characteristic information and key information transmitted by the first end are transmitted to the second end of the speech synthesis system through the information transmission channel, and the second end decrypts the second characteristic information according to the key information.
[0052] In one embodiment, the construction process of the speech synthesis system includes: first obtaining the first end of the pre-trained first speech synthesis model and the second end of the pre-trained second speech synthesis model, and then using the information transmission channel to establish a communication connection between the first end and the second end, thereby obtaining the speech synthesis system, and the communication connection can be established in a wired connection mode or a wireless connection mode. Optionally, after obtaining the first end and the second end, the first end and the second end are respectively encapsulated, and then the two encapsulated parts are connected using the information transmission channel, that is, a communication connection is established between the encapsulated first end and the second end, and the speech synthesis system is obtained.
[0053] An information transmission channel is a path for transmitting information, which can be a physical channel or a logical channel. Among them, a physical channel refers to a physical path for transmitting information, which can be composed of a transmission medium and related physical equipment; a logical channel refers to a logical path realized by both parties sending and receiving information through an intermediate node on the basis of a physical channel.
[0054] The first speech synthesis model and the second speech synthesis model may be the same speech synthesis model, or may be two different and independent speech synthesis models.
[0055] Optionally, use Figure 3 The steps S302-S308 shown in the figure construct a speech synthesis system. Figure 3 In the illustrated embodiment, the first speech synthesis model and the second speech synthesis model are the same speech synthesis model.
[0056] S302, obtaining sample phoneme data and sample audio data corresponding to the sample phoneme data.
[0057] S304, training the speech synthesis model to be trained according to the sample phoneme data and the sample audio data to obtain a pre-trained speech synthesis model.
[0058] Among them, the pre-trained speech synthesis model includes at least a feature extraction module and a speech synthesis module.
[0059] S306, splitting the pre-trained speech synthesis model between the output end of the feature extraction module and the input end of the speech synthesis module to obtain a first end and a second end.
[0060] In this step, after the pre-trained speech synthesis model is divided between the output end of the feature extraction module and the input end of the speech synthesis module, an independent feature extraction module and speech synthesis module are obtained. Then, the key generation module and the encryption module are connected to the output end of the feature extraction module, and the decryption module is connected to the input end of the speech synthesis module, so that the first end and the second end can be obtained. The structure of the first end and the second end can be referred to Figure 2 shown.
[0061] S308: Establish a communication connection between the first end and the second end by using the information transmission channel.
[0062] This embodiment does not limit the pre-trained speech synthesis model, which can be any type of TTS model as long as the TTS model has a feature extraction module and a speech synthesis module. Optionally, the feature extraction module in the TTS model extracts frame-level feature information, such as Figure 4 Of course, in addition to the feature extraction module and the speech synthesis module, the speech synthesis model in this embodiment may also include other modules, such as an audio encoder, a tone length predictor, and the like.
[0063] In this embodiment, the speech synthesis model is divided at a position between the output end of the feature extraction module and the input end of the speech synthesis module, and a communication connection is established between the first end and the second end using an information transmission channel, so that after the first end encrypts the first feature information, it can transmit the information (i.e., the second feature information) in ciphertext form in the information transmission channel, thereby ensuring the security of the second feature information during the information transmission process.
[0064] In one embodiment, the key generation module may generate key information of the target phoneme data according to a preset key generation rule. The key generation rule may include at least one of the following: the information length of the key information, the number of keys included in the key information, and the key type. Among them, the key type can be any type that can be used for encryption, such as letters, numbers, special symbols, etc. The measurement method of the information length is related to the key type. For example, if the key type is a number, the information length can be the number of digits of the number; if the key type is a letter, the information length can be the number of digits of the letter; if the key type is a special symbol, the information length can be the number of special symbols.
[0065] Optionally, the key information includes N keys, where N is an integer greater than 1. Based on this, when the first feature information is encrypted using the key information to obtain the encrypted second feature information, it can be performed as follows:
[0066] First, the first feature information is split into multiple first feature sequences, each of which includes N unit sequences.
[0067] Secondly, according to a preset encryption algorithm, N keys are used to perform encryption calculations on the multiple first feature sequences respectively to obtain multiple encrypted first feature sequences.
[0068] Again, multiple encrypted first feature sequences are combined to obtain second feature information.
[0069] Figure 5 This is a schematic diagram of a preset encryption algorithm according to an embodiment of the present application. In this embodiment, the preset encryption algorithm is the Caesar encryption algorithm, N=5, that is, there are 5 Caesar keys. Assume that the first feature information is a feature sequence with a length of 20 frames, expressed as [1,2,3,4,5,...20], and the Caesar key includes 5 numbers, 2, 5, 10, 3, and 6. First, split the feature sequence of 20 frames into groups of 5 frames to obtain 4 first feature sequences. Each first feature sequence includes 5 unit sequences, which are respectively expressed as: first feature sequence (1), first feature sequence (2), first feature sequence (3), and first feature sequence (4). As Figure 5As shown, the first first characteristic sequence includes frame 1, frame 2, frame 3, frame 4 and frame 5, the second first characteristic sequence includes frame 6, frame 7, frame 8, frame 9 and frame 10, and so on. Then, the four first characteristic sequences are encrypted using the Caesar key. Optionally, each first characteristic sequence is encrypted in turn according to the order of the numbers in the Caesar key, that is, the first characteristic sequence (1) is encrypted using the Caesar key "2", the first characteristic sequence (2) is encrypted using the Caesar key "5", the first characteristic sequence (3) is encrypted using the Caesar key "10", and the first characteristic sequence (4) is encrypted using the Caesar key "3". If the first characteristic information also includes a fifth first characteristic sequence, the fifth first characteristic sequence can be encrypted using the Caesar key "6". If the length of the first characteristic information is longer, for example, including the sixth and seventh first characteristic sequences, then the first Caesar key can be used continuously, that is, the sixth first characteristic sequence is encrypted using Caesar key "2", the seventh first characteristic sequence is encrypted using Caesar key "5", etc. If the length of the last first characteristic sequence is less than 5 frames, the last first characteristic sequence may not be encrypted.
[0070] One encryption method of the Caesar encryption algorithm is: according to the numerical size of the Caesar key, the information content corresponding to each frame in the first feature sequence is right-shifted respectively, and the right-shift value is the number corresponding to the Caesar key, that is: new position = (old position + n)% N, n is the number corresponding to the Caesar key. In this example, after the first feature sequence (1) is encrypted using the Caesar key "2", the information content corresponding to each frame in the first feature sequence (1) is right-shifted by 2, that is: new position = (old position + 2)% 5. After the first feature sequence (2) is encrypted using the Caesar key "5", the information content corresponding to each frame in the first feature sequence (2) is right-shifted by 5, that is: new position = (old position + 5)% 5. After the first feature sequence (3) is encrypted using the Caesar key "10", the information content corresponding to each frame in the first feature sequence (3) is right-shifted by 10, that is: new position = (old position + 10)% 5. After the first characteristic sequence (4) is encrypted using the Caesar key "3", the information content corresponding to each frame in the first characteristic sequence (4) is right-shifted by 3, that is, the new position = (old position + 3)% 5.
[0071] After each first feature sequence is encrypted and calculated in turn, multiple encrypted first feature sequences (ie, second feature sequences) are obtained, and then multiple encrypted first feature sequences are combined to obtain second feature information. The combination method may be a sequential splicing method.
[0072] It should be noted that the number of keys listed above, the digital size corresponding to each key, etc. are all examples and do not constitute a limitation on the encryption method in this application. The key generation module can randomly generate X to Y digital keys, and each digital key has a value range of L to M. X, Y, L and M are not specific values and can be freely adjusted in actual applications, as long as Y is greater than X and M is greater than L.
[0073] It can be seen that in this embodiment, since the key generation module generates key information in real time and randomly for the target phoneme data, it is not easy to be stolen. Even if the key information is stolen and the thief cracks the encryption method, only feature information (such as feature vector sequence) is obtained. Without understanding the model structure of the speech synthesis model and the speech synthesis principle, it is impossible to restore the real speech content based on the feature information, thereby ensuring the data security in the speech synthesis process.
[0074] In one embodiment, decrypting the second characteristic information according to the key information to obtain the first characteristic information may be performed as follows:
[0075] First, the second feature information is split into multiple second feature sequences, each of which includes N unit sequences.
[0076] Secondly, according to the decryption algorithm corresponding to the encryption algorithm, the multiple second feature sequences are decrypted and calculated using N keys to obtain multiple first feature sequences.
[0077] Again, multiple first feature sequences are combined to obtain first feature information.
[0078] In this embodiment, the decryption method is equivalent to the reverse operation of the encryption method. Taking the Caesar encryption algorithm as an example, if the new position of the information content corresponding to each frame in the encrypted first feature sequence is: (old position + n)% N, n is the number corresponding to the key. Then when decrypting, the decrypted position = (initial position - n)% N.
[0079] The encryption method and decryption method provided in the above embodiments are examples. In actual applications, any type of encryption method can be used to encrypt the first feature information, and a decryption method matching the encryption method can be used to restore the first feature information.
[0080] The speech synthesis method provided by the present application is described in detail below through a specific embodiment.
[0081] Before executing the speech synthesis method, a speech synthesis system is pre-built. The steps of building the speech synthesis system include the following A1-A3:
[0082] Step A1, obtaining sample phoneme data and sample audio data corresponding to the sample phoneme data, training a speech synthesis model to be trained according to the sample phoneme data and the sample audio data, and obtaining a pre-trained speech synthesis model.
[0083] The pre-trained speech synthesis model includes a feature extraction module and a speech synthesis module. The feature extraction module is used to extract the first feature information of the target phoneme data, and the first feature information is a feature vector sequence at the frame level. The speech synthesis model is used to perform speech synthesis according to the feature vector sequence to obtain audio data of the target phoneme data.
[0084] Step A2, splitting the pre-trained speech synthesis model between the output end of the feature extraction module and the input end of the speech synthesis module to obtain independent feature extraction modules and speech synthesis modules.
[0085] Step A3, connecting the key generation module and the encryption module to the output end of the feature extraction module, connecting the decryption module to the input end of the speech synthesis module, and establishing a communication connection between the encryption module and the decryption module using an information transmission channel.
[0086] In this embodiment, the pre-trained speech synthesis model is a TTS model based on VITS (Variational Inference with adversarial learning for end-to-end Text-to-Speech, an end-to-end text-to-speech conversion technology that combines variational inference and adversarial learning). It uses the powerful one-to-many synthesis capability of the variational autoencoder structure to make the speech synthesis result get rid of the unnaturalness brought about by the rigid alignment learning of some model frameworks, so that the same input text can be synthesized into speech with different rhythms, which is closer to the real person effect.
[0087] The training process of the VITS-based TTS model (hereinafter referred to as the TTS model) is as follows: Figure 6 As shown, the TTS model to be trained includes: a linear spectrum extraction module, an audio encoder, an audio decoder, a text encoder, a distribution predictor, a monotone alignment matcher, a regularized reversible flow function module and a random tone length predictor.
[0088] The training sample includes sample speech and sample phoneme data corresponding to the sample speech. During training, the sample speech is extracted with a linear spectrum extraction module, and then encoded with an audio encoder to obtain an audio latent variable. The audio latent variable can be restored to audible speech waveform data after passing through an audio decoder. The sample phoneme data is encoded by a text encoder to obtain a text latent variable. The text latent variable is predicted to have its distribution representation through an affine layer (i.e., a distribution predictor). The distribution representation can be a mean, a standard deviation, etc. At the same time, the audio latent variable is passed through a regularized reversible stream function module to obtain a distribution representation of the audio latent variable. The distribution representation of the text latent variable and the distribution representation of the audio latent variable are input into a monotone alignment matcher together for matching learning. Through the monotone alignment matcher, it is possible to learn which audio latent variables correspond to each text latent variable, thereby learning the sound length information. For example, the distribution vector of the text latent variable of a certain phoneme is matched to the distribution vector of the audio latent variable of two frames, which means that the phoneme has pronounced the sound length of two frames, that is, the sound length is two frames. The real sound length mapping relationship matched by the monotone alignment matcher can be used as the real value of the sound length distribution to train the random sound length predictor. The input of the random sound length predictor is the text hidden variable, and the prediction result is the sound length information of each sample phoneme data.
[0089] The application process of the TTS model based on VITS (hereinafter referred to as the TTS model) is as follows: Figure 7 As shown, the trained TTS model includes: an audio decoder, a text encoder, a distribution predictor, a regularized reversible stream function module and a random tone length predictor.
[0090] When using the trained TTS model for speech synthesis, the input data is the phoneme data to be synthesized. The phoneme data is encoded by the text encoder to obtain text latent variables. The random sound length predictor predicts the sound length of the text latent variables to obtain the sound length prediction result of the phoneme data. At the same time, the text latent variables are input into the distribution predictor for distribution prediction to obtain the distribution representation of the text latent variables. The distribution representation of the text latent variables is at the phoneme level, and then according to the sound length prediction result, the phoneme representation is horizontally expanded, so that the distribution representation of the text latent variables is expanded from the character granularity to the frame level granularity. The expansion method example is as follows:
[0091] Distribution representation: [n I h ao];
[0092] Tone length prediction results: [1 3 1 4];
[0093] Expanded result: [n III h ao ao ao ao].
[0094] The expanded representation is at the frame level. The distribution representation at the frame level is then inversely calculated through the regularized reversible flow function to obtain the audio coding sampling value. The audio coding sampling value is then decoded by the audio decoder to obtain audible audio data.
[0095] It can be understood that in the VITS-based TTS model, the text encoder, distribution predictor, and regularized reversible stream function modules correspond to Figure 2 The feature extraction module, audio decoder and random tone length predictor of the embodiment shown correspond to Figure 2 The speech synthesis module of the illustrated embodiment. That is, in the TTS model based on VITS, an information transmission channel can be deployed between the output end of the regularized reversible stream function module and the input end of the audio decoder. Optionally, the model layer and parameters corresponding to the text encoder, distribution predictor and regularized reversible stream function module are isolated and encapsulated as the sending end of the speech synthesis system. The model layer and parameters corresponding to the audio decoder and the random sound length predictor are isolated and encapsulated as the receiving end of the speech synthesis system. The key generation module and the encryption module are connected to the sending end, and the decryption module is connected to the receiving end. Then, the information transmission channel is used to establish a communication connection between the encryption module and the decryption module, and the speech synthesis system can be obtained. In addition, the information transmission channel can also be deployed at other positions in the TTS model, such as the input end of the regularized reversible stream function module, the output end of the text encoder, etc. However, the subsequent input conditions of these deployment positions have vectors of other conditions in addition to the feature vector sequence, and the input composition is relatively complex, which increases the design cost of the encryption process. Therefore, deploying an information transmission channel between the output end of the regularized reversible flow function module and the input end of the audio decoder is a better approach, but it does not constitute the only limitation.
[0096] After building a speech synthesis system, you can use the speech synthesis system to perform secure speech synthesis. Figure 8 FIG. 1 is a schematic diagram of a speech synthesis method according to an embodiment of the present application. Figure 8As shown, the target phoneme data to be synthesized is input into the feature extraction module, and the first feature information of the target phoneme data, that is, the frame-level feature vector sequence, is extracted by the feature extraction module. The key generation module generates the key information corresponding to the target phoneme data, and the frame-level feature vector sequence and the key information are both input into the encryption module. The encryption module uses the key information to encrypt the frame-level feature vector sequence to obtain the encrypted frame-level feature vector sequence, or the encrypted feature vector sequence. The encrypted feature vector sequence and the key information are encapsulated as the sending information, and transmitted to the decryption module through the information transmission channel. After the decryption module uses the sending information, it disassembles the encrypted feature vector sequence and the key information from the sending information, and then uses the key information to decrypt the encrypted feature vector sequence to restore the frame-level feature vector sequence. After that, the frame-level feature vector sequence is subjected to speech synthesis by the speech synthesis module to obtain audio data.
[0097] It can be seen that in the speech synthesis method provided by this embodiment, since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the security of the information transmitted next time. In addition, since the technical solution is not limited to the use of any encryption method (such as symmetric encryption method or asymmetric encryption method, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext in the case of an unknown encryption method. Furthermore, since the key information encrypts the first feature information (i.e., the feature vector sequence at the frame level) of the target phoneme data, rather than encrypting the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as the feature vector sequence) is obtained. Without understanding the model structure of the speech synthesis model and the speech synthesis principle, it is impossible to restore the real speech content based on the feature information, thereby ensuring the data security in the speech synthesis process. If the speech synthesis system is applied to third-party applications, the voice service-related functions in the third-party applications are connected to the speech synthesis module of the speech synthesis system. Due to the high security of the speech synthesis system, encrypted data flows on the entire communication link, thus ensuring the security and privacy of the data, thereby ensuring that the third-party application receives secure audio data.
[0098] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recorded in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.
[0099] The above is a speech synthesis method provided in an embodiment of the present application. Based on the same idea, an embodiment of the present application also provides a speech synthesis device.
[0100] Fig. 9 is a schematic block diagram of a speech synthesis device according to an embodiment of the present application, such as Fig. 9 As shown, the device comprises:
[0101] An extraction module 91, used to extract first feature information of target phoneme data;
[0102] An encryption module 92, used to generate key information of the target phoneme data, and use the key information to encrypt the first feature information to obtain encrypted second feature information;
[0103] A decryption module 93, configured to decrypt the second characteristic information according to the key information to obtain the first characteristic information;
[0104] The speech synthesis module 94 is used to perform speech synthesis according to the first feature information to obtain audio data of the target phoneme data.
[0105] In one embodiment, the apparatus further comprises:
[0106] A first transmission module, configured to, after encrypting the first characteristic information by using the key information to obtain the encrypted second characteristic information, transmit the second characteristic information and the key information by using an information transmission channel;
[0107] When decrypting the second characteristic information according to the key information, the decryption module 93 performs the following steps:
[0108] With respect to the received second characteristic information and the key information, the second characteristic information is decrypted using the key information.
[0109] In one embodiment, the apparatus further comprises:
[0110] A second transmission module, used to transmit the second characteristic information and the key information to the information transmission channel through the first end of the speech synthesis system; the first end is used to extract the first characteristic information and encrypt the first characteristic information;
[0111] When the first transmission module transmits the second characteristic information and the key information through the information transmission channel, the first transmission module performs the following steps:
[0112] The second feature information and the key information transmitted by the first end are transmitted to the second end of the speech synthesis system through the information transmission channel; the second end is used to decrypt the second feature information according to the key information;
[0113] Wherein, the information transmission channel is deployed between the first end and the second end.
[0114] In one embodiment, the encryption module 92 performs the following steps when generating the key information of the target phoneme data:
[0115] The key information corresponding to the target phoneme data is generated according to a preset key generation rule; the key generation rule includes at least one of the following: information length of the key information, number of keys included in the key information, and key type.
[0116] In one embodiment, the key information includes N keys, where N is an integer greater than 1;
[0117] When the encryption module 92 encrypts the first characteristic information using the key information to obtain the encrypted second characteristic information, the encryption module 92 performs the following steps:
[0118] Splitting the first feature information into a plurality of first feature sequences, each of which includes N unit sequences;
[0119] According to a preset encryption algorithm, using the N keys, encryption calculations are performed on the multiple first feature sequences respectively to obtain multiple encrypted first feature sequences;
[0120] The multiple encrypted first feature sequences are combined to obtain the second feature information.
[0121] In one embodiment, the decryption module 94 decrypts the second feature information according to the key information, and when obtaining the first feature information, performs the following steps:
[0122] Splitting the second feature information into a plurality of second feature sequences, each of which includes N unit sequences;
[0123] According to a decryption algorithm corresponding to the encryption algorithm, and using the N keys, decryption calculations are performed on the multiple second feature sequences to obtain the multiple first feature sequences;
[0124] The multiple first feature sequences are combined to obtain the first feature information.
[0125] In one embodiment, the apparatus further comprises:
[0126] An acquisition module, used to acquire the first end of a pre-trained first speech synthesis model and the second end of a pre-trained second speech synthesis model;
[0127] A connection module is used to establish a communication connection between the first end and the second end by using the information transmission channel to obtain the speech synthesis system.
[0128] The device of the embodiment of the present application is used to generate key information corresponding to the target phoneme data, and use the key information to encrypt the first feature information of the target phoneme data to obtain the encrypted second feature information, and then decrypt the second feature information to obtain the first feature information, and then perform speech synthesis according to the first feature information. Since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the security of the information processed next time. In addition, since the technical solution is not limited to the use of any encryption method (such as symmetric encryption or asymmetric encryption, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext without knowing the encryption method. Furthermore, since the key information is used to encrypt the first feature information of the target phoneme data rather than the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as a feature vector sequence) is obtained. The real speech content cannot be restored based on the feature information alone, thereby ensuring data security during the speech synthesis process.
[0129] Those skilled in the art should understand that Fig. 9 The speech synthesis device in can be used to implement the speech synthesis method described above, and the detailed description thereof should be similar to the description of the method part above. To avoid tediousness, it will not be repeated here.
[0130] Based on the same idea, the embodiment of the present application also provides an electronic device, such as Fig.10As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and the memory 1002 may store one or more storage applications or data. Among them, the memory 1002 can be a short-term storage or a persistent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 1001 can be configured to communicate with the memory 1002 and execute a series of computer executable instructions in the memory 1002 on the electronic device. The electronic device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input and output interfaces 1005, and one or more keyboards 1006.
[0131] Specifically in this embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs are configured to be executed by one or more processors, including the following computer executable instructions:
[0132] Extracting first feature information of target phoneme data;
[0133] generating key information of the target phoneme data, and encrypting the first feature information by using the key information to obtain encrypted second feature information;
[0134] Decrypting the second characteristic information according to the key information to obtain the first characteristic information;
[0135] Speech synthesis is performed according to the first feature information to obtain audio data of the target phoneme data.
[0136] The technical solution of the embodiment of the present application is adopted, by generating key information corresponding to the target phoneme data, and using the key information to encrypt the first characteristic information of the target phoneme data, the encrypted second characteristic information is obtained, and then the second characteristic information is decrypted to obtain the first characteristic information, and then speech synthesis is performed according to the first characteristic information. Since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the information security of the next processing. In addition, since the technical solution is not limited to the use of any encryption method (such as symmetric encryption method or asymmetric encryption method, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext without knowing the encryption method. Furthermore, since the key information is used to encrypt the first feature information of the target phoneme data rather than the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as a feature vector sequence) is obtained. The real speech content cannot be restored based on the feature information alone, thereby ensuring data security during the speech synthesis process.
[0137] The embodiment of the present application further proposes a computer-readable storage medium, which stores one or more computer programs. The one or more computer programs include instructions. When the instructions are executed by an electronic device including multiple application programs, the electronic device can perform each process of the above-mentioned speech synthesis method embodiment, and is specifically used to perform:
[0138] Extracting first feature information of target phoneme data;
[0139] generating key information of the target phoneme data, and encrypting the first feature information by using the key information to obtain encrypted second feature information;
[0140] Decrypting the second characteristic information according to the key information to obtain the first characteristic information;
[0141] Speech synthesis is performed according to the first feature information to obtain audio data of the target phoneme data.
[0142] The technical solution of the embodiment of the present application is adopted, by generating key information corresponding to the target phoneme data, and using the key information to encrypt the first characteristic information of the target phoneme data, the encrypted second characteristic information is obtained, and then the second characteristic information is decrypted to obtain the first characteristic information, and then speech synthesis is performed according to the first characteristic information. Since the key information is generated for the target phoneme data after the target phoneme data is input, the key information is unique and targeted, and expires immediately after use. Compared with a password with long-term validity, it is less likely to be stolen and will not affect the information security of the next processing. In addition, since the technical solution is not limited to the use of any encryption method (such as symmetric encryption method or asymmetric encryption method, etc.), that is, the encryption method can be not fixed, it is not easy to be known by outsiders. Even if the key information is stolen, based on the short validity period and real-time generation characteristics of the key information, it is difficult for the thief to crack the ciphertext without knowing the encryption method. Furthermore, since the key information is used to encrypt the first feature information of the target phoneme data rather than the audio data itself, even if the key information is stolen and the thief cracks the encryption method, only the feature information (such as a feature vector sequence) is obtained. The real speech content cannot be restored based on the feature information alone, thereby ensuring data security during the speech synthesis process.
[0143] An embodiment of the present application provides a computer program product, including a computer program, which is executed by a processor to implement the various processes of the above-mentioned speech synthesis method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0144] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0145] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0146] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0147] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0148] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0150] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0151] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0152] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0153] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0154] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0155] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0156] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A speech synthesis method, characterized in that: include: Extracting first feature information of target phoneme data; generating key information of the target phoneme data, and encrypting the first feature information by using the key information to obtain encrypted second feature information; Decrypting the second characteristic information according to the key information to obtain the first characteristic information; Speech synthesis is performed according to the first feature information to obtain audio data of the target phoneme data.
2. The method according to claim 1, characterized in that After the first feature information is encrypted using the key information to obtain the encrypted second feature information, the method further includes: The second characteristic information and the key information are transmitted using an information transmission channel.
3. The method according to claim 2, characterized in that The method further comprises: The second characteristic information and the key information are transmitted to the information transmission channel through the first end of the speech synthesis system; the first end is used to extract the first characteristic information and encrypt the first characteristic information; The transmitting the second characteristic information and the key information by using an information transmission channel includes: The second feature information and the key information transmitted by the first end are transmitted to the second end of the speech synthesis system through the information transmission channel; the second end is used to decrypt the second feature information according to the key information; Wherein, the information transmission channel is deployed between the first end and the second end.
4. The method according to claim 1, characterized in that The key information for generating the target phoneme data includes: The key information of the target phoneme data is generated according to a preset key generation rule; the key generation rule includes at least one of the following: information length of the key information, number of keys included in the key information, and key type.
5. The method according to claim 4, characterized in that The key information includes N keys, where N is an integer greater than 1; The step of encrypting the first characteristic information by using the key information to obtain the encrypted second characteristic information includes: Splitting the first feature information into a plurality of first feature sequences, each of which includes N unit sequences; According to a preset encryption algorithm, using the N keys, encryption calculations are performed on the multiple first feature sequences respectively to obtain multiple encrypted first feature sequences; The multiple encrypted first feature sequences are combined to obtain the second feature information.
6. The method according to claim 5, characterized in that The decrypting the second characteristic information according to the key information to obtain the first characteristic information includes: Splitting the second feature information into a plurality of second feature sequences, each of which includes N unit sequences; According to a decryption algorithm corresponding to the encryption algorithm, and using the N keys, decryption calculations are performed on the multiple second feature sequences to obtain the multiple first feature sequences; The multiple first feature sequences are combined to obtain the first feature information.
7. The method according to claim 3, characterized in that The method further comprises: Acquire the first end of a pre-trained first speech synthesis model and the second end of a pre-trained second speech synthesis model; By using the information transmission channel, a communication connection is established between the first end and the second end to obtain the speech synthesis system.
8. A speech synthesis device, characterized in that: include: An extraction module, used for extracting first characteristic information of target phoneme data; an encryption module, used to generate key information of the target phoneme data, and use the key information to encrypt the first feature information to obtain encrypted second feature information; a decryption module, configured to decrypt the second characteristic information according to the key information to obtain the first characteristic information; A speech synthesis module is used to perform speech synthesis according to the first feature information to obtain audio data of the target phoneme data.
9. An electronic device, characterized in that: It comprises a processor and a memory electrically connected to the processor, the memory stores a computer program, and the processor is used to call and execute the computer program from the memory to implement the speech synthesis method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium is used to store a computer program, and the computer program can be executed by a processor to implement the speech synthesis method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program, wherein the computer program is executed by a processor to implement the speech synthesis method according to any one of claims 1 to 7.
