Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
CN116959405A - A speech synthesis method, device, electronic device and storage medium - Google Patents
[go: Go Back, main page]

CN116959405A - A speech synthesis method, device, electronic device and storage medium - Google Patents

A speech synthesis method, device, electronic device and storage medium Download PDF

Info

Publication number
CN116959405A
CN116959405A CN202311085447.9A CN202311085447A CN116959405A CN 116959405 A CN116959405 A CN 116959405A CN 202311085447 A CN202311085447 A CN 202311085447A CN 116959405 A CN116959405 A CN 116959405A
Authority
CN
China
Prior art keywords
target
target text
speech synthesis
data
speaker model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311085447.9A
Other languages
Chinese (zh)
Inventor
丛士钧
王桂彬
贾铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202311085447.9A priority Critical patent/CN116959405A/en
Publication of CN116959405A publication Critical patent/CN116959405A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L13/00Speech synthesis; Text to speech systems
    • G10L13/02Methods for producing synthetic speech; Speech synthesisers
    • G10L13/04Details of speech synthesis systems, e.g. synthesiser structure or memory management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The disclosure provides a voice synthesis method, a voice synthesis device, electronic equipment and a storage medium, relates to the technical field of artificial intelligence, and particularly relates to the technical field of deep learning and voice processing. The voice synthesis method is applied to cloud equipment provided with the artificial intelligent chip; the cloud end equipment deploys a plurality of speaker models in advance; the artificial intelligent chip comprises a plurality of computing cores for independently processing the voice synthesis request; the method comprises the following steps: receiving speech synthesis request data sent by a user, and adding the speech synthesis request data into a cache queue; the voice synthesis request data comprises at least one target text segment and a target speaker model designated by a user; and concurrently acquiring target text fragments from the cache queue, and respectively transmitting the target text fragments to different computing cores, so that the computing cores convert the target text fragments into corresponding voice data based on a target speaker model. The speech synthesis method and the speech synthesis device can improve speech synthesis efficiency under the scene of the multi-speaker model.

Description

一种语音合成方法、装置、电子设备和存储介质A speech synthesis method, device, electronic device and storage medium

技术领域Technical field

本公开涉及人工智能技术领域,尤其涉及深度学习、语音处理技术领域,具体涉及一种语音合成方法、装置、电子设备、存储介质和计算机程序产品。The present disclosure relates to the technical field of artificial intelligence, especially to the technical field of deep learning and speech processing, and specifically to a speech synthesis method, device, electronic equipment, storage medium and computer program product.

背景技术Background technique

语音合成技术又称文语转换(Text to Speech,TTS)技术,它能将文字信息实时转化为语音。在人机对话、远程语音信息服务、机器阅读、电信、娱乐等方面得到了广泛的应用。Speech synthesis technology, also known as Text to Speech (TTS) technology, can convert text information into speech in real time. It has been widely used in human-computer dialogue, remote voice information services, machine reading, telecommunications, entertainment, etc.

发明内容Contents of the invention

本公开提供了一种语音合成方法、装置、电子设备、存储介质和计算机程序产品。The present disclosure provides a speech synthesis method, device, electronic device, storage medium and computer program product.

根据本公开的一方面,提供了一种语音合成方法,应用于配置有人工智能芯片的云端设备;所述云端设备预先部署多个用于语音合成的发言人模型;所述人工智能芯片包括多个独立处理语音合成请求的计算核心;所述方法包括:According to one aspect of the present disclosure, a speech synthesis method is provided, which is applied to a cloud device configured with an artificial intelligence chip; the cloud device pre-deploys multiple speaker models for speech synthesis; the artificial intelligence chip includes multiple A computing core that independently processes speech synthesis requests; the method includes:

接收用户发送的语音合成请求数据,并添加到缓存队列中;其中,所述语音合成请求数据包括至少一个目标文本片段和用户指定的目标发言人模型;Receive speech synthesis request data sent by the user and add it to the cache queue; wherein the speech synthesis request data includes at least one target text segment and a target speaker model specified by the user;

并发的从所述缓存队列中获取所述目标文本片段,并将所述目标文本片段分别发送到不同的计算核心,使得所述计算核心基于目标发言人模型将所述目标文本片段转换成对应的语音数据。Concurrently obtain the target text fragments from the cache queue, and send the target text fragments to different computing cores respectively, so that the computing core converts the target text fragments into corresponding Voice data.

根据本公开的另一方面,提供了一种语音合成装置,配置于配置有人工智能芯片的云端设备;所述云端设备预先部署多个用于语音合成的发言人模型;所述人工智能芯片包括多个独立处理语音合成请求的计算核心;所述装置包括:According to another aspect of the present disclosure, a speech synthesis device is provided, configured in a cloud device equipped with an artificial intelligence chip; the cloud device pre-deploys a plurality of speaker models for speech synthesis; the artificial intelligence chip includes Multiple computing cores that independently process speech synthesis requests; the device includes:

数据接收与缓存模块,用于接收用户发送的语音合成请求数据,并添加到缓存队列中;其中,所述语音合成请求数据包括至少一个目标文本片段和用户指定的目标发言人模型;A data receiving and caching module, configured to receive speech synthesis request data sent by the user and add it to the cache queue; wherein the speech synthesis request data includes at least one target text segment and a target speaker model specified by the user;

数据提取并计算模块,用于并发的从所述缓存队列中获取所述目标文本片段,并将所述目标文本片段分别发送到不同的计算核心,使得所述计算核心基于目标发言人模型将所述目标文本片段转换成对应的语音数据。A data extraction and calculation module is used to obtain the target text fragments from the cache queue concurrently, and send the target text fragments to different computing cores respectively, so that the computing cores calculate all the target text fragments based on the target speaker model. The target text segment is converted into corresponding speech data.

根据本公开的另一方面,提供了一种电子设备,包括:According to another aspect of the present disclosure, an electronic device is provided, including:

至少一个处理器;以及at least one processor; and

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行本公开任意实施例所述的语音合成方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the speech synthesis method according to any embodiment of the present disclosure. .

根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使计算机执行本公开任意实施例所述的语音合成方法。According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause a computer to execute the speech synthesis method described in any embodiment of the present disclosure.

根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现本公开任意实施例的语音合成方法。According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When executed by a processor, the computer program implements the speech synthesis method of any embodiment of the present disclosure.

