Voice analysis method, device, receiving device and storage medium
By determining the service type and frame type based on the tail characteristics of the voice IP packet in LTE, directly obtaining the payload data and converting it into a data frame, the problem of low voice data analysis efficiency in LTE is solved, and efficient voice data analysis is achieved.
Patent Information
- Application Number
- CN202111591603.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2041-12-23
AI Technical Summary
In LTE, decompression and parsing of IP/UDP/RTP headers in the PDCP layer takes a long time, resulting in low parsing efficiency of speech data.
By receiving the voice IP packet to be parsed, the service type is determined based on the characteristics of the end of the data packet, the payload data is obtained, and the corresponding data frame is converted according to the frame type and service type.
The voice data can be effectively parsed without decompressing the parsed voice IP packet, which significantly improves the efficiency of voice parsing.
Smart Images

Figure CN114244911B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communications, and in particular to a speech analysis method, apparatus, receiving device, and storage medium. Background Art
[0002] In 3GPP (3rd Generation Partnership Project) LTE (Long Term Evolution), in order to improve the utilization efficiency of air interface bandwidth, a compression algorithm is used to compress the IP (Internet Protocol) / UDP (User Datagram Protocol) / RTP (Real-time Transport Protocol) header in the PDCP layer (Packet Data Convergence Protocol).
[0003] In specific applications, the sender compresses the message header according to the Profile (data configuration file) and context, and the receiver decompresses the compressed message header according to the Profile and context. After decompression, the IP / UDP / RTP protocol header needs to be parsed to obtain the voice data in the message. Summary of the invention
[0004] The inventors found in the process of studying related technologies that it takes a long time to decompress the message header and parse the IP / UDP / RTP protocol header, which leads to low efficiency in parsing voice data.
[0005] In a first aspect, a speech analysis method is provided, comprising:
[0006] Receive voice IP data packets to be parsed;
[0007] Determining the service type of the voice IP data packet to be parsed based on the characteristics of the tail of the voice IP data packet to be parsed;
[0008] Based on the service type, obtaining the payload data in the voice IP data packet to be parsed;
[0009] Determining a frame type of the payload data;
[0010] According to the frame type and the service type, a data frame corresponding to the payload data is converted.
[0011] Optionally, determining the service type of the voice IP data packet to be parsed based on the feature of the tail of the voice IP data packet to be parsed includes:
[0012] Extracting first byte data of a first length from the tail of the voice IP data packet to be parsed;
[0013] Acquire first target data located at a preset bit position in the first byte data;
[0014] When it is determined that the first target data is the same as the first value, the service type is determined to be a service type matched by the first length.
[0015] Optionally, before extracting the first byte data of the first length from the tail of the voice IP data packet to be parsed, the method further includes:
[0016] Obtain the byte length of the voice IP data packet to be parsed;
[0017] It is determined that the byte length is greater than the first length.
[0018] Optionally, acquiring the payload data in the voice IP data packet to be parsed based on the service type includes:
[0019] When the service type is a service type matched by the first length, obtaining a first field value of a field indicating a frame type in the first target data;
[0020] When the first field value is a second value, determining that the first byte data is payload data;
[0021] When the first field value is not the second value, second byte data of the second length is extracted from the end of the first byte data, and when it is determined that the second field value of the field indicating the frame type of the second byte data is a third value, the second byte data is determined to be payload data.
[0022] Optionally, determining the frame type of the payload data includes:
[0023] When the first field value is the second value, determining that the frame type is a voice frame;
[0024] When the second field value is the third value, the frame type is determined to be a noise frame.
[0025] Optionally, the determining the service type of the voice IP data packet to be parsed based on the feature of the tail of the voice IP data packet to be parsed further includes:
[0026] When it is determined that the first target data is different from the first value, extracting third byte data of a third length from the tail of the voice IP data packet to be parsed, wherein the third length is greater than the first length;
[0027] Acquire the second target data located at the preset bit position in the third byte data;
[0028] When it is determined that the second target data is the same as the fourth value, the service type is determined to be the service type matched by the third length.
[0029] Optionally, the acquiring, based on the service type, the payload data in the voice IP data packet to be parsed further includes:
[0030] When the service type is a service type matched by the third length, obtaining a third field value of a field indicating a frame type in the second target data;
[0031] When the third field value is a fifth value, determining that the third byte data is payload data;
[0032] When the third field value is not the fifth numerical value, fourth byte data of the fourth length is extracted from the end of the third byte data, and when it is determined that the field value indicating the frame type in the fourth byte data is the sixth numerical value, the fourth byte data is determined to be payload data.
[0033] Optionally, the determining the frame type of the payload data further includes:
[0034] When the third field value is the fifth value, determining that the frame type is a voice frame;
[0035] When the fourth field value is the sixth value, the frame type is determined to be a noise frame.
[0036] Optionally, the voice IP data packet to be parsed is any data packet in the voice parsing process;
[0037] After converting the data frame corresponding to the voice IP data packet to be parsed according to the frame type and the service type, the method further comprises:
[0038] After determining to obtain data frames of all voice IP data packets in the voice analysis process, obtaining a voice frame header corresponding to the service type;
[0039] Generate a voice audio file corresponding to the voice frame header and the data frames of all the voice IP data packets, wherein the voice frame header is the frame header of the voice audio file.
[0040] Optionally, the determining to obtain data frames of all voice IP data packets in the voice parsing process includes:
[0041] When receiving the voice end signaling, determining to obtain the data frames of all the voice IP data packets in the voice parsing process;
[0042] or,
[0043] When no voice IP data packet is received within a preset time, it is determined to obtain data frames of all voice IP data packets in the voice parsing process.
[0044] In a second aspect, a speech analysis device is provided, comprising:
[0045] A receiving unit, used for receiving a voice IP data packet to be parsed;
[0046] A first determining unit, configured to determine the service type of the voice IP data packet to be parsed based on the feature of the tail of the voice IP data packet to be parsed;
[0047] An acquisition unit, configured to acquire the payload data in the voice IP data packet to be parsed based on the service type;
[0048] A second determining unit, configured to determine a frame type of the payload data;
[0049] A conversion unit is used to convert the data frame corresponding to the payload data according to the frame type and the service type.
[0050] In a third aspect, a receiving end device is provided, comprising: a processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus;
[0051] The memory is used to store computer programs;
[0052] The processor is used to execute the program stored in the memory to implement the speech analysis method described in the first aspect.
[0053] According to a fourth aspect, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the speech analysis method according to the first aspect is implemented.
[0054] The above technical solution provided by the embodiment of the present disclosure has the following advantages over the prior art: the method provided by the embodiment of the present disclosure receives a voice IP data packet to be parsed; determines the service type of the voice IP data packet to be parsed based on the characteristics of the tail of the voice IP data packet to be parsed; obtains the payload data in the voice IP data packet to be parsed based on the service type; determines the frame type of the payload data; and converts the data frame corresponding to the payload data according to the frame type and the service type. Since the service type and frame type of the voice IP data packet to be parsed can be determined according to the characteristics of the tail of the voice IP data packet to be parsed, and the payload data in the voice IP data packet to be parsed can be determined based on the service type, even if the voice IP data packet to be parsed is not decompressed, the voice data can be obtained based on the payload data, which greatly improves the efficiency of voice parsing compared to the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0057] Figure 1 Schematic diagram of the flow of the speech analysis method in the embodiment of the present disclosure;
[0058] Figure 2 Schematic diagram of the structure of the speech analysis device in the embodiment of the present disclosure;
[0059] Figure 3 It is a schematic diagram of the structure of a receiving end device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0061] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0062] In order to facilitate understanding of the embodiments of the present disclosure, some terms involved in the present disclosure are explained below.
[0063] CMR, codec mode request, coding mode request;
[0064] FT, Frame Type, frame type;
[0065] Q, Quality, frame quality;
[0066] P, Padding, padding.
[0067] The present disclosure provides a speech analysis method, which can be applied to a receiving device;
[0068] The receiving end devices described in the embodiments of the present disclosure may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, video matrices, monitoring platforms, mobile Internet devices (MID, Mobile Internet Devices), wearable devices, base stations (such as macro base stations, small base stations, etc.), etc. The above are only examples and not exhaustive, including but not limited to the above devices. Of course, the above receiving end devices can also be servers, for example, cloud servers.
[0069] like Figure 1 As shown, the method may include the following steps:
[0070] Step 101: Receive a voice IP data packet to be parsed.
[0071] It should be understood that the voice IP data packet to be parsed is a compressed data packet from a sending device.
[0072] In applications, since the device usually transmits voice data in UM mode (unconfirmed mode), the receiving device and the sending device in this embodiment are both in UM mode when transmitting voice IP data packets.
[0073] Step 102: Determine the service type of the voice IP data packet to be parsed based on the characteristics of the tail of the voice IP data packet to be parsed.
[0074] In this embodiment, the service type of the voice IP data packet to be parsed is a narrowband (NB) service or a broadband (WB) service. It should be understood that this embodiment does not limit the service type of the voice IP data packet to be parsed to only be a NB service or a WB service.
[0075] In a specific embodiment, first byte data of a first length is extracted from the tail of the voice IP data packet to be parsed; first target data located at a preset bit position in the first byte data is obtained; when it is determined that the first target data is the same as the first value, the service type is determined to be the service type matched by the first length.
[0076] The service type that matches the first length here can be NB service. The protocol stipulates that for voice IP data packets belonging to NB services, the length of its payload is 32 bytes, and based on experience, it is found that the decimal value of the first 2 to 10 bits of the 32-byte data is 463. Therefore, by setting the first length to 32 bytes, the preset bit position to the first 2 to 10 bits of the 32 bytes, and the first value to 463, it can be determined whether the service type of the voice IP data packet to be parsed is NB service. It should be understood that the first byte data of the first length is extracted from the tail of the voice IP data packet to be parsed, and the first byte data is calculated from the last byte of the voice IP data packet to be parsed, and the data with a length of the first length is intercepted, and this segment of data is the first byte data. Among them, the first target data is the first byte data, that is, the first 2 to 10 bits of the 32-byte data. That is, assuming that when receiving the voice IP data packet to be parsed, the message header is received first, and then the 32-byte payload data is received in the order of receiving time, the first target data is the first 2 to 10 bits of the 32-byte payload data close to the message header, that is, the second to eighth bits of the first byte (1 byte = 8 bits) of the 32-byte payload data close to the message header, plus the first to second bits of the second byte, which are 9 bits of data. It can be understood that the first value 463 is decimal data. In actual application, the first target data (binary data) needs to be converted into decimal data for judgment.
[0077] In this embodiment, in order to improve processing efficiency and avoid invalid operations, before extracting the first byte data of the first length from the tail of the voice IP data packet to be parsed, the byte length of the voice IP data packet to be parsed can also be obtained, and it is determined that the byte length is greater than the first length.
[0078] When it is determined that the service type of the voice IP data packet to be parsed is not an NB service, it may be further determined whether the service type of the voice IP data packet to be parsed is a WB service.
[0079] In a specific embodiment, when it is determined that the first target data is different from the first value, the third byte data of the third length is extracted from the tail of the voice IP data packet to be parsed, and the third length is greater than the first length; the second target data located at a preset bit position in the third byte data is obtained; when it is determined that the second target data is the same as the fourth value, the service type is determined to be the service type matched by the third length.
[0080] The protocol stipulates that for a voice IP data packet belonging to a WB service, the length of its payload is 61 bytes, and based on experience, it is found that the decimal value of the first 2 to 10 bits of the 61-byte data is 465. Therefore, by setting the second length to 61 bytes, the preset bit position to the first 2 to 10 bits, and the second value to 465, it can be determined whether the service type of the voice IP data packet to be parsed is a WB service. For the specific explanation of the third byte data, the second target data, and the fourth value referred to in this embodiment, refer to the aforementioned explanation related to the NB service, which will not be repeated here.
[0081] In this embodiment, in order to improve processing efficiency and avoid invalid operations, before extracting the third byte data of the third length from the tail of the voice IP data packet to be parsed, the byte length of the voice IP data packet to be parsed can also be obtained, and it can be determined that the byte length is greater than the third length.
[0082] It should be understood that in other embodiments of the present disclosure, it is also possible to first determine whether the voice IP data packet to be parsed is a WB service based on the third byte data at the end of the voice IP data packet to be parsed, and when it is determined that it is not a WB service, it is then determined whether the voice IP data packet to be parsed is an NB service based on the first byte data at the end of the voice IP data packet to be parsed. In other words, the present disclosure does not limit the execution order of determining whether the voice IP data packet to be parsed is an NB service or a WB service.
[0083] In another embodiment of the present disclosure, in order to improve the efficiency of voice parsing, the service type of the currently received voice IP data packet to be parsed can also be determined based on the service type of the last received voice IP data packet to be parsed. Specifically, the service type of the last voice IP data packet to be parsed is used as the service type of the voice IP data packet to be parsed.
[0084] It should be understood that when the currently received voice IP data packet to be parsed is the first voice IP data packet to be parsed received by the receiving device, that is, there is no previous voice IP data packet to be parsed before the currently received voice IP data packet to be parsed, the service type of the voice IP data packet to be parsed is determined by the characteristics of the tail of the voice IP data packet to be parsed.
[0085] Step 103: Based on the service type, the payload data in the voice IP data packet to be parsed is obtained.
[0086] When the service type is a service type matched by the first length, in a specific embodiment,
[0087] Obtain a first field value of a field indicating a frame type in the first target data; when the first field value is a second value, determine that the first byte data is payload data; when the first field value is not the second value, extract second byte data of a second length from the end of the first byte data, and when it is determined that the second field value of the field indicating the frame type of the second byte data is a third value, determine that the second byte data is payload data.
[0088] It should be understood that the service type matched by the first length here may be NB service.
[0089] Based on experience, for NB services, the first target data can be the first 2 to 10 bits of the 32-byte data at the end of the IP data packet to be parsed, and the first field value can be the first 5 to 8 bits of the first target data, that is, the first target data refers to the second to eighth bits in the first byte close to the message header in the 32-byte data, plus the first to second bits in the second byte, which is composed of 9 bits of data, and the first 5 to 8 bits of the first target data refers to the sixth to eighth bits in the first byte close to the message header in the 32-byte data, plus the first bit in the second byte, which is composed of 4 bits of data, and the first field value refers to the value of the 4 bits. The second value can be 7, the second length can be 7 bytes, and the second byte data is the 7 bytes of data extracted from the end of the first byte data, that is, the second byte data is the last 7 bytes of data in the 32-byte data. The field value indicating the frame type of the second byte data is the value of the first 6 to 9 bits of the second byte data, that is, the value of the 4 bits of data of the sixth to eighth bits of the first byte in the 7 bytes and the first bit of the second byte, and the third value can be 8. It can be understood that the second value 7 and the third value 8 are decimal data. In practical applications, the binary data on the corresponding bits need to be converted into decimal data for judgment.
[0090] It should be understood that when the second field value of the field indicating the frame type in the second byte data is not the third value, it means that there is no payload data belonging to the NB service in the voice IP data packet to be parsed, and the process ends at this time.
[0091] When the service type is a service type matched by the third length, in a specific embodiment, a third field value of a field indicating a frame type in the second target data is obtained; when the third field value is a fifth value, the third byte data is determined to be payload data; when the third field value is not the fifth value, fourth byte data of a fourth length is extracted from the end of the third byte data, and when it is determined that the field value indicating the frame type in the fourth byte data is a sixth value, the fourth byte data is determined to be payload data.
[0092] It should be understood that the service type matched by the third length here may be a WB service.
[0093] Based on empirical findings, for WB services, the second target data may be the first 2 to 10 bits of the 61-byte data at the end of the IP data packet to be parsed, the third field value may be the first 5 to 8 bits of the second target data, the fifth value may be 8, the fourth length may be 7 bytes, the fourth byte data may be 7 bytes of data extracted from the end of the 61-byte data, the field value indicating the frame type in the fourth byte data may be the first 6 to 9 bits of the fourth byte data, and the sixth value may be 9. For the specific explanation of the second target data, the fourth byte data, the third field value, the fifth value, and the sixth value referred to in this embodiment, refer to the aforementioned explanation related to the NB service, which will not be repeated here.
[0094] Step 104: Determine the frame type of the payload data.
[0095] In this embodiment, the frame type of the payload data is a speech frame or a noise frame, wherein the frame type of the payload data can be determined by a field value indicating the frame type in the payload data.
[0096] When the payload data is the first byte data or the second byte data, in a specific embodiment, when the first field value is the second value, the frame type is determined to be a voice frame; when the second field value is the third value, the frame type is determined to be a noise frame.
[0097] When the payload data is the third byte data or the fourth byte data, in a specific embodiment, when the third field value is the fifth value, the frame type is determined to be a voice frame; when the fourth field value is the sixth value, the frame type is determined to be a noise frame.
[0098] Step 105: Convert and obtain data frames corresponding to the payload data according to the frame type and service type.
[0099] The following describes the conversion process for the voice IP data packets to be parsed for the two service types of NB service and WB service.
[0100] When the service type of the voice IP data packet to be parsed is NB service:
[0101] If the frame type of the payload data is a voice frame, the frame structure of the payload data is:
[0102] CMR (4 bits) + P (1 bit padding) + FT (4 bits) + Q (1 bit) + voice bits (244 bits) + padding bits;
[0103] The frame structure of the converted data frame is:
[0104] P (1 bit padding) + FT (4 bits) + Q (1 bit) + P (2 bits padding) + voice bits (244 bits) + padding bits (4 bits).
[0105] It should be understood that the filling value of the filling bit field in the frame structure of the converted data frame can be 0.
[0106] If the frame type of the payload data is a noise frame, the frame structure of the payload data is:
[0107] CMR (4 bits) + P (1 bit padding) + FT (4 bits) + Q (1 bit) + voice bit (39 bits) + padding bit;
[0108] The frame structure of the converted data frame is:
[0109] P (1 bit padding) + FT (4 bits) + Q (1 bit) + P (2 bits padding) + voice bit (39 bits) + padding bit (1 bit).
[0110] When the service type of the voice IP data packet to be parsed is WB service:
[0111] If the frame type of the payload data is a voice frame, the frame structure of the payload data is:
[0112] CMR (4 bits) + P (1 bit padding) + FT (4 bits) + Q (1 bit) + voice bit (WB is 477 bits) + padding bit;
[0113] The frame structure of the converted data frame is:
[0114] P (1 bit padding) + FT (4 bits) + Q (1 bit) + P (2 bits padding) + voice bits (WB is 477 bits) + padding bits (3 bits).
[0115] If the frame type of the payload data is a noise frame, the frame structure of the payload data is:
[0116] CMR (4 bits) + P (1 bit padding) + FT (4 bits) + Q (1 bit) + voice bit (WB is 40 bits) + padding bit;
[0117] The frame structure of the converted data frame is:
[0118] P (1 bit padding) + FT (4 bits) + Q (1 bit) + P (2 bits padding) + voice bits (WB is 40 bits).
[0119] In the technical solution provided by the embodiment of the present disclosure, a voice IP data packet to be parsed is received; based on the characteristics of the tail of the voice IP data packet to be parsed, the service type of the voice IP data packet to be parsed is determined; based on the service type, the payload data in the voice IP data packet to be parsed is obtained; the frame type of the payload data is determined; and according to the frame type and the service type, a data frame corresponding to the payload data is converted. Since the service type and frame type of the voice IP data packet to be parsed can be determined according to the characteristics of the tail of the voice IP data packet to be parsed, and the payload data in the voice IP data packet to be parsed can be determined based on the service type, even if the voice IP data packet to be parsed is not decompressed, the voice data can be obtained based on the analysis of the payload data, which greatly improves the efficiency of voice parsing compared to related technologies.
[0120] In another embodiment of the present disclosure, the receiving end device may also add a voice frame header file to the collected data frames after collecting all data frames in the voice analysis process to obtain a voice audio file.
[0121] In a specific embodiment, the voice IP data packet to be parsed is any data packet in the voice parsing process. After converting the data frame corresponding to the voice IP data packet to be parsed according to the frame type and service type, when it is determined that the data frames of all the voice IP data packets in the voice parsing process are obtained, the voice frame header corresponding to the service type is obtained; and a voice audio file corresponding to the voice frame header and the data frames of all the voice IP data packets is generated, wherein the voice frame header is the frame header of the voice audio file.
[0122] In this embodiment, different service types correspond to different voice frame header files. For example, for NB service, the corresponding voice frame header file may be 0x2321414D520A; for WB service, the corresponding voice frame header file may be 0x2321414D522D57420A.
[0123] In this embodiment, whether the voice analysis process is finished can be determined by voice end signaling or whether a voice IP data packet is received within a preset time.
[0124] In a specific embodiment, when a voice end signaling is received, it is determined to obtain data frames of all voice IP data packets in the voice parsing process; or, when no voice IP data packets are received within a preset time, it is determined to obtain data frames of all voice IP data packets in the voice parsing process.
[0125] In the application, the preset time can be set manually based on experience.
[0126] Based on the same concept, a speech analysis device is provided in the embodiment of the present disclosure. The specific implementation of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 2 As shown, the device 200 mainly includes:
[0127] A receiving unit 201 is used to receive a voice IP data packet to be parsed;
[0128] A first determining unit 202, configured to determine a service type of the voice IP data packet to be parsed based on a feature of the tail of the voice IP data packet to be parsed;
[0129] The acquisition unit 203 is used to acquire the payload data in the voice IP data packet to be parsed based on the service type;
[0130] A second determining unit 204, configured to determine a frame type of the payload data;
[0131] The conversion unit 205 is used to convert the data frame corresponding to the payload data according to the frame type and the service type.
[0132] Optionally, the first determining unit 202 is configured to:
[0133] Extracting first byte data of a first length from the tail of the voice IP data packet to be parsed;
[0134] Acquire first target data located at a preset bit position in the first byte data;
[0135] When it is determined that the first target data is the same as the first value, the service type is determined to be the service type matched by the first length.
[0136] Optionally, the device 200 further includes:
[0137] A byte length extraction unit, used for obtaining the byte length of the voice IP data packet to be parsed before extracting the first byte data of the first length from the tail of the voice IP data packet to be parsed;
[0138] The byte length determining unit is used to determine that the byte length is greater than the first length.
[0139] Optionally, the acquiring unit 203 is used to:
[0140] When the service type is a service type matched by the first length, obtaining a first field value of a field indicating a frame type in the first target data;
[0141] When the first field value is the second value, determining that the first byte data is payload data;
[0142] When the first field value is not the second numerical value, second byte data of the second length is extracted from the end of the first byte data, and when it is determined that the second field value of the field indicating the frame type of the second byte data is the third numerical value, the second byte data is determined to be payload data.
[0143] Optionally, the second determining unit 204 is configured to:
[0144] When the first field value is the second value, determining the frame type is a voice frame;
[0145] When the second field value is the third value, the frame type is determined to be a noise frame.
[0146] Optionally, the first determining unit 202 is further configured to:
[0147] When it is determined that the first target data is not the same as the first value, extracting third byte data of a third length from the tail of the voice IP data packet to be parsed, where the third length is greater than the first length;
[0148] Acquire second target data located at a preset bit position in the third byte data;
[0149] When it is determined that the second target data is the same as the fourth value, the service type is determined to be the service type matched by the third length.
[0150] Optionally, the acquiring unit 203 is further configured to:
[0151] When the service type is a service type matched by the third length, obtaining a third field value of a field indicating a frame type in the second target data;
[0152] When the third field value is the fifth value, determining that the third byte data is payload data;
[0153] When the third field value is not the fifth value, the fourth byte data of the fourth length is extracted from the end of the third byte data, and when it is determined that the field value indicating the frame type in the fourth byte data is the sixth value, the fourth byte data is determined to be payload data.
[0154] Optionally, the second determining unit 204 is further configured to:
[0155] When the third field value is the fifth value, determining that the frame type is a voice frame;
[0156] When the fourth field value is the sixth value, the frame type is determined to be a noise frame.
[0157] Optionally, the voice IP data packet to be parsed is any data packet in the voice parsing process;
[0158] The device 200 further includes:
[0159] A voice frame header acquisition unit is used to convert and obtain a data frame corresponding to the voice IP data packet to be parsed according to the frame type and the service type, and after determining that all the data frames of the voice IP data packets in the voice parsing process are obtained, obtain the voice frame header corresponding to the service type;
[0160] The audio file generating unit is used to generate a voice audio file corresponding to the voice frame header and the data frames of all voice IP data packets, wherein the voice frame header is the frame header of the voice audio file.
[0161] Optionally, the device 200 further includes:
[0162] The first detection unit is used to determine the data frames of all voice IP data packets obtained in the voice parsing process when receiving the voice end signaling;
[0163] or,
[0164] The second detection unit is used to determine to obtain data frames of all voice IP data packets in the voice parsing process when no voice IP data packet is received within a preset time.
[0165] Based on the same concept, the present disclosure also provides a receiving device, such as Figure 3 As shown, the receiving end device 300 mainly includes: a processor 301, a memory 302 and a communication bus 303, wherein the processor 301 and the memory 302 communicate with each other through the communication bus 303. The memory 302 stores a program executable by the processor 301, and the processor 301 executes the program stored in the memory 302 to implement the following steps:
[0166] Receive voice IP data packets to be parsed;
[0167] Determine the service type of the voice IP data packet to be parsed based on the characteristics of the tail of the voice IP data packet to be parsed;
[0168] Based on the service type, the payload data in the voice IP data packet to be parsed is obtained;
[0169] Determine the frame type of the payload data;
[0170] According to the frame type and service type, the data frame corresponding to the payload data is converted.
[0171] The communication bus 303 mentioned in the receiving end device 300 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 303 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0172] The memory 302 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the processor 301 .
[0173] The above-mentioned processor 301 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0174] In another embodiment of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the speech analysis method described in the above embodiment.
[0175] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0176] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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 other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0177] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A speech analysis method, characterized in that: include: Receive voice IP data packets to be parsed; Determining the service type of the voice IP data packet to be parsed based on the characteristics of the tail of the voice IP data packet to be parsed; Based on the service type, obtaining the payload data in the voice IP data packet to be parsed; Determining a frame type of the payload data; According to the frame type and the service type, converting to obtain a data frame corresponding to the payload data; The voice IP data packet to be parsed is any data packet in the voice parsing process; After converting the data frame corresponding to the voice IP data packet to be parsed according to the frame type and the service type, the method further comprises: After determining to obtain data frames of all voice IP data packets in the voice analysis process, obtaining a voice frame header corresponding to the service type; Generate a voice audio file corresponding to the voice frame header and the data frames of all the voice IP data packets, wherein the voice frame header is the frame header of the voice audio file.
2. The method according to claim 1, characterized in that Determining the service type of the voice IP data packet to be parsed based on the feature of the tail of the voice IP data packet to be parsed includes: Extracting first byte data of a first length from the tail of the voice IP data packet to be parsed; Acquire first target data located at a preset bit position in the first byte data; When it is determined that the first target data is the same as the first value, the service type is determined to be a service type matched by the first length.
3. The method according to claim 2, characterized in that Before extracting the first byte data of the first length from the tail of the voice IP data packet to be parsed, the method further comprises: Obtain the byte length of the voice IP data packet to be parsed; It is determined that the byte length is greater than the first length.
4. The method according to claim 2, characterized in that: The acquiring, based on the service type, the payload data in the voice IP data packet to be parsed comprises: When the service type is a service type matched by the first length, obtaining a first field value of a field indicating a frame type in the first target data; When the first field value is a second value, determining that the first byte data is payload data; When the first field value is not the second value, second byte data of the second length is extracted from the end of the first byte data, and when it is determined that the second field value of the field indicating the frame type of the second byte data is a third value, the second byte data is determined to be payload data.
5. The method according to claim 4, characterized in that The determining the frame type of the payload data comprises: When the first field value is the second value, determining that the frame type is a voice frame; When the second field value is the third value, the frame type is determined to be a noise frame.
6. The method according to claim 2, characterized in that Determining the service type of the voice IP data packet to be parsed based on the feature of the tail of the voice IP data packet to be parsed also includes: When it is determined that the first target data is different from the first value, extracting third byte data of a third length from the tail of the voice IP data packet to be parsed, wherein the third length is greater than the first length; Acquire the second target data located at the preset bit position in the third byte data; When it is determined that the second target data is the same as the fourth value, the service type is determined to be the service type matched by the third length.
7. The method according to claim 6, characterized in that The acquiring, based on the service type, the payload data in the voice IP data packet to be parsed, further comprises: When the service type is a service type matched by the third length, obtaining a third field value of a field indicating a frame type in the second target data; When the third field value is a fifth value, determining that the third byte data is payload data; When the third field value is not the fifth numerical value, fourth byte data of the fourth length is extracted from the end of the third byte data, and when it is determined that the field value indicating the frame type in the fourth byte data is the sixth numerical value, the fourth byte data is determined to be payload data.
8. The method according to claim 7, characterized in that The determining the frame type of the payload data further includes: When the third field value is the fifth value, determining that the frame type is a voice frame; When the fourth field value is the sixth value, the frame type is determined to be a noise frame.
9. The method according to claim 1, characterized in that: The step of determining to obtain data frames of all voice IP data packets in the voice parsing process includes: When receiving the voice end signaling, determining to obtain the data frames of all the voice IP data packets in the voice parsing process; or, When no voice IP data packet is received within a preset time, it is determined to obtain data frames of all voice IP data packets in the voice parsing process.
10. A speech analysis device, characterized in that: include: A receiving unit, used for receiving a voice IP data packet to be parsed; A first determining unit, configured to determine a service type of the voice IP data packet to be parsed based on a feature of the tail of the voice IP data packet to be parsed; An acquisition unit, configured to acquire the payload data in the voice IP data packet to be parsed based on the service type; A second determining unit, configured to determine a frame type of the payload data; A conversion unit, configured to convert, according to the frame type and the service type, a data frame corresponding to the payload data; Wherein, the voice IP data packet to be parsed is any data packet in the voice parsing process; the voice parsing device is also used to perform the following steps: After determining to obtain data frames of all voice IP data packets in the voice analysis process, obtaining a voice frame header corresponding to the service type; Generate a voice audio file corresponding to the voice frame header and the data frames of all the voice IP data packets, wherein the voice frame header is the frame header of the voice audio file.
11. A receiving device, characterized in that: include: A processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the speech analysis method described in any one of claims 1-9.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the speech analysis method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and system for improving bandwidth utilization over a fixed network
US20080198783A1