CN112312475A - Voice long-time continuous packet loss compensation method and device - Google Patents

Voice long-time continuous packet loss compensation method and device Download PDF

Info

Publication number
CN112312475A
CN112312475A CN201910692548.XA CN201910692548A CN112312475A CN 112312475 A CN112312475 A CN 112312475A CN 201910692548 A CN201910692548 A CN 201910692548A CN 112312475 A CN112312475 A CN 112312475A
Authority
CN
China
Prior art keywords
voice
packet
packets
voice packets
buffer
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.)
Granted
Application number
CN201910692548.XA
Other languages
Chinese (zh)
Other versions
CN112312475B (en
Inventor
刘毅
刘红梅
姜良军
袁鲲
张康
蒲承祖
邱伟娜
王佩佩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Shandong Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Shandong Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Group Shandong Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910692548.XA priority Critical patent/CN112312475B/en
Publication of CN112312475A publication Critical patent/CN112312475A/en
Application granted granted Critical
Publication of CN112312475B publication Critical patent/CN112312475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/04Error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/34Flow control; Congestion control ensuring sequence integrity, e.g. using sequence numbers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a voice long-time continuous packet loss compensation method and device, computer equipment and a computer readable storage medium. The voice long-time continuous packet loss compensation method comprises the following steps: determining an initial voice packet in a voice call; inputting the voice packets in the voice call into a buffer according to the initial voice packet in sequence, wherein the preset number of voice packets are used as a group of word frame groups, and each group of word frame groups corresponds to a number in sequence; detecting continuously lost voice packets in the voice call, and determining the number and the storage position of the continuously lost voice packets; and when the number of the voice packets which are continuously lost is larger than or equal to the preset number, acquiring the word frame groups in the buffer according to the numbering sequence, and sequentially compensating to the storage positions of the voice packets which are continuously lost according to the word frame groups. By adopting the voice long-time continuous packet loss compensation method, the user can still answer the voice when the voice call has a long-time continuous packet loss condition.

Description

Voice long-time continuous packet loss compensation method and device
[ technical field ] A method for producing a semiconductor device
The present invention relates to the field of communications, and in particular, to a method and an apparatus for compensating for a long-time continuous packet loss in voice.
[ background of the invention ]
VOLTE (Voice over Long-Term Evolution Voice bearer) is a high-speed wireless communication standard facing mobile phones and data terminals. At present, in the field of VOLTE communication, when a wireless link fails and a packet loss occurs continuously for a long time in a voice call process, a user cannot receive voice.
[ summary of the invention ]
In view of this, embodiments of the present invention provide a method, an apparatus, a computer device, and a computer readable storage medium for compensating for a long-time continuous packet loss of a voice, so as to solve a problem that a user cannot hear the voice when a long-time continuous packet loss occurs in a current voice call.
In a first aspect, an embodiment of the present invention provides a method for compensating for a long-time continuous packet loss in a voice, including:
determining an initial voice packet in a voice call;
inputting voice packets in voice communication into a buffer according to the initial voice packet in sequence, wherein a preset number of the voice packets are used as a group of word frame groups, and each group of the word frame groups corresponds to a number in sequence;
detecting voice packets continuously lost in the voice call, and determining the number and the storage position of the voice packets continuously lost;
and when the number of the voice packets which are continuously lost is greater than or equal to the preset number, acquiring the word frame group in the buffer according to the numbering sequence, and compensating to the storage position of the voice packets which are continuously lost according to the word frame group in sequence.
The above aspect and any possible implementation manner further provide an implementation manner, where inputting voice packets in a voice call into a buffer in sequence according to the initial voice packet includes:
judging whether the current voice packet is the initial voice packet or not, or whether the initial voice packet exists or not, and if the current voice packet is the initial voice packet or the initial voice packet exists, inputting the voice packets in the voice call into the buffer in sequence;
after voice packets in voice communication are sequentially input into the buffer each time, detecting the storage space condition of the buffer, if the buffer has available storage space, acquiring the next voice packet, and continuing to execute the step of judging whether the current voice packet is an initial voice packet or not or whether the initial voice packet exists or not, if so, sequentially inputting the voice packets in the voice communication into the buffer;
and if the buffer has no available storage space, stopping inputting the voice packet into the buffer.
The above-described aspects and any possible implementations further provide an implementation, and the method further includes:
when the number of the voice packets lost continuously is smaller than the preset number, acquiring target voice packets in the buffer in a residual packet processing mode, wherein when the number of the voice packets lost continuously is smaller than the preset number, the residual packet processing mode is to acquire voice packets of a previous target number in sequence from the word frame group corresponding to the number to be accessed, and the target number is the number of the voice packets lost continuously;
and sequentially compensating the target voice packet to the storage position of the continuously lost voice packet by adopting a residual packet compensation mode.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, before sequentially inputting the voice packets in the voice call into a buffer according to the initial voice packet, further including:
initializing the counting value of the voice packet;
the number is initialized.
The above aspect and any possible implementation manner further provide an implementation manner, where inputting voice packets in a voice call into a buffer in order includes:
when voice packets in voice communication are sequentially input into a buffer at each time, judging whether the number of the input voice packets reaches a preset number;
if not, storing the input voice packet into the cache with the same number as the last input voice packet, and increasing the counting value of the input voice packet by 1;
and if so, resetting the counting value of the input voice packet to 1, increasing the number by 1 to obtain a new number, and storing the input voice packet from the storage position of the new number in the buffer.
The above aspect and any possible implementation manner further provide an implementation manner, where the sequentially compensating to the storage location of the consecutive lost voice packets according to the word frame group includes:
if the result of dividing the number of the voice packets lost continuously by the preset number is a positive integer, compensating the voice packets in the word frame group to the storage position of the voice packets lost continuously according to the sequence of the numbers;
if the number of the continuously lost voice packets is greater than the preset number and the result of dividing the number of the continuously lost voice packets by the preset number has a remainder, sequentially compensating the voice packets in the target word frame group to a first storage position of the continuously lost voice packets according to the sequence of the number, wherein the target word frame group is a word frame group which is sequenced according to the number and corresponds to the quotient value obtained by dividing the number of the continuously lost voice packets by the preset number;
acquiring voice packets with the number of the previous remainders in sequence from the word frame group corresponding to the number to be accessed by adopting a remainder packet processing mode, wherein the number of the remainders is the number corresponding to the number of the remainders;
and sequentially compensating the voice packets with the front and the remainder numbers to a second storage position of the continuous lost voice packets by adopting a residual packet compensation mode, wherein the storage position of the continuous lost voice packets comprises the first storage position and the second storage position.
In accordance with the above-described aspect and any possible implementation manner, there is further provided an implementation manner, where the preset number is 18.
In a second aspect, an embodiment of the present invention provides a device for compensating for a long-time continuous packet loss of a voice, including:
the initial voice packet determining module is used for determining an initial voice packet in the voice call;
the input buffer module is used for inputting the voice packets in the voice call into a buffer according to the initial voice packet in sequence, wherein the voice packets with a preset number are used as a group of word frame groups, and each group of word frame groups corresponds to a number in sequence;
a lost voice packet determining module, configured to detect a continuously lost voice packet in the voice call, and determine the number and storage location of the continuously lost voice packet;
and the compensation module is used for acquiring the word frame groups in the buffer according to the numbering sequence when the number of the continuously lost voice packets is greater than or equal to the preset number, and compensating to the storage positions of the continuously lost voice packets according to the word frame groups in sequence.
In a third aspect, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the voice long-time continuous packet loss compensation method when executing the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including: and the computer program is used for realizing the steps of the voice long-time continuous packet loss compensation method when being executed by the processor.
In the embodiment of the invention, a buffer is adopted to buffer the voice packets in the voice call, and the word frame groups obtained in sequence are adopted as the compensation units for compensating the continuously lost voice packets in the voice call in the buffer. The incidence relation of the number of the word frame groups obtained in sequence and the number of the words spoken by the user can output the lost voice packet by taking the words as a unit after compensation under the condition of ensuring correct time sequence, so that the user can still listen to the voice under the condition of losing the voice packet for a long time.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a flowchart illustrating a method for compensating for long-term continuous packet loss in voice according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a caching process based on word frame group association according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a compensation process based on word frame group association according to an embodiment of the present invention;
FIG. 4 is a flow chart of the caching phase in one embodiment of the present invention;
FIG. 5 is a flow chart of the compensation phase in one embodiment of the present invention;
fig. 6 is a schematic diagram of a device for compensating for long-time continuous packet loss in voice according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device according to an embodiment of the invention.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. 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.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely a field that describes the same of an associated object, meaning that three relationships may exist, e.g., A and/or B, may indicate: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe preset ranges, etc. in embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, the first preset range may also be referred to as a second preset range, and similarly, the second preset range may also be referred to as the first preset range, without departing from the scope of the embodiments of the present invention.
The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
Fig. 1 shows a flowchart of a voice long-time continuous packet loss compensation method in this embodiment. The voice long-time continuous packet loss compensation method can be applied to a telephone communication system, and can be realized by adopting the telephone communication system when voice communication is carried out. The telephone communication system can be applied to computer equipment, wherein the computer equipment can perform human-computer interaction with a user, and the computer equipment comprises, but is not limited to, computers, smart phones, tablets and other equipment. As shown in fig. 1, the method for compensating for long-time continuous packet loss of voice includes the following steps:
s10: an initial voice packet in a voice call is determined.
The initial voice packet refers to an initial position of a voice frame for call setup, and is used for determining the start of a section of call. It can be understood that the voice packet and the voice frame in this embodiment are the same concept, and the voice of each frame is used as the minimum unit in the call, corresponding to each voice packet.
In one embodiment, to determine the timing for buffering the voice packets, an initial voice packet in the voice call may be determined, from which it may be determined that the user is in the call, and the buffering of the voice packets may be started.
S20: and inputting the voice packets in the voice call into a buffer according to the initial voice packet in sequence, wherein the voice packets with a preset number are used as a group of word frame groups, and each group of word frame groups corresponds to a number in sequence.
The buffer is a buffer for storing voice packets, and can be used as a data source for packet loss compensation when voice packets are continuously lost for a long time.
The word frame group is obtained by sequentially combining a preset number of voice packets, where the preset number may be specifically 18. It can be understood that the number of words (hereinafter, the Chinese character is taken as an example) that a person can speak per minute is generally between 160 and 180, which is equivalent to speaking 2.66-3 words per second. The call in mobile communication is transmitted with one voice frame/voice packet every 20ms as frequency, and the total number of the voice packets is 50 in one second, which is equivalent to 16.6-18.7 voice packets corresponding to each Chinese character. The preset number of voice packets is used as a word frame group, and the relevance between the voice packets and the words can be embodied according to the word frame group. A word frame group may essentially represent a word, subject to the initial speech packet determination. The word frame group is used as a compensation unit for compensating the continuously lost voice packets, a foundation is provided for subsequent packet loss compensation, the lost voice packets can be output by using the words as units after compensation, and a user can still listen to the voice under the condition of not sending the voice packets for a long time.
In one embodiment, in the case of determining the initial voice packet, the voice packets in the voice call may be sequentially input into the buffer in a word-frame association (word-frame group). Each group of the word frame groups corresponds to a number in sequence, and the accuracy of the voice packet in the input buffer on the time sequence can be ensured.
Specifically, as shown in fig. 2, fig. 2 shows a caching process based on word frame group association:
according to the relevance of the words embodied by the word frame group, "i", "and" two words in fig. 2 correspond to M (a preset number) voice packets, respectively. "I" is the first word, and the number of M voice packets to which the word belongs is 1; "and" is the second word, and the number of M voice packets to which it belongs is 2; and then classifying the voice packets according to the classification until the voice packets within T seconds are all buffered in a buffer.
Further, in step S20, according to the initial voice packet, sequentially inputting the voice packets in the voice call into the buffer, specifically including:
s211: and judging whether the current voice packet is an initial voice packet or not, or whether the initial voice packet exists or not, and if the current voice packet is the initial voice packet or the initial voice packet exists, inputting the voice packets in the voice call into the buffer in sequence.
It can be understood that, in each buffering process, since the buffering of the next voice packet is not performed from the initial voice packet in each buffering process, it is necessary to determine whether the current voice packet is the initial voice packet or whether the initial voice packet already exists. It will be appreciated that when the initial voice packet is determined, the voice packets in the voice call are input into the buffer in order, assuming that the call has already started. The caching process in the implementation can ensure the accuracy of the voice packet on the time sequence, and the cached voice packet is used as a data source for packet loss compensation.
S212: after the voice packets in the voice call are sequentially input into the buffer each time, detecting the storage space condition of the buffer, if the available storage space exists in the buffer, acquiring the next voice packet, continuously judging whether the current voice packet is the initial voice packet or not or whether the initial voice packet exists or not, and if so, sequentially inputting the voice packets in the voice call into the buffer.
S213: and if the buffer has no available storage space, stopping inputting the voice packet into the buffer.
It is understood that if the buffer has available memory space, the step S211 is continued until the buffer has no available memory space, and the voice packet input into the buffer is stopped.
In steps S211-S213, a specific embodiment is provided for sequentially inputting the voice packets in the voice call into the buffer according to the initial voice packet, and the mode for entering the buffer can be determined according to the initial voice packet, and the voice packets in the voice call are sequentially input into the buffer as the data source for compensating the packet loss of the call.
Further, before step S20, that is, before the voice packets in the voice call are sequentially input into the buffer according to the initial voice packet, the method further includes:
s221: and initializing the counting value of the voice packet.
The count value of the voice packet may be initialized to 0. It is understood that, before buffering, to ensure the accuracy of the timing sequence of the voice packets input into the buffer and to establish different groups of word frame groups, the count value of the voice packets may be initialized.
S222: the number is initialized.
Wherein the initialization value of the number may be 1.
It is to be understood that, in steps S221-S222, the counting value of the voice packets may be obtained as word frame groups in time sequence, and the number of the word frame groups may be distinguished from the word frame groups in time sequence. The counting value and the number of the voice packet are initialized, so that the accurate acquisition of the word frame group can be realized.
Further, in step S20, the step of inputting the voice packets in the voice call into the buffer in sequence includes:
s231: when the voice packets in the voice call are input into the buffer in sequence each time, whether the number of the input voice packets reaches a preset number is judged.
S232: if not, storing the input voice packet into the cache with the same number as the last input voice packet, and increasing the counting value of the input voice packet by 1.
S233: if the number reaches the preset value, the counting value of the input voice packet is reset to 1, the number is increased by 1 to obtain a new number, and the input voice packet is stored from the storage position of the new number in the buffer.
In steps S231-S233, a change rule of a count value of the voice packet, a storage location of the voice packet, a change rule of a number, and the like are described each time the voice packet in the voice call is sequentially input into the buffer, and a frame group of words can be obtained in time sequence in the buffering process to highlight a correlation between the voice packet and the word, so as to provide a technical realization premise for a subsequent compensation of a long-time continuous packet loss, so that a user can listen to the voice as usual after the voice compensation.
S30: and detecting the voice packets continuously lost in the voice call, and determining the number and the storage position of the continuously lost voice packets.
S40: and when the number of the voice packets which are continuously lost is larger than or equal to the preset number, acquiring the word frame groups in the buffer according to the numbering sequence, and sequentially compensating to the storage positions of the voice packets which are continuously lost according to the word frame groups.
It can be understood that, when the number of the voice packets lost continuously is greater than or equal to the preset number, the buffer has at least one word frame group, and at this time, the word frame groups are sequentially compensated to the storage positions of the voice packets lost continuously, so that the lost voice packets can be supplemented in units of words, and when a voice call has a long-time continuous packet loss, the user can hear the voice.
Further, in step S40, sequentially compensating to the storage location of the consecutive lost voice packets according to the word frame group, specifically including:
s411: and if the result of dividing the number of the continuously lost voice packets by the preset number is a positive integer, sequentially compensating the voice packets in the word frame group to the storage position of the continuously lost voice packets according to the sequence of the numbers of the word frame group.
It can be understood that, when the result of dividing the number of consecutive lost voice packets by the preset number is a positive integer, it means that the lost voice packets can be just compensated by using the positive integer number of word frame groups, and there is no lost voice packet that is not compensated, so that the integrity of compensation can be ensured.
S412: and if the number of the continuously lost voice packets is greater than the preset number and the result of dividing the number of the continuously lost voice packets by the preset number has a remainder, sequentially compensating the voice packets in the target word frame group to a first storage position of the continuously lost voice packets according to the sequence of the numbers, wherein the target word frame group is a word frame group which is corresponding to the quotient value obtained by dividing the number of the continuously lost voice packets by the preset number and is sorted according to the numbers.
S413: and acquiring voice packets with the number of the previous remainders in sequence from the word frame group corresponding to the number to be accessed by adopting a remainder packet processing mode, wherein the number of the remainders is the number corresponding to the number of the remainders.
It can be understood that, when the number of the consecutive lost voice packets is greater than the preset number and a remainder exists as a result of dividing the number of the consecutive lost voice packets by the preset number, the manner of processing the remaining packets refers to sequentially obtaining the voice packets with the number of the previous remainders in the word frame group corresponding to the number to be accessed after sequentially compensating the voice packets in the target word frame group to the first storage location of the consecutive lost voice packets.
S414: and compensating the voice packets with the previous and remaining numbers to a second storage position of the continuously lost voice packets in sequence by adopting a packet compensation mode, wherein the storage position of the continuously lost voice packets comprises a first storage position and a second storage position.
In steps S412-S413, considering the completeness of compensation, when there is no multiple relation between the continuously lost voice packets and the word frame groups, as shown in fig. 3, in the Y target word frame groups, the word frames included in each group respectively compensate M lost voice packets, the uncompensated part (called as a collision part) of the Y target word frame groups can be sequentially obtained by using the number-to-be-accessed word frame group (here, the next group of word frame groups after the last group of target word frame groups is numbered as Y +1) to obtain the number of the preceding remainder (H) voice packets, the number of the preceding remainder voice packets is used to sequentially compensate the remaining uncompensated and continuously lost voice packets, therefore, the compensation integrity when the multiple relation does not exist between the voice packets which are continuously lost and the word frame group is realized, and the user can listen to the complete voice as much as possible.
In steps S411-S414, a specific embodiment is provided for sequentially compensating to the storage locations of consecutive lost voice packets according to the word frame groups, and when there is a multiple relationship between consecutive lost voice packets and the word frame groups, or there is no multiple relationship, the word frame groups are taken as the units of compensation, so as to ensure the integrity of compensation.
Further, the method for compensating for long-time continuous packet loss of voice further comprises:
s421: and when the number of the voice packets which are continuously lost is smaller than the preset number, acquiring the target voice packets in the buffer in a residual packet processing mode, wherein when the number of the voice packets which are continuously lost is smaller than the preset number, the residual packet processing mode is to acquire the voice packets of the previous target number in sequence from the word frame group corresponding to the number to be accessed, and the target number is the number of the voice packets which are continuously lost.
S422: and compensating the target voice packet to the storage position of the continuously lost voice packet in sequence by adopting a residual packet compensation mode.
In steps S421 to S422, for the case that the number of consecutive lost voice packets is less than the preset number, the compensation can be performed by using a complementary packet compensation method, and the characteristics of the word frame group can also be embodied, for example, if there are 15 consecutive lost voice packets, then the compensation is performed on the first 15 voice packets of the word frame group in number 1, and then there is a possibility that the first 15 voice packets of the word frame group include the associated information corresponding to the word. Therefore, with the target number of voice packets before the word frame group, an effective voice compensation effect can be achieved as well.
In an embodiment, the voice packet loss compensation method for a long time continuous period may be divided into two stages, one is a buffering stage and the other is a compensation stage.
Specifically, fig. 4 shows a flow chart of the caching phase in an embodiment of the invention. As can be seen in fig. 4:
in step S501, initialization is performed on the serial number and the value of the preset number (M).
In step S502, determining whether the current voice packet is an initial voice packet or has an initial voice packet, if yes, executing step S503; otherwise, step S507 is executed.
In step S503, the current voice packet is marked as a valid packet, and then step S504 is executed.
In step S504, it is determined whether the number of consecutively received voice packets satisfies M, and if not, step S505 is executed; otherwise, step S509 is performed.
In step S505, the current voice packet is sequentially buffered in a buffer with the same number as the last voice packet.
In step S506, the M count value is incremented by 1, and then step S512 is performed.
In step S507, the current voice packet is marked as an invalid packet, and step S508 is executed.
In step S508, the invalid voice packet is filtered out, the next voice packet is extracted, and the process returns to step S502.
In step S509, the number is increased by 1.
In step S510, the voice packets are buffered in the buffer from the position of the new number in sequence.
In step S511, the value of M is initialized and reset to 1.
In step S512, determining whether the buffer is full, if not, extracting the next voice packet, and returning to step S502; otherwise, the caching process is ended.
Specifically, FIG. 5 shows a flow chart of the compensation phase in one embodiment of the present invention. As can be seen in fig. 5:
in step S601, the current voice packet is analyzed, and step S602 is executed after packet loss is detected.
In step S602, the number N of consecutive lost packets is calculated, and step S603 is executed.
In step S603, the size relationship between N and M (a preset number) is determined, and if the number of consecutive packet losses N is less than M, step S606 is executed. Otherwise, step S604 is executed.
In step S604, packet loss is compensated in units of word frame groups and in the order of numbers, and step S605 is performed.
In step S605, after packet loss is continuously compensated, it is determined whether the number of remaining uncompensated packet losses is less than M, and if so, step S606 is executed. Otherwise, step S607 is executed.
In step S606, the first H voice packets in the next number in the buffer are searched, and then step S608 is executed.
In step S607, packet loss is compensated in units of word frame groups and in the order of numbering, and then the packet loss compensation process is ended.
In step S608, the remaining packet compensation is performed, and then the packet loss compensation process is ended.
In the embodiment of the invention, a buffer is adopted to buffer the voice packets in the voice call, and the word frame groups obtained in sequence are adopted as the compensation units for compensating the continuously lost voice packets in the voice call in the buffer. The incidence relation of the number of the word frame groups obtained in sequence and the words spoken by the user can output the lost voice packet by taking the words as a unit after compensation under the condition of ensuring correct time sequence, so that the user can still listen to the voice under the condition of not sending the voice packet for a long time.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Based on the method for compensating for long-time continuous packet loss of voice provided in the embodiment, the embodiment of the present invention further provides an embodiment of an apparatus for implementing each step and method in the above method embodiment.
Fig. 6 shows a schematic block diagram of a voice long-time continuous packet loss compensation device in one-to-one correspondence with the voice long-time continuous packet loss compensation method in the embodiment. As shown in fig. 6, the apparatus for compensating for a voice long continuous packet loss includes an initial voice packet determining module 10, an input buffer module 20, a lost voice packet determining module 30, and a compensating module 40. The implementation functions of the initial voice packet determining module 10, the input buffer module 20, the lost voice packet determining module 30, and the compensating module 40 correspond to the steps of the voice long-time continuous packet loss compensating method in the embodiment one to one, and for avoiding repeated descriptions, detailed descriptions are not needed in this embodiment.
An initial voice packet determining module 10, configured to determine an initial voice packet in a voice call.
The input buffer module 20 is configured to input the voice packets in the voice call to the buffer in sequence according to the initial voice packet, where a preset number of the voice packets are used as a group of word frame groups, and each group of word frame groups corresponds to a serial number in sequence.
And a lost voice packet determining module 30, configured to detect continuously lost voice packets in the voice call, and determine the number and storage location of the continuously lost voice packets.
And the compensation module 40 is configured to, when the number of the consecutive lost voice packets is greater than or equal to the preset number, obtain the word frame groups in the buffer according to the numbering sequence, and sequentially compensate to the storage locations of the consecutive lost voice packets according to the word frame groups.
Optionally, the input buffer module 20 is further specifically configured to:
and judging whether the current voice packet is an initial voice packet or not, or whether the initial voice packet exists or not, and if the current voice packet is the initial voice packet or the initial voice packet exists, inputting the voice packets in the voice call into the buffer in sequence.
After the voice packets in the voice call are sequentially input into the buffer each time, detecting the storage space condition of the buffer, if the available storage space exists in the buffer, acquiring the next voice packet, continuously judging whether the current voice packet is the initial voice packet or not or whether the initial voice packet exists or not, and if so, sequentially inputting the voice packets in the voice call into the buffer.
And if the buffer has no available storage space, stopping inputting the voice packet into the buffer.
Optionally, the device for compensating for long-time continuous packet loss of speech is further specifically configured to:
and when the number of the voice packets which are continuously lost is smaller than the preset number, acquiring the target voice packets in the buffer in a residual packet processing mode, wherein when the number of the voice packets which are continuously lost is smaller than the preset number, the residual packet processing mode is to acquire the voice packets of the previous target number in sequence from the word frame group corresponding to the number to be accessed, and the target number is the number of the voice packets which are continuously lost.
And compensating the target voice packet to the storage position of the continuously lost voice packet in sequence by adopting a residual packet compensation mode.
Optionally, the device for compensating for long-time continuous packet loss of speech is further specifically configured to:
and initializing the counting value of the voice packet.
The number is initialized.
Optionally, the input buffer module 20 is specifically configured to:
when the voice packets in the voice call are input into the buffer in sequence each time, whether the number of the input voice packets reaches a preset number is judged.
If not, storing the input voice packet into the cache with the same number as the last input voice packet, and increasing the counting value of the input voice packet by 1.
If the number reaches the preset value, the counting value of the input voice packet is reset to 1, the number is increased by 1 to obtain a new number, and the input voice packet is stored from the storage position of the new number in the buffer.
Optionally, the compensation module 40 is further specifically configured to:
and if the result of dividing the number of the continuously lost voice packets by the preset number is a positive integer, sequentially compensating the voice packets in the word frame group to the storage position of the continuously lost voice packets according to the sequence of the numbers of the word frame group.
And if the number of the continuously lost voice packets is greater than the preset number and the result of dividing the number of the continuously lost voice packets by the preset number has a remainder, sequentially compensating the voice packets in the target word frame group to a first storage position of the continuously lost voice packets according to the sequence of the numbers, wherein the target word frame group is a word frame group which is corresponding to the quotient value obtained by dividing the number of the continuously lost voice packets by the preset number and is sorted according to the numbers.
And acquiring voice packets with the number of the previous remainders in sequence from the word frame group corresponding to the number to be accessed by adopting a remainder packet processing mode, wherein the number of the remainders is the number corresponding to the number of the remainders.
And compensating the voice packets with the previous and remaining numbers to a second storage position of the continuously lost voice packets in sequence by adopting a packet compensation mode, wherein the storage position of the continuously lost voice packets comprises a first storage position and a second storage position.
Optionally, the preset number is specifically 18.
In the embodiment of the invention, a buffer is adopted to buffer the voice packets in the voice call, and the word frame groups obtained in sequence are adopted as the compensation units for compensating the continuously lost voice packets in the voice call in the buffer. The incidence relation of the number of the word frame groups obtained in sequence and the words spoken by the user can output the lost voice packet by taking the words as a unit after compensation under the condition of ensuring correct time sequence, so that the user can still listen to the voice under the condition of not sending the voice packet for a long time.
The present embodiment provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for compensating for a long-time continuous packet loss in a voice in the embodiment is implemented, which is not repeated herein. Alternatively, the computer program is executed by the processor to implement the functions of each module/unit in the device for compensating for packet loss caused by long-time continuous speech packet loss in the embodiment, which is not described herein again to avoid repetition.
Fig. 7 is a schematic diagram of a computer device provided by an embodiment of the invention. As shown in fig. 7, the computer device 70 of this embodiment includes: the processor 71, the memory 72, and the computer program 73 stored in the memory 72 and capable of running on the processor 71, where the computer program 73 is executed by the processor 71 to implement the method for compensating for a long-time continuous packet loss of voice in the embodiment, and in order to avoid repetition, details are not repeated herein. Alternatively, the computer program 73 is executed by the processor 71 to implement the functions of each model/unit in the voice packet loss compensation apparatus for a long time and continuous packet loss in the embodiment, which is not described herein again to avoid redundancy.
The computing device 70 may be a desktop computer, a notebook computer, a palm top computer, a cloud server, or other computing devices. The computer device 70 may include, but is not limited to, a processor 71, a memory 72. Those skilled in the art will appreciate that fig. 7 is merely an example of a computer device 70 and is not intended to limit computer device 70 and may include more or fewer components than those shown, or some of the components may be combined, or different components, e.g., the computer device may also include input-output devices, network access devices, buses, etc.
The Processor 71 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 72 may be an internal storage unit of the computer device 70, such as a hard disk or a memory of the computer device 70. The memory 72 may also be an external storage device of the computer device 70, such as a plug-in hard disk provided on the computer device 70, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 72 may also include both internal and external storage units of the computer device 70. The memory 72 is used to store computer programs and other programs and data required by the computer device. The memory 72 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for compensating for long-time continuous packet loss of voice is characterized by comprising the following steps:
determining an initial voice packet in a voice call;
inputting voice packets in voice communication into a buffer according to the initial voice packet in sequence, wherein a preset number of the voice packets are used as a group of word frame groups, and each group of the word frame groups corresponds to a number in sequence;
detecting voice packets continuously lost in the voice call, and determining the number and the storage position of the voice packets continuously lost;
and when the number of the voice packets which are continuously lost is greater than or equal to the preset number, acquiring the word frame group in the buffer according to the numbering sequence, and compensating to the storage position of the voice packets which are continuously lost according to the word frame group in sequence.
2. The method of claim 1, wherein the step of sequentially inputting the voice packets of the voice call into a buffer according to the initial voice packet comprises:
judging whether the current voice packet is the initial voice packet or not, or whether the initial voice packet exists or not, and if the current voice packet is the initial voice packet or the initial voice packet exists, inputting the voice packets in the voice call into the buffer in sequence;
after voice packets in voice communication are sequentially input into the buffer each time, detecting the storage space condition of the buffer, if the buffer has available storage space, acquiring the next voice packet, and continuing to execute the step of judging whether the current voice packet is an initial voice packet or not or whether the initial voice packet exists or not, if so, sequentially inputting the voice packets in the voice communication into the buffer;
and if the buffer has no available storage space, stopping inputting the voice packet into the buffer.
3. The method of claim 1, further comprising:
when the number of the voice packets lost continuously is smaller than the preset number, acquiring target voice packets in the buffer in a residual packet processing mode, wherein when the number of the voice packets lost continuously is smaller than the preset number, the residual packet processing mode is to acquire voice packets of a previous target number in sequence from the word frame group corresponding to the number to be accessed, and the target number is the number of the voice packets lost continuously;
and sequentially compensating the target voice packet to the storage position of the continuously lost voice packet by adopting a residual packet compensation mode.
4. The method of claim 1, wherein before sequentially inputting the voice packets of the voice call into a buffer according to the initial voice packet, further comprising:
initializing the counting value of the voice packet;
the number is initialized.
5. The method of claim 1, wherein inputting the voice packets of the voice call into a buffer in sequence comprises:
when voice packets in voice communication are sequentially input into a buffer at each time, judging whether the number of the input voice packets reaches a preset number;
if not, storing the input voice packet into the cache with the same number as the last input voice packet, and increasing the counting value of the input voice packet by 1;
and if so, resetting the counting value of the input voice packet to 1, increasing the number by 1 to obtain a new number, and storing the input voice packet from the storage position of the new number in the buffer.
6. The method according to claim 1, wherein the sequentially compensating to the storage locations of the consecutive lost speech packets according to the group of word frames comprises:
if the result of dividing the number of the voice packets lost continuously by the preset number is a positive integer, compensating the voice packets in the word frame group to the storage position of the voice packets lost continuously according to the sequence of the numbers;
if the number of the continuously lost voice packets is greater than the preset number and the result of dividing the number of the continuously lost voice packets by the preset number has a remainder, sequentially compensating the voice packets in the target word frame group to a first storage position of the continuously lost voice packets according to the sequence of the number, wherein the target word frame group is a word frame group which is sequenced according to the number and corresponds to the quotient value obtained by dividing the number of the continuously lost voice packets by the preset number;
acquiring voice packets with the number of the previous remainders in sequence from the word frame group corresponding to the number to be accessed by adopting a remainder packet processing mode, wherein the number of the remainders is the number corresponding to the number of the remainders;
and sequentially compensating the voice packets with the front and the remainder numbers to a second storage position of the continuous lost voice packets by adopting a residual packet compensation mode, wherein the storage position of the continuous lost voice packets comprises the first storage position and the second storage position.
7. The method according to any one of claims 1 to 6, wherein the predetermined number is 18.
8. An apparatus for compensating for a long-time continuous packet loss of voice, the apparatus comprising:
the initial voice packet determining module is used for determining an initial voice packet in the voice call;
the input buffer module is used for inputting the voice packets in the voice call into a buffer according to the initial voice packet in sequence, wherein the voice packets with a preset number are used as a group of word frame groups, and each group of word frame groups corresponds to a number in sequence;
a lost voice packet determining module, configured to detect a continuously lost voice packet in the voice call, and determine the number and storage location of the continuously lost voice packet;
and the compensation module is used for acquiring the word frame groups in the buffer according to the numbering sequence when the number of the continuously lost voice packets is greater than or equal to the preset number, and compensating to the storage positions of the continuously lost voice packets according to the word frame groups in sequence.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the voice long-time continuous packet loss compensation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the steps of the method for compensating for long-term continuous packet loss according to any one of claims 1 to 7.
CN201910692548.XA 2019-07-30 2019-07-30 Voice long-time continuous packet loss compensation method and device Active CN112312475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910692548.XA CN112312475B (en) 2019-07-30 2019-07-30 Voice long-time continuous packet loss compensation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910692548.XA CN112312475B (en) 2019-07-30 2019-07-30 Voice long-time continuous packet loss compensation method and device

Publications (2)

Publication Number Publication Date
CN112312475A true CN112312475A (en) 2021-02-02
CN112312475B CN112312475B (en) 2023-02-28

Family

ID=74330132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910692548.XA Active CN112312475B (en) 2019-07-30 2019-07-30 Voice long-time continuous packet loss compensation method and device

Country Status (1)

Country Link
CN (1) CN112312475B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114978437A (en) * 2022-07-25 2022-08-30 南京百家云科技有限公司 Data compensation system, method, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760440A (en) * 2012-05-02 2012-10-31 中兴通讯股份有限公司 Voice signal transmitting and receiving device and method
CN109413685A (en) * 2017-08-18 2019-03-01 中国电信股份有限公司 Voice quality determines method, apparatus and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760440A (en) * 2012-05-02 2012-10-31 中兴通讯股份有限公司 Voice signal transmitting and receiving device and method
CN109413685A (en) * 2017-08-18 2019-03-01 中国电信股份有限公司 Voice quality determines method, apparatus and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114978437A (en) * 2022-07-25 2022-08-30 南京百家云科技有限公司 Data compensation system, method, electronic equipment and storage medium
CN114978437B (en) * 2022-07-25 2022-10-28 南京百家云科技有限公司 Data compensation system, method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112312475B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
US10291774B2 (en) Method, device, and system for determining spam caller phone number
CN108076226B (en) Method for adjusting call quality, mobile terminal and storage medium
CN106657528B (en) Incoming call management method and device
CN109785845B (en) Voice processing method, device and equipment
CN108073572B (en) Information processing method and device, simultaneous interpretation system
CN108682421B (en) Voice recognition method, terminal equipment and computer readable storage medium
US11388652B2 (en) Method and apparatus for indicating position of cell-defining synchronization signal block and searching for the same, and base station
CN109151148B (en) Call content recording method, device, terminal and computer readable storage medium
CN112312475B (en) Voice long-time continuous packet loss compensation method and device
CN110970030A (en) Voice recognition conversion method and system
CN111062200B (en) Speaking generalization method, speaking recognition device and electronic equipment
CN107071553B (en) Method, device and computer readable storage medium for modifying video and voice
CN108650306A (en) A kind of game video caching method, device and computer storage media
CN110673753A (en) Key mis-touch error correction method and device
CN106453835B (en) A kind of method and terminal switching answering mode
US11120251B2 (en) Face capturing method and related apparatus
CN116339673A (en) UAC equipment silence state detection method and device and electronic equipment
CN116136855A (en) Account grouping determination method and device, electronic equipment and storage medium
US9626579B2 (en) Increasing canny filter implementation speed
CN108073566B (en) Word segmentation method and device and word segmentation device
CN114154395A (en) Model processing method and device for model processing
CN106294309B (en) Combined type ambiguous word recognition method and device
CN110019657B (en) Processing method, apparatus and machine-readable medium
CN112987941A (en) Method and device for generating candidate words
CN110418245B (en) Method and device for reducing reaction delay of Bluetooth sound box and terminal equipment

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