根据本公开的技术,可以提高多发言人模型场景下的语音合成效率。According to the technology of the present disclosure, the speech synthesis efficiency in a multi-speaker model scenario can be improved.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.

附图说明Description of the drawings

附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. in:

图1是根据本公开实施例的一种语音合成方法的流程示意图;Figure 1 is a schematic flow chart of a speech synthesis method according to an embodiment of the present disclosure;

图2是根据本公开实施例的另一种语音合成方法的流程示意图;Figure 2 is a schematic flowchart of another speech synthesis method according to an embodiment of the present disclosure;

图3是根据本公开实施例的另一种语音合成方法的流程示意图;Figure 3 is a schematic flowchart of another speech synthesis method according to an embodiment of the present disclosure;

图4是根据本公开实施例的另一种语音合成方法逻辑示意图;Figure 4 is a logical schematic diagram of another speech synthesis method according to an embodiment of the present disclosure;

图5是根据本公开实施例的语音合成装置的示意图;Figure 5 is a schematic diagram of a speech synthesis device according to an embodiment of the present disclosure;

图6是用来实现本公开实施例的语音合成方法的电子设备的框图。FIG. 6 is a block diagram of an electronic device used to implement the speech synthesis method according to an embodiment of the present disclosure.

具体实施方式Detailed ways

以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.

本申请方案中,为了给用户提供个性化的语音合成服务,在云端设备(例如云服务器设备)部署多个用于将文本转换成语音的发言人模型(例如预先训练的深度学习模型),且不同发言人模型的模型参数不同。为了提高语音合成的效率,云端设备可以采用CPU(Central Processing Unit,中央处理器)芯片提供算力或采用GPU(Graphics ProcessingUnit,图形处理器)芯片提供算力,但是这两种方式存在一定的不足:CPU芯片因为自身软硬件特征,无法单独操控CPU芯片的核心去处理语音合成请求,使得CPU芯片只能按照串行的方式处理接收到的语音合成请求,导致语音合成的效率较低;而采用GPU芯片提供算力时,一个云端设备部署的发言人模型的数量较少,且GPU芯片价格较贵,导致成本较大。基于此,本申请方案不采用CPU芯片和GPU芯片提供算力,而是采用适用于云端设备人工智能芯片提供算力,也即在云端设备中配置人工智能芯片,其中,人工智能芯片包括多个允许独立处理语音合成请求的计算核心;如此,基于人工智能芯片提供的可以单独操控计算核心的能力,实现语音合成,可以提高多发言人模型场景下的语音合成的效率。可选的,人工智能芯片可以是型号为MLU100的人工智能芯片,通过MLU100芯片不仅可以提高计算效率,还可以节省价格成本。在此基础上,本公开涉及的语音合成方法的具体流程,可以参见如下实施例。In this application solution, in order to provide users with personalized speech synthesis services, multiple speaker models (such as pre-trained deep learning models) for converting text into speech are deployed on cloud devices (such as cloud server devices), and Different speaker models have different model parameters. In order to improve the efficiency of speech synthesis, cloud devices can use CPU (Central Processing Unit, central processing unit) chips to provide computing power or GPU (Graphics Processing Unit, graphics processor) chips to provide computing power. However, these two methods have certain shortcomings. : Due to its own software and hardware characteristics, the CPU chip cannot independently control the core of the CPU chip to process speech synthesis requests, so that the CPU chip can only process the received speech synthesis requests in a serial manner, resulting in low efficiency of speech synthesis; while using When GPU chips provide computing power, the number of speaker models deployed on a cloud device is smaller, and GPU chips are more expensive, resulting in higher costs. Based on this, this application solution does not use CPU chips and GPU chips to provide computing power, but uses artificial intelligence chips suitable for cloud devices to provide computing power, that is, configuring artificial intelligence chips in cloud devices, where the artificial intelligence chips include multiple A computing core that allows independent processing of speech synthesis requests; in this way, speech synthesis based on the ability provided by the artificial intelligence chip to independently control the computing core can improve the efficiency of speech synthesis in multi-speaker model scenarios. Optionally, the artificial intelligence chip can be an artificial intelligence chip model MLU100. The MLU100 chip can not only improve computing efficiency, but also save price and cost. On this basis, for the specific process of the speech synthesis method involved in the present disclosure, please refer to the following embodiments.

图1是根据本公开实施例的一种语音合成方法的流程示意图。本实施例可适用于为基于多发言人模型为用户提供语音合成服务的场景;典型的,针对用户阅读电子书的情况,用户可以选择部分电子书文本,并从多个发言人模型中确定自己需要的发言人模型,进而根据用户选中的文本和发言人模型为用户合成对应语音的情况。该方法可由一种语音合成装置来执行,该装置采用软件和/或硬件的方式实现,优选是配置于电子设备中,例如配置在云端服务器设备中。Figure 1 is a schematic flowchart of a speech synthesis method according to an embodiment of the present disclosure. This embodiment can be applied to scenarios where speech synthesis services are provided to users based on multiple speaker models; typically, when users read e-books, users can select part of the e-book text and determine their own text from multiple speaker models. The required speaker model is then used to synthesize the corresponding speech for the user based on the text and speaker model selected by the user. The method can be performed by a speech synthesis device, which is implemented in software and/or hardware, and is preferably configured in an electronic device, such as a cloud server device.

如图1所示,该方法具体包括如下:As shown in Figure 1, the method specifically includes the following:

S101、接收用户发送的语音合成请求数据,并添加到缓存队列中。S101. Receive speech synthesis request data sent by the user and add it to the cache queue.

S102、并发的从所述缓存队列中获取所述目标文本片段,并将所述目标文本片段分别发送到不同的计算核心,使得所述计算核心基于目标发言人模型将所述目标文本片段转换成对应的语音数据。S102. Concurrently obtain the target text fragments from the cache queue, and send the target text fragments to different computing cores respectively, so that the computing core converts the target text fragments into Corresponding voice data.

