CN112996053B - Method, device and equipment for reordering voice data packets - Google Patents
Method, device and equipment for reordering voice data packets Download PDFInfo
- Publication number
- CN112996053B CN112996053B CN201911295566.0A CN201911295566A CN112996053B CN 112996053 B CN112996053 B CN 112996053B CN 201911295566 A CN201911295566 A CN 201911295566A CN 112996053 B CN112996053 B CN 112996053B
- Authority
- CN
- China
- Prior art keywords
- group
- nvoc
- voice data
- data packet
- expected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000004590 computer program Methods 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000003139 buffering effect Effects 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/06—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/32—Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/622—Queue service order
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/10—Flow control between communication endpoints
- H04W28/14—Flow control between communication endpoints using intermediate storage
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/12—Wireless traffic scheduling
- H04W72/1263—Mapping of traffic onto schedule, e.g. scheduled allocation or multiplexing of flows
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
- G10L19/04—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using predictive techniques
- G10L19/16—Vocoder architecture
- G10L19/167—Audio streaming, i.e. formatting and decoding of an encoded audio signal representation into a data stream for transmission or storage purposes
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a method, a device and equipment for reordering voice data packets. The method includes receiving a first NVOC voice data packet; acquiring a first group number and a first intra-group sequence number of the first NVOC voice data packet; and according to the first group number and the first group sequence number, placing the first NVOC voice data packet into a cache queue, so that the NVOC voice data packets in the cache queue are arranged in a sequence from small to large according to the group number and the group sequence number, and further, the terminal equipment performs voice playing according to the cache queue. The method improves the quality of voice playing.
Description
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a method, an apparatus, and a device for reordering voice packets.
Background
The Narrow band Voice Code (NVOC) is a standard Voice coding format of a Police Digital Trunking (PDT) protocol, the NVOC vocoder outputs one NVOC Voice packet every 20ms, and since a scheduling period of the PDT protocol is 60ms, three NVOC Voice packets can be simultaneously transmitted in one PDT protocol scheduling period.
When a Long Term Evolution (LTE) system is adopted to carry NVOC voice packets, since the scheduling period of the LTE protocol has no option of 60ms, for example, the scheduling period of the LTE protocol is 20ms or 40ms, the LTE network side device can only unpack the NVOC voice packets in one PDT protocol scheduling period and send the unpacked NVOC voice packets to the terminal device.
After the LTE network side device unpacks and sends the NVOC voice data packets, due to instability of a wireless channel, the NVOC voice data packets received by the terminal device are inevitably out of order, thereby causing degradation of voice playing quality.
Disclosure of Invention
The invention provides a method, a device and equipment for reordering voice data packets, which solve the problem of disorder of NVOC voice data packets received by terminal equipment and improve the quality of voice playing.
In a first aspect, the present invention provides a method for reordering voice data packets, which is applied to a terminal device, and includes:
receiving a first NVOC voice data packet;
acquiring a first group number and a first intra-group sequence number of the first NVOC voice data packet; the first group number is used for indicating a first NVOC voice data packet group to which the first NVOC voice data packet belongs, and the first NVOC voice data packet group comprises a plurality of NVOC voice data packets; the first intra-group sequence number is used for indicating the ordering of the first NVOC voice data in the first NVOC voice data packet group;
and according to the first group number and the first intra-group sequence number, the first NVOC voice data packets are placed into a cache queue, and the NVOC voice data packets in the cache queue are arranged from small to large according to the group number and the intra-group sequence number, so that the terminal equipment can play voice according to the cache queue.
Optionally, the method further includes:
if the NVOC voice data packets are end-to-end encrypted data packets, when all the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, sending the plurality of NVOC voice data packets of the first NVOC voice data packet group to a play queue for voice play.
Optionally, after the first group number and the first intra-group sequence number of the first NVOC voice data packet are obtained, the method further includes:
acquiring a first expected group number and a first expected serial number in the group; the first expected group number and the first expected sequence number in the group are used for indicating the NVOC voice data packet which the terminal equipment expects to receive;
comparing the first group number and the first intra-group sequence number to the first expected group number and the first expected intra-group sequence number;
if the first group number and the first in-group serial number are respectively the same as the first expected group number and the first expected in-group serial number, setting a second expected group number and a second expected in-group serial number;
and if the first group number is smaller than the first expected group number, discarding the first NVOC voice data packet.
Optionally, the setting of the second expected group number and the second expected sequence number in the group includes:
if part of the plurality of NVOC voice data packets of the first NVOC voice data packet group is in the cache queue, setting the second expected group number as the first group number, and setting the second expected group sequence number as the first group sequence number plus one;
and if all the NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number plus one, and setting the second expected group number as the initial group sequence number.
Optionally, the method further includes:
if the second NVOC voice data packet is not received after the preset timer is overtime, setting a third expected group number and a third expected group sequence number according to a third NVOC voice data packet in the cache queue;
the second NVOC voice data packet is an NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number; and the third NVOC voice data packet is the NVOC voice data packet with the smallest group number and the smallest sequence number in the group after the second NVOC voice data packet.
Optionally, the method further includes:
and if the NVOC voice data packet is an end-to-end encrypted data packet, discarding other NVOC voice data packets except the second NVOC voice data packet corresponding to the second expected group number in the cache queue.
Optionally, the method further includes:
and if the NVOC voice data packet is an unencrypted data packet and all other NVOC voice data packets corresponding to the second expected group number except the second NVOC voice data packet are in the cache queue, sending the other NVOC voice data packets to a play queue for voice playing.
In a second aspect, the present invention provides a device for reordering voice packets, comprising:
the receiving module is used for receiving the first NVOC voice data packet;
the acquiring module is used for acquiring a first group number and a first intra-group sequence number of the first NVOC voice data packet; the first group number is used for indicating a first NVOC voice data packet group to which the first NVOC voice data packet belongs, and the first NVOC voice data packet group comprises a plurality of NVOC voice data packets; the first intra-group sequence number is used for indicating the ordering of the first NVOC voice data in the first NVOC voice data packet group;
and the buffer module is used for placing the first NVOC voice data packets into a buffer queue according to the first group number and the first intra-group sequence number, and the NVOC voice data packets in the buffer queue are arranged according to the sequence from small to large of the group number and the intra-group sequence number, so that the terminal equipment can play voice according to the buffer queue.
Optionally, the cache module is further configured to:
if the NVOC voice data packets are end-to-end encrypted data packets, when all the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, sending the plurality of NVOC voice data packets of the first NVOC voice data packet group to a play queue for voice play.
Optionally, the obtaining module is further configured to:
acquiring a first expected group number and a first expected serial number in the group; the first expected group number and the first expected sequence number in the group are used for indicating the NVOC voice data packet which the terminal equipment expects to receive;
correspondingly, the device further comprises:
a comparison module for comparing the first group number and the first intra-group sequence number with the first expected group number and the first expected intra-group sequence number;
a setting module, configured to set a second expected group number and a second expected group serial number if the first group number and the first intra-group serial number are the same as the first expected group number and the first expected intra-group serial number, respectively;
correspondingly, the cache module is further configured to discard the first NVOC voice packet if the first group number is smaller than the first expected group number.
Optionally, the setting module is configured to:
if part of the plurality of NVOC voice data packets of the first NVOC voice data packet group is in the cache queue, setting the second expected group number as the first group number, and setting the second expected group sequence number as the first group sequence number plus one;
and if all the NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number plus one, and setting the second expected group number as the initial group sequence number.
Optionally, the setting module is further configured to:
if the second NVOC voice data packet is not received after the preset timer is overtime, setting a third expected group number and a third expected group sequence number according to a third NVOC voice data packet in the cache queue;
the second NVOC voice data packet is an NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number; and the third NVOC voice data packet is the NVOC voice data packet with the smallest group number and the smallest sequence number in the group after the second NVOC voice data packet.
Optionally, the cache module is further configured to:
and if the NVOC voice data packet is an end-to-end encrypted data packet, discarding other NVOC voice data packets except the second NVOC voice data packet corresponding to the second expected group number in the cache queue.
Optionally, the cache module is further configured to:
and if the NVOC voice data packet is an unencrypted data packet and all other NVOC voice data packets corresponding to the second expected group number except the second NVOC voice data packet are in the cache queue, sending the other NVOC voice data packets to a play queue for voice playing.
In a third aspect, the present invention provides a terminal device, comprising a memory and a processor; the memory is connected with the processor;
the memory for storing a computer program;
the processor is configured to implement the reordering method for voice data packets according to any one of the above first aspect when a computer program is executed.
In a fourth aspect, the present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, implements a method of reordering voice data packets as described in any one of the above first aspects.
The invention provides a method, a device and equipment for reordering voice data packets, wherein the method comprises the steps of receiving a first NVOC voice data packet, acquiring a first group number and a first group internal sequence number of the first NVOC voice data packet, and placing the first NVOC voice data packet into a cache queue according to the first group number and the first group internal sequence number, so that the NVOC voice data packets in the cache queue are arranged according to the sequence from small to large of the group number and the group internal sequence number, and further, the terminal equipment plays voice according to the cache queue. According to the method, the device and the equipment, the NVOC voice data packets in the cache queue are sequenced according to the group number and the in-group sequence number, so that the problem of disorder of the NVOC voice data packets received by the terminal equipment is solved, and the voice playing quality is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a reordering method for voice data packets according to the present invention;
FIG. 2 is a first flowchart illustrating a reordering method of voice data packets according to the present invention;
FIG. 3 is a second flowchart illustrating a reordering method of voice packets according to the present invention;
fig. 4 is a first schematic diagram illustrating a method for determining a desired data packet according to the present invention;
fig. 5 is a schematic diagram illustrating a method for determining a desired data packet according to the present invention;
fig. 6 is a third schematic diagram illustrating a method for determining a desired data packet according to the present invention;
fig. 7 is a diagram illustrating a fourth method for determining a desired data packet according to the present invention;
FIG. 8 is a schematic structural diagram of an apparatus for reordering voice packets according to the present invention;
fig. 9 is a schematic structural diagram of a terminal device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario of a reordering method for voice data packets according to the present invention. As shown in fig. 1, the PDT system interfacing with the LTE system enables voice interaction of terminal devices in both systems. When NVOC is adopted for voice coding, the NVOC vocoder outputs one NVOC voice data packet every 20ms, and three NVOC voice data packets can be simultaneously transmitted in one PDT protocol scheduling period because the PDT protocol scheduling period is 60 ms. If the LTE scheduling period is 20ms or 40ms, only one or two NVOC voice packets can be transmitted in one LTE scheduling period.
Therefore, after receiving the NVOC voice data packet of one scheduling period of the PDT system, the LTE network device, such as the base station, can only unpack the NVOC voice data packet and send the unpacked NVOC voice data packet to the LTE terminal device. Due to the instability of a wireless channel, the NVOC voice data packets received by the LTE terminal device are inevitably out of order, thereby causing the voice playing quality to be reduced. In order to improve the voice playing quality, the invention provides a reordering method of voice data packets, namely, after receiving the NVOC voice packets, the LTE terminal device reorders multiple NVOC voice data packets, thereby avoiding the voice playing quality from being influenced by the disorder of the voice data packets. The following describes a reordering method of voice packets according to an embodiment of the present invention.
Fig. 2 is a first flowchart illustrating a reordering method of voice data packets according to the present invention. The main execution body of the method is a reordering device of voice data packets, and the device can be realized in a software and/or hardware mode, for example, the device can be a mobile phone, a tablet computer, a notebook computer and other terminal equipment.
As shown in fig. 2, the method includes:
s201, receiving a first NVOC voice data packet.
In this embodiment, the first NVOC voice packet received by the terminal device is an NVOC voice packet unpacked by an LTE network device, such as a base station. Taking the scheduling period of the LTE system as 20ms for example, since the PDT system sends three NVOC voice data packets in 60ms of one PDT scheduling period, and the LTE system can only send one NVOC voice data packet in 20ms of one scheduling period, the LTE base station splits the three NVOC voice data packets of one PDT scheduling period and sends the three NVOC voice data packets to the LTE terminal device in three times, and each scheduling period sends one NVOC voice data packet. The first NVOC voice data packet is an NVOC voice data packet sent by the LTE base station to the LTE terminal device in any scheduling period.
S202, a first group number and a sequence number in the first group of the first NVOC voice data packet are obtained.
The first group number is used for indicating a first NVOC voice packet group to which the first NVOC voice packet belongs, and the first NVOC voice packet group comprises a plurality of NVOC voice packets; the first intra-group sequence number is used to indicate the ordering of the first NVOC voice data within the first NVOC voice data packet group.
The group number and the sequence number in the group are identifiers set for each NVOC voice data packet by the LTE base station when the NVOC voice data packet is split, three NVOC voice data packets in each PDT scheduling period are one NVOC voice data packet group and have a corresponding group number, and the group numbers are set in an increasing mode according to the sending sequence. Meanwhile, the three NOC voice data packets respectively have corresponding intra-group sequence numbers for indicating the ordering of the NOC voice data packets in the NVOC voice data packet group.
Optionally, the group number and the intra-group sequence number may be sent by one byte, where the first six bits of the byte identify the group number and the last two bits identify the intra-group sequence number, so that the value range of the group number is 000000-111111, the intra-group number is 00, 01, or 10, and the initial intra-group sequence number is 00. Here, the group number and the intra-group sequence number are described as being transmitted by one byte, and may be set according to actual needs in actual applications.
The first NVOC voice packet has a corresponding first group number and a first intra-group number, for example, the first group number is 010111 and the first intra-group number is 01. It can be understood that the first NVOC voice packet group corresponding to the first group number 010111 further includes two other NVOC voice packets except the first NVOC voice packet, and the group sequence numbers of the two other NVOC voice packets are 00 and 10, respectively.
S203, the first NVOC voice data packet is placed into a buffer queue according to the first group number and the first intra-group sequence number.
The NVOC voice data packets in the cache queue are arranged according to the sequence from small to large of the group number and the sequence number in the group, so that the terminal device plays voice according to the cache queue.
The terminal equipment analyzes and plays the NVOC voice packets according to the sequencing of the NVOC voice packets in the cache queue, so after a first group number and a first in-group sequence number are obtained, the first NVOC voice packets are placed into the cache queue according to the first group number and the first in-group sequence number, all the NVOC voice packets in the cache queue are arranged according to the sequence from small group numbers to large group numbers, namely the NVOC voice packets of different group numbers are arranged according to the sequence from small group numbers to large group numbers, and the NVOC voice packets of the same group number are arranged according to the sequence from small group numbers to large group numbers.
For example, the first group number is 010111, the first intra-group sequence number is 01, and an NVOC voice packet with a group number of 010111 and an intra-group sequence number of 10 exists in the cache queue, the first NVOC voice packet is placed before the NVOC voice packet. For another example, if the first group number is 010111, the first intra-group sequence number is 01, and an NVOC voice packet with a group number of 010110 and an intra-group sequence number of 01 exists in the cache queue, the first NVOC voice packet is placed behind the NVOC voice packet.
In the reordering method for voice data packets provided in this embodiment, a first NVOC voice data packet is received, a first group number and a first intra-group sequence number of the first NVOC voice data packet are obtained, and the first NVOC voice data packet is placed in a cache queue according to the first group number and the first intra-group sequence number, so that the NVOC voice data packets in the cache queue are arranged in a descending order of the group numbers and the intra-group sequence numbers, and further the terminal device performs voice playing according to the cache queue. According to the method, the NVOC voice data packets in the cache queue are sequenced according to the group number and the sequence number in the group, so that the problem of disorder of the NVOC voice data packets received by the terminal equipment is solved, and the voice playing quality is improved.
Because the sending of the NVOC voice data packets can be end-to-end encrypted or non-encrypted, the encryption operation is realized for the end-to-end encrypted voice data packets, namely, the three NVOC voice data packets in one PDT scheduling period, and the terminal equipment can analyze the three NVOC voice data packets only after the three NVOC voice data packets are completely received. Therefore, on the basis of the above embodiment, the method further comprises:
if the NVOC voice data packets are end-to-end encrypted data packets, when all the NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, sending the NVOC voice data packets of the first NVOC voice data packet group to a play queue for voice playing.
Illustratively, the first group number of the first NVOC voice packet is 010111 and the sequence number in the first group is 01. Correspondingly, the first NVOC voice packet group corresponding to the first group number 010111 further includes two other NVOC voice packets except the first NVOC voice packet, and the group sequence numbers of the two other NVOC voice packets are 00 and 10, respectively. If the first NVOC is placed in the cache queue according to the method of the above embodiment, and then the three NVOC voice data packets of the first NVOC voice data packet group are all in the cache queue, that is, the cache queue has three NVOC voice data packets with a group number of 010111 and sequence numbers of 00, 01, and 10 in the group, the three NVOC voice data packets are sent to the play queue for voice playing. If the buffer queue does not have all three NVOC voice packets, it indicates that the first NVOC voice packet group is not completely received, and therefore the first NVOC voice packet group cannot be sent to the play queue.
Because the service scene of voice playing usually has higher requirement on real-time performance, in order to avoid that voice playing is influenced by long-time waiting for a certain NVOC voice data packet or excessive cache queue space is occupied, the invention indicates the NVOC voice data packet which is expected to be received by the terminal equipment, namely the expected data packet, by setting an expected group number, an expected in-group sequence number and a preset timer.
On the basis of the above embodiment, the present invention further provides a reordering method for voice data packets. Fig. 3 is a flowchart illustrating a reordering method of voice packets according to the present invention. As shown in fig. 3, after acquiring the first group number and the first intra-group sequence number of the first NVOC voice data packet at S202 shown in fig. 2, the method further includes:
s301, a first expected group number and a first expected sequence number in the group are obtained.
The first expected group number and the first expected intra-group sequence number are used to indicate that the terminal device expects to receive NVOC voice data packets.
S302, comparing the first group number and the first intra-group serial number with the first expected group number and the first expected intra-group serial number. If the first group number and the first intra-group serial number are the same as the first expected group number and the first expected intra-group serial number, respectively, then executing S303; if the first group number is smaller than the first expected group number, S304 is executed.
In this embodiment, the terminal device indicates, by setting an expected group number and an expected intra-group sequence number, that the terminal device expects to receive the NVOC voice data packet, which is called an expected data packet, where the expected group number is a group number of an expected data packet group where the expected data packet is located, and the expected intra-group sequence number is a sequence of the expected data packet in the expected data packet group. Meanwhile, the terminal device also limits the time for receiving the expected data packet through a preset timer, and if the expected data packet is not received after the timer is overtime, a new expected data packet is reset, namely a new expected group number and an expected in-group sequence number are set.
After the terminal device receives the first NVOC voice data packet, the acquired first group number and the acquired first intra-group sequence number are respectively compared with the first expected group number and the first expected intra-group sequence number, so as to determine whether the first NVOC voice data packet is an expected data packet. The first expected group number and the first expected in-group sequence number are the group number and the in-group sequence number of the expected data packet set by the terminal device before the first NVOC voice data packet is received, and the terminal device starts a preset timer after the first expected group number and the first expected in-group sequence number are set.
And S303, setting a second expected group number and a second expected sequence number in the group.
If the first group number and the first intra-group sequence number are respectively the same as the first expected group number and the first expected intra-group sequence number, it indicates that the first NVOC voice data packet is the NVOC voice data packet which the terminal device expects to receive currently, and then after receiving the NVOC voice data packet which the terminal device expects to receive currently, the new expected group number and the expected intra-group sequence number are continuously set, that is, the second expected group number and the second expected intra-group sequence number are set.
Specifically, set up the second and expect serial number in group with the second, include:
if part of the NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number, and setting the second expected group sequence number as the first group sequence number plus one.
For example, as shown in fig. 4, the first group number of the first NVOC voice data packet is 010111, the first intra-group sequence number is 01, the first expected group number is 010111, and the first expected intra-group sequence number is 01, and there is an NVOC voice data packet before the first NVOC voice data packet in the buffering sequence, that is, an NVOC voice data packet with group number 010111 and intra-group sequence number 00, but there is no NVOC voice data packet with group number 010111 after the first NVOC voice data packet, the second expected group number is still 010111, and the second expected intra-group sequence number is 10.
If all of the plurality of NVOC voice packets of the first NVOC voice packet group are in the cache queue, setting the second expected group number as the first group number plus one, and setting the second expected group number as the initial group sequence number.
For example, as shown in fig. 5, if the first group number of the first NVOC voice data packet is 010111, the first intra-group sequence number is 10, the first expected group number is 010111, and the first expected intra-group sequence number is 10, and there are NVOC voice data packets with group number 010111 and intra-group sequence number 00 in the cache queue, and NVOC voice data packets with group number 010111 and intra-group sequence number 01, the second expected group number is set to 011000, and the intra-group sequence number is 00, that is, the starting intra-group sequence number. It is noted that if the group number of the NVOC voice data packet is identified by a six-bit character, i.e., the group number range is 000000-111111, when the first expected group number is 111111 and the first expected sequence number in the group is 10, the next set second expected group number is 000000.
S304, the first NVOC voice data packet is discarded.
If the first group number is smaller than the first expected group number, it indicates that the first NVOC voice packet is an NVOC voice packet that has not been received before timeout, as shown in fig. 6, the first expected group number is 011000, and the first expected intra-group sequence number is 00, but the received first NVOC voice packet group number is 010110, and the first intra-group sequence number is 01, that is, the first NVOC is an NVOC voice packet that has not been received before timeout.
According to the reordering method of the voice data packets provided by the embodiment, the expected group number, the expected in-group sequence number and the timeout time of the preset timer are set, so that the terminal equipment is prevented from waiting for the voice data packets which are not received for a long time, and the real-time performance of the voice service is improved.
On the basis of the above embodiment, correspondingly, the method further includes:
and if the second NVOC voice data packet is not received after the preset timer is overtime, setting a third expected group number and a third expected sequence number in the group according to a third NVOC voice data packet in the cache queue.
The second NVOC voice data packet is an NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number; the third NVOC voice data packet is the NVOC voice data packet with the smallest group number and the smallest sequence number in the group after the second NVOC voice data packet.
And resetting the preset timer after the terminal equipment sets the second expected group number and the second expected in-group sequence number, resetting a new expected group number and an expected in-group sequence number according to the method in S303 if a second NVOC voice data packet corresponding to the second expected group number and the second expected in-group sequence number is received before the preset timer is overtime, and resetting the preset customizer.
If the second NVOC voice data packet is still received after the preset timer is overtime, it is determined that the second NVOC voice data packet is lost, and the third expected group number and the third expected intra-group sequence number are reset according to the third NVOC voice data packet in the cache queue by referring to the method in S303. As shown in fig. 7, the second expected group number is 010111, the second expected intra-group sequence number is 10, however, after the timer timeout T expires, the terminal device does not receive the corresponding second NVOC voice data packet, but receives a third NVOC voice data packet with a group number of 011000 and an intra-group sequence number of 00, and then sets the new expected data packet to be the third expected group number of 011000 and the third expected group number of 01.
In the above embodiment, if the terminal device does not receive the NVOC voice packet that is expected to be received after the preset timer expires, it indicates that the NVOC voice packet that is expected to be received is lost. For the case of packet loss, the following procedure can be followed.
And if the NVOC voice data packet is an end-to-end encrypted data packet, discarding other NVOC voice data packets except the second NVOC voice data packet corresponding to the second expected group number in the cache queue.
In a scenario of end-to-end encryption of the NVOC voice packets, the terminal device can only parse a complete set of three NVOC voice packets after receiving the complete set of three NVOC voice packets, and therefore, if a second NVOC voice packet corresponding to a second expected group number and a second expected intra-group sequence number is lost in the end-to-end encryption scenario, other NVOC voice packets in the same group as the second expected group number cannot be parsed even if the other NVOC voice packets are already in the cache queue, and therefore, other NVOC voice packets except the second NVOC voice packet corresponding to the second expected group number in the cache queue are discarded.
And if the NVOC voice data packet is an unencrypted data packet and all other NVOC voice data packets corresponding to the second expected group number except the second NVOC voice data packet are in the cache queue, sending the other NVOC voice data packets to a play queue for voice playing.
In the unencrypted scene of the NVOC voice data packet, if the second NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number is lost, if other NVOC voice data packets in the same group as the second expected group number are already in the cache queue, the other NVOC voice data packets can also be normally analyzed and played, so that the other NVOC voice data packets are sent to the play queue for voice play.
In the reordering method for voice data packets provided in this embodiment, a preset timer is used to limit the time for receiving the expected data packet, and if the expected data packet is not received after the timeout of the timer, it is determined that the expected data packet is lost, thereby avoiding the terminal device waiting for the expected data packet for a long time. Under the condition that the expected data packet is lost, other data packets of the data packet group where the expected data packet is located are directly discarded for an end-to-end encryption scene, occupation of a buffer queue space is avoided, and for a non-encryption scene, the other data packets of the data packet group where the expected data packet is located are sent into a play queue for voice playing, so that influence on voice playing is avoided, and the real-time performance of voice playing is improved.
Fig. 8 is a schematic structural diagram of a reordering apparatus for voice packets according to the present invention. As shown in fig. 8, the apparatus 80 for reordering voice packets comprises:
a receiving module 801, configured to receive a first NVOC voice data packet;
an obtaining module 802, configured to obtain a first group number and a first intra-group sequence number of the first NVOC voice data packet; the first group number is used for indicating a first NVOC voice data packet group to which the first NVOC voice data packet belongs, and the first NVOC voice data packet group comprises a plurality of NVOC voice data packets; the first intra-group sequence number is used for indicating the ordering of the first NVOC voice data in the first NVOC voice data packet group;
the buffer module 803 is configured to place the first NVOC voice data packet into a buffer queue according to the first group number and the first intra-group sequence number, where the NVOC voice data packets in the buffer queue are arranged in a sequence from small to large according to the group number and the intra-group sequence number, so that the terminal device performs voice playing according to the buffer queue.
Optionally, the caching module 803 is further configured to:
if the NVOC voice data packets are end-to-end encrypted data packets, when all of the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, sending the plurality of NVOC voice data packets of the first NVOC voice data packet group to a play queue for voice playing.
Optionally, the obtaining module 801 is further configured to:
acquiring a first expected group number and a first expected serial number in the group; the first expected group number and the first expected sequence number in the group are used for indicating the NVOC voice data packet which the terminal equipment expects to receive;
accordingly, the apparatus 80 for reordering voice packets further comprises:
a comparing module 804, configured to compare the first group number and the first intra-group sequence number with the first expected group number and the first expected intra-group sequence number;
a setting module 805, configured to set a second expected group number and a second expected group serial number if the first group number and the first expected group serial number are the same as the first expected group number and the first expected group serial number, respectively;
correspondingly, the buffering module 803 is further configured to discard the first NVOC voice packet if the first group number is smaller than the first expected group number.
Optionally, the setting module 805 is configured to:
if part of the NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number, and setting the second expected group sequence number as the first group sequence number plus one;
if all of the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number plus one, and setting the second expected group number as the initial group sequence number.
Optionally, the setting module 805 is further configured to:
if the second NVOC voice data packet is not received after the preset timer is overtime, setting a third expected group number and a third expected group sequence number according to a third NVOC voice data packet in the cache queue;
the second NVOC voice data packet is an NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number; the third NVOC voice data packet is the NVOC voice data packet with the smallest group number and the smallest sequence number in the group after the second NVOC voice data packet.
Optionally, the caching module 803 is further configured to:
and if the NVOC voice data packet is an end-to-end encrypted data packet, discarding other NVOC voice data packets except the second NVOC voice data packet corresponding to the second expected group number in the cache queue.
Optionally, the caching module 803 is further configured to:
if the NVOC voice data packet is an unencrypted data packet and all the other NVOC voice data packets corresponding to the second expected group number except the second NVOC voice data packet are in the cache queue, sending the other NVOC voice data packets to a play queue for voice playing.
The reordering device of voice data packets provided in this embodiment can be used to execute the reordering method of voice data packets in any of the above method embodiments, and the implementation principle and technical effect are similar, and are not described herein again.
Fig. 9 is a schematic structural diagram of a terminal device provided in the present invention. As shown in fig. 9, the terminal device 90 includes a memory 901 and a processor 902; the memory 901 is connected with the processor 902;
a memory 901 for storing a computer program;
a processor 902 for implementing the method for reordering voice data packets in any of the above embodiments when the computer program is executed.
The present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the method for reordering voice packets in any of the above embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (7)
1. A reordering method of voice data packet is applied to terminal equipment, and is characterized by comprising the following steps:
receiving a first NVOC voice data packet;
acquiring a first group number and a first intra-group sequence number of the first NVOC voice data packet; the first group number is used for indicating a first NVOC voice data packet group to which the first NVOC voice data packet belongs, and the first NVOC voice data packet group comprises a plurality of NVOC voice data packets; the first intra-group sequence number is used for indicating the ordering of the first NVOC voice data in the first NVOC voice data packet group;
according to the first group number and the first intra-group sequence number, the first NVOC voice data packet is placed into a cache queue, and the NVOC voice data packets in the cache queue are arranged in the sequence from small to large according to the group number and the intra-group sequence number, so that the terminal device can perform voice playing according to the cache queue;
after the obtaining of the first group number and the first intra-group sequence number of the first NVOC voice data packet, the method further includes:
acquiring a first expected group number and a first expected serial number in the group; the first expected group number and the first expected sequence number in the group are used for indicating the NVOC voice data packet which the terminal equipment expects to receive;
comparing the first group number and the first intra-group sequence number to the first expected group number and the first expected intra-group sequence number;
if the first group number and the first in-group serial number are respectively the same as the first expected group number and the first expected in-group serial number, setting a second expected group number and a second expected in-group serial number;
if the first group number is smaller than the first expected group number, discarding the first NVOC voice data packet;
if the second NVOC voice data packet is not received after the preset timer is overtime, setting a third expected group number and a third expected group sequence number according to a third NVOC voice data packet in the cache queue;
the second NVOC voice data packet is an NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number; the third NVOC voice data packet is an NVOC voice data packet with the smallest group number and the smallest sequence number in the group after the second NVOC voice data packet;
set up the second and expect the group number and the second expects the interior serial number of group, include:
if part of the plurality of NVOC voice data packets of the first NVOC voice data packet group is in the cache queue, setting the second expected group number as the first group number, and setting the second expected group sequence number as the first group sequence number plus one;
if all of the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number plus one, and setting the second expected group number as the initial group sequence number.
2. The method of claim 1, further comprising:
if the NVOC voice data packets are end-to-end encrypted data packets, when all the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, sending the plurality of NVOC voice data packets of the first NVOC voice data packet group to a play queue for voice play.
3. The method of claim 1, further comprising:
and if the NVOC voice data packet is an end-to-end encrypted data packet, discarding other NVOC voice data packets except the second NVOC voice data packet corresponding to the second expected group number in the cache queue.
4. The method of claim 1, further comprising:
and if the NVOC voice data packet is an unencrypted data packet and all other NVOC voice data packets corresponding to the second expected group number except the second NVOC voice data packet are in the cache queue, sending the other NVOC voice data packets to a play queue for voice playing.
5. An apparatus for reordering voice packets, comprising:
the receiving module is used for receiving the first NVOC voice data packet;
the acquiring module is used for acquiring a first group number and a first intra-group sequence number of the first NVOC voice data packet; the first group number is used for indicating a first NVOC voice data packet group to which the first NVOC voice data packet belongs, and the first NVOC voice data packet group comprises a plurality of NVOC voice data packets; the first intra-group sequence number is used for indicating the ordering of the first NVOC voice data in the first NVOC voice data packet group;
the acquisition module is also used for acquiring a first expected group number and a first expected in-group serial number; the first expected group number and the first expected sequence number in the group are used for indicating an NVOC voice data packet expected to be received by the terminal equipment;
a comparison module for comparing the first group number and the first intra-group sequence number with the first expected group number and the first expected intra-group sequence number;
a setting module, configured to set a second expected group number and a second expected group serial number if the first group number and the first intra-group serial number are the same as the first expected group number and the first expected intra-group serial number, respectively;
the setting module is further configured to set a third expected group number and a third expected group sequence number according to a third NVOC voice data packet in the cache queue if the second NVOC voice data packet is not received after the preset timer expires;
the second NVOC voice data packet is an NVOC voice data packet corresponding to the second expected group number and the second expected intra-group sequence number; the third NVOC voice data packet is the NVOC voice data packet with the smallest group number and the smallest sequence number in the group after the second NVOC voice data packet;
the buffer module is configured to place the first NVOC voice data packet into a buffer queue according to the first group number and the first intra-group sequence number, where the NVOC voice data packets in the buffer queue are arranged in a sequence from small to large according to the group number and the intra-group sequence number, so that the terminal device performs voice playing according to the buffer queue;
the cache module is further configured to discard the first NVOC voice packet if the first group number is smaller than the first expected group number;
the setting module is specifically configured to:
if part of the plurality of NVOC voice data packets of the first NVOC voice data packet group are in the cache queue, setting the second expected group number as the first group number, and setting the second expected group sequence number as the first group sequence number plus one;
if all of the plurality of NVOC voice packets of the first NVOC voice packet group are in the cache queue, setting the second expected group number as the first group number plus one, and setting the second expected group number as the initial group sequence number.
6. A terminal device comprising a memory and a processor; the memory is connected with the processor;
the memory for storing a computer program;
the processor, when being executed by a computer program, is adapted to implement the method of reordering voice data packets according to any of claims 1-4.
7. A storage medium having stored thereon a computer program for, when being executed by a processor, implementing a method for reordering speech data packets according to any of the claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911295566.0A CN112996053B (en) | 2019-12-16 | 2019-12-16 | Method, device and equipment for reordering voice data packets |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911295566.0A CN112996053B (en) | 2019-12-16 | 2019-12-16 | Method, device and equipment for reordering voice data packets |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112996053A CN112996053A (en) | 2021-06-18 |
CN112996053B true CN112996053B (en) | 2023-04-18 |
Family
ID=76343440
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911295566.0A Active CN112996053B (en) | 2019-12-16 | 2019-12-16 | Method, device and equipment for reordering voice data packets |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112996053B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7145869B1 (en) * | 1999-03-17 | 2006-12-05 | Broadcom Corporation | Method for avoiding out-of-ordering of frames in a network switch |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7760737B2 (en) * | 2000-11-30 | 2010-07-20 | Audiocodes, Inc. | Method for reordering and reassembling data packets in a network |
US20030173269A1 (en) * | 2002-03-01 | 2003-09-18 | Heinz-Gerhard Breden | Sorting data with long SORT fields |
US7480308B1 (en) * | 2004-03-29 | 2009-01-20 | Cisco Technology, Inc. | Distributing packets and packets fragments possibly received out of sequence into an expandable set of queues of particular use in packet resequencing and reassembly |
US7680118B2 (en) * | 2006-04-13 | 2010-03-16 | Motorola, Inc. | Method and apparatus for reordering fragments within a MAC layer service data unit within a downlink frame |
CN101662461B (en) * | 2008-08-27 | 2012-08-08 | 华为技术有限公司 | Method, device and system for recombining multilink protocol fragment data |
CN103152134B (en) * | 2013-02-26 | 2015-12-02 | 汉柏科技有限公司 | Receiving terminal based on Real-time Transport Protocol resets the method and system of voice packet |
CN103607261B (en) * | 2013-11-22 | 2017-06-23 | 大唐移动通信设备有限公司 | A kind of data transmission method and device |
CN105610544B (en) * | 2015-12-18 | 2018-07-20 | 福建星海通信科技有限公司 | A kind of voice data transmission method and device |
CN106792262A (en) * | 2016-12-05 | 2017-05-31 | 乐视控股(北京)有限公司 | Method of transmitting video data and device |
CN108809542B (en) * | 2017-05-05 | 2021-04-20 | 华为技术有限公司 | Data transmission processing method and device |
CN109714295B (en) * | 2017-10-25 | 2021-10-26 | 普天信息技术有限公司 | Voice encryption and decryption synchronous processing method and device |
CN109729552B (en) * | 2017-10-27 | 2022-03-25 | 成都鼎桥通信技术有限公司 | Voice transmission method and device |
-
2019
- 2019-12-16 CN CN201911295566.0A patent/CN112996053B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7145869B1 (en) * | 1999-03-17 | 2006-12-05 | Broadcom Corporation | Method for avoiding out-of-ordering of frames in a network switch |
Non-Patent Citations (2)
Title |
---|
Packet out-of-order and retransmission in statistics-based traffic analysis;Su-Kang Lee等;《The 16th Asia-Pacific Network Operations and Management Symposium》;全文 * |
嵌入式流媒体系统的设计;秦贵和等;《微计算机信息》(第23期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112996053A (en) | 2021-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20170331757A1 (en) | Traffic control method, traffic control apparatus and server | |
EP4284004A1 (en) | Screen projection data transmission method and apparatus, electronic device, and storage medium | |
EP3720052A1 (en) | Service identification method and device, and network device | |
JP7053808B2 (en) | Information transmission method and equipment | |
JP2009284479A (en) | Method for executing buffer status report and communication device | |
CN107104782B (en) | Data transmission method and device | |
MX2008000317A (en) | System and method for resolving conflicts in multiple simultaneous communications in a wireless system. | |
US20180115488A1 (en) | Arranging media access control protocol data units in a wireless transmission | |
CN111328104B (en) | Data packet decompression method and device | |
CN106209325A (en) | A kind of TCP ACK message processing method and device | |
Salvador et al. | VoIPiggy: Analysis and implementation of a mechanism to boost capacity in IEEE 802.11 WLANs carrying VoIP traffic | |
US10383090B2 (en) | Data sending method, user equipment, and network device | |
CN111224903A (en) | Data transmission method, data transmission equipment and computer readable storage medium | |
CN113573003B (en) | Audio and video real-time communication method, device and equipment based on weak network | |
US8824428B2 (en) | Method for resolving data conflicts and mobile terminal | |
CN112996053B (en) | Method, device and equipment for reordering voice data packets | |
CN114980150A (en) | Buffer optimization method, device, electronic equipment, communication system and storage medium | |
US10225310B2 (en) | Transmission processing methods and apparatuses of data packet | |
CN107800653B (en) | Message compression method and device | |
CN112217734B (en) | Voice information synchronization method and communication system | |
CN114974273A (en) | Conference audio mixing method and device | |
CN109461451B (en) | Voice transmission method, device and system based on OPUS | |
US10142249B2 (en) | Method and apparatus for determining buffer status of user equipment | |
US8791981B2 (en) | Bit rate control apparatus and method thereof | |
JP2009135931A (en) | Method and communication apparatus for setting highest received state variable |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |