Voice data processing method, device, equipment, medium and program product
By preconfiguring the association of detection mode sequences and voice data, using data detection items of different detection modes to identify and process abnormal voice data, the voice data transmission problem when context information cannot be established in mobile communication is solved, and the success of recognition and restoration is improved Rate.
Patent Information
- Application Number
- CN202411480989.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-10-23
AI Technical Summary
In mobile communication, when context information cannot be established, abnormal voice data is difficult to recognize and process, resulting in the failure of voice data transmission.
By preconfiguring the detection mode sequence, the detection mode is associated with the theoretical encoding type and data transmission type of the speech data, the data detection items of different detection modes and their normal value range are used to detect the to-process speech data, and the normal voice is detected when normal voice is detected. The data is processed according to the current detection mode.
It improves the processing effect of voice data detection and recognition and the success rate of correct restoration, ensuring that voice data can be effectively recognized and processed in the absence of context information.
Smart Images

Figure CN119007753B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a voice data processing method, device, equipment, medium and program product. Background Art
[0002] During mobile communications, the communicating parties first negotiate the transmission mode, transmission format, and other contents of the voice data based on signaling, and then perform deterministic encoding and decoding based on the negotiation results, so as to correctly transmit, restore, and play the voice data content.
[0003] In some cases, one party in communication may not receive the communication signaling negotiation packet, resulting in the inability to determine whether the received voice data is abnormal by establishing context information, and the inability to correctly detect, identify and restore normal voice data.
[0004] Therefore, how to process speech data without establishing contextual information becomes an urgent problem to be solved. Summary of the invention
[0005] The present invention provides a voice data processing method, device, equipment, medium and program product, which are used to solve the defect in the prior art that it is difficult to identify abnormal voice data when context information cannot be established, and realize the detection and identification of abnormal voice data.
[0006] The present invention provides a voice data processing method, comprising:
[0007] Determine a normal value range of a data detection item based on a coding type and a data transmission type associated with a current detection mode; the current detection mode is the first detection mode in a detection mode sequence; the detection mode sequence includes a plurality of different detection modes; the detection mode is determined based on a theoretical coding type and a theoretical data transmission type of the speech data to be processed;
[0008] Based on the normal value range of the data detection item, obtaining a judgment result of whether the voice data to be processed is abnormal voice data;
[0009] If the judgment result is that the voice data to be processed is abnormal voice data, the next detection mode of the current detection mode is determined as a new current detection mode, and the process returns to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence;
[0010] If the judgment result is that the voice data to be processed is normal voice data, the voice data to be processed is processed based on the encoding type and data transmission type associated with the current detection mode.
[0011] According to a voice data processing method provided by the present invention, the normal value range of the data detection item is determined based on the encoding type and data transmission type associated with the current detection mode, including:
[0012] Determine a packet data detection item and a frame data detection item based on a coding type and a data transmission type associated with the current detection mode;
[0013] Based on the packet data detection item, determining a normal value range of the packet data detection item;
[0014] Based on the frame data detection item, a normal value range of the frame data detection item is determined.
[0015] According to a voice data processing method provided by the present invention, obtaining a judgment result of whether the voice data to be processed is abnormal voice data based on the normal value range of the data detection item includes:
[0016] Determining a first coding rate value of the voice data to be processed based on a first field extracted from the voice data to be processed;
[0017] If the first coding rate value does not conform to the normal value range of the packet data detection item, determining that the judgment result is that the voice data to be processed is abnormal voice data;
[0018] If the first coding rate value is consistent with the normal value range of the packet data detection item, a speech frame data determination operation is performed.
[0019] According to a voice data processing method provided by the present invention, the performing of the voice frame data determination operation comprises:
[0020] Based on current voice frame data, determining a second field of a second preset length; the current voice frame data is the first voice frame data of the voice data to be processed;
[0021] Based on the second field, determining a second coding rate value of the voice data to be processed;
[0022] If the second encoding rate value does not conform to the normal value range of the frame data detection item, determining that the judgment result is that the speech data to be processed is abnormal speech data;
[0023] If the second coding rate value meets the normal value range of the frame data detection item, the next voice frame data of the current voice frame data is used as the new current voice frame data, and the process returns to the step of determining the second field of the second preset length based on the current voice frame data until the current voice frame data is the last voice frame data of the voice data to be processed;
[0024] Based on the number of voice frames of the voice data to be processed, a length consistency judgment operation of the voice data to be processed is performed.
[0025] According to a method for processing speech data provided by the present invention, the operation of determining the consistency of the length of the speech data to be processed based on the number of speech frames of the speech data to be processed comprises:
[0026] Determining a calculation length of the to-be-processed voice data based on the number of voice frames and the second coding rate value;
[0027] If the calculated length is inconsistent with the length of the voice data packet to be processed, determining that the judgment result is that the voice data to be processed is abnormal voice data;
[0028] If the calculated length is consistent with the length of the voice data packet to be processed, it is determined that the judgment result is that the voice data to be processed is normal voice data.
[0029] According to a voice data processing method provided by the present invention, the voice data to be processed is AMR voice data, the theoretical encoding type includes AMR-NB encoding type and AMR-WB encoding type, and the theoretical data transmission type includes bandwidth saving transmission type and byte alignment transmission type.
[0030] The present invention also provides a voice data processing device, comprising:
[0031] A detection normal value determination module, used to determine the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode; the current detection mode is the first detection mode in the detection mode sequence; the detection mode sequence includes several different detection modes; the detection mode is determined based on the theoretical encoding type and theoretical data transmission type of the voice data to be processed;
[0032] A judgment result acquisition module, used for acquiring a judgment result of whether the speech data to be processed is abnormal speech data based on the normal value range of the data detection item;
[0033] A mode switching detection module, configured to determine the next detection mode of the current detection mode as a new current detection mode if the judgment result is that the voice data to be processed is abnormal voice data, and return to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence;
[0034] The normal voice processing module is used to process the voice data to be processed based on the encoding type and data transmission type associated with the current detection mode if the judgment result is that the voice data to be processed is normal voice data.
[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned voice data processing methods when executing the computer program.
[0036] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the voice data processing method described above is implemented.
[0037] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the voice data processing method described above is implemented.
[0038] The voice data processing method, apparatus, device, medium and program product provided by the present invention associate several detection modes in the detection mode sequence with the theoretical encoding type and theoretical data transmission type of the voice data by pre-configuring the detection mode sequence, thereby using the data detection items corresponding to different detection modes and their normal value ranges to detect the voice data to be processed, and when it is detected that the voice data to be processed is normal voice data, the voice data to be processed is processed according to the encoding type and data transmission type associated with the current detection mode, thereby improving the processing effect of voice data detection and recognition and the success rate of correct restoration when the context information of the communicating parties cannot be established. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 This is one of the flow charts of the voice data processing method provided by the present invention.
[0041] Figure 2 This is the second flow chart of the voice data processing method provided by the present invention.
[0042] Figure 3 This is the third flow chart of the voice data processing method provided by the present invention.
[0043] Figure 4 This is the fourth flow chart of the voice data processing method provided by the present invention.
[0044] Figure 5 It is a structural schematic diagram of the voice data processing device provided by the present invention.
[0045] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] It should be noted that, in the description of the present invention, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0048] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0049] Combine the following Figure 1-Figure 6The present invention describes the speech data processing method, device, equipment, medium and program product provided by the present invention.
[0050] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0051] The current mainstream mobile communication systems are LTE (Long Term Evolution) and NR (New Radio), both of which use IP to transmit voice, called VoLTE (Voice over Long-Term Evolution) or VoNR (Voice over New Radio). In this scenario, the voice data to be processed is AMR (Adaptive Multi-Rate) voice data. The AMR voice data format has the characteristics of good adaptability to the quality of wireless transmission channels, flexible bit rate adjustment, and high voice quality. In the process of mobile communication, the communicating parties first negotiate the transmission mode and format of the voice data based on the signaling, and then perform deterministic encoding and decoding based on the negotiation results, so as to correctly transmit, restore and play the voice data content.
[0052] In some cases, the communicating parties or the communicating third party may not receive the communication signaling negotiation packet, resulting in the inability to determine whether the received voice data is abnormal by establishing context information, and the inability to correctly detect, identify and restore normal voice data. Therefore, the present invention provides a voice data processing method, device, equipment, medium and program product, so as to process the received voice data when the context information cannot be established. It is worth noting that when the communicating third party processes voice data through the method provided by the present invention, it is based on necessary investigative activities permitted by law, or under the premise of complying with the corresponding data protection laws and policies of the country where it is located, and with the authorization given by the owner of the corresponding device.
[0053] Figure 1 It is one of the flow charts of the voice data processing method provided by the present invention, such as Figure 1 As shown, the voice data processing method includes but is not limited to steps 101 to 104.
[0054] It should be noted that the executor of the voice data processing method provided by the present invention is the corresponding voice data processing device, which can specifically be a server, a computer device, such as a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc.
[0055] Step 101: Determine a normal value range of a data detection item based on the encoding type and data transmission type associated with the current detection mode.
[0056] The current detection mode is the first detection mode in a detection mode sequence; the detection mode sequence includes several different detection modes; the detection mode is determined based on a theoretical encoding type and a theoretical data transmission type of the speech data to be processed.
[0057] The detection pattern sequence is a sequence of several detection patterns arranged in a certain order. While predetermining the different detection patterns in the detection pattern sequence based on the theoretical coding type and theoretical data transmission type of the voice data to be processed, each detection pattern is associated with a certain theoretical coding type and a certain theoretical data transmission type, that is, each detection pattern is associated with a coding type and a data transmission type of the voice data.
[0058] The speech data to be processed is speech data lacking context information when it is received. Due to the lack of context information, the speech data to be processed cannot be directly processed after it is received, but anomaly detection and elimination must be performed first.
[0059] Taking the voice data to be processed as AMR voice data as an example, theoretical encoding types of AMR voice data include AMR-NB encoding type and AMR-WB encoding type, and theoretical data transmission types include bandwidth saving transmission type and byte alignment transmission type.
[0060] In the absence of signaling protocol packets, in order to correctly detect, identify and restore the received voice data to be processed, it is necessary to pre-configure the detection mode sequence accordingly. When the voice data to be processed is AMR voice data, the detection mode in the detection mode sequence is determined according to the theoretical encoding type and theoretical data transmission type of the AMR voice data. The detection mode sequence includes four detection modes, namely "AMR-NB encoding + bandwidth saving" detection mode, "AMR-NB encoding + byte alignment" detection mode, "AMR-WB encoding + bandwidth saving" detection mode and "AMR-WB encoding + byte alignment" detection mode.
[0061] Furthermore, when the encoding type and the data transmission type are different, the data detection items and / or the normal value ranges of the data detection items corresponding to the detection modes are different.
[0062] Optionally, the specific order of each detection mode in the detection mode sequence is determined in descending order according to the number of times that the judgment result of each detection mode is normal voice data within a preset historical period.
[0063] Specifically, the first detection mode of the detection mode sequence is taken as the current detection mode, and then according to the encoding type and data transmission type associated with the current detection mode, several data detection items corresponding to the encoding type and data transmission type associated with the current detection mode and the normal value ranges of the several data detection items are determined, so as to facilitate subsequent steps in determining whether the voice data to be processed is normal voice data or abnormal voice data.
[0064] Step 102: Based on the normal value range of the data detection item, a judgment result of whether the speech data to be processed is abnormal speech data is obtained.
[0065] Specifically, after determining the normal value range of several data detection items under the current detection mode, the actual detection values of the several data detection items are determined from the voice data to be processed, and it is judged according to certain steps whether the actual detection values of the several data detection items all meet the corresponding normal value ranges. If all of them meet, the judgment result that the voice data to be processed is normal voice data is obtained, and it is confirmed that the voice data to be processed can be identified and restored according to the encoding type and data transmission type associated with the current detection mode; otherwise, the judgment result that the voice data to be processed is abnormal voice data is obtained.
[0066] Step 103: If the judgment result is that the voice data to be processed is abnormal voice data, the next detection mode of the current detection mode is determined as the new current detection mode, and the process returns to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence.
[0067] Step 104: If the judgment result is that the voice data to be processed is normal voice data, the voice data to be processed is processed based on the encoding type and data transmission type associated with the current detection mode.
[0068] Specifically, Figure 2 FIG. 2 is a flow chart of the voice data processing method provided by the present invention. Figure 2As shown, if the judgment result of whether the voice data to be processed is abnormal voice data is obtained, it is further judged whether the current detection mode is the last detection mode in the detection mode sequence. If so, it is confirmed that the voice data to be processed cannot be recognized and restored. If not, the next detection mode of the current detection mode is determined as the new current detection mode, and the encoding type and data transmission type associated with the new current detection mode are re-determined to determine the several data detection items corresponding to the new current detection mode and the normal value range of the several data detection items. The actual detection values of the several data detection items are determined from the voice data to be processed, and the judgment result of whether the voice data to be processed is abnormal voice data under the new current detection mode is further obtained.
[0069] If the judgment result under the new current detection mode is that the voice data to be processed is normal voice data, then confirm that the voice data to be processed can be identified and restored according to the encoding type and data transmission type associated with the new current detection mode. If the judgment result under the new current detection mode is that the voice data to be processed is abnormal voice data, then determine whether the new current detection mode is the last detection mode in the detection mode sequence. If so, confirm that the voice data to be processed cannot be identified and restored; if not, then update the next detection mode of the new current detection mode in the detection mode sequence to the current detection mode, and perform abnormal detection of the voice data to be processed again, and so on, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence.
[0070] The voice data processing method provided by the present invention associates several detection modes in the detection mode sequence with the theoretical encoding type and theoretical data transmission type of the voice data by pre-configuring the detection mode sequence, thereby utilizing the data detection items corresponding to different detection modes and their normal value ranges to detect the voice data to be processed, and when it is detected that the voice data to be processed is normal voice data, the voice data to be processed is processed according to the encoding type and data transmission type associated with the current detection mode, thereby improving the processing effect of voice data detection and recognition and the success rate of correct restoration when the context information of the communicating parties cannot be established.
[0071] Based on the above embodiment, as an optional embodiment, determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode includes:
[0072] Determine a packet data detection item and a frame data detection item based on a coding type and a data transmission type associated with the current detection mode;
[0073] Based on the packet data detection item, determining a normal value range of the packet data detection item;
[0074] Based on the frame data detection item, a normal value range of the frame data detection item is determined.
[0075] The packet data detection item is a detection item used to detect the overall data features of the voice data to be processed; the frame data detection item is a detection item used to detect the data features of each voice frame of the voice data to be processed.
[0076] Specifically, a table record with the same encoding type and data transmission type as those associated with the current detection mode is determined from a pre-constructed data detection item list, and the packet data detection item and frame data detection item under the current detection mode are determined from the table record. The normal value range of the packet data detection item is determined according to the packet data detection item, and the normal value range of the frame data detection item is determined according to the frame data detection item, so as to determine whether the voice data to be processed is normal voice data or abnormal voice data in subsequent steps.
[0077] Optionally, the pre-constructed data detection item list consists of a coding type field, a data transmission type field, a packet data detection item field, a normal value range field of a packet data detection item, a frame data detection item field, and a normal value range field of a frame data detection item.
[0078] The voice data processing method provided by the present invention improves the efficiency of determining data detection items and their normal value ranges by pre-constructing a data detection item list; by recording the normal value ranges of packet data detection items and the normal value ranges of frame data detection items in the data detection item list, the efficiency of determining data detection items and their normal value ranges can be further improved; the pre-constructed data detection item list can also be indexed and receive maintenance operations of operators, so that the data detection item list can adapt to voice data processing scenarios in different formats.
[0079] Figure 3 FIG. 3 is a flow chart of the voice data processing method provided by the present invention. Figure 3 As shown, the obtaining of the judgment result of whether the voice data to be processed is abnormal voice data based on the normal value range of the data detection item includes:
[0080] Determining a first coding rate value of the voice data to be processed based on a first field extracted from the voice data to be processed;
[0081] If the first coding rate value does not conform to the normal value range of the packet data detection item, determining that the judgment result is that the voice data to be processed is abnormal voice data;
[0082] If the first coding rate value is consistent with the normal value range of the packet data detection item, a speech frame data determination operation is performed.
[0083] The first field is a field that is determined according to the encoding type and data transmission type of the voice data associated with the current detection mode and contains first encoding rate value information.
[0084] Specifically, according to the encoding type and data transmission type of the voice data associated with the current detection mode, a first field with a length of a first preset length that theoretically contains information on the first encoding rate value is extracted from the corresponding position of the voice data to be processed, and the first field is parsed to determine the first encoding rate value of the voice data to be processed.
[0085] It is further determined whether the first coding rate value is consistent with the normal value range of the packet data detection item. If not, it means that the coding type and / or data transmission type associated with the current detection mode must be inconsistent with the voice data to be processed. At this time, it is determined that the voice data to be processed is abnormal voice data, and the next step of detection is performed or the detection is ended according to the relevant detection process of the abnormal voice data.
[0086] If yes, it indicates that the speech data to be processed can enter the next detection step, that is, a speech frame data judgment operation can be performed to determine whether the data characteristics of each frame of speech frame data conform to the encoding type and data transmission type associated with the current detection mode.
[0087] Figure 4 FIG. 4 is a flow chart of the voice data processing method provided by the present invention. Figure 4 As shown in the figure, taking the voice data to be processed as AMR voice data as an example, the detection mode sequence includes four detection modes, namely "AMR-NB encoding + bandwidth saving" detection mode, "AMR-NB encoding + byte alignment" detection mode, "AMR-WB encoding + bandwidth saving" detection mode and "AMR-WB encoding + byte alignment" detection mode. When the encoding type is "AMR-NB encoding", the normal value range of the packet data detection item is: 0~8, 14. When the encoding type is "AMR-NB encoding", the normal value range of the packet data detection item is: 0~9, 14~15.
[0088] According to the current detection mode being the "AMR-NB encoding + bandwidth saving" detection mode, a CMR field with a length of 4 bits is extracted from the first byte of the voice data to be processed, and the CMR field is parsed to determine the first coding rate value of the voice data to be processed. That is, at this time, the CMR field is the first field, and the first preset length, that is, the preset length of the CMR field, is 4 bits.
[0089] It is further determined whether the first coding rate value determined according to the CMR field conforms to the normal value range of "0~8, 14" of the packet data detection item when the coding type is "AMR-NB coding". If so, the next step of the voice frame data determination operation can be entered.
[0090] If it does not match, it means that the current detection mode "AMR-NB encoding + bandwidth saving" detection mode does not match the voice data to be processed, and the voice data to be processed is determined to be abnormal voice data. It is determined that the "AMR-NB encoding + bandwidth saving" detection mode is not the last detection mode of the detection mode sequence, and the next detection mode "AMR-NB encoding + byte alignment" detection mode of the "AMR-NB encoding + bandwidth saving" detection mode is used as the new current detection mode, and detection is performed again.
[0091] The voice data processing method provided by the present invention, based on a preset configuration detection mode sequence, first extracts a field for judging a packet data detection item from the voice data to be processed according to the encoding type and data transmission type associated with the current detection mode, when it is determined that the packet data detection item does not conform to the normal value range, it is determined that the encoding type and data transmission type associated with the current detection mode do not conform to the voice data to be processed, and no subsequent detection operation is required, and the next detection mode is switched to detect the voice data to be processed, and the voice data to be processed is preliminarily filtered, thereby improving the efficiency of voice data detection and recognition.
[0092] Based on the above embodiment, as an optional embodiment, combined with Figure 3 As shown, the execution of the voice frame data judgment operation includes:
[0093] Based on current voice frame data, determining a second field of a second preset length; the current voice frame data is the first voice frame data of the voice data to be processed;
[0094] Based on the second field, determining a second coding rate value of the voice data to be processed;
[0095] If the second encoding rate value does not conform to the normal value range of the frame data detection item, determining that the judgment result is that the speech data to be processed is abnormal speech data;
[0096] If the second coding rate value meets the normal value range of the frame data detection item, the next voice frame data of the current voice frame data is used as the new current voice frame data, and the process returns to the step of determining the second field of the second preset length based on the current voice frame data until the current voice frame data is the last voice frame data of the voice data to be processed;
[0097] Based on the number of voice frames of the voice data to be processed, a length consistency judgment operation of the voice data to be processed is performed.
[0098] The second field is a field that is determined according to the encoding type and data transmission type of the voice data associated with the current detection mode and contains second encoding rate value information.
[0099] Specifically, according to the encoding type and data transmission type of the voice data associated with the current detection mode, the first voice frame data in the voice data to be processed is used as the current voice frame data, and a second field with a length of a second preset length that theoretically contains information on the second encoding rate value is extracted from the corresponding position of the current voice frame data, and the second field is parsed to determine the second encoding rate value of the voice data to be processed.
[0100] It is further determined whether the second coding rate value is consistent with the normal value range of the frame data detection item. If not, it means that the coding type and / or data transmission type associated with the current detection mode does not match the voice data to be processed. At this time, it is determined that the voice data to be processed is abnormal voice data, and the next step of detection is performed or the detection is ended according to the relevant detection process of the abnormal voice data.
[0101] If it is in compliance, the next voice frame data of the current voice frame data is updated as the new current voice frame data, and the process returns to the step of determining the second field and the second coding rate value to determine whether the second coding rate value corresponding to the new voice frame data meets the normal value range of the frame data detection item. If the judgment result at this time is not in compliance, the voice frame data judgment operation is exited, and it is determined that the voice data to be processed is abnormal voice data; if it is in compliance, the next voice frame data of the current voice frame data is continued to be updated as the new current voice frame data.
[0102] By analogy, if the current speech frame data is the last speech frame data of the speech data to be processed, and the detection results of all previous speech frame data are in line with the normal value range of the frame data detection item, it means that the next detection link can be entered, that is, the number of speech frames determined based on the number of iterations recorded during the speech frame data judgment operation, and the length consistency judgment operation of the speech data to be processed is performed.
[0103] Combination Figure 4 As shown, the first voice frame data of the AMR voice data to be processed is determined as the current voice frame data, a ToC (Table of Contents) field with a length of 6 bits is extracted therefrom, and the FT field in the ToC field is parsed to obtain the second coding rate value of the current voice frame data, and it is determined whether the second coding rate value is in line with the normal value range of the frame data detection item.
[0104] If not, the voice frame data judgment operation is exited, and the voice data to be processed is determined to be abnormal voice data.
[0105] If it is met, it is determined whether the end mark of the FT field is 0. When the end mark of the FT field is not 0, the next voice frame data of the current voice frame data is updated to the new current voice frame data, and the process returns to the step of extracting the ToC field from the current voice frame data and determining the second coding rate value according to the FT field therein, and all the voice frame data of the voice frame data to be processed are detected in sequence. When the end mark of the FT field is 0, it indicates that the current voice frame data is the last voice frame data of the voice data to be processed, indicating that the voice frame data judgment operation is completed, and then the number of voice frames of the voice data to be processed is determined according to the number of iterations when the voice frame data is detected cyclically, and the length consistency judgment operation of the next step is performed.
[0106] The voice data processing method provided by the present invention, after confirming that the overall data characteristics of the voice data to be processed are consistent with the current detection mode, further determines whether the data characteristics of each voice frame data of the voice data to be processed are consistent with the frame data detection items corresponding to the current detection mode. As long as the encoding rate value of any voice frame is not within the normal value range, it is determined that the voice data to be processed does not conform to the current detection mode, and switches to the next detection mode for re-detection. Therefore, after preliminarily filtering out the current detection mode whose overall data characteristics do not conform, the detection mode whose overall data characteristics conform but the frame data characteristics do not conform is screened again, which speeds up the determination of the encoding type and data transmission type suitable for identifying and restoring the voice data to be processed, and improves the efficiency and accuracy of voice processing.
[0107] Based on the above embodiment, as an optional embodiment, combined with Figure 3 As shown, the operation of determining the length consistency of the voice data to be processed based on the number of voice frames of the voice data to be processed includes:
[0108] Determining a calculation length of the to-be-processed voice data based on the number of voice frames and the second coding rate value;
[0109] If the calculated length is inconsistent with the length of the voice data packet to be processed, determining that the judgment result is that the voice data to be processed is abnormal voice data;
[0110] If the calculated length is consistent with the length of the voice data packet to be processed, it is determined that the judgment result is that the voice data to be processed is normal voice data.
[0111] Specifically, after executing the speech frame data judgment operation, the number of speech frames in the speech data to be processed can be obtained according to the number of iterative judgments, and then the overall length of the speech data to be processed can be calculated based on the length of each speech frame corresponding to the current detection mode associated with the encoding type and data transmission type, the number of speech frames determined after executing the speech frame data judgment operation, and the second encoding rate value corresponding to each speech frame, that is, the calculated length of the speech data to be processed is obtained.
[0112] The calculated length is further compared with the length of the data packet obtained after the voice data packet to be processed is stored in the local computing system. If the calculated length is inconsistent with the data packet length, it is determined that the voice data to be processed is abnormal voice data, and then the next detection mode in the detection mode sequence is switched to perform detection again. If the calculated length is consistent with the data packet length, it is determined that the voice data to be processed is normal voice data, and the next step of recognition and restoration is performed to complete the processing of voice data lacking context information.
[0113] Optionally, after receiving the voice data packet to be processed and storing the voice data packet to be processed as a file, the length of the voice data file to be processed is directly obtained by checking the properties of the file, or by using a programming language such as Python or Java and calling a related function (such as Python's os.path.getsize() function) to directly obtain the number of bytes of the file, thereby obtaining the length of the voice data file to be processed. The obtained voice data file length is the length of the voice data packet to be processed.
[0114] Combination Figure 4 As shown, after the coding rate value of the AMR voice data to be processed meets the normal value range of the packet data detection item and the frame data detection item determined based on the current detection mode, since the length of each frame of the AMR voice data is 20ms, the calculated length of the AMR voice data to be processed is calculated by combining the number of voice frames of the AMR voice data to be processed and the second coding rate value corresponding to each voice frame.
[0115] It is further determined whether the calculated length is consistent with the length of the data packet obtained after the voice data to be processed is stored in the local computing system. If they are consistent, it is determined that the voice data to be processed is normal voice data. If they are inconsistent, it is determined that the voice data to be processed is abnormal voice data, and then the next detection mode "AMR-NB encoding + byte alignment" of the "AMR-NB encoding + bandwidth saving" detection mode in the detection mode sequence is used as the current detection mode, and detection is performed again.
[0116] The voice data processing method provided by the present invention compares the calculated length of the voice data to be processed with the system length when it is detected that the overall data characteristics of the voice data to be processed and the data characteristics of each voice frame are consistent with the encoding type and the data transmission type associated with the current detection mode, and exits the detection step of the current detection mode when the lengths are inconsistent. While attempting to use other detection modes to re-detect the voice data to be processed, the security of voice data processing is also guaranteed to avoid the security risk to the processing system caused by the received voice data to be processed containing bad information.
[0117] Based on the above embodiment, as an optional embodiment, the voice data to be processed is AMR voice data, the theoretical encoding type includes AMR-NB encoding type and AMR-WB encoding type, and the theoretical data transmission type includes bandwidth saving transmission type and byte alignment transmission type.
[0118] Furthermore, when the voice data to be processed is AMR voice data, the detection mode sequence includes four detection modes: "AMR-NB encoding + bandwidth saving" detection mode, "AMR-NB encoding + byte alignment" detection mode, "AMR-WB encoding + bandwidth saving" detection mode, and "AMR-WB encoding + byte alignment" detection mode. This embodiment does not limit the specific arrangement order of the four detection modes.
[0119] Optionally, when it is estimated that the voice data to be processed is AMR voice data, the detection mode sequence only includes the aforementioned four detection modes. At this time, the voice data processing method provided by the present invention can determine the AMR voice data from voice data of different formats and focus on processing the AMR voice data.
[0120] Optionally, when the voice data to be processed is estimated to be AMR voice data, the detection mode sequence includes, in addition to the aforementioned four detection modes, also a detection mode determined by the theoretical encoding type and the theoretical data transmission type when the voice data to be processed is estimated to be other voice formats, so as to classify the received voice data that lacks contextual information as much as possible.
[0121] Figure 5 Schematic diagram of the structure of the speech data processing device provided by the present invention. Figure 5 As shown, the speech data processing device includes but is not limited to a detection normal value determination module 501 , a judgment result acquisition module 502 , a mode switching detection module 503 and a normal speech processing module 504 .
[0122] A detection normal value determination module 501 is used to determine a normal value range of a data detection item based on a coding type and a data transmission type associated with a current detection mode; the current detection mode is the first detection mode in a detection mode sequence; the detection mode sequence includes a plurality of different detection modes; the detection mode is determined based on a theoretical coding type and a theoretical data transmission type of the speech data to be processed;
[0123] A judgment result acquisition module 502, configured to acquire a judgment result of whether the speech data to be processed is abnormal speech data based on the normal value range of the data detection item;
[0124] A mode switching detection module 503 is used to determine the next detection mode of the current detection mode as a new current detection mode if the judgment result is that the voice data to be processed is abnormal voice data, and return to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence;
[0125] The normal voice processing module 504 is configured to process the voice data to be processed based on the encoding type and data transmission type associated with the current detection mode if the judgment result is that the voice data to be processed is normal voice data.
[0126] It should be noted that the speech data processing device provided by the present invention can execute the speech data processing method described in any of the above embodiments during specific operation, which will not be elaborated in this embodiment.
[0127] The voice data processing device provided by the present invention pre-configures a detection mode sequence, associates several detection modes in the detection mode sequence with the theoretical encoding type and theoretical data transmission type of the voice data, thereby utilizing the data detection items corresponding to different detection modes and their normal value ranges to detect the voice data to be processed, and when it is detected that the voice data to be processed is normal voice data, processes the voice data to be processed according to the encoding type and data transmission type associated with the current detection mode, thereby improving the processing effect of voice data detection and recognition and the success rate of correct restoration when the context information of the communicating parties cannot be established.
[0128] Figure 6 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6As shown, the electronic device may include: a processor (Processor) 610, a communication interface (Communications Interface) 620, a memory (Memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the logic instructions in the memory 630 to execute the voice data processing method provided by any of the above embodiments, and the voice data processing method includes but is not limited to the following steps: determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode; the current detection mode is the first detection mode in the detection mode sequence; the detection mode sequence includes several different detection modes; the detection mode is determined based on the theoretical encoding type and theoretical data transmission type of the voice data to be processed; based on the normal value range of the data detection item, obtaining a judgment result of whether the voice data to be processed is abnormal voice data; if the judgment result is that the voice data to be processed is abnormal voice data, then determining the next detection mode of the current detection mode as the new current detection mode, and returning to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence; if the judgment result is that the voice data to be processed is normal voice data, then processing the voice data to be processed based on the encoding type and data transmission type associated with the current detection mode.
[0129] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0130] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the voice data processing method provided in any of the above embodiments, and the voice data processing method includes but is not limited to the following steps: based on the encoding type and data transmission type associated with the current detection mode, determining the normal value range of the data detection item; the current detection mode is the first detection mode in the detection mode sequence; the detection mode sequence includes several different detection modes; the detection mode is determined based on the theoretical encoding type and theoretical data transmission type of the voice data to be processed; based on the data detection item Normal value range, obtain the judgment result of whether the voice data to be processed is abnormal voice data; if the judgment result is that the voice data to be processed is abnormal voice data, determine the next detection mode of the current detection mode as the new current detection mode, and return to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence; if the judgment result is that the voice data to be processed is normal voice data, process the voice data to be processed based on the encoding type and data transmission type associated with the current detection mode.
[0131] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the voice data processing method provided by any of the above embodiments, the voice data processing method including but not limited to the following steps: determining a normal value range of a data detection item based on a coding type and a data transmission type associated with a current detection mode; the current detection mode is the first detection mode in a detection mode sequence; the detection mode sequence includes several different detection modes; the detection mode is determined based on a theoretical coding type and a theoretical data transmission type of the voice data to be processed; obtaining the voice data to be processed based on the normal value range of the data detection item According to the judgment result of whether the voice data to be processed is abnormal voice data; if the judgment result is that the voice data to be processed is abnormal voice data, the next detection mode of the current detection mode is determined as the new current detection mode, and the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode is returned to, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence; if the judgment result is that the voice data to be processed is normal voice data, the voice data to be processed is processed based on the encoding type and data transmission type associated with the current detection mode.
[0132] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing speech data, characterized in that: include: Determine a normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode; The current detection mode is the first detection mode in a detection mode sequence; the detection mode sequence includes a number of different detection modes; the detection mode is determined based on a theoretical encoding type and a theoretical data transmission type of the speech data to be processed; Based on the normal value range of the data detection item, obtaining a judgment result of whether the voice data to be processed is abnormal voice data; If the judgment result is that the voice data to be processed is abnormal voice data, the next detection mode of the current detection mode is determined as a new current detection mode, and the process returns to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence; If the judgment result is that the voice data to be processed is normal voice data, processing the voice data to be processed based on the encoding type and data transmission type associated with the current detection mode; The obtaining, based on the normal value range of the data detection item, a judgment result of whether the voice data to be processed is abnormal voice data includes: Based on the first field extracted from the voice data to be processed, determining a first coding rate value of the voice data to be processed; if the first coding rate value does not conform to the normal value range of the packet data detection item, determining the judgment result that the voice data to be processed is abnormal voice data; if the first coding rate value conforms to the normal value range of the packet data detection item, performing a voice frame data judgment operation; The performing of the voice frame data determination operation comprises: Based on the current voice frame data, determine the second field of the second preset length; the current voice frame data is the first voice frame data of the voice data to be processed; based on the second field, determine the second coding rate value of the voice data to be processed; if the second coding rate value does not conform to the normal value range of the frame data detection item, determine that the judgment result is that the voice data to be processed is abnormal voice data; if the second coding rate value conforms to the normal value range of the frame data detection item, take the next voice frame data of the current voice frame data as the new current voice frame data, and return to the step of determining the second field of the second preset length based on the current voice frame data until the current voice frame data is the last voice frame data of the voice data to be processed; based on the number of voice frames of the voice data to be processed, perform the length consistency judgment operation of the voice data to be processed; The step of performing a length consistency judgment operation on the voice data to be processed based on the number of voice frames of the voice data to be processed includes: Based on the number of voice frames and the second coding rate value, the calculated length of the voice data to be processed is determined; if the calculated length is inconsistent with the length of the voice data packet to be processed, the judgment result is determined to be that the voice data to be processed is abnormal voice data; if the calculated length is consistent with the length of the voice data packet to be processed, the judgment result is determined to be that the voice data to be processed is normal voice data.
2. The method for processing speech data according to claim 1, characterized in that: The determining of the normal value range of the data detection item based on the encoding type and the data transmission type associated with the current detection mode includes: Determine a packet data detection item and a frame data detection item based on a coding type and a data transmission type associated with the current detection mode; Based on the packet data detection item, determining a normal value range of the packet data detection item; Based on the frame data detection item, a normal value range of the frame data detection item is determined.
3. The method for processing speech data according to claim 1, characterized in that: The voice data to be processed is AMR voice data, the theoretical encoding types include AMR-NB encoding type and AMR-WB encoding type, and the theoretical data transmission types include bandwidth saving transmission type and byte alignment transmission type.
4. A voice data processing device, characterized in that: include: A detection normal value determination module, used to determine a normal value range of a data detection item based on a coding type and a data transmission type associated with a current detection mode; The current detection mode is the first detection mode in a detection mode sequence; the detection mode sequence includes a number of different detection modes; the detection mode is determined based on a theoretical encoding type and a theoretical data transmission type of the speech data to be processed; A judgment result acquisition module, used for acquiring a judgment result of whether the speech data to be processed is abnormal speech data based on the normal value range of the data detection item; A mode switching detection module, configured to determine the next detection mode of the current detection mode as a new current detection mode if the judgment result is that the voice data to be processed is abnormal voice data, and return to the step of determining the normal value range of the data detection item based on the encoding type and data transmission type associated with the current detection mode, until the judgment result is that the voice data to be processed is normal voice data, or until the current detection mode is the last detection mode in the detection mode sequence; A normal voice processing module, configured to process the voice data to be processed based on the encoding type and data transmission type associated with the current detection mode if the judgment result is that the voice data to be processed is normal voice data; The obtaining, based on the normal value range of the data detection item, a judgment result of whether the voice data to be processed is abnormal voice data includes: Based on the first field extracted from the voice data to be processed, determining a first coding rate value of the voice data to be processed; if the first coding rate value does not conform to the normal value range of the packet data detection item, determining the judgment result that the voice data to be processed is abnormal voice data; if the first coding rate value conforms to the normal value range of the packet data detection item, performing a voice frame data judgment operation; The performing of the voice frame data determination operation comprises: Based on the current voice frame data, determine the second field of the second preset length; the current voice frame data is the first voice frame data of the voice data to be processed; based on the second field, determine the second coding rate value of the voice data to be processed; if the second coding rate value does not conform to the normal value range of the frame data detection item, determine that the judgment result is that the voice data to be processed is abnormal voice data; if the second coding rate value conforms to the normal value range of the frame data detection item, take the next voice frame data of the current voice frame data as the new current voice frame data, and return to the step of determining the second field of the second preset length based on the current voice frame data until the current voice frame data is the last voice frame data of the voice data to be processed; based on the number of voice frames of the voice data to be processed, perform the length consistency judgment operation of the voice data to be processed; The step of performing a length consistency judgment operation on the voice data to be processed based on the number of voice frames of the voice data to be processed includes: Based on the number of voice frames and the second coding rate value, the calculated length of the voice data to be processed is determined; if the calculated length is inconsistent with the length of the voice data packet to be processed, the judgment result is determined to be that the voice data to be processed is abnormal voice data; if the calculated length is consistent with the length of the voice data packet to be processed, the judgment result is determined to be that the voice data to be processed is normal voice data.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the voice data processing method according to any one of claims 1 to 3 is implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the voice data processing method according to any one of claims 1 to 3 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the voice data processing method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Audio data processing method and device, equipment and storage medium
CN114913864A