本实施例中,每个用户发送的语音合成请求数据中包括至少一个需要转换成语音的目标文本片段和用户指定的目标发言人模型。示例性的,用户在通过移动终端阅读电子书时,可以选中一个或多个电子书文本片段,并触发语音合成功能,此时可以在移动终端中以弹窗形式展示用户可选择的发言人模型,进而在用户确定目标发言人模型后,移动终端通过网络通信将用户选中的至少一个目标文本片段和用户选中的目标发言人模型发送到云端设备中,也即云端设备接收用户发送的语音合成请求数据。需要说明的是,针对任一用户发送的语音合成请求数据,云端设备需要开启一个对应的线程来接收该用户的语音合成请求数据,如此可以实现并发接收不同用户的语音合成请求数据。进一步的,由于为云端设备提供算力的人工智能芯片允许单独操控每个计算核心,使得每个计算核心能够单独处理一个语音合成请求,也即单个计算核心可以将一个用户发送的目标文本片段转换成对应的语音,而人工智能芯片包括多个计算核心,如此可以并发的处理多个用户的语音合成请求。需要说明的是,若云端设备以CPU芯片提供算力,虽然CPU芯片也有多个计算核心,但是CPU芯片的计算核心无法单独操控,如此,在接到多个用户的语音合成请求后,CPU芯片只能按照串行的方式进行处理,导致整个语音合成效率较低。而采用人工智能芯片提供算力恰好能解决该问题。In this embodiment, the speech synthesis request data sent by each user includes at least one target text segment that needs to be converted into speech and a target speaker model specified by the user. For example, when reading an e-book on a mobile terminal, the user can select one or more e-book text fragments and trigger the speech synthesis function. At this time, the user-selectable speaker model can be displayed in a pop-up window on the mobile terminal. , and then after the user determines the target speaker model, the mobile terminal sends at least one target text segment selected by the user and the target speaker model selected by the user to the cloud device through network communication, that is, the cloud device receives the speech synthesis request sent by the user data. It should be noted that for the speech synthesis request data sent by any user, the cloud device needs to open a corresponding thread to receive the user's speech synthesis request data, so that the speech synthesis request data of different users can be received concurrently. Furthermore, since the artificial intelligence chip that provides computing power for cloud devices allows each computing core to be independently controlled, each computing core can independently process a speech synthesis request, that is, a single computing core can convert a target text fragment sent by a user. into corresponding speech, and the artificial intelligence chip includes multiple computing cores, so that multiple users' speech synthesis requests can be processed concurrently. It should be noted that if the cloud device uses a CPU chip to provide computing power, although the CPU chip also has multiple computing cores, the computing cores of the CPU chip cannot be controlled individually. Therefore, after receiving speech synthesis requests from multiple users, the CPU chip It can only be processed in a serial manner, resulting in low efficiency of the entire speech synthesis. The use of artificial intelligence chips to provide computing power can solve this problem.

进一步的,有时存在某一用户发送的语音合成请求中包括大量的目标文本片段情况,此时如果还通过一个计算核心处理该用户的语音合成请求时,该计算核心需要串行执行多次才能完成这个用户的语音合成请求。此时,如果其他用户的语音合成请求数量包括的目标文本片段较少,其他计算核心很快就处理完,如此可能会出现一个计算核心在工作,而其他计算核心处于空闲状态,使得各计算核心的负载不均衡,而且还影响该用户的语音合成效率。针对可能存在的这种问题,本公开方案预先设置了缓存队列,针对某一用户的语音合成请求数据包括大量目标文本片段的情况,先将该用户的语音合成请求数据中的目标文本片段添加到缓存队列中;进而通过并发的方式,将该用户的目标文本片段分发到不同的计算核心进行语音合成处理。例如,通过开启多个线程分别获取属于该用户的一定量的目标文本片段,并分发给不同的计算核心,使得每个计算核心基于用户指定的目标发言人模型将目标文本片段转换成对应的语音数据。进而将多个计算核心输出的语音数据进行拼接反馈给用户。如此实现了多个计算核心同时处理一个用户的语音合成请求数据,不仅保证了的计算核心的负载均衡,还保证了语音合成的效率。Furthermore, sometimes the speech synthesis request sent by a certain user includes a large number of target text fragments. At this time, if the user's speech synthesis request is also processed by a computing core, the computing core needs to be serially executed multiple times to complete. This user's speech synthesis request. At this time, if the number of speech synthesis requests from other users includes less target text fragments, other computing cores will finish processing them quickly. In this case, one computing core may be working while other computing cores are idle, causing each computing core to be idle. The load is not balanced, and it also affects the user's speech synthesis efficiency. In response to this possible problem, the disclosed solution pre-sets a cache queue. When a certain user's speech synthesis request data includes a large number of target text fragments, the target text fragments in the user's speech synthesis request data are first added to in the cache queue; and then distribute the user's target text fragments to different computing cores for speech synthesis processing in a concurrent manner. For example, multiple threads are opened to obtain a certain amount of target text fragments belonging to the user and distributed to different computing cores, so that each computing core converts the target text fragments into corresponding speech based on the target speaker model specified by the user. data. Then the voice data output by multiple computing cores are spliced and fed back to the user. In this way, multiple computing cores can simultaneously process a user's speech synthesis request data, which not only ensures the load balancing of the computing cores, but also ensures the efficiency of speech synthesis.

本实施例中,通过设置缓存队列来缓存用户的语音合成请求数据,以便后续通过多个计算核心同时处理该请求数据,不仅保证了计算核心的负载均衡,还提高了语音合成效率。In this embodiment, a cache queue is set up to cache the user's speech synthesis request data so that the request data can be processed simultaneously by multiple computing cores. This not only ensures load balancing of the computing cores, but also improves speech synthesis efficiency.

图2是根据本公开实施例的另一种语音合成方法的流程示意图。本公开实施例中,每个发言人模型预先关联有多个在线服务线程和多个内部计算线程。在此基础上,如图2所示,该语音合成方法具体包括如下步骤:Figure 2 is a schematic flowchart of another speech synthesis method according to an embodiment of the present disclosure. In the embodiment of the present disclosure, each speaker model is pre-associated with multiple online service threads and multiple internal computing threads. On this basis, as shown in Figure 2, the speech synthesis method specifically includes the following steps:

S201、通过目标发言人模型关联的在线服务线程,接收用户发送的语音合成请求数据,并添加到缓存队列中。S201. Receive the speech synthesis request data sent by the user through the online service thread associated with the target speaker model, and add it to the cache queue.

S202、通过目标发言人模型关联的内部计算线程,并发的从所述缓存队列中获取所述目标文本片段;并将所述目标文本片段分别发送到不同的计算核心,使得所述计算核心基于目标发言人模型将所述目标文本片段转换成对应的语音数据。S202. Concurrently obtain the target text fragments from the cache queue through the internal computing thread associated with the target speaker model; and send the target text fragments to different computing cores respectively, so that the computing cores are based on the target The speaker model converts the target text segments into corresponding speech data.

