CN107317795B - Method and device for adjusting code rate of data packet - Google Patents

Method and device for adjusting code rate of data packet Download PDF

Info

Publication number
CN107317795B
CN107317795B CN201710317741.6A CN201710317741A CN107317795B CN 107317795 B CN107317795 B CN 107317795B CN 201710317741 A CN201710317741 A CN 201710317741A CN 107317795 B CN107317795 B CN 107317795B
Authority
CN
China
Prior art keywords
client
code rate
data packet
rate
packet loss
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
Application number
CN201710317741.6A
Other languages
Chinese (zh)
Other versions
CN107317795A (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.)
Guiyang Longmaster Information and Technology Co ltd
Original Assignee
Guiyang Longmaster Information and Technology 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 Guiyang Longmaster Information and Technology Co ltd filed Critical Guiyang Longmaster Information and Technology Co ltd
Priority to CN201710317741.6A priority Critical patent/CN107317795B/en
Publication of CN107317795A publication Critical patent/CN107317795A/en
Application granted granted Critical
Publication of CN107317795B publication Critical patent/CN107317795B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/141Systems for two-way working between two video terminals, e.g. videophone
    • H04N7/147Communication arrangements, e.g. identifying the communication as a video-communication, intermediate storage of the signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Environmental & Geological Engineering (AREA)
  • Quality & Reliability (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The invention discloses a method and a device for adjusting the code rate of a data packet, wherein the method comprises the following steps: the method comprises the steps that a server detects a first packet loss rate of an uplink data packet received from a first client in a preset detection period; when the first packet loss rate is determined to be greater than a first preset value, the server sends a signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate for sending the uplink data packet; the server receives an uplink data packet from the first client, and detects a first packet loss rate of the uplink data packet in a preset period to judge whether information for sending the data packet with the reduced code rate needs to be sent to the first client continuously. According to the technical scheme of the invention, the server can dynamically adjust the bandwidth occupied by the video according to the current packet loss rate, and provide high-definition video as much as possible under the condition of ensuring smooth video, so that a user can carry out high-quality video call.

Description

Method and device for adjusting code rate of data packet
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for adjusting a code rate of a data packet.
Background
The current mobile internet is very popular, the requirement of using a mobile phone to carry out video call becomes a very important demand point, and the demand point is also a function which can be frequently used by vast users, but under many conditions, when a mobile network is used by a mobile phone end, the mobile phone end can be used in moving, so that the instability of network quality can be caused.
In general, if the bandwidth occupied by video transmission exceeds the current maximum bandwidth of the mobile phone, the packet loss rate rises linearly, and the fluency of the video is greatly affected when packet loss occurs. And, on the premise of considering fluency, the definition of the video is also considered, because the definition of the video is also an important factor influencing the quality of the video.
Therefore, for different network conditions, how to provide high-definition video as much as possible under the condition of ensuring smooth video is a technical problem which needs to be researched and overcome so that a user can carry out high-quality video call.
Disclosure of Invention
The invention mainly aims to disclose a method and a device for adjusting the code rate of a data packet, so as to at least solve the technical problem that how to comprehensively consider the fluency and the definition of a video under the condition of poor network conditions in the related technology and enable a user to carry out high-quality video call.
According to one aspect of the invention, a method for adjusting a code rate of a data packet is provided.
The method for adjusting the code rate of the data packet comprises the following steps: the method comprises the steps that a server detects a first packet loss rate of an uplink data packet received from a first client in a preset detection period; when the first packet loss rate is determined to be greater than a first preset value, the server sends a signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate for sending the uplink data packet; and the server receives an uplink data packet from the first client, and detects the first packet loss rate of the uplink data packet in the preset period so as to judge whether information for continuously sending a data packet with a reduced code rate to the first client is required.
Preferably, the receiving, by the server, the uplink data packet from the first client, and detecting a packet loss rate of the uplink data packet in the predetermined period, so as to determine whether information for continuously sending a data packet with a reduced bit rate to the first client includes: the server receives an uplink data packet from the first client, and detects the first packet loss rate of the uplink data packet in the preset period; and when the first packet loss rate is determined to be greater than a second preset value, the server continues to send the signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate for sending the data packets.
Preferably, the information instructing the first client to send the data packet with the reduced code rate includes: and indicating the code rate value and/or the code rate level of the uplink data packet to be sent by the first client.
Preferably, after the server sends the signaling to the first client, the method further includes: the server detects the current sending code rate of the uplink data packet carried in the heartbeat information returned by the first client; and when the current code rate is determined and is not matched with the code rate value or the code rate level, repeatedly sending a notification packet for adjusting the code rate to the first client until the current code rate is matched with the code rate value or the code rate level.
Preferably, after the server sends the signaling to the first client, the method further includes: the server detects a first packet loss rate of an uplink data packet received from a first client in each preset detection period; if the first packet loss rate is N1If the number of the continuous preset detection periods is less than or equal to a fourth preset value, the server sends a code rate recovery notification to the first client, wherein N is1The code rate recovery notification carries information indicating that the first client increases the code rate for sending the uplink data packet, wherein the code rate recovery notification is an integer larger than 1; the server receives an uplink data packet from the first client, and detects the first packet loss rate of the uplink data packet within a preset time after the code rate recovery notification is sent; determining that the code rate is successfully recovered under the condition that the first packet loss rate is not increased; and under the condition that the first packet loss rate is increased, determining code rate recovery failure and marking the failure.
Preferably, in the case that the first packet loss rate is increased, after determining that the rate recovery fails, the method further includes: the server detects a first packet loss rate of an uplink data packet received from a first client in each preset detection period; if the first packet loss rate is N2If the number of the consecutive detection periods is less than or equal to the fourth predetermined value, the server sends the rate recovery notification to the first client again, where N is2Is greater than N1The code rate recovery notification carries information indicating that the first client increases the code rate for sending the uplink data packet; the server receives an uplink data packet from the first client, and within a preset time after the server sends the code rate recovery notification, the server sends the uplink data packet to the first clientDetecting the first packet loss rate; determining that the code rate is successfully recovered under the condition that the first packet loss rate is not increased; and under the condition that the first packet loss rate is increased, determining code rate recovery failure and marking the failure.
Preferably, the method further comprises the following steps: the server sends a downlink data packet to the second client according to a preset code rate; the server receives heartbeat information from a second client, wherein the heartbeat information carries a current second packet loss rate of a downlink data packet; the server judges whether the code rate of the downlink data packet needs to be adjusted or not according to the second packet loss rate; when the second packet loss rate is greater than a third preset value, the server reduces the code rate and sends a downlink data packet; and the server continuously receives the heartbeat information from the second client and detects the current second packet loss rate in the heartbeat information so as to judge whether to continuously reduce the code rate and send a downlink data packet to the second client.
Preferably, the method further comprises the following steps: the server compares the current code rate of the uplink data packet with the current code rate of the downlink data packet; when the current code rate of the uplink data packet is smaller than or equal to the current code rate of the downlink data packet, the server directly forwards the uplink data packet to the second client; and when the current code rate of the uplink data packet is greater than the current code rate of the downlink data packet, the server decodes the uplink data packet, re-encodes the data packet according to the current code rate of the downlink data packet, and sends the encoded data packet to the second client.
Preferably, after the server reduces the code rate and sends the downlink data packet, the method further includes: the server receives a second packet loss rate carried in the heartbeat information from a second client; if the second packet loss rate is N3In each continuous heartbeat sending period, if the heartbeat sending period is less than or equal to a fifth preset value, the server increases the code rate of sending the downlink data packet to the second client, wherein N is3Is an integer greater than 1; the server receives heartbeat information from the second client and carries the heartbeat informationDetecting the second packet loss rate; determining that the code rate is successfully recovered under the condition that the second packet loss rate is not increased; and under the condition that the second packet loss rate is increased, determining code rate recovery failure and marking the failure.
Preferably, in the case that the second packet loss rate is increased, after determining that the rate recovery fails, the method further includes: the server detects a second packet loss rate carried in heartbeat information returned from a second client in each preset detection period; if the second packet loss rate is N4If the number of consecutive detection periods is less than or equal to the sixth predetermined value, the server increases the code rate of sending downlink data packets to the second client, where N is4Is greater than N3An integer of (d); the server receives heartbeat information from the second client and detects a second packet loss rate carried in the heartbeat information; determining that the code rate is successfully recovered under the condition that the second packet loss rate is not increased; and under the condition that the second packet loss rate is increased, determining code rate recovery failure and marking the failure.
According to another aspect of the present invention, an apparatus for adjusting a bit rate of a data packet is provided.
The device for adjusting the code rate of the data packet comprises: the first detection module is used for detecting a first packet loss rate of an uplink data packet received from a first client in a preset detection period; a first sending module, configured to send a signaling to the first client when it is determined that the first packet loss rate is greater than a first predetermined value, where the signaling carries information indicating that the first client reduces a code rate for sending an uplink data packet; a first receiving module, configured to receive an uplink data packet from the first client, and detect the first packet loss rate of the uplink data packet in the predetermined period, so as to determine whether information for sending a data packet with a reduced code rate needs to be sent to the first client continuously.
Preferably, the method further comprises the following steps: a second detection module, configured to detect, in each predetermined detection period, an uplink data packet received from the first clientDetecting the first packet loss rate; a second sending module, configured to send the first packet loss rate at N1Sending a rate recovery notification to the first client when the number of the consecutive detection periods is less than or equal to a fourth predetermined value, wherein N is1The code rate recovery notification carries information indicating that the first client increases the code rate for sending the uplink data packet, wherein the code rate recovery notification is an integer larger than 1; a second receiving module, configured to receive an uplink data packet from the first client, and detect the first packet loss rate of the uplink data packet within a predetermined time after the code rate recovery notification is sent; a first determining module, configured to determine that a code rate recovery is successful when the first packet loss rate is not increased; and a second determining module, configured to determine a code rate recovery failure and mark the failure when the first packet loss rate is increased.
Preferably, the method further comprises the following steps: a third sending module, configured to send a downlink data packet to the second client according to the predetermined code rate; a third receiving module, configured to receive heartbeat information from a second client, where the heartbeat information carries a current second packet loss rate of a downlink data packet; a judging module, configured to judge whether a code rate for sending a downlink data packet needs to be adjusted according to the second packet loss rate; a first code rate adjustment module, configured to reduce a code rate to send a downlink data packet when the second packet loss rate is greater than a third predetermined value; and the third detection module is used for continuously receiving the heartbeat information from the second client and detecting the current second packet loss rate in the heartbeat information so as to judge whether a downlink data packet needs to be sent to the second client by continuously reducing the code rate.
Preferably, the method further comprises the following steps: the fourth receiving module is configured to receive a second packet loss rate carried in the heartbeat information from the second client; a second code rate adjusting module, if the second packet loss rate is N3In each continuous heartbeat sending period, the heartbeat sending period is less than or equal to a fifth preset value, the code rate of sending downlink data packets to the second client is increased, wherein N is3Is an integer greater than 1; a fifth receiving module, configured to receive heartbeat information from the second client,detecting a second packet loss rate carried in the heartbeat information; a third determining module, configured to determine that the code rate recovery is successful when the second packet loss rate is not increased; and a fourth determining module, configured to determine a code rate recovery failure and mark the failure when the second packet loss rate is increased.
Compared with the prior art, the embodiment of the invention at least has the following advantages: the server can dynamically adjust the bandwidth occupied by the video according to the current packet loss rate, and provide high-definition video as far as possible under the condition of ensuring smooth video, so that a user can carry out high-quality video call.
Drawings
Fig. 1 is a flowchart of a method for adjusting a code rate of a data packet according to an embodiment of the present invention;
fig. 2 is a block diagram of a transmission system of data packets according to a preferred embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for adjusting a bit rate of a data packet according to an embodiment of the present invention; and
fig. 4 is a block diagram of a device for adjusting a code rate of a data packet according to a preferred embodiment of the present invention.
Detailed Description
The following detailed description of specific embodiments of the present invention is provided in conjunction with the accompanying drawings.
Fig. 1 is a flowchart of a method for adjusting a code rate of a data packet according to an embodiment of the present invention. As shown in fig. 1, the method for adjusting the code rate of the data packet includes:
step S101: the method comprises the steps that a server detects a first packet loss rate of an uplink data packet received from a first client in a preset detection period;
step S103: when the first packet loss rate is determined to be larger than a first preset value, the server sends a signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate for sending the uplink data packet;
step S105: the server receives an uplink data packet from the first client, and detects a first packet loss rate of the uplink data packet in a preset period to judge whether information for sending the data packet with the reduced code rate needs to be sent to the first client continuously.
By adopting the method shown in fig. 1, the server can dynamically adjust the bandwidth occupied by the video according to the current packet loss rate, and provide a high-definition video as much as possible under the condition of ensuring the smoothness of the video, so that a user can carry out high-quality video call.
The information instructing the first client to send the data packet with the reduced code rate includes but is not limited to: and indicating the code rate value and/or the code rate level of the uplink data packet to be sent by the first client. That is, the server may directly notify the first client of the bitrate value to be adjusted of the first client, may also directly notify the first client of the bitrate level to be adjusted of the first client, or directly notify the first client of the bitrate value to be adjusted and the bitrate level to be adjusted of the first client.
Preferably, in step S105, the receiving, by the server, the uplink data packet from the first client, and detecting a packet loss rate of the uplink data packet in a predetermined period to determine whether information of sending the data packet with a reduced code rate to the first client needs to be sent further includes: the method comprises the steps that a server receives an uplink data packet from a first client, and detects a first packet loss rate of the uplink data packet in a preset period; and when the first packet loss rate is determined to be larger than a second preset value, the server continuously sends a signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate of sending the data packet.
Preferably, the method further comprises: the server sends a downlink data packet to the second client according to a preset code rate; the server receives heartbeat information from the second client, wherein the heartbeat information carries a current second packet loss rate of the downlink data packet; the server judges whether the code rate of the downlink data packet needs to be adjusted or not according to the second packet loss rate; when the second packet loss rate is greater than a third preset value, the server reduces the code rate and sends a downlink data packet; and the server continuously receives the heartbeat information from the second client and detects the current second packet loss rate in the heartbeat information so as to judge whether the downlink data packet needs to be sent to the second client continuously for reducing the code rate.
In a preferred implementation, as shown in fig. 2, a transmission system for video data packets comprises: a sender (e.g., a first client), a server, and a receiver (e.g., a second client). In general, only the link of receiving a video packet can count the current packet loss rate, and a video call is divided into an uplink and a downlink of the video. For example, uplink: sender (also video recorder) to server; descending: the server forwards the video data packet sent by the recording party to the receiving party.
For uplink transmission, a client of a sending party sends video data packets to a server, each video data packet has a serial number, the serial number is self-increasing, when the server receives the video data packets, the server checks once every detection period, and the following can be obtained according to the serial numbers: the packet loss ratio is the number of received video data packets/total number of video data packets.
For downlink transmission, the receiving side calculates the downlink packet loss rate according to the above manner based on the received video data packet, and feeds back the downlink packet loss rate to the server.
In a preferred embodiment, the transmission rate of the video data packets can be generally divided into a plurality of levels (e.g., three levels of 800kb/s (0.8M/s),400kb/s (0.4M/s), and 100kb/s (0.1M/s)). The higher the code rate, the more the occupied bandwidth and the clearer the video, and the conditions of increasing and decreasing the code rate adjustment exist.
Typically, a default initial bitrate, such as 800kb/s (0.8M/s), can be used, because typically, a user has at least a bandwidth of 1M or more, and a video with a bitrate of 800kb/s (0.8M/s) is usually able to be carried.
The byte transmitted by each video packet is 1kByte, and then 100 video packets are transmitted per second when the video rate is 800 kbit/s.
800k/(1k*8)=100;
This has the concept: 1Byte ═ 8 bit;
the number of video packets sent per second with different code rates is obtained as follows:
code rate (kb/s) Per secondNumber of bags(p/s)
800 100
400 50
100 13
The server checks the packet loss rate once every predetermined period (for example, 2s), but due to the dynamic condition of the video data packet parameters, the server cannot divide the detection period of the packet loss rate according to the absolute time, and only can be according to the number of the received data packets. Then the number of packet detections corresponding to different code rates is as follows:
code rate (kb/s) Detection period (packet)
800 200
400 100
100 26
In the uplink transmission process, the server detects the packet loss rate according to the detection period, if the packet loss rate is found to be greater than a first predetermined value (for example, 1%), a signaling packet is sent to the sender to inform the sender to reduce the code rate to send a data packet, for example, the data packet is sent by using the code rate of 400kb/s (0.4M/s), after the sender receives the notification from the server, the video is encoded into the code rate of 400kb/s (0.4M/s), and the video data packet is continuously sent to the server. If the code rate of 400kb/s (0.4M/s) is adopted, the packet loss rate is greater than a second preset value (for example, 3%), and the server informs the client to continue to reduce the code rate to send the data packet, for example, the code rate of 100kb/s (0.1M/s) is used.
In the downlink transmission process, the receiver detects the packet loss rate according to the above detection period, and notifies the server of the current downlink packet loss rate in the heartbeat packet, and if the server finds that the packet loss rate is greater than a third predetermined value (e.g., 1%), the code rate is reduced to transmit the data packet, for example, the data packet is transmitted by using the code rate of 400kb/s (0.4M/s). If the code rate of 400kb/s (0.4M/s) is adopted and the packet loss rate is greater than a fourth predetermined value (e.g., 3%), the server will continue to reduce the code rate to transmit the data packet, for example, using the code rate of 100kb/s (0.1M/s).
Preferably, after the server continues to send the signaling to the first client in step S103, or after determining that the first packet loss rate is greater than the second predetermined value, the method may further include: the server detects the current sending code rate of the uplink data packet carried in the heartbeat information returned by the first client; and when the current code rate is determined to be not matched with the code rate value or the code rate level, repeatedly sending a notification packet for adjusting the code rate to the first client until the current code rate is matched with the code rate value or the code rate level.
In a preferred implementation, the server notifies the first client (sender) that a data packet for adjusting the code rate may be lost, and in order to ensure that the notification will take effect, there is a mechanism that the client sends a heartbeat message to the server every predetermined time (for example, 1 second) to notify the server of the currently encoded code rate of the client. The server sends a notification packet for adjusting the code rate to the client, and the server considers that the code rate is successfully adjusted until the code rate in the heartbeat packet of the client is equal to the code rate.
Preferably, the method further comprises: the server compares the current code rate of the uplink data packet with the current code rate of the downlink data packet; when the current code rate of the uplink data packet is smaller than or equal to the current code rate of the downlink data packet, the server directly forwards the uplink data packet to the second client; and when the current code rate of the uplink data packet is greater than that of the downlink data packet, the server decodes the uplink data packet, re-encodes the data packet according to the current code rate of the downlink data packet, and sends the encoded data packet to the second client.
In the preferred implementation process, if the uplink code rate is recorded as: the code rate of uploadbite downlink is recorded as: when the downlink Bitrate is equal to the uplink Bitrate, the server directly forwards the uplink video data packet; when the downloadbite < uploadbite, the server decodes the upstream video data packet, re-encodes the video data packet at a bit rate required by the downstream, and transmits the encoded video data packet to the receiving party (the second client).
Preferably, after the server continues to send the signaling to the first client in step S103, or after determining that the first packet loss rate is greater than the second predetermined value, the method further includes: the method comprises the steps that a server detects a first packet loss rate of an uplink data packet received from a first client in each preset detection period; if the first packet loss rate is N1If the number of the detection periods is less than or equal to a fourth preset value, the server sends a code rate recovery notification to the first client, wherein N is1If the bit rate is an integer larger than 1, the bit rate recovery notice carries information for indicating the first client to increase the bit rate for sending the uplink data packet;the method comprises the steps that a server receives an uplink data packet from a first client, and detects a first packet loss rate of the uplink data packet within a preset time after a code rate recovery notification is sent; determining that the code rate is successfully recovered under the condition that the first packet loss rate is not increased; and under the condition that the first packet loss rate is increased, determining code rate recovery failure, and marking the failure.
Preferably, in the case that the first packet loss rate is increased, after determining that the rate recovery fails, the method further includes: the method comprises the steps that a server detects a first packet loss rate of an uplink data packet received from a first client in each preset detection period; if the first packet loss rate is N2If the number of the detection periods is less than or equal to a fourth preset value, the server sends a code rate recovery notification to the first client again, wherein N is2Is greater than N1The code rate recovery notification carries information indicating the first client to increase the code rate for sending the uplink data packet; the method comprises the steps that a server receives an uplink data packet from a first client, and detects a first packet loss rate of the uplink data packet within a preset time after a code rate recovery notification is sent; determining that the code rate is successfully recovered under the condition that the first packet loss rate is not increased; and under the condition that the first packet loss rate is increased, determining code rate recovery failure, and marking the failure.
Preferably, after the server reduces the code rate and sends the downlink data packet, the method may further include: the server receives a second packet loss rate carried in the heartbeat information from the second client; if the second packet loss rate is N3In each continuous heartbeat sending period, if the heartbeat sending period is less than or equal to a fifth preset value, the server increases the code rate of sending the downlink data packet to the second client, wherein N is3Is an integer greater than 1; the server receives heartbeat information from the second client and detects a second packet loss rate carried in the heartbeat information; determining that the code rate is successfully recovered under the condition that the second packet loss rate is not increased; and under the condition that the second packet loss rate is increased, determining that the code rate recovery fails, and marking the failure.
Preferably, in the case that the second packet loss rate increases, after determining that the rate recovery fails, the method further includesThe method can comprise the following steps: the server detects a second packet loss rate carried in heartbeat information returned from the second client in each preset detection period; if the second packet loss rate is N4If the number of the continuous preset detection periods is less than or equal to a sixth preset value, the server increases the code rate of the downlink data packet sent to the second client, wherein N is4Is greater than N3An integer of (d); the server receives heartbeat information from the second client and detects a second packet loss rate carried in the heartbeat information; determining that the code rate is successfully recovered under the condition that the second packet loss rate is not increased; and under the condition that the second packet loss rate is increased, determining that the code rate recovery fails, and marking the failure.
In the preferred implementation process, the network of the mobile terminal is not very stable, and when the network state is not good, the code rate can be reduced, but if the network state is recovered, the code rate should be increased to obtain better definition and user experience.
In uplink transmission, after reducing the code rate of a video data packet, if the packet loss rate of the video data packet is less than or equal to a fourth predetermined value (e.g., 0%), after a plurality of consecutive periods (e.g., 10 periods), the server will try to notify the first client to increase the uplink code rate, and if the packet loss rate does not increase within a predetermined time (e.g., 2s) after the code rate is increased, the rate is considered to be successfully increased, and if the packet loss rate also increases within a predetermined time (e.g., 2s) after the code rate is increased, the first client is notified that the code rate is reduced to the original code rate, and the rate is marked as a rate increase failure.
Each failure to raise the code rate will increase the requirement for the next attempt to raise the code rate. For example, originally under low code rate, only continuous N1If the packet loss rate in one (e.g., 10) period is 0% of the fourth predetermined value, then the code rate is attempted to be increased, but if the code rate is failed to be increased, the requirement for increasing the next code rate attempt is changed to N consecutive periods2The code rate is increased only if the packet loss rate is 0% for one (e.g., 20) cycles.
In downlink transmission, after the server reduces the code rate, if the second client returnsIf the packet loss rate of the video data packets carried in the heartbeat information is less than or equal to a fifth predetermined value (e.g., 0%), then in N consecutive frames3After a period (e.g., 10 periods), the server tries to raise the downlink code rate, and if the packet loss rate is not raised within a predetermined time (e.g., 2s) after the code rate is raised, the code rate is considered to be successfully raised, and if the packet loss rate is also raised within a predetermined time (e.g., 2s) after the code rate is raised, the code rate is considered to be failed to be raised, and the server reduces the code rate to the original code rate, and marks the code rate as a code rate raising failure.
Each failure to raise the code rate will increase the requirement for the next attempt to raise the code rate. For example, originally under low code rate, only continuous N3If the packet loss rate in one (e.g., 10) period is 0% of a fifth predetermined value, then the code rate is attempted to be increased, but if the code rate is failed to be increased, the requirement for increasing the next code rate attempt is changed to N consecutive periods4The code rate is increased only if the packet loss rate is 0% for one (e.g., 20) cycles.
In the implementation process, when the code rate is failed to be increased, the requirement for increasing the next code rate is to avoid unstable video, and the requirement is to try to increase the code rate and not to frequently increase the code rate, so that the video quality is not stable.
The embodiment of the invention also provides a device for adjusting the code rate of the data packet.
Fig. 3 is a block diagram of an apparatus for adjusting a bit rate of a data packet according to an embodiment of the present invention. As shown in fig. 3, the code rate adjusting apparatus includes: a first detection module 30, configured to detect a first packet loss rate of an uplink data packet received from a first client in a predetermined detection period; a first sending module 32, configured to send a signaling to the first client when it is determined that the first packet loss rate is greater than a first predetermined value, where the signaling carries information indicating that the first client reduces a code rate for sending an uplink data packet; the first receiving module 34 is configured to receive an uplink data packet from the first client, and detect a first packet loss rate of the uplink data packet in a predetermined period, so as to determine whether information for continuously sending a data packet with a reduced code rate to the first client is needed.
Preferably, as shown in fig. 4, the apparatus may further include: a second detection module 40, configured to detect, in each predetermined detection period, a first packet loss rate of an uplink data packet received from a first client; a second sending module 42, configured to send the first packet loss rate at N1Sending a code rate recovery notification to the first client when the number of the detection periods is less than or equal to a fourth preset value, wherein N is1If the bit rate is an integer larger than 1, the bit rate recovery notice carries information for indicating the first client to increase the bit rate for sending the uplink data packet; a second receiving module 44, configured to receive an uplink data packet from the first client, and detect a first packet loss rate of the uplink data packet within a predetermined time after the code rate recovery notification is sent; a first determining module 46, configured to determine that the code rate recovery is successful when the first packet loss rate is not increased; the second determining module 48 is configured to determine that the code rate recovery fails and mark the failure when the first packet loss rate is increased.
Preferably, as shown in fig. 4, the apparatus may further include: a third sending module 50, connected to the first receiving module 34, configured to send a downlink data packet to the second client according to a predetermined code rate; a third receiving module 52, configured to receive heartbeat information from the second client, where the heartbeat information carries a current second packet loss rate of the downlink data packet; a determining module 54, configured to determine whether a code rate for sending the downlink data packet needs to be adjusted according to the second packet loss rate; a first code rate adjustment module 56, configured to reduce the code rate to send a downlink data packet when the second packet loss rate is greater than a third predetermined value; the third detecting module 58 is configured to continue receiving the heartbeat information from the second client, and detect a current second packet loss rate in the heartbeat information, so as to determine whether it is necessary to continue to reduce the code rate and send a downlink data packet to the second client.
Preferably, as shown in fig. 4, the apparatus may further include: a fourth receiving module 60, configured to receive, from the second client, a second packet loss rate carried in the heartbeat information; a second code rate adjusting module 62, if the second packet loss rate is N3A continuous heartbeat transmissionIn the period, the code rates of the downlink data packets sent to the second client are all smaller than or equal to a fifth preset value, wherein N is3Is an integer greater than 1; a fifth receiving module 64, configured to receive the heartbeat information from the second client, and detect a second packet loss rate carried in the heartbeat information; a third determining module 66, configured to determine that the code rate recovery is successful when the second packet loss rate is not increased; a fourth determining module 68, configured to determine that the code rate recovery fails and mark the failure when the second packet loss rate is increased.
In summary, with the above embodiments provided by the present invention, the server can dynamically adjust the bandwidth occupied by the video according to the current packet loss rate, and provide a high-definition video as much as possible while ensuring that the video is smooth, so that the user can perform a high-quality video call.
The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.

Claims (12)

1. A method for adjusting a code rate of a data packet, comprising:
the method comprises the steps that a server detects a first packet loss rate of an uplink data packet received from a first client in a preset detection period;
when the first packet loss rate is determined to be greater than a first preset value, the server sends a signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate for sending the uplink data packet;
the server receives an uplink data packet from the first client, and detects the first packet loss rate of the uplink data packet in the preset period so as to judge whether information for continuously sending a data packet with a reduced code rate to the first client is needed;
after the server continues to send the signaling to the first client, or after the server continues to send the data packet for reducing the code rate to the first clientAfter the information of (1), further comprising: the server detects a first packet loss rate of an uplink data packet received from the first client in each preset detection period, and if the first packet loss rate is N1If the number of the detection periods is less than or equal to a fourth preset value, the server sends a code rate recovery notification to the first client, wherein N is1If the bit rate is an integer larger than 1, the bit rate recovery notice carries information for indicating the first client to increase the bit rate for sending the uplink data packet; the server receives an uplink data packet from the first client, detects a first packet loss rate of the uplink data packet within a preset time after sending the code rate recovery notification, determines that the code rate recovery is successful under the condition that the first packet loss rate is not increased, determines that the code rate recovery fails under the condition that the first packet loss rate is increased, notifies the first client to reduce the original code rate, and marks the failure.
2. The method of claim 1, wherein the receiving, by the server, the uplink data packet from the first client, and detecting a packet loss rate of the uplink data packet in the predetermined period to determine whether information for continuously sending a reduced code rate transmission data packet to the first client is required comprises:
the server receives an uplink data packet from the first client, and detects the first packet loss rate of the uplink data packet in the preset period;
and when the first packet loss rate is determined to be greater than a second preset value, the server continues to send the signaling to the first client, wherein the signaling carries information for indicating the first client to reduce the code rate for sending the data packets.
3. The method of claim 1 or 2, wherein the information instructing the first ue to send data packets with reduced code rate comprises: and indicating the code rate value and/or the code rate level of the uplink data packet to be sent by the first client.
4. The method of claim 3, after the server sends the signaling to the first client, further comprising:
the server detects the current sending code rate of the uplink data packet carried in the heartbeat information returned by the first client;
and when the current code rate is determined and is not matched with the code rate value or the code rate level, repeatedly sending a notification packet for adjusting the code rate to the first client until the current code rate is matched with the code rate value or the code rate level.
5. The method of claim 1, wherein after determining that the rate recovery fails in case of the first packet loss rate increasing, further comprising:
the server detects a first packet loss rate of an uplink data packet received from a first client in each preset detection period;
if the first packet loss rate is N2If the number of the consecutive detection periods is less than or equal to the fourth predetermined value, the server sends the rate recovery notification to the first client again, where N is2Is greater than N1The code rate recovery notification carries information indicating that the first client increases the code rate for sending the uplink data packet;
the server receives an uplink data packet from the first client, and detects the first packet loss rate of the uplink data packet within a preset time after the code rate recovery notification is sent;
determining that the code rate is successfully recovered under the condition that the first packet loss rate is not increased;
and under the condition that the first packet loss rate is increased, determining code rate recovery failure and marking the failure.
6. The method of claim 1, further comprising:
the server sends a downlink data packet to the second client according to a preset code rate;
the server receives heartbeat information from a second client, wherein the heartbeat information carries a current second packet loss rate of a downlink data packet;
the server judges whether the code rate of the downlink data packet needs to be adjusted or not according to the second packet loss rate;
when the second packet loss rate is greater than a third preset value, the server reduces the code rate and sends a downlink data packet;
and the server continuously receives the heartbeat information from the second client and detects the current second packet loss rate in the heartbeat information so as to judge whether to continuously reduce the code rate and send a downlink data packet to the second client.
7. The method of claim 6, further comprising:
the server compares the current code rate of the uplink data packet with the current code rate of the downlink data packet;
when the current code rate of the uplink data packet is smaller than or equal to the current code rate of the downlink data packet, the server directly forwards the uplink data packet to the second client;
and when the current code rate of the uplink data packet is greater than the current code rate of the downlink data packet, the server decodes the uplink data packet, re-encodes the data packet according to the current code rate of the downlink data packet, and sends the encoded data packet to the second client.
8. The method of claim 6, wherein after the server reduces the code rate and transmits the downlink data packet, the method further comprises:
the server receives a second packet loss rate carried in the heartbeat information from a second client;
if the second packet loss rate is N3Within each continuous heartbeat transmission period, all are less than or equal to the fifth preAnd if the value is fixed, the server increases the code rate of sending the downlink data packet to the second client, wherein N3Is an integer greater than 1;
the server receives heartbeat information from the second client and detects a second packet loss rate carried in the heartbeat information;
determining that the code rate is successfully recovered under the condition that the second packet loss rate is not increased;
and under the condition that the second packet loss rate is increased, determining code rate recovery failure and marking the failure.
9. The method of claim 8, wherein in case that the second packet loss rate is increased, after determining that the rate recovery fails, further comprising:
the server detects a second packet loss rate carried in heartbeat information returned from a second client in each preset detection period;
if the second packet loss rate is N4If the number of consecutive detection periods is less than or equal to the sixth predetermined value, the server increases the code rate of sending downlink data packets to the second client, where N is4Is greater than N3An integer of (d);
the server receives heartbeat information from the second client and detects a second packet loss rate carried in the heartbeat information;
determining that the code rate is successfully recovered under the condition that the second packet loss rate is not increased;
and under the condition that the second packet loss rate is increased, determining code rate recovery failure and marking the failure.
10. An apparatus for adjusting a bit rate of a packet, comprising:
the first detection module is used for detecting a first packet loss rate of an uplink data packet received from a first client in a preset detection period;
a first sending module, configured to send a signaling to the first client when it is determined that the first packet loss rate is greater than a first predetermined value, where the signaling carries information indicating that the first client reduces a code rate for sending an uplink data packet;
a first receiving module, configured to receive an uplink data packet from the first client, and detect the first packet loss rate of the uplink data packet in the predetermined period, so as to determine whether information for sending a data packet with a reduced code rate needs to be sent to the first client;
a second detection module, configured to detect, in each predetermined detection period, a first packet loss rate of an uplink data packet received from a first client;
a second sending module, configured to send the first packet loss rate at N1Sending a rate recovery notification to the first client when the number of the consecutive detection periods is less than or equal to a fourth predetermined value, wherein N is1The code rate recovery notification carries information indicating that the first client increases the code rate for sending the uplink data packet, wherein the code rate recovery notification is an integer larger than 1;
a second receiving module, configured to receive an uplink data packet from the first client, and detect the first packet loss rate of the uplink data packet within a predetermined time after the code rate recovery notification is sent;
a first determining module, configured to determine that a code rate recovery is successful when the first packet loss rate is not increased;
and the second determining module is used for determining the code rate recovery failure under the condition that the first packet loss rate is increased, informing the first client of reducing the code rate to the original code rate and marking the failure.
11. The apparatus of claim 10, further comprising:
a third sending module, configured to send a downlink data packet to the second client according to the predetermined code rate;
a third receiving module, configured to receive heartbeat information from a second client, where the heartbeat information carries a current second packet loss rate of a downlink data packet;
a judging module, configured to judge whether a code rate for sending a downlink data packet needs to be adjusted according to the second packet loss rate;
a first code rate adjustment module, configured to reduce a code rate to send a downlink data packet when the second packet loss rate is greater than a third predetermined value;
and the third detection module is used for continuously receiving the heartbeat information from the second client and detecting the current second packet loss rate in the heartbeat information so as to judge whether a downlink data packet needs to be sent to the second client by continuously reducing the code rate.
12. The apparatus of claim 10, further comprising:
the fourth receiving module is configured to receive a second packet loss rate carried in the heartbeat information from the second client;
a second code rate adjusting module, if the second packet loss rate is N3In each continuous heartbeat sending period, the heartbeat sending period is less than or equal to a fifth preset value, the code rate of sending downlink data packets to the second client is increased, wherein N is3Is an integer greater than 1;
a fifth receiving module, configured to receive heartbeat information from the second client, and detect a second packet loss rate carried in the heartbeat information;
a third determining module, configured to determine that the code rate recovery is successful when the second packet loss rate is not increased;
and a fourth determining module, configured to determine a code rate recovery failure and mark the failure when the second packet loss rate is increased.
CN201710317741.6A 2017-05-08 2017-05-08 Method and device for adjusting code rate of data packet Active CN107317795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710317741.6A CN107317795B (en) 2017-05-08 2017-05-08 Method and device for adjusting code rate of data packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710317741.6A CN107317795B (en) 2017-05-08 2017-05-08 Method and device for adjusting code rate of data packet

Publications (2)

Publication Number Publication Date
CN107317795A CN107317795A (en) 2017-11-03
CN107317795B true CN107317795B (en) 2021-07-09

Family

ID=60184804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710317741.6A Active CN107317795B (en) 2017-05-08 2017-05-08 Method and device for adjusting code rate of data packet

Country Status (1)

Country Link
CN (1) CN107317795B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109104320B (en) * 2018-08-31 2021-07-30 深圳市亿兆互联技术有限公司 Method for improving communication network capacity
CN110876121B (en) * 2018-09-04 2022-01-07 成都鼎桥通信技术有限公司 B-trunC video group calling code rate adjusting method and system
CN109194921B (en) * 2018-10-11 2021-03-23 广州市九安智能技术股份有限公司 Wireless video monitoring data transmission method based on dynamic power and rate adjustment and wireless video monitoring equipment
CN109756692A (en) * 2019-01-08 2019-05-14 Oppo广东移动通信有限公司 Video data handling procedure, device, mobile device, computer readable storage medium
CN110149452A (en) * 2019-03-27 2019-08-20 杭州叙简科技股份有限公司 A method of it reducing network packet loss rate and promotes call sound effect
CN110784684A (en) * 2019-10-21 2020-02-11 华中科技大学 Data processing method, device and equipment
CN111200760A (en) * 2019-11-26 2020-05-26 安徽文香信息技术有限公司 Data processing method and device and electronic equipment
CN110996103A (en) * 2019-12-12 2020-04-10 杭州叙简科技股份有限公司 Method for adjusting video coding rate according to network condition
CN111526163B (en) * 2020-07-03 2020-10-13 翱捷科技(上海)有限公司 ViLTE video call quality control system and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125034A (en) * 2013-04-23 2014-10-29 深圳市同洲电子股份有限公司 Transmission method and system for UDP data packets
CN104170459A (en) * 2013-07-30 2014-11-26 华为技术有限公司 Handover opportunity configuring method, device, system and equipment
CN105722159A (en) * 2016-02-05 2016-06-29 中国移动通信集团江苏有限公司 Network switching method, method and device for determining network switching area

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102204182B (en) * 2010-12-29 2013-09-11 华为技术有限公司 Method and apparatus for controlling congestion of data transmission
US8661323B2 (en) * 2011-05-09 2014-02-25 Google Inc. Method and apparatus for generating packet mask
CN103686227B (en) * 2012-09-17 2018-03-20 南京中兴力维软件有限公司 Audio-video collection coding method, apparatus and system for mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125034A (en) * 2013-04-23 2014-10-29 深圳市同洲电子股份有限公司 Transmission method and system for UDP data packets
CN104170459A (en) * 2013-07-30 2014-11-26 华为技术有限公司 Handover opportunity configuring method, device, system and equipment
CN105722159A (en) * 2016-02-05 2016-06-29 中国移动通信集团江苏有限公司 Network switching method, method and device for determining network switching area

Also Published As

Publication number Publication date
CN107317795A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN107317795B (en) Method and device for adjusting code rate of data packet
US9888054B2 (en) Seamless video pipeline transition between WiFi and cellular connections for real-time applications on mobile devices
EP1719302B8 (en) Fast signalling procedure for streaming services quality of service managing in wireless networks
CN110769296B (en) Video code rate self-adaptive adjusting mode based on local cache during transmission
EP1800437B1 (en) A radio communications gateway and radio communications terminal
JP2001160824A (en) Wired and wireless mixed network data distributor and data distribution method
CN102025963B (en) Method and device for controlling call of video telephone
CN110996103A (en) Method for adjusting video coding rate according to network condition
US9538132B2 (en) Methods, devices, and systems for controlling audio and video transmission
JP2000261398A (en) Communication equipment
CN105979495B (en) Method for improving call quality, radio network controller and core network
US20070097925A1 (en) Method and apparatus for full rate erasure handling in cdma
CN102780877B (en) Video data transmitting method and equipment
US8799749B2 (en) Ad-hoc multimedia group communication terminal robust to packet loss and method of operating the same
US6317224B1 (en) Method and apparatus for modifying facsimile data transfer rates based upon varying bit rates of a transport medium
US20110314506A1 (en) Point to multi-point wireless video delivery
CN101552771B (en) Media gateway, media gateway controller, multimedia telephone intercommunication method and system
CN107404363A (en) A kind of method of adjustment, system, terminal and the network side equipment of voice code check
EP2264959A1 (en) Media gateway, media gateway controller, method and system for communication of multimedia phones
CN106231618B (en) A kind of method and device sending encoding and decoding renegotiation request
JP4884922B2 (en) Communication apparatus and communication method
KR100880568B1 (en) Method for receiving efficient video using received signal strength notification mechanism in iptv environment
JP2014068087A (en) Buffer controller, control method by buffer controller, media communication device, and computer program
JP4847543B2 (en) Method and apparatus for improving media transmission quality using a robust representation of media frames
US7697599B2 (en) xDSL modem and method for stabilizing connection of xDSL modem

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20171103

Assignee: Guiyang Longma Video Technology Co.,Ltd.

Assignor: GUIYANG LONGMASTER INFORMATION & TECHNOLOGY Co.,Ltd.

Contract record no.: X2022520000003

Denomination of invention: Code rate adjustment method and device of data packet

Granted publication date: 20210709

License type: Common License

Record date: 20220302