Data transmission method and device, equipment and storage medium
Through the network detection and response mechanism between the sending end and the receiving end, the transmission volume of data transmission is adjusted, and the network congestion caused by dynamic code rate video data transmission is solved, and more stable video transmission is achieved.
Patent Information
- Application Number
- CN202411288126.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-06
AI Technical Summary
Dynamic code rate video data transmission may cause network congestion, especially on networks with limited bandwidth, resulting in video stuttering and packet loss.
The sending end sends a network detection packet after each cycle, the receiving end responds to the reply packet, adjusts the transmission volume according to the network status and the processing conditions of the receiving end, and adopts a flexible transmission strategy and confirmation retransmission mechanism, including adjusting the initial rated transmission volume and discarding. Some data frames are used to match the network status and the processing capabilities of the receiver.
Effectively reduce network congestion, reduce video lag time, quickly restore normal transmission, and ensure the stability and quality of data transmission.
Smart Images

Figure CN119094465A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network data transmission, and more specifically, to a data transmission method, device, equipment and storage medium. Background Art
[0002] With the development of technology, especially with the development of video conferencing technology, the amount of data that needs to be transmitted is getting larger and larger, which puts higher requirements on network transmission. The actual physical link processing capacity has a maximum value in theory, so when the audio and video data currently sent is greater than the current bandwidth, it will cause a momentary impact on the network, especially for networks with limited bandwidth, this impact will be greater, which will further deteriorate the network condition and cause a large number of network packet loss.
[0003] In the field of real-time audio and video, dynamic bit rate video is often needed. When dynamic bit rate video is transmitted in real time, its bit rate is not evenly distributed over time. Bit rate peaks will occur during the transmission process. When the bit rate peaks, it is possible that the audio and video data sent is greater than the current bandwidth, which will bring an instantaneous impact to the link and have the opportunity to cause network congestion. Summary of the invention
[0004] In order to overcome the defect of the above-mentioned prior art that dynamic bit rate video data transmission may cause network congestion, the present invention provides a data transmission method, device, equipment and storage medium. The technical solution adopted by the present invention is as follows.
[0005] In a first aspect, the present invention provides a method for data transmission, comprising:
[0006] The transmitting end sends a network detection packet to the receiving end after sending the data packet in the Kth cycle, wherein the network detection packet includes: a first sending timestamp T1 of the transmitting end;
[0007] The receiving end receives the network detection packet, takes out the first sending timestamp T1 of the sending end in the network detection packet, and replies to the sending end with a response packet, wherein the response packet includes: the second sending timestamp T2 of the receiving end, the first sending timestamp T1 of the sending end, the number of unprocessed data packets in the receiving cache S1 of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the speed V2 of receiving packets at the receiving end;
[0008] The sending end receives the response packet sent by the receiving end;
[0009] The sending end obtains a network status judgment result from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end;
[0010] The sending end obtains the processing status judgment result of the receiving end according to the number of unprocessed data packets S1 in the receiving buffer, the speed V1 of the receiving end's application layer processing packets, and the rate V2 of the receiving packets at the receiving end;
[0011] Obtain the initial rated transmission amount of n cycles after the Kth cycle;
[0012] According to the network status judgment result and the processing status judgment result of the receiving end, each initial rated transmission amount is adjusted to obtain the final rated transmission amount of n cycles after the Kth cycle.
[0013] In one embodiment, the n periods include, in chronological order, a first period segment, a second period segment, and a third period segment;
[0014] The process of adjusting each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle includes:
[0015] Selecting a corresponding execution strategy according to the network status judgment result and the processing status judgment result of the receiving end;
[0016] The execution strategy includes:
[0017] The first strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the first processing result, each initial rated transmission amount is used as the final rated transmission amount;
[0018] The second strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the second processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, wherein the second processing result is a processing status judgment result that is more congested than the first processing result;
[0019] A third strategy: when the network status judgment result is a second network result and the processing status judgment result of the receiving end is a first processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, and reducing the initial rated transmission amount of the second cycle segment to obtain the final rated transmission amount of the second cycle segment, wherein the second network result is a network status judgment result that is more congested than the first network result;
[0020] Fourth strategy: When the network status judgment result is the second network result and the processing status judgment result of the receiving end is the second processing result, reduce the initial rated sending amount of the first cycle segment to obtain the final rated sending amount of the first cycle segment, reduce the initial rated sending amount of the second cycle segment to obtain the final rated sending amount of the second cycle segment, and reduce the initial rated sending amount of the third cycle segment to obtain the final rated sending amount of the third cycle segment.
[0021] In one implementation, when the transmitting end sends video data, the fourth strategy further includes:
[0022] Part of the P frames in the data sent within the n cycles are discarded.
[0023] In one embodiment, the process of adjusting each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle also includes:
[0024] The sending end sends the policy information to the receiving end, and receives confirmation information about the policy information from the receiving end, wherein the policy information is used to indicate which execution policy is selected;
[0025] When the sending end does not receive confirmation information about the policy information from the receiving end, the fourth policy is reselected as the execution policy.
[0026] In one embodiment, the process of obtaining the processing status judgment result of the receiving end according to the number S1 of unprocessed data packets received by the receiving end buffer, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end comprises:
[0027] According to the speed V1 of the receiving end application layer processing packets and the number S1 of unprocessed data packets received in the receiving cache, a cache processing judgment result is obtained, wherein the cache processing judgment result is used to judge whether the receiving end can process the number S1 of unprocessed data packets in the cache within a preset time length;
[0028] When the speed V1 of processing packets at the application layer of the receiving end is greater than the rate V2 of receiving packets at the receiving end, and the cache processing judgment result is that the number S1 of cached unprocessed data packets can be processed within the preset time length, the processing status judgment result of the receiving end is the first processing result; otherwise, the processing status judgment result of the receiving end is the second processing result.
[0029] In one implementation, the process of obtaining a network status judgment result from the transmitting end to the receiving end according to the difference between the second transmitting timestamp T2 of the receiving end and the first transmitting timestamp T1 of the transmitting end includes:
[0030] Obtaining a current one-way delay from the sending end to the receiving end according to a difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end;
[0031] Get the minimum one-way delay from the sender to the receiver;
[0032] According to the difference between the current one-way delay and the minimum one-way delay, the one-way delay jitter of the link from the sender to the receiver is obtained;
[0033] A network status judgment result from the sending end to the receiving end is obtained according to the one-way delay jitter of the link.
[0034] In one implementation, the process of obtaining the result of determining the network status in the direction from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end by the sending end further includes:
[0035] Compare the current one-way delay with the minimum one-way delay, and update the minimum one-way delay according to the comparison result between the current one-way delay and the minimum one-way delay;
[0036] When the current one-way delay is less than the minimum one-way delay, the current minimum one-way delay is replaced by the current one-way delay as the minimum one-way delay.
[0037] In one embodiment, it further includes:
[0038] After sending the data packet in the Kth cycle, the sender obtains the current packet loss rate and the actual transmission volume in the Kth cycle;
[0039] Obtaining a corresponding packet loss rate modification coefficient according to the current packet loss rate;
[0040] The initial rated transmission amounts are obtained according to the actual transmission amount and the packet loss rate modification coefficient.
[0041] In a second aspect, the present invention provides a data transmission device, comprising:
[0042] The sending module of the sending end is used to send a network detection packet to the receiving end after the sending end sends the data packet in the Kth cycle, wherein the network detection packet includes: a first sending timestamp T1 of the sending end;
[0043] A receiving module at a receiving end, configured to receive the network detection packet at the receiving end, extract the first sending timestamp T1 of the sending end in the network detection packet, and reply to the sending end with a response packet, wherein the response packet includes: the second sending timestamp T2 of the receiving end, the first sending timestamp T1 of the sending end, the number of unprocessed data packets S1 in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the speed V2 of receiving packets at the receiving end;
[0044] The sending end receiving module is used for the sending end to receive the response packet sent by the receiving end;
[0045] An acquisition module, used for acquiring an initial rated transmission amount of n cycles after the Kth cycle;
[0046] The analysis module is used to obtain a network status judgment result in the direction from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end; obtain a processing status judgment result of the receiving end according to the number S1 of unprocessed data packets in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end; and adjust each initial rated sending amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain a final rated sending amount of n cycles after the Kth cycle.
[0047] In a third aspect, the present invention provides 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 any of the above-mentioned methods when executing the program.
[0048] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method of any of the above-mentioned embodiments.
[0049] In the present invention, based on the network status judgment result from the transmitting end to the receiving end and the processing status judgment result of the receiving end, the pre-calculated rated transmission amount is corrected, thereby obtaining the rated transmission amount of several cycles after the current cycle. The present invention estimates the rated transmission amount in advance and continuously corrects it so that the actual transmission rate more accurately fits the network status and the processing speed of the receiving end. The use of this flexible transmission strategy and the corresponding confirmation retransmission mechanism can not only reduce the time of video freezing, but also effectively reduce network congestion and quickly restore normal transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the overall process of an implementation method of Example 1 of the present invention.
[0051] Figure 2 It is a schematic diagram of the overall structure of the second embodiment of the present invention. DETAILED DESCRIPTION
[0052] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0053] It should be noted that the terms "first\second\..." involved in the embodiments of the present invention are only used to distinguish similar objects, and do not represent a specific order for the objects. It is understandable that the specific order or sequence of "first\second\..." can be interchanged where permitted. It should be understood that the objects distinguished by "first\second\..." can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0054] Embodiment 1
[0055] See also Figure 1 , Figure 1 1 is a flowchart of a method for data transmission provided in Embodiment 1 of the present invention, the method comprising step S110, step S120, step S130, step S140, step S150, step S160 and step S170. It should be noted that step S110, step S120, step S130, step S140, step S150, step S160 and step S170 are merely reference numerals for the purpose of clearly explaining the embodiment and the appendix. Figure 1 The corresponding relationship does not limit the order of the steps in this embodiment.
[0056] Step S110, the transmitting end sends a network detection packet to the receiving end after sending the data packet in the Kth cycle, wherein the network detection packet includes: a first sending timestamp T1 of the transmitting end;
[0057] Step S120, the receiving end receives the network detection packet, takes out the first sending timestamp T1 of the sending end in the network detection packet, and replies to the sending end with a response packet, wherein the response packet includes: the second sending timestamp T2 of the receiving end, the first sending timestamp T1 of the sending end, the number of unprocessed data packets in the receiving cache S1 of the receiving end, the speed V1 of the receiving end's application layer processing packets, and the rate V2 of the receiving end's receiving packets;
[0058] Step S130, the sending end receives the response packet sent by the receiving end;
[0059] Step S140, the sending end obtains a result of judging the network status in the direction from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end;
[0060] Step S150, the sending end obtains a result of judging the processing status of the receiving end according to the number S1 of unprocessed data packets received by the receiving end buffer, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end;
[0061] Step S160, obtaining the initial rated transmission amount of n cycles after the Kth cycle;
[0062] Step S170, adjusting each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle.
[0063] The data channel is used for the actual sending and receiving of data, and the control channel can be used to timely exchange the status and control information of the sending and receiving data. This method is applicable to the control channel. The sender sends data periodically. For example, for a video with 30 frames per second, the sending cycle of the audio and video frame data is 33ms. After sending the data packet in each cycle, it is necessary to predict and calculate the rated sending volume for the next n cycles. This method is a method for accurately determining the rated sending volume.
[0064] In step S110, after the data packet is sent in the Kth cycle, a network detection packet is sent to the receiving end. The network detection packet carries the local timestamp T1 (i.e., the first sending timestamp T1 of the sending end). The timestamp can be used as a unique identifier of the network detection packet to prevent the responder from making misjudgments on several consecutive late detection packets in the case of network congestion.
[0065] After receiving and processing the data packet, the receiving end then processes the network detection packet. After receiving the network detection packet, it takes out T1 and replies to the sending end with a response packet, which carries the local timestamp T2 (i.e., the second sending timestamp T2 of the receiving end), the first sending timestamp T1 of the sending end, the number of unprocessed data packets in the receiving cache S1 of the receiving end, the speed V1 (unit: packet / s) of the receiving end's application layer processing packets, and the receiving end's receiving packet rate V2.
[0066] The receiver's response packet also contains the receiver's timestamp T2, which is similar to the sender's first sending timestamp T1 and is also a necessary choice for its uniqueness. At the same time, the receiver also replies its own sending timestamp to the sender, so that the sender can accurately count the RTT in its sending direction. S1, V1 and V2 help the sender determine the processing status of the receiver and the status of the data to be processed.
[0067] In step S130, the sending end receives the response packet sent by the receiving end, and steps S140 and S150 analyze the received data. Step S140 is to obtain the result of the network status judgment from the sending end to the receiving end after analysis, and step S150 is to obtain the result of the processing status judgment of the receiving end after analysis.
[0068] Specifically, in step S140, the sending end obtains the sending timestamp T2 of the receiving end and the sending timestamp T1 of the local end, calculates the difference between the sending timestamp T2 of the receiving end and the sending timestamp T1 of the local end, and obtains the current one-way delay in the sending direction, that is, SentTimeSlot = T2 - T1. Of course, the difference between T2 and T1 can also be used as a basis, and corrected according to the preset model to obtain the final current one-way delay in the sending direction. Since the link was established, we assume that there is an ideal RTT value with very good network conditions, which is called the best one-way delay SentTimeSlot _ good. Through calculation, the difference between the current one-way delay and the best one-way delay is obtained, and the difference is used as the basic value for calculating the one-way delay jitter of the link in the sending direction from the sender to the receiver. On the basis of the obtained basic value, the basic value is corrected through experiments or experience. For example, the basic value is multiplied by the correction coefficient, and then the one-way delay jitter of the link in the sending direction from the local end to the opposite end is obtained. Of course, it is also possible to use the basic value directly as the one-way delay jitter of the link in the sending direction from the local end to the opposite end without making any corrections. For example, SentTimeSlot_jitter is used to represent the one-way delay jitter value of the link in the sending direction from the sender to the receiver, SentTimeSlot _ jitter=SentTimeSlot-SentTimeSlot _ good, that is, the difference between the current one-way delay and the best one-way delay is used as the current jitter value. After obtaining the jitter value, the network status from the sender to the receiver can be judged according to the SentTimeSlot_jitter to obtain the network status judgment result from the sender to the receiver.
[0069] We know that within a certain limited time, the physical link that the data of both communicating parties passes through will not change much, so the propagation delay is certain. In this case, the main cause of network jitter is the change in the congestion level of the network bandwidth. Therefore, the one-way delay when the link is unobstructed and uncongested can be used as a benchmark, and it is believed that the time that the current one-way delay takes longer than the benchmark one-way delay is caused by network jitter. Therefore, the current one-way delay is compared with the benchmark one-way delay, and the difference between the two is used as the basic value of one-way delay jitter.
[0070] In addition, in a video conferencing system, there may be multiple conferences or multiple terminals concurrently. In addition to network bottlenecks, there may be processing speed, scheduling mechanism and other reasons that lead to unsmooth conference video. These reasons are bound to be reflected in the processing speed and remaining amount of the receiving buffer. The sender's response to these variables can also alleviate network congestion. Therefore, in step S150, the processing status judgment result of the receiving end must be obtained.
[0071] Specifically, for example, when the speed V1 of the receiving end application layer processing packets is greater than or equal to the receiving end packet receiving rate V2, it means that the receiving end application layer still has spare capacity to process the number S1 of unprocessed packets in the receiving end receiving buffer. The time for processing the unprocessed packets in the buffer can be obtained by using S1 / V1. If it can be completed within the preset specified time, it can be considered that the processing status of the receiving end is very smooth. Similarly, according to the size relationship between V1 and V2, and the relationship between S1 / V1 and the preset specified time, the processing status judgment result of the receiving end can be obtained.
[0072] In step S160, the initial rated transmission amount of n cycles after the Kth cycle is obtained. The initial rated transmission amount can be obtained based on the known packet loss rate of the current Kth cycle. Although this value is not necessarily the final transmission amount, it can be used as a good reference value.
[0073] Step S170 is to modify the initial rated transmission amount of each cycle in step S160, and the basis for this modification is obtained based on the previously obtained network status judgment result from the transmitting end to the receiving end and the processing status judgment result of the receiving end. For example, when the network status is good and the processing status of the receiving end is also smooth, the transmission is carried out according to the original rated transmission amount; when the network status or the processing status of the receiving end is not congested, the rated transmission amount is reduced in some cycles among the n cycles; when both are congested, the rated transmission amount is reduced in all cycles, and while reducing the transmission amount, measures are taken to reduce the amount of data that should be sent.
[0074] The corrected rated transmission amount is the final rated transmission amount sent n cycles after the Kth cycle.
[0075] In this method, based on the network status judgment result from the sender to the receiver and the processing status judgment result of the receiver, the pre-calculated rated transmission amount is corrected to obtain the rated transmission amount for several cycles after the current cycle. This method estimates the rated transmission amount in advance and continuously corrects it so that the actual transmission rate more accurately fits the network status and the processing speed of the receiver. The use of this flexible transmission strategy and the corresponding confirmation retransmission mechanism can not only reduce the video freeze time, but also effectively reduce network congestion and quickly restore normal transmission.
[0076] In one embodiment, the n periods include, in chronological order, a first period segment, a second period segment, and a third period segment;
[0077] The process of step S170 includes: step S171.
[0078] Step S171, selecting a corresponding execution strategy according to the network status judgment result and the processing status judgment result of the receiving end;
[0079] The execution strategy includes:
[0080] The first strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the first processing result, each initial rated transmission amount is used as the final rated transmission amount;
[0081] The second strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the second processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, wherein the second processing result is a processing status judgment result that is more congested than the first processing result;
[0082] A third strategy: when the network status judgment result is a second network result and the processing status judgment result of the receiving end is a first processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, and reducing the initial rated transmission amount of the second cycle segment to obtain the final rated transmission amount of the second cycle segment, wherein the second network result is a network status judgment result that is more congested than the first network result;
[0083] Fourth strategy: When the network status judgment result is the second network result and the processing status judgment result of the receiving end is the second processing result, reduce the initial rated sending amount of the first cycle segment to obtain the final rated sending amount of the first cycle segment, reduce the initial rated sending amount of the second cycle segment to obtain the final rated sending amount of the second cycle segment, and reduce the initial rated sending amount of the third cycle segment to obtain the final rated sending amount of the third cycle segment.
[0084] In one implementation, when the transmitting end sends video data, the fourth strategy further includes:
[0085] Part of the P frames in the data sent within the n cycles are discarded.
[0086] The above two implementation modes are both processes of correcting the rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end.
[0087] Assume that the n cycles are 3 cycles which are 3 subsequent consecutive cycles, and the initial rated transmission amounts of the three subsequent consecutive cycles are C0, C1, and C2 respectively.
[0088] In the first strategy, the network is good and the receiving end processing is smooth, and no correction is made to the calculated rated transmission amount.
[0089] In the second strategy, the network is good but the receiving end is congested, and the rated sending amount of the sending cycle segment to be executed is appropriately reduced, for example, the rated sending amount of C0 is reduced to the original 0.8.
[0090] In the third strategy, the network is congested but the receiving end is processing smoothly, and the rated sending amount of the next two consecutive sending cycle segments is appropriately reduced, for example, the rated sending amount of C0 and C1 are both reduced to the original 0.8.
[0091] In the fourth strategy, the network is congested and the receiving end processes the congestion, and the rated sending amount of the three sending cycle segments is appropriately reduced, for example, the rated sending amount of C0, C1, and C2 are all reduced to the original 0.8, and in one embodiment, some data frames are appropriately lost, such as P frames in video data.
[0092] In a conference system, the video sender may be a terminal, and the receiver is a server. The server not only has a bandwidth resource bottleneck, but also the processor processing speed and conference resource scheduling may cause video freezes when there are multiple concurrent connections. The sender considers these factors and recalculates the sending rated amount, thereby avoiding network congestion from the source, reducing packet loss and retransmission, and further adapting to network jitter.
[0093] It should be noted here that the cycle segment in the first cycle segment, the second cycle segment and the third cycle segment refers to a period of time, which may include one cycle or multiple cycles, and the number of cycles included in each cycle segment is not necessarily the same.
[0094] In one implementation, the process of step S170 further includes: step S172 and step S173.
[0095] Step S172, the sending end sends the policy information to the receiving end, and receives confirmation information about the policy information from the receiving end, wherein the policy information is used to indicate which execution policy is selected;
[0096] Step S173: When the sending end does not receive confirmation information about the policy information from the receiving end, the fourth policy is reselected as the execution policy.
[0097] After the sender selects a sending volume and sending strategy, it will inform the receiving end of the rated sending volume and strategy through a heartbeat packet or a data packet. If the receiving end does not receive the sending strategy, it is deemed that the sender has selected the fourth strategy above; the receiving end selects the corresponding frame confirmation mechanism according to different sending strategies, and the corresponding confirmation packet will be transmitted back to the sender to prevent the sender from excessively retransmitting the data packet.
[0098] In real-time video transmission systems, appropriate confirmation and retransmission can reduce the packet loss rate within the bandwidth allowed, thereby ensuring transmission quality. However, when the network is congested, it is necessary to select a suitable confirmation and retransmission mechanism to avoid infinite retransmission, which will cause the network congestion to last too long and the video to freeze for too long.
[0099] In one implementation, the process of step S150 includes: step S151 and step S152.
[0100] Step S151, obtaining a cache processing judgment result according to the speed V1 of the receiving end application layer processing packets and the number S1 of unprocessed data packets received in the receiving cache, wherein the cache processing judgment result is used to judge whether the receiving end can process the number S1 of unprocessed data packets in the cache within a preset time length;
[0101] Step S152, when the speed V1 of processing packets at the application layer of the receiving end is greater than the rate V2 of receiving packets at the receiving end, and the cache processing judgment result is that the number S1 of cached unprocessed data packets can be processed within the preset time length, the processing status judgment result of the receiving end is obtained as the first processing result; otherwise, the processing status judgment result of the receiving end is the second processing result.
[0102] This is the specific method mentioned above, which is to determine the processing status of the receiving end based on the relationship between V1 and V2 and the relationship between S1 / V1 and the preset specified time.
[0103] When V1 is greater than V2 and S1 / V1 is less than or equal to the preset specified time, the processing status judgment result of the receiving end is the first processing result; if other situations occur, the processing status judgment result of the receiving end is the second processing result.
[0104] In one implementation, the process of step S140 includes: step S141, step S142, step S143 and step S144.
[0105] Step S141, obtaining the current one-way delay from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end;
[0106] Step S142, obtaining the minimum one-way delay from the sending end to the receiving end;
[0107] Step S143, obtaining the one-way delay jitter of the link from the transmitting end to the receiving end according to the difference between the current one-way delay and the minimum one-way delay;
[0108] Step S144, obtaining a network status judgment result from the transmitting end to the receiving end according to the one-way delay jitter of the link.
[0109] In this implementation, the difference between the current one-way delay and the best one-way delay is used as the current jitter value, and the network status from the sender to the receiver is judged according to the jitter value to obtain the network status judgment result from the sender to the receiver. In this implementation, the historical minimum one-way delay is used as the best one-way delay.
[0110] In one implementation, the process of step S140 further includes: step S145.
[0111] Step S145, comparing the current one-way delay with the minimum one-way delay, and updating the minimum one-way delay according to the comparison result between the current one-way delay and the minimum one-way delay;
[0112] When the current one-way delay is less than the minimum one-way delay, the current minimum one-way delay is replaced by the current one-way delay as the minimum one-way delay.
[0113] In the previous implementation, the historical minimum one-way delay is used as the best one-way delay. Since the obtained minimum one-way delay refers to the minimum one-way delay before the current sampling period, it may happen that the current one-way delay of the current sampling period is less than the obtained minimum one-way delay. Therefore, it is necessary to compare the two and use the smaller value of the two as the final minimum one-way delay, that is, SentTimeSlot _ good=SentTimeSlot _ good>SentTimeSlot? SentTimeSlot: SentTimeSlot _ The minimum one-way delay obtained in this sampling period can be used for the next sampling period, and the method of this embodiment can be used to obtain the minimum one-way delay of the sampling period in the next sampling period.
[0114] In one implementation, the data transmission method further includes: step S211, step S212, and step S213.
[0115] Step S211, after the sending end sends the data packet in the Kth cycle, the sending end obtains the current packet loss rate and the actual sending amount in the Kth cycle;
[0116] Step S212, obtaining a corresponding packet loss rate modification coefficient according to the current packet loss rate;
[0117] Step S213, obtaining each initial rated transmission amount according to the actual transmission amount and the packet loss rate modification coefficient.
[0118] The actual transmission amount Cn of the current Kth cycle and the current packet loss rate are obtained, and then the corresponding packet loss rate modification coefficient is obtained according to the current packet loss rate. The packet loss rate modification coefficient is a pre-set coefficient, which can be obtained in various ways, for example, according to actual debugging experience. For example, when the packet loss rate is less than 1%, the initial rated transmission amount is 1.2 times the actual transmission amount Cn of the current cycle; when the packet loss rate is greater than 3%, the initial rated transmission amount is 0.9 times the actual transmission amount Cn of the current cycle; when it is between the two, the initial rated transmission amount is equal to the actual transmission amount Cn of the current cycle.
[0119] Embodiment 2
[0120] Corresponding to the method of embodiment 1, as Figure 2 As shown, the present invention also provides a data transmission device 2, including: a sending end sending module 210, a receiving end receiving module 220, a sending end receiving module 230, an acquisition module 240 and an analysis module 250.
[0121] The sending module 210 of the sending end is used to send a network detection packet to the receiving end after the sending end sends the data packet in the Kth cycle, wherein the network detection packet includes: a first sending timestamp T1 of the sending end;
[0122] The receiving module 220 of the receiving end is used for receiving the network detection packet at the receiving end, taking out the first sending timestamp T1 of the sending end in the network detection packet, and replying a response packet to the sending end, wherein the response packet includes: the second sending timestamp T2 of the receiving end, the first sending timestamp T1 of the sending end, the number of unprocessed data packets S1 in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end;
[0123] The sending end receiving module 230 is used for the sending end to receive the response packet sent by the receiving end;
[0124] An acquisition module 240 is used to acquire an initial rated transmission amount of n cycles after the Kth cycle;
[0125] The analysis module 250 is used to obtain a network status judgment result in the direction from the sending end to the receiving end based on the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end; to obtain a processing status judgment result of the receiving end based on the number S1 of unprocessed data packets in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end; and to adjust each initial rated sending amount based on the network status judgment result and the processing status judgment result of the receiving end to obtain a final rated sending amount of n cycles after the Kth cycle.
[0126] In one embodiment, the n periods include, in chronological order, a first period segment, a second period segment, and a third period segment;
[0127] The process in which the analysis module adjusts each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle includes:
[0128] Selecting a corresponding execution strategy according to the network status judgment result and the processing status judgment result of the receiving end;
[0129] The execution strategy includes:
[0130] The first strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the first processing result, each initial rated transmission amount is used as the final rated transmission amount;
[0131] The second strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the second processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, wherein the second processing result is a processing status judgment result that is more congested than the first processing result;
[0132] A third strategy: when the network status judgment result is a second network result and the processing status judgment result of the receiving end is a first processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, and reducing the initial rated transmission amount of the second cycle segment to obtain the final rated transmission amount of the second cycle segment, wherein the second network result is a network status judgment result that is more congested than the first network result;
[0133] Fourth strategy: When the network status judgment result is the second network result and the processing status judgment result of the receiving end is the second processing result, reduce the initial rated sending amount of the first cycle segment to obtain the final rated sending amount of the first cycle segment, reduce the initial rated sending amount of the second cycle segment to obtain the final rated sending amount of the second cycle segment, and reduce the initial rated sending amount of the third cycle segment to obtain the final rated sending amount of the third cycle segment.
[0134] In one implementation, when the transmitting end sends video data, the fourth strategy further includes:
[0135] Part of the P frames in the data sent within the n cycles are discarded.
[0136] In one embodiment, the analysis module, when executing the process of adjusting each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle, further includes:
[0137] The sending end sends the policy information to the receiving end, and receives confirmation information about the policy information from the receiving end, wherein the policy information is used to indicate which execution policy is selected;
[0138] When the sending end does not receive confirmation information about the policy information from the receiving end, the fourth policy is reselected as the execution policy.
[0139] In one embodiment, the analysis module, when executing the sending end, obtains the processing status judgment result of the receiving end according to the number of unprocessed data packets S1 received by the receiving end, the speed V1 of the application layer processing packets of the receiving end, and the rate V2 of the receiving packets of the receiving end, including:
[0140] According to the speed V1 of the receiving end application layer processing packets and the number S1 of unprocessed data packets received in the receiving cache, a cache processing judgment result is obtained, wherein the cache processing judgment result is used to judge whether the receiving end can process the number S1 of unprocessed data packets in the cache within a preset time length;
[0141] When the speed V1 of processing packets at the application layer of the receiving end is greater than the rate V2 of receiving packets at the receiving end, and the cache processing judgment result is that the number S1 of cached unprocessed data packets can be processed within the preset time length, the processing status judgment result of the receiving end is the first processing result; otherwise, the processing status judgment result of the receiving end is the second processing result.
[0142] In one embodiment, the analysis module, when executing the process of obtaining the network status judgment result from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end, comprises:
[0143] Obtaining a current one-way delay from the sending end to the receiving end according to a difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end;
[0144] Get the minimum one-way delay from the sender to the receiver;
[0145] According to the difference between the current one-way delay and the minimum one-way delay, the one-way delay jitter of the link from the sender to the receiver is obtained;
[0146] A network status judgment result from the sending end to the receiving end is obtained according to the one-way delay jitter of the link.
[0147] In one embodiment, the analysis module, when executing the process of obtaining the network status judgment result from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end, further includes:
[0148] Compare the current one-way delay with the minimum one-way delay, and update the minimum one-way delay according to the comparison result between the current one-way delay and the minimum one-way delay;
[0149] When the current one-way delay is less than the minimum one-way delay, the current minimum one-way delay is replaced by the current one-way delay as the minimum one-way delay.
[0150] In one implementation, the data transmission device further includes: a computing module.
[0151] The calculation module is used for obtaining the current packet loss rate and the actual transmission volume of the Kth period after the transmitter sends the data packet in the Kth period; obtaining the corresponding packet loss rate modification coefficient according to the current packet loss rate; and obtaining each initial rated transmission volume according to the actual transmission volume and the packet loss rate modification coefficient.
[0152] In this device, based on the network status judgment result from the sending end to the receiving end and the processing status judgment result of the receiving end, the pre-calculated rated transmission amount is corrected to obtain the rated transmission amount of several cycles after the current cycle. This device estimates the rated transmission amount in advance and continuously corrects it so that the actual transmission rate more accurately fits the network status and the processing speed of the receiving end. The use of this flexible transmission strategy and the corresponding confirmation retransmission mechanism can not only reduce the time of video freeze, but also effectively reduce network congestion and quickly restore normal transmission.
[0153] Embodiment 3
[0154] An embodiment of the present invention further provides a storage medium on which computer instructions are stored. When the instructions are executed by a processor, the method for data transmission in any of the above embodiments is implemented.
[0155] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, random access memories (RAM), read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0156] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, RAM, ROM, magnetic disks or optical disks.
[0157] Corresponding to the above-mentioned computer storage medium, in one embodiment, a computer device is also provided, which includes a memory, an encoder, and a computer program stored in the memory and executable on the encoder, wherein when the encoder executes the program, a method for data transmission as described in any one of the above-mentioned embodiments is implemented.
[0158] The above-mentioned computer device corrects the pre-calculated rated transmission amount based on the judgment result of the network status in the direction from the sending end to the receiving end and the judgment result of the processing status of the receiving end, thereby obtaining the rated transmission amount of several cycles after the current cycle. This computer device estimates the rated transmission amount in advance and continuously corrects it so that the actual transmission rate more accurately fits the network status and the processing speed of the receiving end. The use of this flexible transmission strategy and the corresponding confirmation retransmission mechanism can not only reduce the time of video freeze, but also effectively reduce network congestion and quickly restore normal transmission.
[0159] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for data transmission, characterized in that: include: The transmitting end sends a network detection packet to the receiving end after sending the data packet in the Kth cycle, wherein the network detection packet includes: a first sending timestamp T1 of the transmitting end; The receiving end receives the network detection packet, takes out the first sending timestamp T1 of the sending end in the network detection packet, and replies to the sending end with a response packet, wherein the response packet includes: the second sending timestamp T2 of the receiving end, the first sending timestamp T1 of the sending end, the number of unprocessed data packets S1 in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the speed V2 of receiving packets at the receiving end; The sending end receives the response packet sent by the receiving end; The sending end obtains a network status judgment result from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end; The sending end obtains the processing status judgment result of the receiving end according to the number of unprocessed data packets S1 in the receiving buffer, the speed V1 of the receiving end's application layer processing packets, and the rate V2 of the receiving packets at the receiving end; Obtain the initial rated transmission amount of n cycles after the Kth cycle; According to the network status judgment result and the processing status judgment result of the receiving end, each initial rated transmission amount is adjusted to obtain the final rated transmission amount of n cycles after the Kth cycle.
2. The data transmission method according to claim 1, characterized in that: The n periods include, in chronological order, a first period segment, a second period segment, and a third period segment; The process of adjusting each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle includes: Selecting a corresponding execution strategy according to the network status judgment result and the processing status judgment result of the receiving end; The execution strategy includes: The first strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the first processing result, each initial rated transmission amount is used as the final rated transmission amount; The second strategy: when the network status judgment result is the first network result and the processing status judgment result of the receiving end is the second processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, wherein the second processing result is a processing status judgment result that is more congested than the first processing result; A third strategy: when the network status judgment result is a second network result and the processing status judgment result of the receiving end is a first processing result, reducing the initial rated transmission amount of the first cycle segment to obtain the final rated transmission amount of the first cycle segment, and reducing the initial rated transmission amount of the second cycle segment to obtain the final rated transmission amount of the second cycle segment, wherein the second network result is a network status judgment result that is more congested than the first network result; Fourth strategy: When the network status judgment result is the second network result and the processing status judgment result of the receiving end is the second processing result, reduce the initial rated sending amount of the first cycle segment to obtain the final rated sending amount of the first cycle segment, reduce the initial rated sending amount of the second cycle segment to obtain the final rated sending amount of the second cycle segment, and reduce the initial rated sending amount of the third cycle segment to obtain the final rated sending amount of the third cycle segment.
3. The data transmission method according to claim 2, characterized in that: When the transmitting end sends video data, the fourth strategy further includes: Part of the P frames in the data sent within the n cycles are discarded.
4. The data transmission method according to claim 2 or 3, characterized in that: The process of adjusting each initial rated transmission amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain the final rated transmission amount of n cycles after the Kth cycle also includes: The sending end sends the policy information to the receiving end, and receives confirmation information about the policy information from the receiving end, wherein the policy information is used to indicate which execution policy is selected; When the sending end does not receive confirmation information about the policy information from the receiving end, the fourth policy is reselected as the execution policy.
5. The data transmission method according to claim 1, characterized in that: The process of obtaining the processing status judgment result of the receiving end according to the number S1 of unprocessed data packets received by the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end comprises: According to the speed V1 of the receiving end application layer processing packets and the number S1 of unprocessed data packets received in the receiving cache, a cache processing judgment result is obtained, wherein the cache processing judgment result is used to judge whether the receiving end can process the number S1 of unprocessed data packets in the cache within a preset time length; When the speed V1 of processing packets at the application layer of the receiving end is greater than the rate V2 of receiving packets at the receiving end, and the cache processing judgment result is that the number S1 of cached unprocessed data packets can be processed within the preset time length, the processing status judgment result of the receiving end is the first processing result; otherwise, the processing status judgment result of the receiving end is the second processing result.
6. The data transmission method according to claim 1, characterized in that: The process of obtaining a network status judgment result from the transmitting end to the receiving end according to the difference between the second transmitting timestamp T2 of the receiving end and the first transmitting timestamp T1 of the transmitting end includes: Obtaining a current one-way delay from the sending end to the receiving end according to a difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end; Get the minimum one-way delay from the sender to the receiver; According to the difference between the current one-way delay and the minimum one-way delay, the one-way delay jitter of the link from the sender to the receiver is obtained; A network status judgment result from the sending end to the receiving end is obtained according to the one-way delay jitter of the link.
7. The data transmission method according to claim 6, characterized in that: The process in which the transmitting end obtains a network status judgment result from the transmitting end to the receiving end according to the difference between the second transmitting timestamp T2 of the receiving end and the first transmitting timestamp T1 of the transmitting end, further includes: Compare the current one-way delay with the minimum one-way delay, and update the minimum one-way delay according to the comparison result between the current one-way delay and the minimum one-way delay; When the current one-way delay is less than the minimum one-way delay, the current minimum one-way delay is replaced by the current one-way delay as the minimum one-way delay.
8. The method for data transmission according to claim 1, characterized in that: Also includes: After sending the data packet in the Kth cycle, the sender obtains the current packet loss rate and the actual transmission volume in the Kth cycle; Obtaining a corresponding packet loss rate modification coefficient according to the current packet loss rate; The initial rated transmission amounts are obtained according to the actual transmission amount and the packet loss rate modification coefficient.
9. A data transmission device, characterized in that: include: The sending module of the sending end is used to send a network detection packet to the receiving end after the sending end sends the data packet in the Kth cycle, wherein the network detection packet includes: a first sending timestamp T1 of the sending end; A receiving module at a receiving end, configured to receive the network detection packet at the receiving end, extract the first sending timestamp T1 of the sending end in the network detection packet, and reply to the sending end with a response packet, wherein the response packet includes: the second sending timestamp T2 of the receiving end, the first sending timestamp T1 of the sending end, the number of unprocessed data packets S1 in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the speed V2 of receiving packets at the receiving end; The sending end receiving module is used for the sending end to receive the response packet sent by the receiving end; An acquisition module, used for acquiring an initial rated transmission amount of n cycles after the Kth cycle; The analysis module is used to obtain a network status judgment result in the direction from the sending end to the receiving end according to the difference between the second sending timestamp T2 of the receiving end and the first sending timestamp T1 of the sending end; obtain a processing status judgment result of the receiving end according to the number S1 of unprocessed data packets in the receiving cache of the receiving end, the speed V1 of processing packets at the application layer of the receiving end, and the rate V2 of receiving packets at the receiving end; and adjust each initial rated sending amount according to the network status judgment result and the processing status judgment result of the receiving end to obtain a final rated sending amount of n cycles after the Kth cycle.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