本实施例中,语音合成请求数据包括至少一个目标文本片段和用户指定的目标发言人模型。由于用户发送的语音合成请求数据中包括用户指定的目标发言人模型,因此可通过目标发言人模型关联的在线服务线程,接收用户发送的语音合成请求数据,并添加到缓存队列中。需要说明的是,每个发言人模型都预先关联多个在线服务线程,如此可以同时接收多个不同用户针对某一发言人模型的语音合成请求数据。In this embodiment, the speech synthesis request data includes at least one target text segment and a target speaker model specified by the user. Since the speech synthesis request data sent by the user includes the target speaker model specified by the user, the speech synthesis request data sent by the user can be received through the online service thread associated with the target speaker model and added to the cache queue. It should be noted that each speaker model is pre-associated with multiple online service threads, so that it can receive speech synthesis request data for a certain speaker model from multiple different users at the same time.

本实施例中,由于目标发言人模型预先关联有多个内部计算线程,如此可以通过目标发言人模型关联的内部计算线程,并发的从所述缓存队列中获取所述目标文本片段。需要说明的是,针对每个用户的语音合成请求数据中的目标文本片段都很少的情况,每个内部计算线程可以各自获取一个用户发送的语音合成请求数据,并发送到不同的计算核心进行语音合成处理,由此实现了多个计算核心并发处理不同用户的语音合成请求。而针对某一用户的语音合成请求数据中包括大量目标文本片段,而其他用户的语音合成请求数据中的目标文本片段的数量较少,可以通过多个内部计算线程并发获取该用户发送的目标文本片段,并发送到不同计算核心进行语音合成处理,如此实现了多个计算核心处理集中处理一个用户发送的目标文本片段,不仅可以提高语音合成效率,还可以保证各计算核心的负载均衡。In this embodiment, since the target speaker model is pre-associated with multiple internal calculation threads, the target text fragments can be concurrently obtained from the cache queue through the internal calculation threads associated with the target speaker model. It should be noted that for the situation where there are very few target text fragments in each user's speech synthesis request data, each internal computing thread can obtain the speech synthesis request data sent by a user and send it to different computing cores for processing. Speech synthesis processing enables multiple computing cores to concurrently process speech synthesis requests from different users. While the speech synthesis request data for a certain user includes a large number of target text fragments, while the speech synthesis request data for other users contains a smaller number of target text fragments, the target text sent by the user can be obtained concurrently through multiple internal computing threads. The fragments are sent to different computing cores for speech synthesis processing. This allows multiple computing cores to centrally process the target text fragments sent by one user. This not only improves speech synthesis efficiency, but also ensures load balancing of each computing core.

另外,需要说明的是,之所以设置在线服务线程和内部计算线程两种线程,是因为设置了缓存队列,需要这两种线程将向缓存队列添加数据和从缓存队列获取数据并分发。如果不设置缓存队列,各个在线服务线程会将各自接收的不同用户的语音合成请求数据发送到不同的计算核心去执行语音合成,此时如果某一在线服务线程接收的数据量众多,导致为该线程的数据提供算力的计算核心只能按顺序依次进行语音合成,使得该用户的语音合成效率低下。而且可能出现该计算核心还在处理语音合成请求,而其他计算核心已停止工作的负载不均衡的问题。In addition, it should be noted that the reason why the online service thread and the internal computing thread are set up is because the cache queue is set up, and these two threads are required to add data to the cache queue and obtain data from the cache queue and distribute it. If the cache queue is not set, each online service thread will send the speech synthesis request data received by different users to different computing cores to perform speech synthesis. At this time, if a certain online service thread receives a large amount of data, the result will be: The computing core whose thread data provides computing power can only perform speech synthesis in sequence, making the user's speech synthesis inefficient. Moreover, there may be a load imbalance problem in which the computing core is still processing speech synthesis requests, while other computing cores have stopped working.

本实施例中,每个发言人模型关联多个在线服务线程和内部计算线程,使得在线服务线程只接收与其自身关联的发言人模型需要处理的语音合成请求数据,内部计算线程只获取与其关联的发言人模型需要的文本数据。如此精准的使用用户选中的发言人模型进行语音合成。In this embodiment, each speaker model is associated with multiple online service threads and internal computing threads, so that the online service thread only receives the speech synthesis request data that needs to be processed by the speaker model associated with itself, and the internal computing thread only obtains the speech synthesis request data associated with it. Text data required by the speaker model. Such an accurate use of the speaker model selected by the user for speech synthesis.

进一步的,本实施例中,在将语音合成请求数据添加到缓存队列之前,在线服务线程还可以对语音合成请求数据中的目标文本片段进行预处理;其中,所述预处理是将目标文本片段转换成预设长度的文本数据;预设长度可以是发言人模型要求的数据长度。例如,目标文本片段的长度小于预设长度,则进行数据补全;若目标文本片段的长度大于预设长度,则对目标文本片段进行划分。如此,通过对目标文本片段进行预处理,使得后续分发到计算核心的文本数据是符合发言人模型要求的,不需要计算核心再做处理,保证了语音合成的效率。Further, in this embodiment, before adding the speech synthesis request data to the cache queue, the online service thread can also preprocess the target text fragment in the speech synthesis request data; wherein the preprocessing is to add the target text fragment to the cache queue. Convert to text data of preset length; the preset length can be the data length required by the speaker model. For example, if the length of the target text fragment is less than the preset length, data completion is performed; if the length of the target text fragment is greater than the preset length, the target text fragment is divided. In this way, by preprocessing the target text fragment, the text data subsequently distributed to the computing core meets the requirements of the speaker model and does not require further processing by the computing core, ensuring the efficiency of speech synthesis.

进一步的,在所述云端设备初始化阶段,针对任一发言人模型,对所述发言人模型所包括的算子进行融合;算子可选的是发言人模型中的运算函数。如此通过算子融合,后续进行语音合成时,可通过一个融合算子直接进行计算,不需要单独运算产生中间数据,避免了中间数据的产生以及中间数据在不同算子间的传递,可以保证计算效率。进而对算子融合后的发言人模型进行编译优化处理,可以减少在线编译时间。Further, during the initialization stage of the cloud device, for any speaker model, the operators included in the speaker model are fused; the operator optionally is an operation function in the speaker model. In this way, through operator fusion, when subsequent speech synthesis is performed, calculations can be performed directly through a fusion operator, without the need for separate operations to generate intermediate data. This avoids the generation of intermediate data and the transfer of intermediate data between different operators, and can ensure calculation efficiency. Then, the speaker model after operator fusion is compiled and optimized to reduce online compilation time.

图3是根据本公开实施例的另一种语音合成方法的流程示意图。本实施例中,多个发言人模型共享一个显存池;所述显存池包括多个预设的用于存数据的数据块,且所述数据块的数量与所述人工智能芯片的计算核心的数量相同。如图3所示,该方法具体包括如下:Figure 3 is a schematic flowchart of another speech synthesis method according to an embodiment of the present disclosure. In this embodiment, multiple speaker models share a video memory pool; the video memory pool includes a plurality of preset data blocks for storing data, and the number of the data blocks is related to the computing core of the artificial intelligence chip. The quantity is the same. As shown in Figure 3, the method specifically includes the following:

S301、接收用户发送的语音合成请求数据,并添加到缓存队列中。S301. Receive speech synthesis request data sent by the user and add it to the cache queue.

其中,所述语音合成请求数据包括至少一个目标文本片段和用户指定的目标发言人模型。可选的,通过所述目标发言人模型关联的在线服务线程,接收用户发送的语音合成请求数据,并添加到缓存队列中。需要说明的是,缓存队列存储的数据实际上保存在云端设备的运行内存中。Wherein, the speech synthesis request data includes at least one target text segment and a target speaker model specified by the user. Optionally, receive the speech synthesis request data sent by the user through the online service thread associated with the target speaker model, and add it to the cache queue. It should be noted that the data stored in the cache queue is actually stored in the running memory of the cloud device.

S302、并发的从所述缓存队列中获取所述目标文本片段;针对任一目标文本片段,将所述目标文本片段发送到所述显存池的处于空闲的目标数据块中。S302. Concurrently obtain the target text fragment from the cache queue; for any target text fragment, send the target text fragment to an idle target data block in the video memory pool.

可选的,通过目标发言人模型关联的多个内部计算线程,并发的从缓存队列中获取所述目标文本片段。需要说明的是,每个内部计算线程可以根据预设的收据获取参数batchsize,从缓存队列中获取所述目标文本片段。Optionally, the target text fragment is obtained concurrently from the cache queue through multiple internal calculation threads associated with the target speaker model. It should be noted that each internal computing thread can obtain the target text fragment from the cache queue according to the preset receipt acquisition parameter batchsize.

本实施例中,将人工智能芯片作为算力进行语音合成时,需要将语音合成请求包括的目标文本片段保存在人工智能芯片的显存中,人工智能芯片的计算核心才能根据相应的文本数据进行语音合成运算。也即需要将目标文本片段从运行内存中添加到人工智能芯片的显存中。In this embodiment, when using the artificial intelligence chip as computing power to perform speech synthesis, the target text fragment included in the speech synthesis request needs to be saved in the video memory of the artificial intelligence chip, so that the computing core of the artificial intelligence chip can perform speech synthesis based on the corresponding text data. Composite operations. That is, the target text fragment needs to be added from the running memory to the video memory of the artificial intelligence chip.

本实施例中,预先设置一个多个发言人模型共享显存池,该显存池包括多个预设的用于存数据的数据块,且所述数据块的数量与人工智能芯片的计算核心的数量相同。如此,内部计算线程在获取到目标文本片段后,只要将目标文本片段添加到空闲的数据块中即可,不需要每次都单独开辟一个显存空间来保存待合成语音的文本数据(即上文提到的目标文本片段)。可以从整体上保证语音合成的效率。In this embodiment, a video memory pool shared by multiple speaker models is preset. The video memory pool includes a plurality of preset data blocks for storing data, and the number of data blocks is equal to the number of computing cores of the artificial intelligence chip. same. In this way, after the internal computing thread obtains the target text fragment, it only needs to add the target text fragment to the free data block. There is no need to open up a separate video memory space each time to save the text data of the speech to be synthesized (i.e., the above mentioned target text fragment). It can ensure the efficiency of speech synthesis as a whole.

S303、轮询各计算核心当前所处的状态,并确定当前处于空闲状态的目标计算核心,使得所述目标计算核心利用所述目标发言人模型将目标数据块中的目标文本片段转换成语音数据。S303. Poll the current status of each computing core, and determine the target computing core that is currently idle, so that the target computing core uses the target speaker model to convert the target text fragment in the target data block into speech data. .

本实施例中,响应于将目标文本片段发送到显存池中处于空闲的目标数据块的操作,轮询各计算核心当前所处的状态,并确定当前处于空闲状态的目标计算核心,使得所述目标计算核心利用所述目标发言人模型将目标数据块中的目标文本片段转换成语音数据。In this embodiment, in response to the operation of sending the target text fragment to the idle target data block in the video memory pool, the current status of each computing core is polled, and the target computing core currently in the idle status is determined, so that the The target computing core converts the target text segments in the target data block into speech data using the target speaker model.

本实施例中,共用一个预先设置的显存池,避免每次处理语音合成请求时,都单独开辟一段显存空间来保存待合成语音的文本数据,可在整体上保证语音合成的效率。In this embodiment, a preset video memory pool is shared to avoid opening a separate video memory space to save the text data of the speech to be synthesized every time a speech synthesis request is processed, which can ensure the efficiency of speech synthesis as a whole.

进一步的,在将用户的目标文本片段合成语音数据后,将合成的语音数据反馈给所述用户,并将所述目标数据块中的目标文本片段清空,以便内部计算线程继续将待合成语音的目标文本片段保存在空闲的数据块中。Further, after the user's target text segment is synthesized into speech data, the synthesized speech data is fed back to the user, and the target text segment in the target data block is cleared so that the internal computing thread can continue to synthesize the speech data to be synthesized. The target text fragment is stored in a free data block.

