An acoustic index parallelization calculation method
By using a master-slave node parallel computing method, the problem of low efficiency in traditional acoustic index calculation is solved, and efficient calculation is achieved in scenarios with massive amounts of large audio files, thus improving computing efficiency and applicability.
Patent Information
- Application Number
- CN202411246398.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Traditional acoustic index calculation methods are not applicable to massive large-file audio scenarios, have low computational efficiency, and cannot meet actual response requirements.
A parallel computing method using a master node and multiple slave nodes is adopted. By creating task queues and result queues, audio files are distributed to slave nodes for parallel acoustic index calculation, and the process ends when the task queue is empty.
It achieves efficient computation in scenarios with massive amounts of large audio files, improving computational efficiency, applicability, and processing capabilities.
Smart Images

Figure CN119724226B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of acoustic index analysis, and in particular to an acoustic index parallelization calculation method. BACKGROUND
[0002] The acoustic index is an important parameter for measuring the intensity, frequency and characteristics of sound, and is crucial for understanding and controlling the propagation, echo, attenuation, etc. of sound in various environments and applications, and plays an important role in architectural design, audio engineering, biological research and medical fields. With the development of science and technology and the progress of various fields, how to improve the acoustic index calculation efficiency of audio files and shorten the calculation time has become a key technology. The traditional acoustic index calculation method has the following process:
[0003] 1) A single process reads an audio file and performs analysis;
[0004] 2) The audio file is parsed, and the results are calculated according to the formula of each acoustic index;
[0005] 3) The results are displayed and the parsing of the next audio file is performed, and the above steps are repeated;
[0006] However, the traditional acoustic index calculation method can only be applied to a small amount of data and a small amount of audio files. With the increasing demand for audio data acquisition and analysis in various fields and engineering, the size and number of audio files are increasing exponentially. The traditional single-process algorithm cannot meet the actual response requirements. In view of the above problems, the present application provides an acoustic index parallelization calculation method, which aims to solve the problems of the existing acoustic index calculation method that is not suitable for massive audio files, slow calculation efficiency, etc. SUMMARY
[0007] The technical problem to be solved by the present application is to realize the application of massive audio files and improve the calculation efficiency. In order to overcome the defects of the above prior art (or related technology), the present application provides an acoustic index parallelization calculation method.
[0008] The present application provides an acoustic index parallelization calculation method, which pre-configures a master node and a plurality of slave nodes on a host, and establishes a connection between each slave node and the master node. The acoustic index parallelization calculation method comprises the following steps:
[0009] Step S1, controlling the master node to create a task queue and a result queue, and controlling the master node to obtain a plurality of audio files and put them into the task queue;
[0010] Step S2, controlling the master node to distribute each audio file in the task queue to each slave node;
[0011] Step S3, for each of the slave nodes, controlling the slave nodes to perform acoustic index calculation on the received audio file to obtain a corresponding acoustic index, and putting the audio file and the acoustic index into the result queue after association;
[0012] Step S4, judging whether the task queue is empty:
[0013] If yes, ending the process after each of the slave nodes completes processing of the received audio file;
[0014] If no, returning to step S2.
[0015] Compared with the prior art, the acoustic index parallelization calculation method has the following advantages:
[0016] In the present application, the task queue and the result queue are created through step S1, and the audio file is obtained and stored. Through step S2, the audio file is distributed, so that even in a massive file audio scene, a large number of audio files can be processed by each slave node. Through step S3, the acoustic index is calculated in parallel, and through step S4, the empty set of the task queue is judged to end or continue the process. The whole method flow can realize the application in a massive file audio scene, and improve the calculation efficiency through parallel calculation.
[0017] In a possible implementation, the step S3 includes:
[0018] Step S31, for each of the slave nodes, controlling the slave nodes to divide the sound data in the received audio file by time step and frequency band to obtain an intensity matrix, and obtaining the absolute difference value of each frequency band adjacent two intensity values based on the intensity matrix;
[0019] Step S32, accumulating all the absolute difference values in a unit of time in the sound data to obtain a difference sum, and obtaining a corresponding ACI value according to the difference sum and each of the intensity values in the same unit of time;
[0020] Step S33, accumulating all the ACI values corresponding to all the units of time and all the frequency bands to obtain the acoustic index, and putting the audio file and the acoustic index into the result queue after association.
[0021] In a possible implementation, in the step S31, the absolute difference value is obtained through the following calculation formula:
[0022]
[0023] wherein,
[0024] represents the absolute difference value;
[0025] represents the intensity value of the i-th;
[0026] represents the intensity value of the i-th;
[0027] In one possible implementation, in the step S32, the difference sum is obtained by the following calculation formula:
[0028]
[0029] wherein,
[0030] represents the difference sum;
[0031] represents the number of subsets of each frequency band per unit time;
[0032] represents the absolute difference value;
[0033] represents the unit time.
[0034] In one possible implementation, in the step S32, the ACI value is obtained by the following calculation formula:
[0035]
[0036] wherein,
[0037] represents the ACI value;
[0038] represents the difference sum;
[0039] represents the number of subsets of each frequency band per unit time;
[0040] represents the intensity value of the i-th;
[0041] In one possible implementation, in the step S33, the acoustic index is obtained by the following calculation formula:
[0042]
[0043] wherein,
[0044] representing the acoustic index;
[0045] representing the number of the frequency bands;
[0046] representing the number of the time steps;
[0047] representing the ACI value.
[0048] In a possible implementation, the step S3 further comprises:
[0049] For each slave node, it is determined whether the slave node is abnormal when fetching the audio file or performing acoustic index calculation:
[0050] If yes, the audio file is put back to the task queue;
[0051] If no, exit.
[0052] In a possible implementation, after performing the step S3, the method further comprises:
[0053] controlling the master node to write each audio file in the result queue and the corresponding acoustic index into a table, and determining whether at least one acoustic index is abnormal:
[0054] If yes, display abnormal information and skip the writing operation, and put the audio file corresponding to the abnormal acoustic index back to the task queue;
[0055] If no, exit. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 is a step flowchart of the present application;
[0057] Figure 2 is a parallel computing framework schematic diagram of the present application;
[0058] Figure 3 is a specific flowchart of the step S31 of the present application. DETAILED DESCRIPTION
[0059] Firstly, 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 adjust them as needed in order to adapt to specific application occasions.
[0060] The present application will be further described in detail below in combination with the drawings and specific embodiments.
[0061] Referring toFigure 1 and Figure 2 The embodiment of the present application discloses an acoustic index parallel computing method, comprising:
[0062] Firstly, the master node reads the audio file to be calculated and puts it into the task queue;
[0063] Secondly, the slave node obtains the audio file from the task queue;
[0064] Thirdly, the slave node analyzes and calculates the audio file through the acoustic index calculation formula, and puts the calculation result into the result queue;
[0065] Fourthly, the master node checks the task queue, judges whether the task queue is empty, if not, repeats the second step and the third step, if yes, ends the process.
[0066] Continuing to refer to Figure 1 In the first step, i.e., step S1, the master node creates the task and result queues, the slave node is connected to the master node through the same port, and the master node puts the audio file into the shared task queue.
[0067] Referring to Figure 3 In the third step, i.e., step S3, each slave node has a function for calculating each acoustic index, then repeatedly obtains the audio file sent by the master node from the task queue, reads the corresponding audio file according to the address, and executes the calculation of each acoustic index, such as the calculation process of the Acoustic Diversity Index (ACI index, which captures the instantaneous biological sound by calculating the intensity change of the short-term sound signal, and better monitors the animal dynamics quickly): a sound data is divided according to the time step and the frequency band to obtain an intensity matrix, then the absolute difference value of two adjacent intensity values of a single frequency band is expressed as:
[0068]
[0069] Then, all the differences in the unit time in the sound data are accumulated to obtain the total difference sum:
[0070]
[0071] Subsequently, the total difference sum is divided by the total sum of the intensity values of the sound data to obtain the ACI value:
[0072]
[0073] And finally, the acoustic index needs to contain all the unit time and all the frequency bands, and the calculation formula is as follows:
[0074] .
[0075] Continuing to refer to Figure 1 , the method considers some possible error situations, increases the corresponding exception handling mechanism, and can make the entire framework more perfect and run more smoothly. The exception handling mechanism includes:
[0076] (1) The child node sets the repeated connection mechanism after the connection with the master node fails, preventing connection failures caused by network or other problems;
[0077] (2) If an exception occurs when the child node takes an audio file or performs acoustic index calculation, the child node reports the exception and places the audio file back in the task queue;
[0078] (3) When the master node takes an audio file and its corresponding acoustic index from the result queue and writes it into the table, if it finds that the acoustic index is abnormal, it displays the exception information, skips the write-in stage, and places the audio file back in the task queue for calculation;
[0079] (4) When each audio file has an exception, an error reporting counter is increased, and if the number of errors exceeds a certain amount, the audio file is skipped and a warning is given;
[0080] (5) When all audio files and their corresponding acoustic indexes are written into the calculation, the master node sends a signal to end all processes.
[0081] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "in this embodiment", "specific examples", or "some examples" 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 the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, mechanisms, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, different embodiments or examples described in the present specification and the features of different embodiments or examples can be combined and combined by those skilled in the art without contradiction.
[0082] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application can be easily thought of by those skilled in the art, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An acoustic index parallelization computation method, characterized by, A master node and multiple slave nodes are configured in advance on a host side, and each of the slave nodes is connected with the master node, and the acoustic index parallelization calculation method comprises the following steps. In step S1, the master node is controlled to create a task queue and a result queue, and the master node is controlled to obtain multiple audio files and put them into the task queue. In step S2, the master node is controlled to distribute each of the audio files in the task queue to each of the slave nodes. In step S3, for each of the slave nodes, the slave node is controlled to perform acoustic index calculation on the received audio file to obtain the corresponding acoustic index, and the audio file and the acoustic index are associated and put into the result queue. In step S4, it is judged whether the task queue is empty: If yes, the process is ended after each of the slave nodes completes processing of the received audio file; If no, the step S2 is returned. The step S3 comprises: In step S31, for each of the slave nodes, the slave node is controlled to divide the sound data in the received audio file by time step and frequency band to obtain an intensity matrix, and to obtain the absolute difference value of each frequency band between two adjacent intensity values based on the intensity matrix. In step S32, the absolute difference values in the sound data in a unit time are accumulated to obtain a difference sum, and an ACI value is obtained according to the difference sum and each of the intensity values in the same unit time. In step S33, the ACI values corresponding to all unit times and all frequency bands are accumulated to obtain the acoustic index, and the audio file and the acoustic index are associated and put into the result queue.
2. The acoustic index parallelization calculation method according to claim 1, characterized in that, In the step S31, the absolute difference value is obtained by the following calculation formula: d k =|I k -I k+1 | Wherein, d k denotes the absolute difference; I k denotes the kth intensity value; I k+1 denotes the k+1th said intensity value.
3. The acoustic index parallelization calculation method of claim 1, wherein, In the step S32, the difference sum is obtained by the following calculation formula: Wherein, D represents the difference sum; n represents the number of subsets of each of the frequency bands in a unit time. d k denotes the absolute difference; Δt k represents a unit of time.
4. The acoustic index parallelization calculation method of claim 1, wherein, In the step S32, the ACI value is obtained by the following calculation formula: Wherein, ACI signal represents the ACI value; D represents the difference sum; n represents the number of subsets of each of the frequency bands in a unit time. I k denotes the kth intensity value.
5. The acoustic index parallelization calculation method of claim 1, wherein, In the step S33, the acoustic index is obtained by the following calculation formula: Wherein, ACI represents the acoustic index; q represents the number of frequency bands; m represents the number of time steps. ACI signal represents the ACI value.
6. The acoustic index parallelization calculation method of claim 1, wherein, In the step S3, it further comprises: For each of the slave nodes, it is judged whether an exception occurs when the slave node receives the audio file or performs acoustic index calculation: If yes, the audio file is put back into the task queue; If no, exit.
7. The acoustic index parallelization calculation method of claim 1, wherein, After the step S3 is executed, it further comprises: The master node is controlled to write each of the audio files and the corresponding acoustic index in the result queue into a table, and it is judged whether at least one of the acoustic indexes is abnormal: If yes, display abnormal information and skip the writing operation, and put the audio file corresponding to the abnormal acoustic index back into the task queue; If no, exit.
Citation Information
Patent Citations
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