A voiceprint registration method, device, equipment and storage medium
By combining multi-threaded concurrent processing of short audio files with single-threaded processing of long audio files, and audio storage tree management, the problem of low resource utilization in the voiceprint registration system is solved, improving efficiency and saving hardware costs.
Patent Information
- Application Number
- CN202210922630.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-02
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-08-02
AI Technical Summary
In existing voiceprint registration systems, the processor resources of computing devices are underutilized, resulting in low voiceprint registration efficiency. Furthermore, increasing the number of processors or engine server clusters will increase costs significantly.
By using multi-threaded concurrency to process short audio files and single-threaded processing to process long audio files, combined with keyword management of the audio storage tree, the audio storage and processing flow is optimized, improving resource utilization.
It effectively improves the efficiency of voiceprint registration, reduces hardware cost investment, avoids congestion of computing devices, and improves resource utilization.
Smart Images

Figure CN115292681B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of voiceprint registration, and in particular to a voiceprint registration method, device, equipment and storage medium. BACKGROUND
[0002] The voiceprint database has been widely applied in the fields of smart home, finance, public security and the like. The core technology of the voiceprint database is voiceprint registration. The general process of voiceprint registration is as follows: obtaining audio to be registered for voiceprint, and performing operation on the audio to be registered for voiceprint based on an operation device (such as a GPU server) to realize voiceprint registration.
[0003] With the increasing popularity of the voiceprint database application, the number of daily voiceprints registered is also increasing. The voiceprint registration efficiency mainly depends on the number of processors (such as GPUs) in the operation device, and the performance and utilization rate of each processor. Since the cost of the processor in the operation device is very high, how to fully utilize the processor in the operation device and improve the efficiency of voiceprint registration has become a problem to be solved at present. SUMMARY
[0004] Therefore, the present application provides a voiceprint registration method, device, equipment and storage medium to fully utilize the processor in the operation device and improve the efficiency of voiceprint registration. The technical solutions are as follows:
[0005] A voiceprint registration method comprises the following steps:
[0006] After obtaining each piece of audio to be registered, the audio to be registered is stored according to the time length of the audio to be registered, wherein the audio to be registered is audio to be registered for voiceprint.
[0007] A plurality of small file consumption service threads acquire first type audio from the stored audio, and a first type audio is registered for voiceprint based on an operation device. A single large file consumption service thread acquires second type audio from the stored audio, and the second type audio is registered for voiceprint based on the operation device, wherein the audio time length of the second type audio is greater than the audio time length of the first type audio.
[0008] Optionally, the step of storing the audio to be registered according to the time length of the audio to be registered comprises the following steps:
[0009] The audio to be registered is stored in a leaf node of an audio storage tree according to the time length of the audio to be registered.
[0010] The leaf node of the audio storage tree is used to store audio, and each leaf node takes the time length of the audio stored in the leaf node as a key.
[0011] Optionally, the storing the audio to be registered in a leaf node of the audio storage tree according to the length of the audio to be registered comprises:
[0012] In the case that there is an audio storage tree, determining a leaf node for storing the audio to be registered according to the length of the audio to be registered and the key of the leaf node of the audio storage tree, and storing the audio to be registered in the determined leaf node.
[0013] In the case that there is no audio storage tree, creating a root node with the length of the audio to be registered as the key, and storing the audio to be registered in the root node.
[0014] Optionally, the determining a leaf node for storing the audio to be registered according to the length of the audio to be registered and the key of the leaf node of the audio storage tree, and storing the audio to be registered in the determined leaf node comprises:
[0015] Determining a leaf node to be inserted with a target key as a target leaf node from the leaf nodes of the audio storage tree according to the length of the audio to be registered and the keys contained in the leaf nodes of the audio storage tree, wherein the target key is the length of the audio to be registered.
[0016] In the case that the target key exists in the keys contained in the target leaf node, determining the target leaf node as the leaf node for storing the audio to be registered, and storing the audio to be registered in an audio list corresponding to the target key on the target leaf node.
[0017] In the case that the target key does not exist in the keys contained in the target leaf node, inserting the target key in the target leaf node, and if the number of the keys contained in the target leaf node after inserting the target key is less than or equal to m, storing the audio to be registered in an audio list corresponding to the target key on the target leaf node; wherein m is the order of the audio storage tree.
[0018] Optionally, the determining a leaf node for storing the audio to be registered according to the length of the audio to be registered and the key of the leaf node of the audio storage tree, and storing the audio to be registered in the determined leaf node further comprises:
[0019] if the target key does not exist in the keys contained in the target leaf node, and if the number of keys contained in the target leaf node is greater than M after the target key is inserted, split the target leaf node into two nodes, so that one of the two split nodes contains part of the keys of the target leaf node, and the other of the two split nodes contains the other part of the keys of the target leaf node;
[0020] store the audio to be registered in the audio list corresponding to the target key in the node containing the target key among the two split nodes.
[0021] Optionally, the keys contained in each node of the audio storage tree are sorted by size.
[0022] The method further comprises:
[0023] After splitting the target leaf node into two nodes, move the middle position key of the target leaf node to the parent node of the two nodes.
[0024] After moving the middle position key to the parent node of the two nodes, if the number of keys contained in the parent node is greater than M, perform node splitting and key moving on the parent node.
[0025] Optionally, the acquiring of the first type of audio from the plurality of stored audios based on the plurality of small file consumption service threads comprises:
[0026] acquiring audio from the leaf node with the smallest key on the audio storage tree based on the plurality of small file consumption service threads.
[0027] The acquiring of the second type of audio from the plurality of stored audios based on the single large file consumption service thread comprises:
[0028] acquiring audio from the leaf node with the largest key on the audio storage tree based on the single large file consumption service thread.
[0029] Optionally, the acquiring of the first type of audio from the plurality of stored audios based on the plurality of threads comprises:
[0030] monitoring the resource utilization and resource growth value of the computing device, and determining the number of threads according to the resource utilization and resource growth value of the computing device;
[0031] acquiring the first type of audio from the plurality of stored audios based on the small file consumption service threads determined according to the number of threads.
[0032] Optionally, the monitoring of the resource utilization and the resource growth value of the operation device and the determination of the number of multi-threads according to the resource utilization and the resource growth value of the operation device comprises:
[0033] monitoring the resource utilization and the resource growth value of the operation device according to a preset period;
[0034] for each period:
[0035] determining a thread increasing and decreasing strategy according to the resource utilization and the resource growth value monitored in the period and a pre-constructed resource scheduling matrix;
[0036] determining the number of multi-threads used next according to the thread increasing and decreasing strategy, a preset thread increasing and decreasing number and a current thread number.
[0037] Optionally, the monitoring of the resource utilization and the resource growth value of the operation device and the determination of the number of multi-threads according to the resource utilization and the resource growth value of the operation device comprises:
[0038] monitoring the resource utilization and the resource growth value of the operation device according to a preset period;
[0039] for each period:
[0040] if the thread increasing and decreasing strategy is determined according to the resource utilization and the resource growth value monitored in the last period, the thread increasing and decreasing strategy is not determined in the current period, and the number of multi-threads is kept unchanged;
[0041] if the thread increasing and decreasing strategy is not determined in the last period, determining a thread increasing and decreasing strategy according to the resource utilization and the resource growth value monitored in the current period and a pre-constructed resource scheduling matrix, and determining the number of multi-threads used next according to the thread increasing and decreasing strategy, a preset thread increasing and decreasing number and a current thread number.
[0042] A voiceprint registration device comprises an audio storage module and a voiceprint registration module.
[0043] The audio storage module is configured to store a piece of to-be-registered audio according to a time length of the to-be-registered audio each time a piece of to-be-registered audio is obtained, wherein the to-be-registered audio is audio to be subjected to voiceprint registration.
[0044] The voiceprint registration module is configured to acquire a first type of audio from a plurality of pieces of stored audio based on a plurality of small file consumption service threads, and perform voiceprint registration on the acquired first type of audio based on an operation device; and acquire a second type of audio from a plurality of pieces of stored audio based on a single large file consumption service thread, and perform voiceprint registration on the acquired second type of audio based on the operation device, wherein an audio time length of the second type of audio is greater than an audio time length of the first type of audio.
[0045] A voiceprint registration device, comprising a memory and a processor;
[0046] The memory is configured to store a program.
[0047] The processor is configured to execute the program to implement each step of the voiceprint registration method.
[0048] A computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements each step of the voiceprint registration method.
[0049] The voiceprint registration method, device, equipment and storage medium provided by the present application, after obtaining each piece of audio to be registered, store the audio to be registered according to the time length of the audio to be registered, acquire first type audio (i.e. short audio) from the stored several pieces of audio based on multiple small file consumption service threads, and perform voiceprint registration on the acquired first type audio (i.e. short audio) based on the computing device. The second type audio (i.e. long audio) is acquired from the stored several pieces of audio based on a single large file consumption service thread, and the acquired second type audio (i.e. long audio) is subjected to voiceprint registration based on the computing device. The voiceprint registration method provided by the present application can effectively improve the resource utilization rate of the computing device and effectively improve the efficiency of voiceprint registration, thereby greatly saving hardware costs. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.
[0051] Figure 1 A flowchart of the voiceprint registration method provided by the embodiment of the present application;
[0052] Figure 2 An example of the audio storage tree provided by the embodiment of the present application;
[0053] Figure 3 A flowchart of determining a leaf node for storing the audio to be registered according to the time length of the audio to be registered and the keyword of the leaf node of the audio storage tree, and storing the audio to be registered to the determined leaf node provided by the embodiment of the present application;
[0054] Fig. 4 is an example of constructing and updating an audio storage tree according to an embodiment of the present application;
[0055] Figure 5 Fig. 5 is a flowchart of a process of acquiring a first type of audio from a plurality of audio stored in a storage based on a plurality of small file consumption service threads and performing voiceprint registration on the acquired first type of audio based on a computing device according to an embodiment of the present application;
[0056] Figure 6 Fig. 6 is a structural diagram of a voiceprint registration device according to an embodiment of the present application;
[0057] Figure 7 Fig. 7 is a structural diagram of a voiceprint registration device according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0059] In order to improve the efficiency of voiceprint registration, the present inventor has conducted research. The initial idea is to process the audio to be registered by using a multi-thread concurrent mode to achieve voiceprint registration.
[0060] In the process of implementing the above idea, the present inventor found that the duration of the audio to be registered for voiceprint registration varies from several tens of seconds to several tens of minutes. The voiceprint registration of an audio of about one minute takes about 5 seconds, and the voiceprint registration of an audio of several tens of minutes takes about several minutes. If multiple long audios (such as multiple audios of more than 10 minutes) are called to register voiceprints in a certain time period, several large resource exclusive threads and computing resources will appear, which will cause the computing device (such as a GPU server) to be congested. Moreover, as the number of concurrent users increases, the resource preemption phenomenon will become more serious, and the congestion situation will increase exponentially. Due to the exclusive occupation of computing resources by several large resource threads, the utilization rate of computing resources is only about 60%, and the computing efficiency cannot be fully utilized.
[0061] In view of the above problems, the present inventor thought that the number of computing resources such as GPUs could be increased, or the number of engine server clusters could be increased. However, this solution strategy has a large investment cost. In order to improve the utilization rate of computing resources and the efficiency of voiceprint registration without increasing the investment cost, the present inventor further conducted research and finally proposed a relatively good voiceprint registration method through continuous research.
[0062] Before introducing the voiceprint registration provided by the present application, the hardware architecture involved in the present application is described.
[0063] In a possible implementation manner, the hardware architecture involved in the present application can include an electronic device and a server.
[0064] Exemplarily, the electronic device can be any electronic product capable of human-computer interaction with a user, for example, a PC, a notebook computer, a tablet computer, a palm computer, a PAD, a mobile phone, etc.
[0065] Exemplarily, the server can be a server or a server cluster composed of multiple servers, or a cloud computing server center. The server can include a processor, a memory, a network interface, etc.
[0066] Exemplarily, the electronic device can establish a connection with the server and communicate through a wireless communication network; exemplarily, the electronic device can establish a connection with the server and communicate through a wired communication network.
[0067] The electronic device can send the audio to be registered for voiceprint or the download address of the audio to be registered for voiceprint to the server, and the server performs voiceprint registration on the audio to be registered for voiceprint according to the voiceprint registration method provided by the present application.
[0068] Those skilled in the art should understand that the above-mentioned electronic device and server are only examples, and other existing or future electronic devices or servers, such as those applicable to the present application, should also be included in the protection scope of the present application and are hereby included by reference.
[0069] Next, the voiceprint registration method provided by the present application is introduced through the following embodiments.
[0070] First Embodiment
[0071] Please refer to Figure 1 , which shows the flowchart of the voiceprint registration method provided by the embodiment of the present application, which can include:
[0072] Step S101: store the audio to be registered according to the time length of the audio to be registered every time a piece of audio to be registered is obtained.
[0073] The audio to be registered is the audio to be registered for voiceprint.
[0074] In this embodiment, the process of obtaining the audio to be registered includes: receiving a voiceprint registration request sent by a client, wherein the voiceprint registration request includes the audio to be registered or a download address (such as a URL) of the audio to be registered; if the audio to be registered is included in the voiceprint registration request, the audio to be registered is parsed from the voiceprint registration request; and if the download address of the audio to be registered is included in the voiceprint registration request, the audio to be registered is downloaded according to the download address of the audio to be registered.
[0075] After obtaining the audio to be registered, the audio to be registered can be stored according to the length of the audio to be registered. Optionally, if the length of the audio to be registered is a non-integer, the length of the audio to be registered is processed into an integer by means of rounding up, for example, the length of the audio to be registered is 1.4 minutes, and 1.4 is rounded up to 2. The audio length mentioned in the subsequent application is an integer length.
[0076] Step S102a: obtaining a first type of audio from a plurality of stored audios based on a plurality of small file consumption service threads, and performing voiceprint registration on the obtained first type of audio based on a computing device.
[0077] In this embodiment, the computing device performs voiceprint registration on the obtained first type of audio based on a voiceprint registration engine service. The first type of audio in this embodiment is a short audio. Optionally, the short audio can be defined as an audio with a length less than or equal to a preset length T, wherein the preset length T can be set according to specific circumstances, for example, the preset length T is 10 minutes.
[0078] In this embodiment, a plurality of small file consumption service threads are used to obtain a plurality of short audios from a plurality of stored audios, and then the plurality of short audios are processed in parallel.
[0079] Step S102b: obtaining a second type of audio from a plurality of stored audios based on a single large file consumption service thread, and performing voiceprint registration on the obtained second type of audio based on a computing device.
[0080] The second type of audio in this embodiment is a long audio. Optionally, the long audio can be defined as an audio with a length greater than a preset length T.
[0081] It should be noted that this embodiment does not limit the short audio to be an audio with a length less than or equal to a preset length T, and the long audio to be an audio with a length greater than a preset length T. For example, the plurality of stored audios are arranged in order of audio length from small to large, the short audio can be the first 90% of the audios, and the long audio can be the last 10% of the audios.
[0082] In this embodiment, a single large file consumption service thread is used to obtain a long audio from a plurality of stored audios, and then the long audio is processed.
[0083] The voiceprint registration method provided by the embodiment of the present application stores the to-be-registered audio according to the time length of the to-be-registered audio after obtaining each to-be-registered audio, acquires first-type audio (namely, short audio) from the stored several audios based on a plurality of small file consumption service threads, and performs voiceprint registration on the acquired first-type audio (namely, short audio) based on the operation device. The second-type audio (namely, long audio) is acquired from the stored several audios based on a single large file consumption service thread, and voiceprint registration is performed on the acquired second-type audio (namely, long audio) based on the operation device. In order to avoid the problem of large resource monopolization thread and operation resource, and further cause the congestion of the operation device, the present application proposes to perform voiceprint registration on the short audio in a multi-thread concurrent manner (concentrated processing of short audio), and perform voiceprint registration on the long audio in a single thread. This processing manner can effectively improve the resource utilization rate of the operation device, effectively improve the efficiency of voiceprint registration, and greatly save the hardware cost.
[0084] Second embodiment
[0085] The embodiment introduces the specific implementation process of "step S101: storing the to-be-registered audio according to the time length of the to-be-registered audio after obtaining each to-be-registered audio" in the above embodiment.
[0086] In a possible implementation manner, the process of storing the to-be-registered audio according to the time length of the to-be-registered audio after obtaining each to-be-registered audio can include: storing the to-be-registered audio in a leaf node of an audio storage tree according to the time length of the to-be-registered audio after obtaining each to-be-registered audio.
[0087] The audio storage tree is a tree for storing audio, please refer to Figure 2 , which shows an example of an audio storage tree. The leaf node of the audio storage tree is used to store audio, and each leaf node takes the time length of the audio stored in the leaf node as a key. The keys contained in the leaf node of the audio storage tree are sorted by size (for example, the keys contained in the leaf node of the audio storage tree are sorted in ascending order). The leaf nodes of the audio storage tree can be linked in order of key size.
[0088] When the to-be-registered audio is stored in the leaf node of the audio storage tree according to the time length of the to-be-registered audio, there are two cases: one is that there is already an audio storage tree, and the other is that there is no audio storage tree at present, that is, the to-be-registered audio obtained at present is the first to-be-registered audio. Next, the implementation process of storing the to-be-registered audio in the leaf node of the audio storage tree according to the time length of the to-be-registered audio in the two cases is introduced.
[0089] In the case of the current audio storage tree, the process of storing the audio to be registered in the leaf node of the audio storage tree according to the time length of the audio to be registered can include: creating a root node with the time length of the audio to be registered as the key (the root node at this time is also a leaf node), and storing the audio to be registered in the audio category corresponding to the target key (the target key refers to the time length of the audio to be registered) of the root node.
[0090] In the case of the current audio storage tree, the process of storing the audio to be registered in the leaf node of the audio storage tree according to the time length of the audio to be registered can include: according to the time length of the audio to be registered and the key of the leaf node of the audio storage tree, determining the leaf node for storing the audio to be registered, and storing the audio to be registered in the determined leaf node.
[0091] Please refer to Figure 3 , which shows that according to the time length of the audio to be registered and the key of the leaf node of the audio storage tree, the process of determining the leaf node for storing the audio to be registered and storing the audio to be registered in the determined leaf node can include:
[0092] Step S301: According to the time length of the audio to be registered and the key of the leaf node of the audio storage tree, the leaf node to be inserted into the target key is determined from the leaf node of the audio storage tree as the target leaf node.
[0093] Wherein, the target key is the time length of the audio to be registered.
[0094] Since the leaf node of the audio storage tree has audio time length as the key, the keys contained in the leaf node of the audio storage tree are sorted by size, so the leaf node to be inserted into the target key can be determined according to the time length of the audio to be registered (i.e. the target key) and the key of the leaf node of the audio storage tree.
[0095] For example, the audio storage tree has two leaf nodes, one of which has keys including [1, 4, 6], and the other has keys including [7, 8, 30], and the target key is 9, then the leaf node to be inserted into the target key is the leaf node with [7, 8, 30] as the key.
[0096] Step S302a: In the case that the target key exists in the several keys of the target leaf node, the target leaf node is determined as the leaf node for storing the audio to be registered.
[0097] For example, the time length of the audio to be registered is 5 minutes, i.e. the target key is 5, and if 5 exists in the several keys of the target leaf node, the target leaf node is determined as the leaf node for storing the audio to be registered.
[0098] Step S303a: store the audio to be registered into the audio list corresponding to the target keyword on the target leaf node.
[0099] For example, the duration of the audio to be registered is 5 minutes, i.e., the target keyword is 5, if there is 5 in the several keywords of the target leaf node, the audio to be registered is stored in the audio list corresponding to the keyword "5" on the target leaf node.
[0100] Step S302b: in the case that the target keyword does not exist in the several keywords of the target leaf node, insert the target keyword into the target leaf node.
[0101] It should be noted that if the keywords contained by the leaf nodes of the audio storage tree are sorted in ascending order, the target keyword is inserted into the target leaf node, and first the insertion position of the target keyword is determined to ensure that the keywords contained by the target leaf node are sorted in ascending order after the target keyword is inserted, and after the insertion position is determined, the target keyword is inserted into the determined insertion position. For example, the target keyword is 7, and the keywords contained by the target leaf node are [1, 6, 8], since 7 is greater than 6 and less than 8, 7 is inserted between 6 and 8, and after the target keyword 7 is inserted, the keywords contained by the target leaf node become [1, 6, 7, 8].
[0102] Optionally, the insertion position of the target keyword can be determined as follows:
[0103] Suppose the target keyword is t, the number of keywords of the target leaf node is n (n <= m), the insertion position to be inserted is index, and the keywords of the target leaf node are k[0], k[1]…k[n] in turn. The process of determining the insertion position is as follows:
[0104] (1) left = 0, right = n - 1, index = n;
[0105] (2) calculate middle = (left + right) / 2;
[0106] (3) if k[middle] < t, then left = middle + 1; if k[middle] >= t, then right = middle - 1, index = middle;
[0107] (4) if left > right, end the search, if left <= right, return to step (2).
[0108] For example, the keywords of the target leaf node are [1, 6, 7, 30], and the target keyword is 8. The process of determining the insertion position is as follows:
[0109] left = 0, right = 4 - 1 = 3, index = 4;
[0110] middle = (left + right) / 2 = (0 + 3) / 2 = 1;
[0111] k[middle] = k[1] = 6 < 8; left = middle + 1 = 1 + 1 = 2;
[0112] At this time, left < right, continue to search;
[0113] middle = (left + right) / 2 = (2 + 3) / 2 = 2;
[0114] k[middle] = k[2] = 7 < 8; left = middle + 1 = 2 + 1 = 3;
[0115] At this time, left = right, continue to search;
[0116] middle = (left + right) / 2 = (3 + 3) / 2 = 3;
[0117] k[middle] = k[3] = 30 > 8, then right = middle - 1 = 3 - 1 = 2, index = middle = 3;
[0118] At this time, left > right, end search, and the insertion position is index = 3.
[0119] After determining the insertion position index = 3, the target key 8 is inserted at the position to obtain [1, 6, 7, 8, 30].
[0120] Step S303b-a: If the number of keys in the target leaf node is less than or equal to m after inserting the target key, the audio to be registered is stored in the audio list corresponding to the target key in the target leaf node.
[0121] Wherein, m is the order of the audio storage tree.
[0122] For example, m = 4, the target key is 7, and after inserting the target key, the target leaf node contains the keys [1, 6, 7, 8]. Since the number of keys in the target leaf node does not exceed 4 after inserting the target key, the audio to be registered is stored in the audio list corresponding to the target key 7 in the target leaf node.
[0123] Step S303b-b: If the number of keys in the target leaf node is greater than m after the target key is inserted, split the target leaf node into two nodes, so that one of the two split nodes contains part of the keys of the target leaf node, and the other of the two split nodes contains the other part of the keys of the target leaf node, and store the audio to be registered in the node containing the target key in the audio list corresponding to the target key.
[0124] In the case where the number of keys in the target leaf node is greater than m, the target leaf node is split into two nodes, one of which (e.g., the left node) can contain keys, and the other of which (e.g., the right node) can contain keys. Alternatively, one of the two split nodes contains the keys of the target leaf node before the middle position key, and the other contains the middle position key and the keys after the middle position key.
[0125] For example, the order of the audio storage tree is 4, the target key is 8, and after the target key 8 is inserted, the keys of the target leaf node include [1, 6, 7, 8, 30]. Since the number of keys is greater than 4, the target node needs to be split into two nodes, one of which (e.g., the left node) contains keys [1, 6], and the other of which (e.g., the right node) contains keys [7, 8, 30].
[0126] For example, the order of the audio storage tree is 5, the target key is 8, and after the target key 8 is inserted, the keys of the target leaf node include [1, 6, 7, 8, 30, 32]. Since the number of keys is greater than 5, the target node needs to be split into two nodes, one of which (e.g., the left node) contains keys [1, 6, 7], and the other of which (e.g., the right node) contains keys [8, 30, 32]. It should be noted that 8 of [1, 6, 7, 8, 30, 32] is the middle position key.
[0127] After splitting the target node into two nodes, the middle position key of the target leaf node is moved up to the parent node of the two nodes. For the above target leaf node including keys [1, 6, 7, 8, 30], after splitting the target leaf node into two nodes (including keys [1, 6] and including keys [7, 8, 30]), the middle position key 7 of the target leaf node is moved up to the parent node.
[0128] After the middle position key of the target leaf node is moved up to the parent node, if the number of keys of the parent node is greater than m, the node splitting and key moving of the parent node is continued, and the processing mode of the node splitting and key moving of the parent node is similar to the mode of the node splitting and key moving of the target leaf node.
[0129] Next, the process of constructing and updating the audio storage tree is introduced in combination with a specific example.
[0130] Suppose that the audio with time length of {6, 30, 7, 1, 8, 4, 5, 8, 9, 7, 4, 10, 2, 12, 3, 52, 20, 18} is obtained in turn, and the process of constructing and updating the 4-order audio storage tree is as follows:
[0131] (1) Insert 6:
[0132] The root node is created, and the key 6 is inserted into the root node, and the audio storage tree at this time includes the root node with [6] as the key, as shown in Fig. 4(a).
[0133] (2) Insert 30:
[0134] The key 30 is inserted after the key 6 of the root node, and the audio storage tree at this time includes the root node with [6, 30] as the key, as shown in Fig. 4(b).
[0135] (3) Insert 7:
[0136] The key 7 is inserted between the keys 6 and 30 of the root node, and the audio storage tree at this time includes the root node with [6, 7, 30] as the key, as shown in Fig. 4(c).
[0137] (4) Insert 1:
[0138] The key 1 is inserted before the key 6 of the root node, and the audio storage tree at this time includes the root node with [1, 6, 7, 30] as the key, as shown in Fig. 4(d).
[0139] (5) Insert 8:
[0140] The key 8 is inserted between the keys 7 and 30 of the root node, and the keys of the root node include [1, 6, 7, 8, 30], and since the number of keys is greater than 4, the root node needs to be split into two nodes, one of which has [1, 6] as the key, and the other has [7, 8, 30] as the key, and the middle position key 7 of [1, 6, 7, 8, 30] is moved up to the parent node, and the audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 6] as the key, and the leaf node with [7, 8, 30] as the key, as shown in Fig. 4(e).
[0141] (6) Insert 4:
[0142] Insert key 4 in the leaf node with [1, 4, 6] as the key. The audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 4, 6] as the key, and the leaf node with [7, 8, 30] as the key, as shown in 4(f).
[0143] (7) Insert 5:
[0144] Insert key 5 in the leaf node with [1, 4, 6] as the key. The audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 4, 5, 6] as the key, and the leaf node with [7, 8, 30] as the key, as shown in 4(g).
[0145] (8) Insert 8:
[0146] Since the key 8 is already included in the key of the leaf node with [7, 8, 30] as the key, there is no need to insert the key 8 again. The audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 4, 5, 6] as the key, and the leaf node with [7, 8, 30] as the key, as shown in 4(h).
[0147] (9) Insert 9:
[0148] Insert key 9 in the leaf node with [7, 8, 30] as the key. The audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 4, 5, 6] as the key, and the leaf node with [7, 8, 9, 30] as the key, as shown in 4(i).
[0149] (10) Insert 7:
[0150] Since the key 7 is already included in the key of the leaf node with [7, 8, 9, 30] as the key, there is no need to insert the key 7 again. The audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 4, 5, 6] as the key, and the leaf node with [7, 8, 9, 30] as the key, as shown in 4(j).
[0151] (11) Insert 4:
[0152] Since the key 4 is already included in the key of the leaf node with [1, 4, 5, 6] as the key, there is no need to insert the key 4 again. The audio storage tree at this time includes the root node with [7] as the key, the leaf node with [1, 4, 5, 6] as the key, and the leaf node with [7, 8, 9, 30] as the key, as shown in 4(k).
[0153] (12) Insert 10:
[0154] The key 10 is inserted into the leaf node with the keys [7, 8, 9, 30], and after the insertion of the key 10, the keys become [7, 8, 9, 10, 30]. Since the number of keys is greater than 4, the leaf node needs to be split into two nodes, one of which has the keys [7, 8] and the other has the keys [9, 10, 30]. The middle key 9 of [7, 8, 9, 10, 30] is moved to the parent node, and the keys of the parent node change from [7] to [7, 9]. At this time, the audio storage tree includes the root node with the keys [7, 9], the leaf node with the keys [1, 4, 5, 6], the leaf node with the keys [7, 8], and the leaf node with the keys [9, 10, 30], as shown in 4(l).
[0155] (13) Insert 2:
[0156] The key 2 is inserted into the leaf node with the keys [1, 4, 5, 6], and after the insertion of the key 2, the keys become [1, 2, 4, 5, 6]. Since the number of keys is greater than 4, the leaf node needs to be split into two nodes, one of which has the keys [1, 2] and the other has the keys [4, 5, 6]. The middle key 4 of [1, 2, 4, 5, 6] is moved to the parent node, and the keys of the parent node change from [7, 9] to [4, 7, 9]. At this time, the audio storage tree includes the root node with the keys [4, 7, 9], the leaf node with the keys [1, 2], the leaf node with the keys [4, 5, 6], the leaf node with the keys [7, 8], and the leaf node with the keys [9, 10, 30], as shown in 4(m).
[0157] (14) Insert 12:
[0158] The key 12 is inserted into the leaf node with the keys [9, 10, 30], and after the insertion of the key 12, the keys become [9, 10, 12, 30]. At this time, the audio storage tree includes the root node with the keys [4, 7, 9], the leaf node with the keys [1, 2], the leaf node with the keys [4, 5, 6], the leaf node with the keys [7, 8], and the leaf node with the keys [9, 10, 12, 30], as shown in 4(n).
[0159] (15) Insert 3:
[0160] The key 3 is inserted into the leaf node with the keys [1, 2] and the inserted key 3 becomes [1, 2, 3], and the audio storage tree at this time includes the root node with the keys [4, 7, 9], the leaf node with the keys [1, 2, 3], the leaf node with the keys [4, 5, 6], the leaf node with the keys [7, 8], and the leaf node with the keys [9, 10, 12, 30], as shown in 4(o).
[0161] (16) Insert 52:
[0162] The key 52 is inserted into the leaf node with the keys [9, 10, 12, 30] and the inserted key 52 becomes [9, 10, 12, 30, 52], and since the number of keys is greater than 4, the leaf node needs to be split into two nodes, one of which has the keys [9, 10] and the other has the keys [12, 30, 52], and the middle key 12 of [9, 10, 12, 30, 52] is moved to the parent node, and the keys of the parent node change from [4, 7, 9] to [4, 7, 9, 12], and the audio storage tree at this time includes the root node with the keys [4, 7, 9, 12], the leaf node with the keys [1, 2, 3], the leaf node with the keys [4, 5, 6], the leaf node with the keys [7, 8], the leaf node with the keys [9, 10], and the leaf node with the keys [12, 30, 52], as shown in 4(p).
[0163] (17) Insert 20:
[0164] The key 20 is inserted into the leaf node with the keys [12, 30, 52] and the inserted key 20 becomes [12, 20, 30, 52], and the audio storage tree at this time includes the root node with the keys [4, 7, 9, 12], the leaf node with the keys [1, 2, 3], the leaf node with the keys [4, 5, 6], the leaf node with the keys [7, 8], the leaf node with the keys [9, 10], and the leaf node with the keys [12, 20, 30, 52], as shown in 4(q).
[0165] (18) Insert 18:
[0166] The keyword 18 is inserted into the leaf node with the keywords [12, 20, 30, 52], and after the insertion, the keywords are [12, 18, 20, 30, 52]. Since the number of keywords is greater than 4, the leaf node needs to be split into two nodes, one of which has the keywords [12, 18] and the other has the keywords [20, 30, 52]. The middle position keyword 20 of [12, 18, 20, 30, 52] is moved to the parent node, and the keywords of the parent node are changed from [4, 7, 9, 12] to [4, 7, 9, 12, 20]. Since the number of keywords of the parent node is greater than 4, the parent node needs to be split into two nodes, one of which has the keywords [4, 7] and the other has the keywords [9, 12, 20]. The middle position keyword 9 of [4, 7, 9, 12, 20] is moved to the parent node. At this time, the audio storage tree includes a root node with the keyword [9], an intermediate node with the keywords [4, 7], an intermediate node with the keywords [12, 20], a leaf node with the keywords [1, 2, 3], a leaf node with the keywords [4, 5, 6], a leaf node with the keywords [7, 8], a leaf node with the keywords [9, 10], a leaf node with the keywords [12, 18], and a leaf node with the keywords [20, 30, 52], as shown in 4(r).
[0167] Third embodiment
[0168] This embodiment introduces the specific implementation process of steps S102a and S102b in the above embodiment.
[0169] First, the specific implementation process of step S102a is introduced.
[0170] Please refer to Figure 5 , which shows the flowchart of "step S102a: based on a plurality of small file consumption service threads, acquiring a first type of audio from a plurality of stored audios, and based on an operation device, performing voiceprint registration on the acquired first type of audio". It can include:
[0171] Step S501: monitoring the resource utilization and resource growth value of the operation device, and determining the number of multi-thread based on the resource utilization and resource growth value of the operation device.
[0172] There are many implementation methods for step S501, and the following two implementation methods are provided in this embodiment:
[0173] First implementation method:
[0174] monitoring resource utilization and resource growth value of the operation device according to a preset period; determining a thread increase / decrease strategy according to the monitored resource utilization and resource growth value of the period and a pre-constructed resource scheduling matrix; and determining the number of the multi-threads to be used next according to the determined thread increase / decrease strategy, a preset thread increase / decrease number and a current thread number.
[0175] The resource growth value is the difference between the resource utilization of the current period and the resource utilization of the last period, i.e., the resource growth value is equal to the resource utilization of the current period minus the resource utilization of the last period.
[0176] The resource scheduling matrix is a matrix used to determine the thread increase / decrease strategy, and the resource scheduling matrix includes a plurality of elements and thread increase / decrease strategies corresponding to the plurality of elements respectively. Each element includes resource utilization and resource growth value, and the thread increase / decrease strategy corresponding to one element is one of the following strategies: increasing threads, decreasing threads, and not increasing / decreasing threads.
[0177] An example of the resource scheduling matrix is shown in Table 1, which is a resource scheduling matrix constructed for a GPU server. Each element in the resource scheduling matrix constructed for the GPU server includes GPU utilization and GPU growth value. "+" in the table indicates increasing threads, "-" indicates decreasing threads, and a blank position indicates not increasing / decreasing threads. For example, if the monitored GPU utilization of the current period is 0.1 and the GPU growth value is 15, the thread increase / decrease strategy can be determined as increasing threads. For another example, if the monitored GPU utilization of the current period is 0.4 and the GPU growth value is -20, the thread increase / decrease strategy can be determined as decreasing threads.
[0178] Table 1 Resource scheduling matrix
[0179]
[0180] The determining of the number of the multi-threads to be used next according to the determined thread increase / decrease strategy, the preset thread increase / decrease number and the current thread number includes: if the thread increase / decrease strategy is increasing threads, increasing threads by the preset thread increase / decrease number based on the current thread number; if the thread increase / decrease strategy is decreasing threads, decreasing threads by the preset thread increase / decrease number based on the current thread number; and if the thread increase / decrease strategy is not increasing / decreasing threads, keeping the current thread number unchanged.
[0181] For example, the GPU utilization rate monitored in the current period is 0.1, and the GPU growth value is 20. It is determined that the thread increase / decrease strategy is to increase threads. Assuming that the preset thread increase / decrease number is 1 and the current thread number is 3, it is determined that the number of threads to be used next is 4. For example, the GPU utilization rate monitored in the current period is 0.4, and the GPU growth value is -20. It is determined that the thread increase / decrease strategy is to decrease threads. Assuming that the preset thread increase / decrease number is 1 and the current thread number is 3, it is determined that the number of multi-threads to be used next is 2.
[0182] The second implementation manner is as follows:
[0183] The resource utilization rate and the resource growth value of the operation device are monitored according to a preset period. For each period: if the thread increase / decrease is performed according to the resource utilization rate and the resource growth value monitored in the last period, the thread increase / decrease strategy is not determined in the current period, and the number of multi-threads is kept unchanged. If the thread increase / decrease strategy is not determined in the last period, the thread increase / decrease strategy is determined according to the resource utilization rate and the resource growth value monitored in the current period and the resource scheduling matrix constructed in advance. The number of multi-threads to be used next is determined according to the thread increase / decrease strategy, the preset thread increase / decrease number and the current thread number.
[0184] It is to be noted that if the thread increase / decrease strategy determined according to the resource utilization rate and the resource growth value monitored in the last period is to increase / decrease threads or to decrease threads, the thread increase / decrease strategy is not determined in the current period. If the thread increase / decrease strategy is not determined according to the resource utilization rate and the resource growth value monitored in the last period, or the thread increase / decrease strategy determined according to the resource utilization rate and the resource growth value monitored in the last period is not to increase / decrease threads, the thread increase / decrease strategy is determined according to the resource utilization rate and the resource growth value monitored in the current period and the resource scheduling matrix constructed in advance. The number of multi-threads to be used next is determined according to the determined thread increase / decrease strategy, the preset thread increase / decrease number and the current thread number.
[0185] The related description of the resource scheduling matrix in the present implementation manner, and the specific implementation process and related description of “determining the thread increase / decrease strategy according to the resource utilization rate and the resource growth value monitored in the current period and the resource scheduling matrix constructed in advance, and determining the number of multi-threads to be used next according to the determined thread increase / decrease strategy, the preset thread increase / decrease number and the current thread number” can be referred to the related part in the first implementation manner, which will not be described herein.
[0186] In step S502, the small file consumption service thread based on the determined number of multi-threads acquires the first type of audio from the stored audio.
[0187] Optionally, the audio with the smallest key from the audio storage tree can be obtained by the small file consumption service thread based on the determined number of threads. For example, the determined number of threads is 4, and the leaf node with the smallest key from the audio storage tree is leaf node X. Then, 4 audios can be obtained from the leaf node X by the 4 small file consumption service threads. Optionally, when obtaining the audios, the audios can be obtained from the audio list corresponding to the smallest key. If the number of audios in the audio list corresponding to the smallest key is less than 4, audios can be obtained from the audio list corresponding to the second smallest key. For example, if the audio list corresponding to the smallest key of the leaf node X has more than or equal to 4 audios, 4 audios can be obtained from the audio list corresponding to the smallest key of the leaf node X by the 4 threads. If the audio list corresponding to the smallest key of the leaf node X has less than 4 audios, for example, 2 audios, 2 audios can be obtained from the audio list corresponding to the smallest key, and 2 audios can be obtained from the audio list corresponding to the second smallest key.
[0188] If the keys contained in the nodes of the audio storage tree are sorted in ascending order, the leftmost node can be found from the root node of the audio storage tree, and the audio can be obtained from the leftmost leaf node by the thread based on the determined number of threads.
[0189] Step S503: performing voiceprint registration on the obtained audio based on the operation device.
[0190] The obtained audio is operated based on the operation device to obtain a voiceprint feature.
[0191] Next, the implementation process of "Step S102b: obtaining the second type of audio from the stored audios based on a single large file consumption service thread, and performing voiceprint registration on the obtained second type of audio based on the operation device" will be introduced.
[0192] The process of obtaining the second type of audio from the stored audios based on a single large file consumption service thread, and performing voiceprint registration on the obtained second type of audio based on the operation device can include: obtaining the audio from the leaf node with the largest key from the audio storage tree based on the single large file consumption service thread, and performing voiceprint registration on the obtained second type of audio based on the operation device.
[0193] If the keys contained in the nodes of the audio storage tree are sorted in ascending order, the rightmost node can be found from the root node of the audio storage tree, and the audio can be obtained from the rightmost leaf node by the single large file consumption service thread.
[0194] Optionally, after the acquired audio is successfully registered for voiceprint, it can be deleted from the leaf node of the audio storage tree, so that only audio that has not been registered for voiceprint is stored on the audio storage tree.
[0195] In order to avoid large resource monopolization threads and operation resources, and further cause the congestion of the operation device, the application proposes to register the short audio for voiceprint in a multi-thread concurrent manner (centralized processing of short audio), and to register the long audio for voiceprint in a single thread. This processing manner can effectively improve the resource utilization rate of the operation device, effectively improve the efficiency of voiceprint registration, and greatly save the hardware cost.
[0196] Fourth embodiment
[0197] The embodiment of the application further provides a voiceprint registration device, and the voiceprint registration device provided by the embodiment of the application is described below. The voiceprint registration device described below can be correspondingly referred to the voiceprint registration method described above.
[0198] Please refer to Figure 6 , which shows the structure schematic diagram of the voiceprint registration device provided by the embodiment of the application, which can include an audio storage module 601 and a voiceprint registration module 602.
[0199] The audio storage module 601 is configured to store the audio to be registered according to the time length of the audio to be registered when obtaining the audio to be registered.
[0200] The audio to be registered is audio to be registered for voiceprint.
[0201] The voiceprint registration module 602 is configured to acquire first type audio from the stored audio based on a plurality of small file consumption service threads, and register the acquired first type audio for voiceprint based on an operation device; and acquire second type audio from the stored audio based on a single large file consumption service thread, and register the acquired second type audio for voiceprint based on the operation device; wherein the audio time length of the second type audio is greater than the audio time length of the first type audio.
[0202] Optionally, the audio storage module 601, when storing the audio to be registered according to the time length of the audio to be registered, is specifically configured to:
[0203] store the audio to be registered in the leaf node of the audio storage tree according to the time length of the audio to be registered;
[0204] The leaf node of the audio storage tree is configured to store audio, and each leaf node takes the time length of the audio stored in the leaf node as a key.
[0205] Optionally, the audio storage module 601 stores the audio to be registered in a leaf node of the audio storage tree according to the length of the audio to be registered, and specifically for:
[0206] In the case of an existing audio storage tree, a leaf node for storing the audio to be registered is determined according to the length of the audio to be registered and the keys of the leaf nodes of the audio storage tree, and the audio to be registered is stored in the determined leaf node.
[0207] In the case of no audio storage tree, a root node is created with the length of the audio to be registered as a key, and the audio to be registered is stored in the root node.
[0208] Optionally, when the audio storage module 601 determines a leaf node for storing the audio to be registered according to the length of the audio to be registered and the keys of the leaf nodes of the audio storage tree, and stores the audio to be registered in the determined leaf node, it is specifically for:
[0209] According to the length of the audio to be registered and the keys contained in the leaf nodes of the audio storage tree, a leaf node to be inserted with a target key is determined from the leaf nodes of the audio storage tree as a target leaf node, wherein the target key is the length of the audio to be registered.
[0210] In the case that the target key exists in the keys contained in the target leaf node, the target leaf node is determined as a leaf node for storing the audio to be registered, and the audio to be registered is stored in an audio list corresponding to the target key on the target leaf node.
[0211] In the case that the target key does not exist in the keys contained in the target leaf node, the target key is inserted into the target leaf node, and if the number of keys contained in the target leaf node after inserting the target key is less than or equal to m, the audio to be registered is stored in an audio list corresponding to the target key on the target leaf node; wherein m is the order of the audio storage tree.
[0212] Optionally, when the audio storage module 601 determines a leaf node for storing the audio to be registered according to the length of the audio to be registered and the keys of the leaf nodes of the audio storage tree, and stores the audio to be registered in the determined leaf node, it is also for:
[0213] if the target key does not exist in the target leaf node, and if the number of keys contained in the target leaf node is greater than M after the target key is inserted, the target leaf node is split into two nodes, one of the two split nodes contains part of the keys of the target leaf node, and the other of the two split nodes contains another part of the keys of the target leaf node;
[0214] The target audio is stored in an audio list corresponding to the target key in the node containing the target key among the two split nodes.
[0215] Optionally, the keys contained in each node of the audio storage tree are sorted by size.
[0216] The audio storage module 601 is further configured to, after splitting the target leaf node into two nodes, move an intermediate position key of the target leaf node to a parent node of the two nodes.
[0217] After moving the intermediate position key to the parent node of the two nodes, if the number of keys contained in the parent node is greater than M, the parent node is split and the keys are moved.
[0218] Optionally, the voiceprint registration module 602, when acquiring the first type of audio from the plurality of audio stored based on the plurality of small file consumption service threads, is specifically configured to:
[0219] acquire audio from a leaf node with the smallest key on the audio storage tree based on the plurality of small file consumption service threads.
[0220] The second type of audio is acquired from the plurality of audio stored based on the single large file consumption service thread, including:
[0221] acquire audio from a leaf node with the largest key on the audio storage tree based on the single large file consumption service thread.
[0222] Optionally, the voiceprint registration module 602, when acquiring the first type of audio from the plurality of audio stored based on the plurality of small file consumption service threads, is specifically configured to:
[0223] monitor resource utilization and resource growth value of the computing device, and determine the number of multi-threads according to the resource utilization and resource growth value of the computing device;
[0224] acquire the first type of audio from the plurality of audio stored based on the determined number of multi-threads.
[0225] Optionally, the voiceprint registration module 602, when monitoring the resource utilization and resource growth value of the computing device and determining the number of multithreading according to the resource utilization and resource growth value of the computing device, is specifically configured to:
[0226] monitor the resource utilization and resource growth value of the computing device according to a preset period;
[0227] for each period:
[0228] determine a thread increase / decrease strategy according to the resource utilization and resource growth value monitored in the period and a pre-constructed resource scheduling matrix;
[0229] determine the number of multithreading used next according to the thread increase / decrease strategy, a preset thread increase / decrease number and a current thread number.
[0230] Optionally, the voiceprint registration module 602, when monitoring the resource utilization and resource growth value of the computing device and determining the number of multithreading according to the resource utilization and resource growth value of the computing device, is specifically configured to:
[0231] monitor the resource utilization and resource growth value of the computing device according to a preset period;
[0232] for each period:
[0233] if the thread increase / decrease strategy is determined according to the resource utilization and resource growth value monitored in the last period, the determination of the thread increase / decrease strategy is not performed in the period, and the number of multithreading is kept unchanged;
[0234] if the determination of the thread increase / decrease strategy is not performed in the last period, determine a thread increase / decrease strategy according to the resource utilization and resource growth value monitored in the period and a pre-constructed resource scheduling matrix; and determine the number of multithreading used next according to the thread increase / decrease strategy, a preset thread increase / decrease number and a current thread number.
[0235] The voiceprint registration device provided by the embodiment of the present application stores the audio to be registered according to the time length of the audio to be registered after obtaining each piece of the audio to be registered, acquires the first type of audio (i.e., short audio) from the stored audio to be registered based on a plurality of small file consumption service threads, and performs voiceprint registration on the acquired first type of audio (i.e., short audio) based on the computing device. The second type of audio (i.e., long audio) is acquired from the stored audio to be registered based on a single large file consumption service thread, and voiceprint registration is performed on the acquired second type of audio (i.e., long audio) based on the computing device. In order to avoid the problem of large resource monopolization threads and computing resources, thereby causing congestion of the computing device, the voiceprint registration device provided by the embodiment of the present application performs voiceprint registration on short audio in a multi-thread concurrent manner (centralized processing of short audio), and performs voiceprint registration on long audio in a single thread. This processing manner can effectively improve the resource utilization rate of the computing device, effectively improve the efficiency of voiceprint registration, and greatly save hardware costs.
[0236] Fifth embodiment
[0237] The embodiment of the present application also provides a voiceprint registration device, please refer to Figure 7 , which shows the structure diagram of the voiceprint registration device. The voiceprint registration device can include at least one processor 701, at least one communication interface 702, at least one memory 703 and at least one communication bus 704.
[0238] In the embodiment of the present application, the number of processors 701, communication interfaces 702, memories 703 and communication buses 704 is at least one, and the processor 701, the communication interface 702, the memory 703 and the communication bus 704 complete the communication among each other through the communication bus 704.
[0239] The processor 701 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiment of the present application, etc.
[0240] The memory 703 can include a high-speed RAM memory, and can also include a non-volatile memory, etc., such as at least one disk memory.
[0241] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to:
[0242] After obtaining each piece of audio to be registered, the audio to be registered is stored according to the time length of the audio to be registered; wherein the audio to be registered is the audio to be registered for voiceprint registration;
[0243] The first type of audio is obtained from the plurality of audio stored in the memory based on a plurality of small file consumption service threads for voiceprint registration, and the second type of audio is obtained from the plurality of audio stored in the memory based on a single large file consumption service thread for voiceprint registration, wherein the audio duration of the second type of audio is greater than the audio duration of the first type of audio.
[0244] Optionally, the refinement function and the extension function of the program can refer to the description above.
[0245] Sixth embodiment
[0246] The embodiment of the application further provides a readable storage medium, which can store a program suitable for processor execution, and the program is used for:
[0247] After obtaining each piece of audio to be registered, the audio to be registered is stored according to the duration of the audio to be registered, wherein the audio to be registered is audio to be registered for voiceprint registration.
[0248] The first type of audio is obtained from the plurality of audio stored in the memory based on a plurality of small file consumption service threads for voiceprint registration, and the second type of audio is obtained from the plurality of audio stored in the memory based on a single large file consumption service thread for voiceprint registration, wherein the audio duration of the second type of audio is greater than the audio duration of the first type of audio.
[0249] Optionally, the refinement function and the extension function of the program can refer to the description above.
[0250] Finally, it should be noted that in this document, the terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0251] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between various embodiments can be referred to each other.
[0252] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Modifications of these embodiments will occur to persons of skill in the art, and that the appended claims are intended to cover all such modifications that do not depart from the true spirit and scope of the application. Therefore, the application is not limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A voiceprint registration method, characterized in that, include: Upon obtaining each audio file to be registered, the audio file is stored according to its duration; wherein, the audio file to be registered is the audio file to be registered for voiceprint. The system uses multiple small file consumption service threads to obtain a first type of audio from several stored audio files and performs voiceprint registration on the obtained first type of audio based on the computing device; and uses a single large file consumption service thread to obtain a second type of audio from several stored audio files and performs voiceprint registration on the obtained second type of audio based on the computing device; wherein the audio duration of the second type of audio is longer than that of the first type of audio.
2. The voiceprint registration method according to claim 1, characterized in that, The step of storing the audio to be registered according to its duration includes: Based on the duration of the audio to be registered, the audio to be registered is stored in the leaf node of the audio storage tree; The leaf nodes of the audio storage tree are used to store audio, and each leaf node uses the duration of the audio stored in that leaf node as its key.
3. The voiceprint registration method according to claim 2, characterized in that, The step of storing the audio to be registered in the leaf node of the audio storage tree according to the duration of the audio to be registered includes: Given an existing audio storage tree, the leaf node for storing the audio to be registered is determined based on the duration of the audio to be registered and the key of the leaf node of the audio storage tree, and the audio to be registered is stored in the determined leaf node. In the absence of an audio storage tree, a root node is created with the duration of the audio to be registered as the key, and the audio to be registered is stored in the root node.
4. The voiceprint registration method according to claim 3, characterized in that, The step of determining the leaf node for storing the audio to be registered based on the duration of the audio to be registered and the key of the leaf node of the audio storage tree, and storing the audio to be registered in the determined leaf node, includes: Based on the duration of the audio to be registered and the keywords contained in the leaf nodes of the audio storage tree, determine the leaf node from the leaf nodes of the audio storage tree into which the target keyword is to be inserted, and use it as the target leaf node, wherein the target keyword is the duration of the audio to be registered; If the target keyword exists among the several keywords contained in the target leaf node, the target leaf node is determined to be a leaf node for storing the audio to be registered, and the audio to be registered is stored in the audio list corresponding to the target keyword on the target leaf. If the target keyword is not present among the keywords contained in the target leaf node, the target keyword is inserted into the target leaf node. If, after inserting the target keyword, the number of keywords contained in the target leaf node is less than or equal to m, then the audio to be registered is stored in the audio list corresponding to the target keyword on the target leaf node; where m is the order of the audio storage tree.
5. The voiceprint registration method according to claim 4, characterized in that, The step of determining the leaf node for storing the audio to be registered based on the duration of the audio to be registered and the key of the leaf node of the audio storage tree, and storing the audio to be registered in the determined leaf node, further includes: If the target keyword is not present among the keywords contained in the target leaf node, and if the number of keywords contained in the target leaf node is greater than m after inserting the target keyword, then the target leaf node is split into two nodes, such that one of the two split nodes contains a portion of the keywords of the target leaf node, and the other of the two split nodes contains another portion of the keywords of the target leaf node. The audio to be registered is stored in the audio list corresponding to the target keyword on the node containing the target keyword in the two split nodes.
6. The voiceprint registration method according to claim 5, characterized in that, The keywords contained in each node of the audio storage tree are sorted by size; The method further includes: After splitting the target leaf node into two nodes, the middle key of the target leaf node is moved up to the parent node of the two nodes; After moving the middle keyword to the parent node of the two nodes, if the number of keywords contained in the parent node is greater than m, then the parent node is split and the keywords are moved up.
7. The voiceprint registration method according to claim 2, characterized in that, The process of retrieving the first type of audio from a stored set of audio files using multiple small file consumption service threads includes: Audio is obtained from the leaf node with the smallest key in the audio storage tree based on multiple small file consumption services; The process of retrieving the second type of audio from several stored audio files using a single large file consumption service thread includes: Audio is retrieved from the leaf node with the largest key in the audio storage tree based on a single large file consumption service thread.
8. The voiceprint registration method according to claim 1, characterized in that, The process of retrieving the first type of audio from a stored set of audio files using multiple small file consumption service threads includes: Monitor the resource utilization and resource growth of the computing device, and determine the number of multithreads based on the resource utilization and resource growth of the computing device; Based on a determined number of small file consumption service threads, the first type of audio is obtained from several stored audio files.
9. The voiceprint registration method according to claim 8, characterized in that, The monitoring of the resource utilization and resource growth of the computing device, and the determination of the number of multithreads based on the resource utilization and resource growth of the computing device, includes: Monitor the resource utilization and resource growth of the computing device according to a preset cycle; For each cycle: Based on the resource utilization and resource growth values monitored during this period, as well as the pre-built resource scheduling matrix, the thread addition and reduction strategy is determined. Based on the thread addition / reduction strategy, the preset number of threads to add / reduce, and the current number of threads, determine the number of multithreads to be used next.
10. The voiceprint registration method according to claim 8, characterized in that, The monitoring of the resource utilization and resource growth of the computing device, and the determination of the number of multithreads based on the resource utilization and resource growth of the computing device, includes: Monitor the resource utilization and resource growth of the computing device according to a preset cycle; For each cycle: If threads were added or removed based on the resource utilization and resource growth value monitored in the previous period, then no thread addition or removal strategy will be determined in this period, and the number of threads will remain unchanged. If the thread addition / reduction strategy was not determined in the previous period, the thread addition / reduction strategy will be determined based on the resource utilization and resource growth value monitored in this period and the pre-built resource scheduling matrix. Based on the thread addition / reduction strategy, the preset number of threads to add / reduce, and the current number of threads, determine the number of multithreads to be used next.
11. A voiceprint registration device, characterized in that, include: Audio storage module and voiceprint registration module; The audio storage module is used to store each audio to be registered according to its duration upon receiving it; wherein the audio to be registered is the audio to be registered for voiceprint. The voiceprint registration module is used to obtain a first type of audio from a number of stored audio files based on multiple small file consumption service threads, and to register the voiceprint of the obtained first type of audio based on a computing device; and to obtain a second type of audio from a number of stored audio files based on a single large file consumption service thread, and to register the voiceprint of the obtained second type of audio based on the computing device; wherein the audio duration of the second type of audio is longer than the audio duration of the first type of audio.
12. A voiceprint registration device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement each step of the voiceprint registration method as described in any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the various steps of the voiceprint registration method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Page downloading control method and system for IE (Internet Explorer) core browser
CN102368213A
File transfer method and device
CN103237049A