图4是根据本公开实施例的另一种语音合成方法的逻辑示意图。如图4所示,其中。Model0表示一个部署在云端设备中的发言人模型,该发言人模型关联的在线服务线程分别为线程0、线程1、线程2、线程3;该发言人模型关联的内部计算线程示例性的为线程A、线程B、线程C;人工智能芯片的计算核心示例性的包括计算核心0、计算核心1……计算核心31。其他发言人模型与发言人模型Model0类似,不在图中进行显示。以Model0为例,对本公开的语音合成过程进行描述:在线服务线程(线程0、线程1、线程2、线程3)分别获取不同用户的语音合成请求数据(包括目标文本片段);其中,不同用户指的是指定利用Model0进行语音合成的不同用户。在线服务线程将获取的不同用户的语音合成请求数据添加到缓存队列中。进一步的,内部计算线程(线程A、线程B、线程C)并发的从缓存队列中获取目标文本片段,并发送到显存池中,以便不同的计算核心根据显存池的数据,利用Model0进行语音合成。需要说明的是,线程A、线程B、线程C各自获取的目标文本可以是属于同一用户,也可以分属于不同的用户;最后将合成结果输出并反馈给相应的用户。Figure 4 is a logic diagram of another speech synthesis method according to an embodiment of the present disclosure. As shown in Figure 4, where. Model0 represents a speaker model deployed in a cloud device. The online service threads associated with the speaker model are thread 0, thread 1, thread 2, and thread 3 respectively. The internal computing thread associated with the speaker model is, for example, thread A. Thread B, thread C; the computing cores of the artificial intelligence chip include, for example, computing core 0, computing core 1... and computing core 31. Other speaker models are similar to the speaker model Model0 and are not shown in the figure. Taking Model0 as an example, the speech synthesis process of the present disclosure is described: the online service threads (thread 0, thread 1, thread 2, and thread 3) respectively obtain speech synthesis request data (including target text fragments) of different users; among them, different users Refers to different users who specify using Model0 for speech synthesis. The online service thread adds the obtained speech synthesis request data of different users to the cache queue. Further, the internal computing threads (Thread A, Thread B, Thread C) concurrently obtain the target text fragments from the cache queue and send them to the video memory pool, so that different computing cores can use Model0 to perform speech synthesis based on the data in the video memory pool. . It should be noted that the target text obtained by thread A, thread B, and thread C can belong to the same user or different users; finally, the synthesis result is output and fed back to the corresponding user.

图5是根据本公开实施例的语音合成装置的结构示意图,本实施例可适用于为基于多发言人模型为用户提供语音合成的场景。该装置可实现本公开任意实施例所述的语音合成方法。该装置配置于配置有人工智能芯片的云端设备;所述云端设备预先部署多个用于语音合成的发言人模型;所述人工智能芯片包括多个独立处理语音合成请求的计算核心。如图5所示,该装置500具体包括:FIG. 5 is a schematic structural diagram of a speech synthesis device according to an embodiment of the present disclosure. This embodiment can be applied to a scenario in which speech synthesis is provided for users based on a multi-speaker model. The device can implement the speech synthesis method described in any embodiment of the present disclosure. The device is configured on a cloud device equipped with an artificial intelligence chip; the cloud device has pre-deployed multiple speaker models for speech synthesis; and the artificial intelligence chip includes multiple computing cores that independently process speech synthesis requests. As shown in Figure 5, the device 500 specifically includes:

数据接收与缓存模块501,用于接收用户发送的语音合成请求数据,并添加到缓存队列中;其中,所述语音合成请求数据包括至少一个目标文本片段和用户指定的目标发言人模型;The data receiving and caching module 501 is used to receive speech synthesis request data sent by the user and add it to the cache queue; wherein the speech synthesis request data includes at least one target text segment and a target speaker model specified by the user;

数据提取并计算模块502,用于并发的从所述缓存队列中获取所述目标文本片段,并将所述目标文本片段分别发送到不同的计算核心,使得所述计算核心基于目标发言人模型将所述目标文本片段转换成对应的语音数据。The data extraction and calculation module 502 is used to obtain the target text fragments from the cache queue concurrently, and send the target text fragments to different computing cores respectively, so that the computing cores calculate the target text fragments based on the target speaker model. The target text segments are converted into corresponding speech data.

在一种可选的实现方案中,每个发言人模型关联有多个在线服务线程;In an optional implementation, each speaker model is associated with multiple online service threads;

数据接收与缓存模块包括:Data receiving and caching modules include:

接收单元,用于通过所述目标发言人模型关联的在线服务线程,接收用户发送的语音合成请求数据。A receiving unit configured to receive speech synthesis request data sent by the user through an online service thread associated with the target speaker model.

在一种可选的实现方案中,每个发言人模型关联有多个内部计算线程;In an alternative implementation, each speaker model is associated with multiple internal computing threads;

数据提取并计算模块包括:Data extraction and calculation modules include:

提取单元,用于通过所述目标发言人模型关联的内部计算线程,并发的从所述缓存队列中获取所述目标文本片段。An extraction unit is configured to concurrently obtain the target text fragment from the cache queue through an internal computing thread associated with the target speaker model.

在一种可选的实现方案中,多个发言人模型共享一个显存池;所述显存池包括多个预设的用于存数据的数据块,且所述数据块的数量与所述人工智能芯片的计算核心的数量相同;In an optional implementation, multiple speaker models share a video memory pool; the video memory pool includes a plurality of preset data blocks for storing data, and the number of the data blocks is consistent with the artificial intelligence The chips have the same number of computing cores;

数据提取并计算模块还包括:The data extraction and calculation module also includes:

发送单元,用于针对任一目标文本片段,将所述目标文本片段发送到所述显存池的处于空闲的目标数据块中;A sending unit, configured to send any target text fragment to an idle target data block in the video memory pool;

计算单元,用于轮询各计算核心当前所处的状态,并确定当前处于空闲状态的目标计算核心,使得所述目标计算核心利用所述目标发言人模型将目标数据块中的目标文本片段转换成语音数据。A computing unit configured to poll the current status of each computing core and determine the target computing core that is currently idle, so that the target computing core uses the target speaker model to convert the target text fragment in the target data block. into voice data.

在一种可选的实现方案中,还包括:In an optional implementation, it also includes:

反馈与清空模块,用于将合成的语音数据反馈给所述用户,并将所述目标数据块中的目标文本片段清空。A feedback and clearing module is used to feed back the synthesized voice data to the user, and clear the target text segments in the target data block.

在一种可选的实现方案中,还包括:In an optional implementation, it also includes:

