Acoustic index parallelization calculation method
The parallelized acoustic index computation method addresses the inefficiencies of traditional methods by distributing audio file processing across multiple nodes, enhancing computation efficiency for large audio datasets.
Patent Information
- Application Number
- CN202411246398.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Traditional methods for calculating acoustic indices are inefficient and unable to handle large volumes of audio data, leading to slow computation times and inability to meet the growing demands of audio data analysis in various fields.
A parallelized acoustic index computation method is introduced, utilizing a master node and multiple worker nodes to distribute audio files and perform calculations in parallel, creating task and result queues to manage the processing and output of audio files.
This approach significantly improves computation efficiency, enabling the handling of large audio files by distributing tasks across multiple nodes, thereby speeding up the calculation process and addressing the limitations of traditional methods.
Smart Images

Figure CN119724226A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of acoustic index analysis, and in particular to a parallelized calculation method for acoustic index. Background Art
[0002] Acoustic index is an important parameter to measure the intensity, frequency and characteristics of sound. It is crucial to understand and control the propagation, echo, attenuation and other aspects of sound in various environments and applications. It plays an important role in architectural design, audio engineering, biological research and medicine. With the development of science and technology and the progress of various fields, how to improve the efficiency of acoustic index calculation of audio files and shorten the calculation time has become a key technology. The traditional acoustic index calculation method is as follows: 1) A single process reads an audio file and analyzes it; 2) Analyze the audio file and calculate the result according to the formula of each acoustic index; 3) Display the results and proceed to parse the next audio file, repeating the above steps; However, the traditional acoustic index calculation method can only be applied to a small number of audio files with small data volume. With the increasing ability to obtain audio data in various fields and projects, the demand for analysis is increasing. Nowadays, the size and number of audio files are increasing exponentially. The traditional single-process algorithm cannot meet the actual response needs. In view of the above shortcomings, the present invention provides a parallelized calculation method for acoustic index, which aims to solve the problems that the existing acoustic index calculation method is not suitable for massive large-file audio scenes and has slow calculation efficiency. Summary of the invention
[0003] The technical problem to be solved by the present invention is to realize the applicability to massive large-file audio scenes and improve the calculation efficiency. In order to overcome the defects of the above-mentioned prior art (or related technology), the present invention provides a parallel calculation method of acoustic index.
[0004] The present invention provides a method for parallel calculation of acoustic indexes. A master node and multiple slave nodes are configured in advance on a host side, and each of the slave nodes is connected to the master node. The method for parallel calculation of acoustic indexes includes the following steps: Step S1, controlling the master node to create a task queue and a result queue, and controlling the master node to obtain multiple audio files and put them into the task queue; Step S2, controlling the master node to distribute each of the audio files in the task queue to each of the slave nodes; Step S3, for each of the slave nodes, controlling the slave node to calculate the acoustic index of the received audio file to obtain a corresponding acoustic index, and associating the audio file with the acoustic index and putting the result into the result queue; Step S4, determine whether the task queue is empty: If so, the process ends after each of the slave nodes completes processing the received audio file; If not, return to step S2.
[0005] Compared with the prior art, the acoustic index parallel calculation method of the present application has the following advantages: In the present application, step S1 is used to create a task queue and a result queue, and audio files are obtained and stored. Step S2 is used to distribute audio files, so that even in a massive large-file audio scenario, a large number of audio files can be processed through each slave node. Step S3 is used to perform parallel calculation of acoustic indexes. Step S4 is used to determine the empty set of the task queue to terminate or continue the execution process. The entire method flow can be applicable to massive large-file audio scenarios and improve computing efficiency through parallel computing.
[0006] In a possible implementation, step S3 includes: Step S31, for each of the slave nodes, controlling the slave node to divide the sound data in the received audio file according to the time step and the frequency band to obtain an intensity matrix, and obtaining the absolute difference between two adjacent intensity values in each frequency band based on the intensity matrix; Step S32, accumulating all the absolute differences in the sound data within a unit time to obtain a difference sum, and obtaining a corresponding ACI value according to the difference sum and each intensity value within the same unit time; Step S33: Accumulate the ACI values corresponding to all unit times and all frequency bands to obtain the acoustic index, and associate the audio file with the acoustic index and put them into the result queue.
[0007] In a possible implementation, in step S31, the absolute difference is obtained by the following calculation formula: in, represents the absolute difference; Indicates the intensity value; Indicates The intensity value.
[0008] In a possible implementation, in step S32, the sum of the differences is obtained by the following calculation formula: in, represents the sum of the differences; Indicates the number of subsets of each frequency band per unit time; represents the absolute difference; Indicates unit time.
[0009] In a possible implementation, in step S32, the ACI value is obtained by the following calculation formula: in, represents the ACI value; represents the sum of the differences; Indicates the number of subsets of each frequency band per unit time; Indicates The intensity value.
[0010] In a possible implementation, in step S33, the acoustic index is obtained by the following calculation formula: in, represents the acoustic index; Indicates the number of frequency bands; represents the number of time steps; Indicates the ACI value.
[0011] In a possible implementation manner, step S3 further includes: For each of the slave nodes, determine whether an abnormality occurs when the slave node receives the audio file or performs acoustic index calculation: If yes, put the audio file back into the task queue; If not, exit.
[0012] In a possible implementation manner, after executing step S3, the method further includes: Control the master node to write each of the audio files in the result queue and the corresponding acoustic indexes into a table, and determine whether at least one of the acoustic indexes is abnormal: If yes, display the abnormal information and skip the writing operation, and put the audio file corresponding to the abnormal acoustic index back into the task queue; If not, exit. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flow chart of the steps of the present invention; Figure 2 It is a schematic diagram of the parallel computing framework of the present invention; Figure 3 It is a specific flow chart of step S31 of the present invention. DETAILED DESCRIPTION
[0014] First, those skilled in the art should understand that these implementations are only used to explain the technical principles of the embodiments of the present application, and are not intended to limit the protection scope of the embodiments of the present application. Those skilled in the art can make adjustments to them as needed to adapt to specific application scenarios.
[0015] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] See also Figure 1 and Figure 2 , the present application embodiment discloses a parallelized acoustic index calculation method, including: In the first step, the master node reads the audio file to be calculated and puts it into the task queue; In the second step, the child node obtains the audio file from the task queue; In the third step, the child node parses the audio file and analyzes and calculates the audio file using the acoustic index calculation formula, and puts the calculation result into the result queue; In the fourth step, the master node checks the task queue to determine whether the task queue is empty. If it is not empty, the second and third steps are repeated. If it is empty, the process is terminated.
[0017] Continue to see Figure 1 ,In the first step S1, the master node creates the task ,result queue, the child node is connected to the master node through the ,same port, and the master node puts the audio file into the shared ,task queue.
[0018] See also Figure 3In the third step, i.e., step S3, each slave node has a function for calculating each acoustic index, and then receives the audio file sent by the master node from the task queue without duplication, reads the corresponding audio file according to the address, and performs the calculation of each acoustic index, such as the calculation process of Acoustic Diversity Index (ACI index captures instantaneous biological sounds by calculating the intensity changes of short-term sound signals, so as to better and quickly monitor animal dynamics): a section of sound data is divided into intensity matrices according to time steps and frequency bands, and the absolute difference between two adjacent intensity values of a single frequency band is expressed as: Then, all the sound data in a unit time are Add up the differences to get the total: Then, the ACI value is obtained by dividing the sum of the difference values by the sum of the intensity values of the sound data: The final acoustic index needs to include all unit times and all frequency bands, and the calculation formula is as follows: .
[0019] Continue to see Figure 1 This method takes into account some possible error situations and adds corresponding exception handling mechanisms, which can make the entire framework more complete and run more smoothly. The exception handling mechanism includes: 1. The subnode sets up a mechanism for reconnecting to the master node after a connection failure, to prevent connection failures caused by network or other problems; (ii) If an exception occurs when a child node receives an audio file or calculates an acoustic index, the child node reports the exception and puts the audio file back into the task queue; (III) When the master node takes out the audio file and its corresponding acoustic index from the result queue and writes them into the table, if it finds that the acoustic index is abnormal, it will display the abnormal information, skip the writing phase, and put the audio file back into the task queue for calculation; (iv) When an error occurs in each audio file, an error counter is incremented. If the number of errors exceeds a certain amount, the audio file is skipped and a warning is given; (V) When all audio files and their corresponding acoustic indexes are written and calculated, the master node sends a signal to end all processes.
[0020] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "in the present embodiment", "specific example", or "some examples" etc. means that the specific features, mechanisms, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, mechanisms, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0021] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A parallel calculation method for acoustic index, characterized in that: A master node and multiple slave nodes are configured in advance on the host side, and each of the slave nodes is connected to the master node respectively. The acoustic index parallel calculation method includes the following steps: Step S1, controlling the master node to create a task queue and a result queue, and controlling the master node to obtain multiple audio files and put them into the task queue; Step S2, controlling the master node to distribute each of the audio files in the task queue to each of the slave nodes; Step S3, for each of the slave nodes, controlling the slave node to calculate the acoustic index of the received audio file to obtain a corresponding acoustic index, and associating the audio file with the acoustic index and putting the result into the result queue; Step S4, determine whether the task queue is empty: If so, the process ends after each of the slave nodes completes processing the received audio file; If not, return to step S2.
2. The acoustic index parallel calculation method according to claim 1, characterized in that: The step S3 comprises: Step S31, for each of the slave nodes, controlling the slave node to divide the sound data in the received audio file according to the time step and the frequency band to obtain an intensity matrix, and obtaining the absolute difference between two adjacent intensity values in each frequency band based on the intensity matrix; Step S32, accumulating all the absolute differences in the sound data within a unit time to obtain a difference sum, and obtaining a corresponding ACI value according to the difference sum and each intensity value within the same unit time; Step S33: Accumulate the ACI values corresponding to all unit times and all frequency bands to obtain the acoustic index, and associate the audio file with the acoustic index and put them into the result queue.
3. The acoustic index parallel calculation method according to claim 2, characterized in that: In step S31, the absolute difference is obtained by the following calculation formula: in, represents the absolute difference; Indicates the intensity value; Indicates The intensity value.
4. The acoustic index parallel calculation method according to claim 2, characterized in that: In step S32, the sum of the differences is obtained by the following calculation formula: in, represents the sum of the differences; Indicates the number of subsets of each frequency band per unit time; represents the absolute difference; Indicates unit time.
5. The parallelized calculation method of acoustic index according to claim 2, characterized in that: In step S32, the ACI value is obtained by the following calculation formula: in, represents the ACI value; represents the sum of the differences; Indicates the number of subsets of each frequency band per unit time; Indicates The intensity value.
6. The acoustic index parallel calculation method according to claim 2, characterized in that: In step S33, the acoustic index is obtained by the following calculation formula: in, represents the acoustic index; Indicates the number of frequency bands; represents the number of time steps; Indicates the ACI value.
7. The acoustic index parallel calculation method according to claim 1, characterized in that: The step S3 also includes: For each of the slave nodes, determine whether an abnormality occurs when the slave node receives the audio file or performs acoustic index calculation: If yes, put the audio file back into the task queue; If not, exit.
8. The parallelized calculation method of acoustic index according to claim 1, characterized in that: After executing step S3, the method further includes: Control the master node to write each of the audio files in the result queue and the corresponding acoustic indexes into a table, and determine whether at least one of the acoustic indexes is abnormal: If yes, display the abnormal information and skip the writing operation, and put the audio file corresponding to the abnormal acoustic index back into the task queue; If not, exit.
Citation Information
Patent Citations
Method for visualizing soundscape information
CN105205091A
Acoustic index determination method and device and storage medium
CN113936688A
Speech-to-text processing based on a time-ordered classification of audio file segments
US8423361B1