预处理模块,用于对所述语音合成请求数据中的目标文本片段进行预处理;其中,所述预处理是将目标文本片段转换成预设长度的文本数据。A preprocessing module, configured to preprocess target text segments in the speech synthesis request data; wherein the preprocessing is to convert the target text segments into text data of a preset length.

在一种可选的实现方案中,还包括:In an optional implementation, it also includes:

算子融合模块,用于在所述云端设备初始化阶段,针对任一发言人模型,对所述发言人模型所包括的算子进行融合;An operator fusion module is used to fuse the operators included in the speaker model for any speaker model during the initialization phase of the cloud device;

编译模块,用于对算子融合后的发言人模型进行编译优化处理。The compilation module is used to compile and optimize the speaker model after operator fusion.

在一种可选的实现方案中,所述人工智能芯片为MLU100芯片。In an optional implementation solution, the artificial intelligence chip is an MLU100 chip.

上述产品可执行本公开任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。The above-mentioned products can execute the methods provided by any embodiment of the present disclosure, and have corresponding functional modules and beneficial effects for executing the methods.

本公开的技术方案中,所涉及的用户个人信息的收集、存储、使用、加工、传输、提供和公开等处理,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with relevant laws and regulations and do not violate public order and good customs.

根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

图6示出了可以用来实施本公开的实施例的示例电子设备600的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。Figure 6 shows a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.

如图6所示,设备600包括计算单元601,其可以根据存储在只读存储器(ROM)602中的计算机程序或者从存储单元608加载到随机访问存储器(RAM)603中的计算机程序,来执行各种适当的动作和处理。在RAM 603中,还可存储设备600操作所需的各种程序和数据。计算单元601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6 , the device 600 includes a computing unit 601 that can execute according to a computer program stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random access memory (RAM) 603 Various appropriate actions and treatments. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. Computing unit 601, ROM 602 and RAM 603 are connected to each other via bus 604. An input/output (I/O) interface 605 is also connected to bus 604.

设备600中的多个部件连接至I/O接口605,包括:输入单元606,例如键盘、鼠标等;输出单元607,例如各种类型的显示器、扬声器等;存储单元608,例如磁盘、光盘等;以及通信单元609,例如网卡、调制解调器、无线通信收发机等。通信单元609允许设备600通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in device 600 are connected to I/O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as magnetic disk, optical disk, etc. ; and communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.

计算单元601可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元601的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种执行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元601执行上文所描述的各个方法和处理,例如语音合成方法。例如,在一些实施例中,语音合成方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元608。在一些实施例中,计算机程序的部分或者全部可以经由ROM 602和/或通信单元609而被载入和/或安装到设备600上。当计算机程序加载到RAM 603并由计算单元601执行时,可以执行上文描述的语音合成方法的一个或多个步骤。备选地,在其他实施例中,计算单元601可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行语音合成方法。Computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that execute machine learning model algorithms, digital signal processing processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as speech synthesis methods. For example, in some embodiments, the speech synthesis method may be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 600 via ROM 602 and/or communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the speech synthesis method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the speech synthesis method in any other suitable manner (eg, by means of firmware).

本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、复杂可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip implemented in a system (SOC), complex programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.

用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of this disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)、区块链网络和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上执行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务中,存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式系统的服务器,或者是结合了区块链的服务器。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs executing on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as cloud computing server or cloud host. It is a host product in the cloud computing service system to solve the problems of difficult management and weak business scalability in traditional physical hosts and VPS services. defect. The server can also be a distributed system server or a server combined with a blockchain.

人工智能是研究使计算机来模拟人的某些思维过程和智能行为(如学习、推理、思考、规划等)的学科,既有硬件层面的技术也有软件层面的技术。人工智能硬件技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理等技术;人工智能软件技术主要包括计算机视觉技术、语音识别技术、自然语言处理技术及机器学习/深度学习技术、大数据处理技术、知识图谱技术等几大方向。Artificial intelligence is the study of using computers to simulate certain human thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It has both hardware-level technology and software-level technology. Artificial intelligence hardware technology generally includes sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing and other technologies; artificial intelligence software technology mainly includes computer vision technology, speech recognition technology, natural language processing technology and machine learning/depth Learning technology, big data processing technology, knowledge graph technology and other major directions.

云计算(cloud computing),指的是通过网络接入弹性可扩展的共享物理或虚拟资源池,资源可以包括服务器、操作系统、网络、软件、应用和存储设备等,并可以按需、自服务的方式对资源进行部署和管理的技术体系。通过云计算技术,可以为人工智能、区块链等技术应用、模型训练提供高效强大的数据处理能力。Cloud computing refers to a flexible and scalable shared physical or virtual resource pool through network access. Resources can include servers, operating systems, networks, software, applications, storage devices, etc., and can be on-demand and self-service. A technical system for deploying and managing resources. Through cloud computing technology, it can provide efficient and powerful data processing capabilities for artificial intelligence, blockchain and other technology applications and model training.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开提供的技术方案所期望的结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the present disclosure can be executed in parallel, sequentially, or in a different order. As long as the desired results of the technical solution provided by the present disclosure can be achieved, there is no limitation here.

上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the scope of the present disclosure. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this disclosure shall be included in the protection scope of this disclosure.

Claims (19)

1. A speech synthesis method is applied to cloud equipment configured with an artificial intelligent chip; the cloud device deploys a plurality of speaker models for speech synthesis in advance; the artificial intelligent chip comprises a plurality of computing cores for independently processing the voice synthesis request; the method comprises the following steps:
receiving speech synthesis request data sent by a user, and adding the speech synthesis request data into a cache queue; wherein the speech synthesis request data comprises at least one target text segment and a target speaker model specified by a user;
and concurrently acquiring the target text fragments from the cache queue, and respectively sending the target text fragments to different computing cores, so that the computing cores convert the target text fragments into corresponding voice data based on a target speaker model.
2. The method of claim 1, wherein each speaker model is associated with a plurality of online service threads;
receiving speech synthesis request data sent by a user, wherein the speech synthesis request data comprises:
and receiving voice synthesis request data sent by a user through the online service thread associated with the target speaker model.
3. The method of claim 1, wherein each speaker model is associated with a plurality of internal computing threads;
concurrently obtaining the target text segment from the cache queue includes:
and concurrently acquiring the target text fragments from the cache queue through the internal computing threads associated with the target speaker model.
4. The method of claim 1, wherein a plurality of speaker models share a video pool; the video memory pool comprises a plurality of preset data blocks for storing data, and the number of the data blocks is the same as the number of the computing cores of the artificial intelligent chip;
sending the target text segments to different computing cores respectively, so that the computing cores convert the target text segments into corresponding voice data based on a target speaker model, and the method comprises the following steps:
for any target text segment, the target text segment is sent to a target data block which is free in the video memory pool;
and polling the current state of each computing core, and determining the target computing core in the idle state, so that the target computing core converts the target text segment in the target data block into voice data by using the target speaker model.
5. The method of claim 4, further comprising:
and feeding the synthesized voice data back to the user, and emptying the target text segment in the target data block.
6. The method of claim 1, further comprising:
preprocessing a target text segment in the voice synthesis request data; the preprocessing is to convert the target text segment into text data with preset length.
7. The method of claim 1, further comprising:
in the cloud equipment initialization stage, aiming at any speaker model, fusing operators included in the speaker model;
and compiling and optimizing the speaker model after operator fusion.
8. The method of claim 1, wherein the artificial intelligence chip is an MLU100 chip.
9. A voice synthesis device is configured on a cloud device configured with an artificial intelligent chip; the cloud device deploys a plurality of speaker models for speech synthesis in advance; the artificial intelligent chip comprises a plurality of computing cores for independently processing the voice synthesis request; the device comprises:
the data receiving and caching module is used for receiving voice synthesis request data sent by a user and adding the voice synthesis request data into a cache queue; wherein the speech synthesis request data comprises at least one target text segment and a target speaker model specified by a user;
the data extraction and calculation module is used for obtaining the target text fragments from the cache queue in a concurrent mode, and sending the target text fragments to different calculation cores respectively, so that the calculation cores convert the target text fragments into corresponding voice data based on a target speaker model.
10. The apparatus of claim 9, wherein each speaker model is associated with a plurality of online service threads;
the data receiving and buffering module comprises:
and the receiving unit is used for receiving the voice synthesis request data sent by the user through the online service thread associated with the target speaker model.
11. The apparatus of claim 9, wherein each speaker model is associated with a plurality of internal computing threads;
the data extraction and calculation module comprises:
and the extraction unit is used for concurrently acquiring the target text fragments from the cache queue through the internal calculation threads associated with the target speaker model.
12. The apparatus of claim 9, wherein a plurality of speaker models share a video memory pool; the video memory pool comprises a plurality of preset data blocks for storing data, and the number of the data blocks is the same as the number of the computing cores of the artificial intelligent chip;
the data extraction and computation module further comprises:
the sending unit is used for sending the target text fragments to the idle target data blocks in the video memory pool aiming at any target text fragment;
and the computing unit is used for polling the current state of each computing core and determining the target computing core in the idle state, so that the target computing core converts the target text segment in the target data block into voice data by using the target speaker model.
13. The apparatus of claim 12, further comprising:
and the feedback and emptying module is used for feeding the synthesized voice data back to the user and emptying the target text segment in the target data block.
14. The apparatus of claim 9, further comprising:
the preprocessing module is used for preprocessing the target text segment in the voice synthesis request data; the preprocessing is to convert the target text segment into text data with preset length.
15. The apparatus of claim 9, further comprising:
the operator fusion module is used for fusing operators included in the speaker model aiming at any speaker model in the cloud equipment initialization stage;
and the compiling module is used for compiling and optimizing the speaker model after operator fusion.
16. The apparatus of claim 9, wherein the artificial intelligence chip is an MLU100 chip.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the speech synthesis method of any one of claims 1-8.
18. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the speech synthesis method according to any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the speech synthesis method according to any of claims 1-8.
CN202311085447.9A 2023-08-25 2023-08-25 A speech synthesis method, device, electronic device and storage medium Pending CN116959405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311085447.9A CN116959405A (en) 2023-08-25 2023-08-25 A speech synthesis method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311085447.9A CN116959405A (en) 2023-08-25 2023-08-25 A speech synthesis method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN116959405A true CN116959405A (en) 2023-10-27

Family

ID=88446406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311085447.9A Pending CN116959405A (en) 2023-08-25 2023-08-25 A speech synthesis method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116959405A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118968998A (en) * 2024-07-30 2024-11-15 中国移动通信集团福建有限公司 End-cloud voice interaction method, device, electronic device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118968998A (en) * 2024-07-30 2024-11-15 中国移动通信集团福建有限公司 End-cloud voice interaction method, device, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN113377520B (en) Resource scheduling method, device, equipment and storage medium
KR20210090123A (en) Distributed model training methods, related devices and computer program
KR20210090122A (en) Distributed model training apparatus, methods and computer program
CN110489440B (en) Data query method and device
JP7412489B2 (en) Federated learning methods and devices, electronic devices, storage media and computer programs
WO2023201981A1 (en) Mixture-of-experts model implementation method and system, electronic device, and storage medium
CN109783472A (en) Moving method, device, computer equipment and the storage medium of table data
KR20220009338A (en) Configuration method, device, electronic equipment and computer storage medium of modeling parameters
CN114911596B (en) Scheduling method and device for model training, electronic equipment and storage medium
US10395658B2 (en) Pre-processing partial inputs for accelerating automatic dialog response
KR20220104106A (en) Voice synthesizing method, device, electronic equipment and storage medium
CN114582339A (en) Voice interaction method and device, electronic equipment and medium
CN117130524A (en) Interactive methods, devices, electronic devices and storage media
CN113724398A (en) Augmented reality method, apparatus, device and storage medium
CN113434218B (en) Microservice configuration method, apparatus, electronic device and medium
WO2025055266A1 (en) Image processing method and apparatus, device, and medium
CN116959405A (en) A speech synthesis method, device, electronic device and storage medium
JP7265618B2 (en) Method and Apparatus for Optimizing Processor Memory for Deep Learning Training Tasks
JP2021193619A (en) Dialog generation method, device, electronic apparatus and storage medium
CN115034198B (en) Method for optimizing computation of embedded module in language model
CN116594708A (en) Method, device, equipment and medium for generating multi-model loading configuration file
CN118433039A (en) Node communication method and device during model training
CN114860455B (en) A request processing method, device, equipment and storage medium
CN117278648A (en) Protocol dynamic adaptation method, device, electronic equipment and storage medium
CN116932147A (en) Streaming job processing method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination