Audio and video data transmission method and related apparatus
By acquiring the traffic packet set and response packets of audio and video frames, the data sender predicts the client's buffer status and adjusts the transmission strategy, thus solving the problem of insufficient buffer awareness in audio and video data transmission and improving transmission efficiency and playback effect.
Patent Information
- Application Number
- CN202310632510.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-05-31
AI Technical Summary
In existing technologies, during audio and video data transmission, the data sending end cannot promptly perceive the client's player caching status, resulting in untimely adjustments to the data sending strategy, which affects transmission efficiency and playback quality.
The data sender determines the complete frames received and played by the client by acquiring the traffic packet set and response packets of audio and video frames, predicts the buffer state, and adjusts the data transmission strategy based on the predicted buffer state.
It improved data transmission efficiency, enhanced audio and video playback effects, met the business experience requirements of live video streaming scenarios, and improved service quality.
Smart Images

Figure CN119071275B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and provides an audio and video data transmission method and related apparatus. Background Technology
[0002] With the continuous development of audio and video technology, various forms of audio and video services, such as live streaming, video-on-demand, and video calls, have brought diverse user experiences. However, audio and video services mainly rely on network transmission services; therefore, the transmission process of audio and video data is crucial.
[0003] In related technologies, when the data sending end transmits audio and video data to the client, it adjusts the audio and video data transmission strategy according to the real-time network status (such as packet loss rate, latency, etc.) through protocol improvement, congestion control, etc., to ensure that the client receives complete audio and video data and guarantees the playback quality of audio and video.
[0004] However, the audio and video playback effect on the client does not depend entirely on network transmission performance, but may also be related to the client's player caching status. If the data sender adjusts the data sending strategy only based on network transmission performance, it cannot adjust the data sending strategy in a timely and effective manner, which seriously affects the data sending efficiency and audio playback effect. In addition, since the player caching is highly dynamic, the data sender cannot perceive the client's player caching status in a timely manner, making it difficult for the data sender to adjust the data sending strategy according to the player caching status, thus affecting the traffic control effect.
[0005] For example, if packet loss occurs during audio and video data transmission, and the client's player has little cached data, even if the lost packets are retransmitted based on network transmission performance, playback will still stutter because the client has no cached data. Summary of the Invention
[0006] This application provides an audio and video data transmission method and related apparatus to improve data transmission efficiency and audio and video playback quality.
[0007] In a first aspect, embodiments of this application provide an audio / video data transmission method, including:
[0008] The system acquires each audio and video frame to be transmitted, sends the traffic packet set of each audio and video frame to the data receiving end, and receives each response packet returned by the data receiving end.
[0009] When it is determined, based on the response messages, that the data receiving end has received at least one complete frame among the audio and video frames, a playable frame that supports complete playback by the data receiving end is detected from the at least one complete frame based on the playback order of the audio and video frames.
[0010] Based on the detection results, the predicted buffer state of the data receiving end is obtained, and a new audio and video frame to be transmitted is sent to the data receiving end using a data transmission strategy preset for the predicted buffer state.
[0011] Secondly, embodiments of this application provide an audio / video data transmission device, comprising:
[0012] The traffic transceiver unit is used to acquire each audio and video frame to be transmitted, and send the traffic packet set of each audio and video frame to the data receiving end respectively, and receive each response packet returned by the data receiving end respectively.
[0013] The frame integrity sensing unit is used to detect, based on the playback order of the audio and video frames, a playable frame that supports complete playback by the data receiving end when the data receiving end determines that it has received at least one complete frame among the audio and video frames based on the response messages.
[0014] The player cache prediction unit is used to obtain the prediction cache state of the data receiving end based on the detection result, and to send new audio and video frames to be transmitted to the data receiving end using a data transmission strategy preset for the prediction cache state.
[0015] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described method.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium including a computer program, which, when run on an electronic device, causes the electronic device to perform the steps of the above-described method.
[0017] Fifthly, embodiments of this application provide a computer program product, the program product including a computer program stored in a computer-readable storage medium, wherein a processor of an electronic device reads from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the steps of the above-described method.
[0018] In this embodiment, the data sender sends the traffic packet set of each audio and video frame to be transmitted to the data receiver and receives each response packet returned by the data receiver. Then, when it is determined from each response packet that the data receiver has received at least one complete frame from each audio and video frame, based on the playback order of each audio and video frame, a playable frame that supports complete playback by the data receiver is detected from the at least one complete frame. After that, based on the detection result, the predicted buffer state of the data receiver is obtained, and a data transmission strategy preset for the predicted buffer state is adopted to send new audio and video frames to be transmitted to the data receiver.
[0019] In this way, the data sender determines, through response messages, which audio and video frames are completely received by the client and which are predicted to support complete playback by the client. This empowers the data sender to predict the client's player cache information. Based on the predicted client player cache information, the data sender can adjust the data sending strategy in a timely and effective manner, improving data transmission efficiency and enhancing audio and video playback effects. Furthermore, subsequent data transmission based on a pre-defined data transmission strategy for the predicted cache state (such as sufficient data or insufficient data) can better adapt to the client's business experience requirements in live audio and video scenarios, thereby improving the audio and video service quality of the service provider and ultimately enhancing the user experience.
[0020] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 This is a schematic diagram of the first application scenario provided in the embodiments of this application;
[0023] Figure 2 This is a schematic diagram illustrating the second application scenario provided in the embodiments of this application;
[0024] Figure 3 This is a flowchart illustrating an audio / video data transmission method provided in an embodiment of this application.
[0025] Figure 4 This is a schematic diagram of a traffic packet provided in an embodiment of this application;
[0026] Figure 5 This is a schematic diagram of a response message provided in an embodiment of this application;
[0027] Figure 6A This is a schematic diagram of a logic for detecting a complete frame provided in an embodiment of this application;
[0028] Figure 6B This is a schematic diagram of another logic for detecting complete frames provided in an embodiment of this application;
[0029] Figure 7 This is a logical diagram illustrating a status information table update process provided in an embodiment of this application.
[0030] Figure 8 This is a schematic diagram illustrating a playback order provided in an embodiment of this application;
[0031] Figure 9 This is a logical diagram illustrating a cache duration determination process provided in an embodiment of this application;
[0032] Figure 10 This is a schematic diagram illustrating the data transmission strategies for the two predicted cache states provided in the embodiments of this application;
[0033] Figure 11 This is a schematic diagram illustrating another application scenario provided in the embodiments of this application;
[0034] Figure 12 This is a schematic diagram of the structure of an audio and video data transmission device provided in an embodiment of this application;
[0035] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0037] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.
[0038] In this application, the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and conduct subsequent data use and processing within the scope authorized by laws and regulations and the personal information subject. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computing, storage, processing, and sharing of data.
[0039] Cloud technology is a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.
[0040] Cloud computing is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, resources in the "cloud" appear infinitely scalable, readily available, on-demand, and expandable, with payment based on usage.
[0041] As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called Infrastructure as a Service (IaaS)) platform) is established. Various types of virtual resources are deployed in the resource pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices.
[0042] Based on logical function, a Platform as a Service (PaaS) layer can be deployed on top of the IaaS layer, followed by a Software as a Service (SaaS) layer. Alternatively, SaaS can be deployed directly on top of IaaS. PaaS is the platform for running software, such as databases and web containers. SaaS refers to various types of business software, such as web portals and bulk SMS senders. Generally, SaaS and PaaS are upper layers compared to IaaS.
[0043] With the continuous development of audio and video technology, various forms of audio and video services, such as live streaming, video-on-demand, and video calls, have brought diverse user experiences. However, audio and video services mainly rely on network transmission services; therefore, the transmission process of audio and video data is crucial.
[0044] In related technologies, when the data sending end transmits audio and video data to the client, it adjusts the audio and video data transmission strategy according to the real-time network status (such as packet loss rate, latency, etc.) through protocol improvement, congestion control, etc., to ensure that the client receives complete audio and video data and guarantees the playback quality of audio and video.
[0045] However, the audio and video playback effect on the client does not depend entirely on network transmission performance, but may also be related to the client's player caching status. If the data sender adjusts the data sending strategy only based on network transmission performance, it cannot adjust the data sending strategy in a timely and effective manner, which seriously affects the data sending efficiency and audio playback effect. In addition, since the player caching is highly dynamic, the data sender cannot perceive the client's player caching status in a timely manner, making it difficult for the data sender to adjust the data sending strategy according to the player caching status, thus affecting the traffic control effect.
[0046] For example, if packet loss occurs during audio and video data transmission, and the client's player has little cached data, even if the lost packets are retransmitted based on network transmission performance, playback will still stutter because the client has no cached data.
[0047] In this embodiment, the data sender sends the traffic packet set of each audio and video frame to be transmitted to the data receiver and receives each response packet returned by the data receiver. Then, when it is determined from each response packet that the data receiver has received at least one complete frame from each audio and video frame, based on the playback order of each audio and video frame, a playable frame that supports complete playback by the data receiver is detected from the at least one complete frame. After that, based on the detection result, the predicted buffer state of the data receiver is obtained, and a data transmission strategy preset for the predicted buffer state is adopted to send new audio and video frames to be transmitted to the data receiver.
[0048] In this way, the data sender determines, through response messages, which audio and video frames are completely received by the client and which are predicted to support complete playback by the client. This empowers the data sender to predict the client's player cache information. Based on the predicted client player cache information, the data sender can adjust the data sending strategy in a timely and effective manner, improving data transmission efficiency and enhancing audio and video playback effects. Furthermore, subsequent data transmission based on a pre-defined data transmission strategy for the predicted cache state (such as sufficient data or insufficient data) can better adapt to the client's business experience requirements in live audio and video scenarios, thereby improving the audio and video service quality of the service provider and ultimately enhancing the user experience.
[0049] See Figure 1 As shown, it is a schematic diagram of a possible application scenario provided in the embodiment of this application, which includes: a data sending end 110 and a data receiving end 120.
[0050] The data sending end 110 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.
[0051] The data receiving end 120 can be a terminal with audio and video playback requirements. This terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.
[0052] The data transmitter 110 and the data receiver 120 can be connected directly or indirectly through wired or wireless communication, and this application does not impose any restrictions on this.
[0053] In this application, the data sending end 110 acquires each audio and video frame to be transmitted, and sends each audio and video frame's respective traffic packet set to the client, and receives each response packet returned by the client. When the data receiving end 120 determines that it has received at least one complete frame from each audio and video frame based on the identifier of each received packet, it detects a playable frame that supports complete playback by the client from the at least one complete frame based on the playback order of each audio and video frame. Based on the detection result, it obtains the client's predicted buffer state, and uses a data transmission strategy preset for the predicted buffer state to send a new audio and video frame to be transmitted to the data receiving end 120, so that the data receiving end 120 can play the transmitted audio and video frame.
[0054] In this embodiment, the audio and video data transmission method can be applied to various audio and video data transmission scenarios, such as live streaming, instant messaging, and online conferencing, but is not limited to these.
[0055] See Figure 2 As shown, taking a live streaming scenario as an example, the live streaming scenario includes a broadcaster client, a cloud data sending end, and a viewer client. The broadcaster client obtains various audio and video data through a device with audio and video recording capabilities, encodes each audio and video data, and then uploads the encoded audio and video data to the cloud server. After receiving the encoded audio and video data, the cloud server obtains each audio and video data through decoding, and can generate audio and video frames of one or more bitrates (i.e., resolution) through one or more encoding methods. When the cloud server receives a viewing request from a viewer client, it transmits traffic packets of audio and video frames of the specified bitrate to the viewer client. Then, based on the response packets returned by the viewer client, it predicts the audio and video frames that the viewer client will receive completely, as well as the audio and video frames that the viewer client can play completely. Then, based on the predicted audio and video frames that the viewer client will receive completely, as well as the audio and video frames that the viewer client can play completely, it obtains the client's prediction cache state. Finally, using a data transmission strategy preset for the prediction cache state, it sends new audio and video frames to be transmitted to the viewer client. The audio and video data transmission process will be explained using a live streaming scenario as an example.
[0056] See Figure 3 The diagram shown is a flowchart of an audio / video data transmission method provided in this embodiment of the application. This process is applied to the data sending end, and is illustrated using the data sending end as a server and the data receiving end as a viewing client (which can also be directly referred to as a client). The specific process is as follows:
[0057] S301. The server obtains each audio and video frame to be transmitted, and sends the respective traffic packet set of each audio and video frame to the client, and receives each response packet returned by the client.
[0058] In the embodiments of this application, audio and video frames can refer to audio frames, video frames, or a combination of both, and there is no limitation on this.
[0059] In a live streaming scenario, the audio and video frames to be transmitted, obtained by the server, can be transmitted from the broadcaster's client to the server. (See also...) Figure 2 As shown, when the server receives a viewing request from a viewer's client, the server sends the respective traffic packet sets of each audio and video frame to the client, and receives the respective response packets returned by the client. It should be noted that the data transmission process between the broadcaster's client and the server is not limited in this embodiment and will not be described further here.
[0060] After the server obtains each audio and video frame to be transmitted, it can also identify one or more of the playback time and frame type (frame_type) of each audio and video frame.
[0061] The playback time of each audio / video frame can be represented by a presentation timestamp (pts). PTS is a relative timestamp, usually expressed in milliseconds (ms). PTS represents the playback time of the audio / video frame on the client relative to the playback time of the first audio / video frame. For example, if the pts of the first audio / video frame is 0, then when the pts of an audio / video frame is 1, it indicates that the audio / video frame was played 1 ms after the first audio / video frame.
[0062] The PTS (pts) of each audio / video frame can be obtained based on the audio / video protocol used. Audio / video protocols include, but are not limited to, streaming media format (Flash Video, FLV) protocols. Taking the FLV protocol as an example, the PTS of each audio / video frame is recorded in the "Timestamps" field of the tag header in the FLV file of each audio / video frame.
[0063] The frame_type of each audio / video frame is used to characterize the frame type corresponding to that audio / video frame. In this embodiment, the frame type includes, but is not limited to, audio frames and video frames. For video frames, the video frame type can be further subdivided into key frames and non-key frames. Key frames refer to video I-frames, and non-key frames include video P-frames and video B-frames. Video I-frames do not depend on the information of other frames, while video P-frames depend on the preceding I-frames or P-frames, and video B-frames depend on adjacent I-frames or P-frames.
[0064] The `frame_type` of each audio / video frame can be obtained based on the audio / video protocol used. Taking the FLV protocol as an example, in the respective FLV file of each audio / video frame, the `Type` field in the tag header records the frame type. For instance, a `Type` value of 0x08 indicates that the audio / video frame is an audio frame, and a `Type` value of 0x09 indicates that the audio / video frame is a video frame. Specifically for video frames, when the `Frametype` field in the tag data is 2, it indicates that the video frame is not a keyframe; when the `Frametype` field is 1, it indicates that the video frame is a keyframe.
[0065] In this embodiment of the application, referring to Table 1, the server can also maintain a status information table for each audio and video frame that has not been fully confirmed. In addition to pts and frame_type, the status information table may also include one or more of the following: message number (Pkt_num), complete reception (Rcv_bool), and complete playback (Play_bool).
[0066] Table 1 Status Information Table
[0067]
[0068] In Table 1, the Pkt_num field of each audio / video frame contains the Pkt_num of each traffic packet in the traffic packet set of that audio / video frame. In this embodiment, the server can transmit an audio / video frame through one or more traffic packets. The Pkt_num field in Table 1 is used to record which traffic packets an audio / video frame was sent out through. The initial value of each Pkt_num field can be empty, and the content of the Pkt_num field can be updated after some or all of the traffic packets in the traffic packet set of the audio / video frame have been sent.
[0069] The Rcv_bool field of each audio / video frame is used to indicate whether the audio / video frame can be completely received by the client. The initial value of the Rcv_bool field can be a set value (such as 0) indicating that the audio / video frame cannot be completely received. See S302 for updating the content of the Rcv_bool field.
[0070] The Play_bool field for each audio / video frame indicates whether the frame can be played completely by the client. The initial value of the Play_bool field can be a set value (e.g., 0) indicating that the audio / video frame cannot be played completely. See S302 for updating the content of the Rcv_bool field.
[0071] After the server obtains each audio and video frame to be transmitted, before sending the traffic packet set of each audio and video frame to the client, it can also check whether there is a predicted cache evaluation information of the player (i.e., historical cache evaluation information). If there is no historical cache evaluation information, or if the existing historical cache evaluation information does not meet the conditions of sufficient cache and insufficient cache, then the traffic packets of each audio and video frame are sent to the network according to the transmission parameters calculated by the conventional congestion control method.
[0072] In conventional congestion control methods, servers can employ optimized protocols for data transmission. These optimized protocols include, but are not limited to, Quick UDP Internet Connections (QUIC), multipath transport protocols, and more. Multipath transport protocols include, but are not limited to, Multi Path TCP (MPTCP) based on Transmission Control Protocol (TCP) and Multipath QUIC (MPQUIC) based on QUIC. QUIC, in particular, largely addresses the problems faced by the widely deployed TCP protocol. While improving traffic transmission performance, QUIC utilizes multiplexing of Hypertext Transfer Protocol 2.0 (HTTP2), the security of HTTPS, and the reliability of TCP. Multipath transport (such as MPTCP and MPQUIC) solves the problem of low transmission performance caused by limited transmission resources on a single path faced by existing TCP and QUIC protocols. By adding a new transmission path, it addresses the challenge of audio and video traffic not reaching the terminal in a timely manner during traffic transmission and packet loss recovery, significantly improving traffic transmission efficiency.
[0073] On the other hand, servers can sense the congestion level and transmission resource capacity of intermediate networks and adjust data transmission strategies such as traffic sending and packet loss retransmission based on the sensed information. For example, servers can use TCP congestion control algorithms (Reno algorithm) to determine whether there is congestion in the intermediate network based on packet loss, use the Timely algorithm to determine whether there is congestion in the intermediate network based on traffic transmission latency, and use bottleneck bandwidth and RTT (BBR) congestion control algorithms to calculate the available transmission resources (i.e., available network bandwidth) of the intermediate network through network modeling methods. These algorithms determine the congestion level of the intermediate network based on different signals and then adjust the sending window or sending rate of the sending end to make full use of intermediate network resources "as much as possible", thereby improving network transmission efficiency and hoping to improve the service experience of the terminal.
[0074] If the existing historical cache evaluation information meets the control conditions of sufficient or insufficient cache, the target transmission parameters are calculated according to the congestion control method in S303, and the respective traffic packets of each audio and video are sent to the client using the target transmission parameters. See S303 for details.
[0075] As one possible implementation, after the server sends the traffic packet sets of each audio and video frame to the client, for each audio and video frame, the pkt_num of each traffic packet in the traffic packet set of that audio and video frame is filled into the pkt_num column in Table 1.
[0076] For example, see Figure 4 As shown in Table 1, assume the video frames to be transmitted include: frame 3, frame 4, etc. In Table 1, frame 3 is a video frame, specifically a P-frame, with Pts = 30 and pkt_num including 50, 51, ..., 60. That is, frame 3 is a video frame, specifically a P-frame, which is played 30ms after the client plays the first video frame. This video frame is transmitted via traffic packets with message numbers 50, 51, ..., 60. In Table 1, frame 4 is a video B-frame, with Pts = 31 and pkt_num including 61, 63, 64, ..., 72. That is, frame 4 is a video frame, specifically a B-frame, which is played 31ms after the client plays the first video frame. This video frame is transmitted via traffic packets with message numbers 61, 63, 64, ..., 720.
[0077] It should be noted that, in this embodiment of the application, in the pkt_num column of Table 1, the first bit of each pkt_num is used to indicate whether the traffic packet is a retransmission packet. For example, if it is a retransmission packet, the first bit is a binary number 1; otherwise, the first bit is a binary number 0. When the first bit of pkt_num is a binary number 1, the remaining m bits of pkt_num represent the packet number of the retransmission packet and the packet number of the retransmitted traffic packet. The packet number of the retransmitted traffic packet can be represented by the relative number of the traffic packet in each traffic packet corresponding to the audio / video frame, or it can be directly represented by the packet number of the traffic packet; there is no restriction on this.
[0078] For example, suppose that in Table 1, the pkt_num column of frame 2 contains the following pkt_num: {0, 40}, {0, 41}, ..., {0, 49}, {1, 1, 62}, where {0, 40} represents the traffic packet with packet number 40, {0, 41} represents the traffic packet with packet number 41, {0, 49} represents the traffic packet with packet number 49, and {1, 1, 62} represents the traffic packet with packet number 62. The traffic packet with packet number 62 is a retransmission of the first traffic packet (i.e., the traffic packet with packet number 40), and the traffic packet with packet number 62 is used to repair the loss of the first traffic packet of frame 2.
[0079] In this embodiment, after receiving a traffic packet from the server, the client sends a response packet to the server. The response packet may carry the packet number of one or more traffic packets. The response packet can be used to declare that the client has received the corresponding traffic packet, or it can be used to declare that the client has not received the corresponding traffic packet; there is no limitation on this. The following description only uses the example of the response packet being used to declare that the client has received the corresponding traffic packet.
[0080] For example, see Figure 5 As shown, assume that the response message is used to declare that the client has received the corresponding traffic message. Each response message carries the message number of a traffic message. After receiving traffic messages with message numbers 50, 51, 52, ..., 74 sent by the server, the client returns a response message to the server carrying message numbers 50, 52, ..., 74 respectively, to declare to the server that the client has received traffic messages with message numbers 50, 51, 52, ..., 74.
[0081] S302. When the server determines, based on each response message, that the client has received at least one complete frame from each audio and video frame, it detects a playable frame from the at least one complete frame that supports complete playback by the client, based on the playback order of each audio and video frame.
[0082] After receiving each response message, as one possible implementation, the server checks whether the client has received each audio and video frame based on the message identifier (i.e., message number) carried by each response message, and treats the audio and video frames received by the client as complete frames.
[0083] When a server checks whether a client has received each audio and video frame based on the received response messages, it may use, but is not limited to, the following methods:
[0084] The server obtains the message identifier set of each audio and video frame recorded locally. Each message identifier set contains the message identifiers of each traffic packet in the traffic message set of the corresponding audio and video frame.
[0085] Based on the message identifier carried in each response message, the server determines that when the data receiving end receives at least one audio or video frame, it will treat at least one audio or video frame as at least one complete frame.
[0086] Taking audio / video frame x as an example, audio / video frame x can be any audio / video frame in the series of audio / video frames. In this embodiment of the application, the message identifier set of audio / video frame x is recorded in the Pkt_num column of Table 1 above. After the server obtains each response message through the Pkt_num column in Table 1, assuming that the response message is used to declare that the client has received the corresponding traffic message, the server determines, based on the message identifier carried by each response message, that when the data receiving end receives each traffic message of audio / video frame x, it treats audio / video frame x as a complete frame.
[0087] For example, see Figure 6A As shown, frame 3 was sent using traffic packets with message numbers 50, 51, ..., 60. Among the response packets (i.e. ACK packets) received by the server, there are ACK packets declaring that the client has received traffic packets with message numbers 50, 52, ..., 60, but there is no ACK packet declaring that the client has received traffic packets with message number 51. At this point, it is determined that the client has not received frame 3, and frame 3 is not a complete frame.
[0088] For example, see Figure 6B As shown, frame 4 is sent through traffic packets with message numbers 63, 64, ..., 72. Assuming that among the response packets received by the server, there is a response packet that declares that the client has received traffic packets with message numbers 63, 64, ..., 72, the server determines that the client has received frame 4 and treats frame 4 as a complete frame.
[0089] It should be noted that in this embodiment of the application, if the server determines that all traffic packets of a certain audio or video frame have been received by the client, the Rcv_bool value of that frame in the status information table can be set to 1. That is, if the audio or video frame x is determined to be a complete frame, the value of the Rcv_bool field in Table 1 is set to 1.
[0090] For example, see Figure 7 As shown, assuming the server determines that frame 3 is a complete frame, then the value of the Rcv_bool field (i.e., the complete reception field) in Table 1 is set to 1. Furthermore, if the server determines that frame 3 is a playable frame that supports complete playback by the client, then the value of the Play_bool field (i.e., complete playback) in Table 1 is set to 1.
[0091] When the server detects that a certain audio or video frame has been completely received by the client, it further checks whether that audio or video frame can be completely played by the client. Specifically, for each complete frame in at least one complete frame, the server performs the following operations:
[0092] When it is determined, based on the playback order of each audio and video frame, that there is at least one other frame preceding a complete frame, a complete frame is determined to be a playable frame that supports complete playback by the client, based on the detection results corresponding to each of the at least one other frame.
[0093] Assuming that the audio / video frame x has been completely received by the client, and still using audio / video frame x as an example, the process of how to detect whether a certain audio / video frame can be completely played by the client will be explained.
[0094] As one possible scenario, when it is determined, based on the playback order of each audio and video frame, that there are no other frames preceding audio and video frame x, i.e., when audio and video frame x is the first frame, audio and video frame x can be directly regarded as a playable frame that supports complete playback by the client.
[0095] As another possible scenario, when it is determined, based on the playback order of each audio and video frame, that there is at least one other frame preceding audio and video frame x, then based on the detection results corresponding to each of the at least one other frame, it is determined whether audio and video frame x is a playable frame that supports complete playback by the client.
[0096] For example, see Figure 8As shown, assuming the playback order of the video frames is: frame 1, frame 2, frame 3, frame 4, frame 5, etc., where frames 1, 2, 4, and 5 are complete frames, while frame 3 is not. For frame 1, there are no other frames preceding it in the audio and video frames, so frame 1 is directly considered a playable frame that supports complete playback by the client. For frame 2, there is frame 1 preceding it in the audio and video frames. Therefore, based on the detection result of frame 1, we can determine whether frame 2 is a playable frame that supports complete playback by the client. Similarly, for frame 4, based on the detection results of frames 1, 2, and 3, we can determine whether frame 4 is a playable frame that supports complete playback by the client. For frame 5, based on the detection results of frames 1, 2, 3, and 4, we can determine whether frames 1, 2, 3, and 4 are playable frames that support complete playback by the client.
[0097] As one possible implementation, when detecting whether an audio / video frame x is a playable frame that supports complete playback by the client, based on the detection results corresponding to at least one other frame, if it is determined that at least one other frame is a complete frame, then the audio / video frame x is determined to be a playable frame that supports complete playback by the client; if it is determined that there is an audio / video frame that the client has not received in at least one other frame, then the audio / video frame x is determined not to be a playable frame that supports complete playback by the client.
[0098] In this embodiment of the application, the detection result corresponding to at least one other frame can be determined by the Play_bool field of at least one other frame. For example, when Play_bool is 1, it indicates that the corresponding frame is a playable frame that supports complete playback by the client. When Play_bool is 0, it indicates that the corresponding frame is not a playable frame that supports complete playback by the client.
[0099] See also Figure 8 As shown, only frames 2 and 5 are used as examples for explanation. Based on the detection result of frame 1 (the value of Play_bool in frame 1 is 1), the server determines that frame 2 is a playable frame that the client can play completely. Based on the detection results of frames 1, 2, 3, and 4, the server determines that the value of Play_bool in frames 1 and 2 is 1, while the value of Play_bool in frames 3 and 4 is 0. That is, frames 1 and 2 are playable frames that the client can play completely, but frames 3 and 4 are not playable frames. Therefore, frame 5 is not a playable frame that the client can play completely.
[0100] The following sections will explain whether audio frames and video frames support complete playback by the client.
[0101] If audio / video frame x is an audio frame, the server determines, based on the playback order of the audio / video frames, whether there are other frames preceding audio / video frame x. If none exist (i.e., audio / video frame x is the first frame), then audio / video frame x is a playable frame that can be played completely by the client. If it exists (i.e., audio / video frame x is not the first frame), the server further checks whether audio / video frame x is a playable frame that can be played completely by the client based on the detection results of at least one other frame. During this further detection, if the Play_bool value of at least one other frame is 1, then audio / video frame x is determined to be a playable frame that can be played completely by the client. If the Play_bool value of at least one other frame is not all 1, then audio / video frame x is determined not to be a playable frame that can be played completely by the client.
[0102] If audio / video frame x is a video frame (I-frame), then audio / video frame x is determined to be a playable frame that can be fully played by the client if it meets any of the following conditions:
[0103] Condition 1: There are no I-frames, P-frames, or B-frames preceding this video I-frame. In other words, there are no other frames preceding this video I-frame in any audio or video frame.
[0104] Condition 2: The Play_bool of all video frames preceding this video I-frame is 1. In other words, the Play_bool of at least one other frame preceding this video I-frame is 1.
[0105] If audio / video frame x is a video P-frame, it is determined that audio / video frame x belongs to a playable frame that can be fully played by the client when it meets any of the following conditions: the Play_bool of all I-frames, P-frames and B-frames preceding the video P-frame is 1.
[0106] If audio / video frame x is a video B-frame, it is determined that audio / video frame x belongs to a playable frame that can be fully played by the client when it meets any of the following conditions: the Play_bool of all I-frames, P-frames and B-frames preceding the video P-frame is 1.
[0107] Furthermore, when it is determined that the audio / video frame x belongs to a playable frame that supports complete playback by the client, the Play_bool of the audio / video frame x is set to 1; otherwise, the Play_bool of the audio / video frame x is kept at 0.
[0108] In one possible implementation, the playback order of each audio and video frame can be determined in the following way:
[0109] Obtain the message identifier set of each audio and video frame recorded locally. Each message identifier set contains the message identifiers of each traffic message in the traffic message set of the corresponding audio and video frame. Each message identifier is obtained by numbering according to the sending order of the corresponding traffic message.
[0110] Based on the values of each message identifier contained in each acquired message identifier set, the playback order of each audio and video frame is determined.
[0111] For example, in playback order, if the minimum message identifier (MPI) of one audio / video frame is less than that of another, then one audio / video frame precedes the other. In other words, the order of audio / video frames can be determined by their corresponding minimum pkt_num: if the minimum pkt_num of one frame (frame a) is less than that of another frame (frame b), then frame a precedes frame b. For instance, the pkt_nums of frame a include 50, 51, 52, ..., 60, and the pkt_nums of frame b include 61, 62, 63, ..., 66. Since the minimum pkt_num of frame a (50) is less than the minimum pkt_num of another frame (frame b) (61), frame a precedes frame b.
[0112] S303. Based on the detection results, the server obtains the client's predicted cache state and sends new audio and video frames to be transmitted to the client using a data transmission strategy preset for the predicted cache state.
[0113] In this embodiment, the predicted cache state is used to characterize the state of the audio and video frames cached in the client's player, as predicted by the server. The predicted cache state can be either a cache shortage state or a cache abundance state. Based on the detection results, the server obtains the client's predicted cache state and can use a preset data transmission strategy for either a cache shortage state or a cache abundance state to send new audio and video frames to be transmitted to the client. This dynamically adjusts subsequent data transmission, improves data transmission efficiency, and enhances audio and video playback effects. Here, the new audio and video frames to be transmitted refer to the audio and video frames that need to be transmitted subsequently.
[0114] In one possible implementation, when obtaining the client's predicted cache state based on the detection results, the following operations can be used, but are not limited to:
[0115] Based on the detection results and the audio and video frames currently being played by the client, the server obtains the number of cached audio and video frames and their cache duration in the client; based on the number of cached frames and their cache duration, the server obtains the predicted cache status of the client.
[0116] The buffering duration of audio and video frames cached in the client can be predicted in, but is not limited to, the following ways:
[0117] When, based on the detection results, it is determined that at least one playable frame exists in at least one complete frame, the server determines the target frame whose playback time meets the set reference conditions from at least one playable frame based on the playback time of each of the at least one playable frame; then, the server obtains the cache duration of the audio and video frames cached in the client based on the audio and video frames currently being played by the client and the target frame.
[0118] Among them, the target frame that meets the set reference conditions can be at least one playable frame with the largest pts, that is, the audio and video frame with the largest pts value when play_bool=1, but it is not limited to this.
[0119] The buffering time for audio and video frames cached in the client can be determined based on the difference between the playback time of the currently playing audio and video frame and the playback time of the target frame, but it is not limited to this.
[0120] For example, the server determines the audio / video frame currently being played by the client (denoted as frame_cur) and the PTS (denoted as pts_cur) of the audio / video frame currently being played by the client. Then, based on the PTS of at least one playable frame, the playable frame with the largest PTS among at least one playable frame is taken as the target frame. Based on the PTS of the target frame (denoted as pts_max) and combined with pts_cur, the buffering time of the audio / video frames cached in the client (denoted as Frame_time_len) can be calculated using formula (1):
[0121] Frame_time_len = pts_max - pts_cur (Formula 1)
[0122] It should be noted that, in this embodiment of the application, the audio and video frames currently being played by the client can be fed back to the server by the client in real time, but are not limited to this.
[0123] For example, see Figure 9 As shown, assuming the playable frames include frame 1 and frame 2, with pts of 50 and 51 respectively, and the client is currently playing audio / video frame 1, the server determines the client's current audio / video frame and its pts value of 50 (i.e., pts_cur = 50). Then, based on the pts of frame 1 and frame 2, frame 2, which has the largest pts, is selected as the target frame. Based on the target frame's pts (i.e., pts_max = 51), combined with pts_cur, the buffering time of the audio / video frame in the client is calculated as Frame_time_len = 51 - 50 = 1ms.
[0124] In this embodiment of the application, the number of audio and video frames cached in the client can be predicted in, but is not limited to, the following ways:
[0125] When the detection results indicate that at least one playable frame exists in at least one complete frame, the server determines the number of audio and video frames cached in the client (denoted as frame_buffer_amount) based on the number of at least one playable frame and the audio and video frames currently being played by the client.
[0126] Specifically, as one possible implementation, the server can use the number of playable frames whose corresponding PTS values are not less than PTS_cur from at least one playable frame as the number of audio and video frames cached in the client. For example, see still... Figure 9 As shown, pts_cur = 50, the playable frames include frame 1 and frame 2, and the pts of frame 1 and frame 2 are 50 and 51 respectively. The playable frames with pts not less than pts_cur include frame 1 and frame 2. The number of audio and video frames cached in the client is 2.
[0127] As another possible implementation, in order to reduce memory usage and improve audio and video frame detection efficiency, if the server detects that a certain video frame is already being played by the client player, that is, the pts of the audio and video frame is less than pts_cur, then the relevant information of the audio and video frame is deleted from the status information table. Accordingly, when predicting the number of audio and video frames cached in the client, the number of playable frames contained in the status information table can be used as the number of audio and video frames cached in the client.
[0128] After predicting the number and duration of cached audio and video frames in the client, in one possible implementation, based on the number and duration of cached audio and video frames in the client, there are two possible predicted cache states:
[0129] The first possible state: If the preset cache shortage conditions are met based on the cache quantity and cache duration, then the predicted cache state representing the client's cache shortage state is obtained.
[0130] The preset cache insufficiency condition is met when at least one of the following conditions is satisfied:
[0131] Condition a: Cache duration (frame_time_len) < Cache duration threshold (frame_time_len_thres);
[0132] Condition b: Cache size (frame_buffer_amount) < Cache size threshold (frame_buffer_amount_thres).
[0133] The frame_time_len_thres and frame_buffer_amount_thres can be configured by the administrator and reflected in the configuration file. For example, by default, frame_time_len_thres = 100ms and frame_buffer_amount_thres = 5.
[0134] The second possible state: If the preset cache sufficiency conditions are met based on the cache quantity and cache duration, then a predicted cache state representing the client's cache sufficiency state is obtained.
[0135] The preset cache sufficiency condition is met when at least one of the following conditions is satisfied:
[0136] Condition c: frame_time_len>N*frame_time_len_thres;
[0137] Condition d: frame_buffer_amount>N*frame_buffer_amount_thres.
[0138] Where N is a positive integer, N can be configured by the administrator and reflected in the configuration file. For example, by default, N = 5.
[0139] In one possible implementation, a data transmission strategy pre-defined based on the predicted buffer state is used to send new audio / video frames to be transmitted to the client, including:
[0140] Determine the initial transmission parameters based on the network performance between the server and the client;
[0141] Based on the data transmission strategy preset for the predicted buffer state, the initial transmission parameters are adjusted to obtain the target transmission parameters, and based on the target transmission parameters, new audio and video frames to be transmitted are sent to the client.
[0142] The transmission parameters include, but are not limited to, one or more of the transmission rate and the transmission window. The transmission rate in the initial transmission parameters is denoted as pacing_cpt, and the transmission window is denoted as cwnd_cpt. pacing_cpt and cwnd_cpt can be calculated using a congestion control algorithm; the specific congestion control algorithm is not limited and will not be elaborated upon here. The transmission rate in the target transmission parameters is denoted as Pacing_final, and the transmission window in the target transmission parameters is denoted as Cwnd_final.
[0143] In this embodiment of the application, different data transmission strategies can be used for data transmission in the state of insufficient cache and the state of sufficient cache. The data transmission in the state of insufficient cache and the state of sufficient cache will be described below.
[0144] See Figure 10 As shown, if the predicted cache state indicates that the client is in a state of insufficient cache, the initial transmission parameters are adjusted according to the data transmission strategy of increasing the amount of transmitted data to obtain the target transmission parameters.
[0145] For example, Pacing_final can be calculated using formula (2), and Cwnd_final can be calculated using formula (3):
[0146] Cwnd_final = cwnd_cpt * cwnd_gain_weight_1 formula (2)
[0147] Pacing_final = pacing_cpt * pacing_gain_weight_1 Formula (3)
[0148] Wherein, cwnd_gain_weight_1 is the first weight corresponding to cwnd_cpt, and pacing_gain_weight_1 is the first weight corresponding to pacing_cpt. cwnd_gain_weight_1 and pacing_gain_weight_1 can be configured by the administrator and can be shown in the configuration manual. For example, by default, pacing_gain_weight_1 = cwnd_gain_weight_1 = 1.5.
[0149] If the predicted cache state indicates that the client is in a cache-insufficient state, the server can also perform packet loss repair operations in an aggressive manner. Specifically, the server can use redundant retransmission to address packet loss, that is, retransmit M identical copies of the lost packet data. These M copies of the lost packet data can be sent at the same time or at intervals of SRTT / 2, where SRTT represents smoothed RTT, which can be measured by the server. Packet loss detection can be implemented using algorithms such as, but is not limited to, Forward Acknowledgments (FACK) and Recent Acknowledgments (RACK).
[0150] If the predicted cache state indicates that the client is in a state of sufficient cache, then the initial transmission parameters are adjusted according to the data transmission strategy of reducing the amount of data transmitted to obtain the target transmission parameters.
[0151] For example, Pacing_final can be calculated using formula (4), and Cwnd_final can be calculated using formula (5):
[0152] Cwnd_final = cwnd_cpt * cwnd_gain_weight_2 Formula (4)
[0153] Pacing_final = pacing_cpt * pacing_gain_weight_2 Formula (5)
[0154] Here, cwnd_gain_weight_2 is the second weight corresponding to cwnd_cpt, and pacing_gain_weight_2 is the second weight corresponding to pacing_cpt. cwnd_gain_weight_2 and pacing_gain_weight_2 can be configured by the administrator and can be shown in the configuration manual. For example, by default, pacing_gain_weight_2 = cwnd_gain_weight_2 = 0.75.
[0155] It should be noted that in this application, in order to achieve a smaller number of audio and video frames cached by the client, the data sender can use a "appropriately aggressive" data transmission method (such as increasing the traffic sending window or sending window) to try to cache more audio and video frames in the client player's cache within the same time. When the client caches fewer audio and video frames, the data sender will adopt a "more aggressive" data transmission method (such as a packet loss retransmission strategy) to deal with packet loss, ensuring that the lost traffic packets are repaired in the shortest possible time. Therefore, Cwnd_final obtained based on cwnd_gain_weight_2 should be less than Cwnd_final obtained based on cwnd_gain_weight_1, and Pacing_final obtained based on pacing_gain_weight_2 should be less than Pacing_final obtained based on pacing_gain_weight_1.
[0156] In addition to predicting that the client is in a cache-sufficient state, the server can also perform tasks such as bandwidth probing or minimum latency probing. For example, in the BBR algorithm, the server will perform one or more of the following operations: bandwidth probing (ProbeBW) or latency probing (ProbeRTT) to obtain at least one of the latest bandwidth and latency information.
[0157] The present application will now be described with reference to a specific embodiment.
[0158] For example, in the context of online meetings, please refer to... Figure 11 As shown, this application scenario includes client A of object A, client B of object B, client B of object C, and a server for providing voice call services. Object A is the speaker at the conference. For example, clients A, B, and C are all mobile clients.
[0159] Client A obtains audio frames using a device with audio recording capabilities, encodes each audio frame, and then uploads the encoded audio frames to the server. The server receives the encoded audio frames and decodes them to obtain the individual audio frames.
[0160] When the server receives a meeting request from client B (object B), it transmits the traffic packets from the respective traffic packet sets of each audio and video frame to client B, and receives the response packets returned by client B. Then, based on the response packets, when it is determined that client B has received at least one complete frame from the audio and video frames, the server, based on the playback order of the audio and video frames, detects playable frames from the at least one complete frame that support complete playback by client B. Furthermore, based on the detection results, the predicted cache state of client B is determined. In the first case, if the predicted cache state of client B is insufficient, then a new audio / video frame to be transmitted is sent to client B according to the data transmission strategy preset for the predicted cache state (aggressive packet sending and redundant retransmission). In the second case, if the predicted cache state of client B is sufficient, then a new audio / video frame to be transmitted is sent to client B according to the data transmission strategy preset for the predicted cache state (moderate packet sending and network probing). In the third case, if the predicted cache state of client B is neither sufficient nor insufficient, then a new audio / video frame to be transmitted is sent to client B according to the data transmission strategy preset for the predicted cache state (data transmission strategy based on conventional congestion control algorithm).
[0161] Similarly, when the server receives a meeting request from client C (object C), it transmits the traffic packets from the respective traffic packet sets of each audio and video frame to client C, and receives the response packets returned by client C. Then, based on the response packets returned by client C, it predicts the audio and video frames that client C will receive completely, as well as the audio and video frames that client C can play completely. Then, based on the predicted audio and video frames that client C will receive completely, as well as the audio and video frames that client C can play completely, it obtains the client's prediction buffer state, and then uses a data transmission strategy preset for the prediction buffer state to send new audio and video frames to be transmitted to the viewer client.
[0162] Based on the same inventive concept, embodiments of this application provide an audio and video data transmission device. For example... Figure 12 As shown, this is a structural schematic diagram of the audio and video data transmission device 1200, which may include:
[0163] The traffic transceiver unit 1201 is used to acquire each audio and video frame to be transmitted, and send the traffic packet set of each audio and video frame to the data receiving end respectively, and receive each response packet returned by the data receiving end respectively.
[0164] The frame integrity sensing unit 1202 is used to detect, based on the playback order of the audio and video frames, a playable frame that supports complete playback by the data receiving end when the data receiving end determines that it has received at least one complete frame among the audio and video frames based on the response messages.
[0165] The player cache prediction unit 1203 is used to obtain the prediction cache state of the data receiving end based on the detection result, and to send new audio and video frames to be transmitted to the data receiving end using a data transmission strategy preset for the prediction cache state.
[0166] As one possible implementation, when detecting playable frames that support complete playback by the data receiving end from at least one complete frame based on the playback order of the audio and video frames, the frame integrity sensing unit 1202 is specifically used for:
[0167] For each complete frame in at least one complete frame, perform the following operations:
[0168] When it is determined, based on the playback order of the audio and video frames, that there is at least one other frame preceding a complete frame, the complete frame is detected as a playable frame that supports complete playback by the data receiving end, based on the detection results corresponding to each of the at least one other frame.
[0169] As one possible implementation, when detecting whether a complete frame is a playable frame that supports complete playback by the data receiving end based on the detection results corresponding to at least one other frame, the frame integrity sensing unit 1202 is specifically used for:
[0170] If, based on the detection results corresponding to each of the at least one other frame, it is determined that the at least one other frame is a complete frame, then the complete frame is determined to be a playable frame that supports complete playback by the data receiving end.
[0171] If, based on the detection results corresponding to each of the at least one other frame, it is determined that there are audio or video frames in the at least one other frame that the data receiver has not received, then the complete frame is determined not to be a playable frame that supports complete playback by the data receiver.
[0172] As one possible implementation, when obtaining the prediction cache state of the data receiving end based on the detection results, the player cache prediction unit 1203 is specifically used for:
[0173] Based on the detection results, and combined with the audio and video frames currently being played at the data receiving end, the cache evaluation information of the data receiving end is obtained;
[0174] Based on the cache evaluation information, the predicted cache state of the data receiving end is obtained.
[0175] As one possible implementation, the cache evaluation information includes: the number of audio and video frames cached in the data receiving end and the cache duration;
[0176] When obtaining the cache evaluation information of the data receiver based on the detection result and in conjunction with the audio and video frames currently being played at the data receiver, the player cache prediction unit 1203 is specifically used for:
[0177] When it is determined, based on the detection results, that there is at least one playable frame in the at least one complete frame, a target frame whose playback time meets the set reference conditions is determined from the at least one playable frame based on the playback time of each of the at least one playable frame.
[0178] Based on the playback time of the audio and video frames currently being played at the data receiving end and the playback time of the target frame, the buffer duration is obtained, and the number of the at least one playable frame is used as the buffer quantity.
[0179] As one possible implementation, when obtaining the predicted cache state of the data receiving end based on the cache evaluation information, the player cache prediction unit 1203 is specifically used for:
[0180] If, based on the cache evaluation information, it is determined that the preset cache insufficiency condition is met, then a predicted cache state representing that the data receiving end is in a cache insufficiency state is obtained.
[0181] If, based on the cache evaluation information, it is determined that the preset cache sufficiency conditions are met, then a predicted cache state representing the cache sufficiency status of the data receiving end is obtained.
[0182] As one possible implementation, when a new audio / video frame to be transmitted is sent to the data receiving end using a data transmission strategy preset for the predicted cache state, the player cache prediction unit 1203 is specifically used for:
[0183] The initial transmission parameters are determined based on the network transmission performance between the data sender and the data receiver.
[0184] Based on the data transmission strategy preset for the predicted cache state, the initial transmission parameters are adjusted to obtain the target transmission parameters, and based on the target transmission parameters, new audio and video frames to be transmitted are sent to the data receiving end.
[0185] As one possible implementation, when adjusting the initial transmission parameters based on a preset data transmission strategy for the predicted cache state to obtain the target transmission parameters, the player cache prediction unit 1203 is specifically used for:
[0186] If the predicted buffer state indicates that the data receiving end is in a state of insufficient buffer, then the initial transmission parameters are adjusted according to the data transmission strategy of increasing the amount of transmitted data to obtain the target transmission parameters.
[0187] If the predicted buffer state indicates that the data receiving end is in a state of sufficient buffer, then the initial transmission parameters are adjusted according to the data transmission strategy of reducing the amount of transmitted data to obtain the target transmission parameters.
[0188] As one possible implementation, the frame integrity awareness unit 1202 is also used for:
[0189] Obtain the message identifier set of each audio and video frame recorded locally. Each message identifier set contains the message identifiers of each traffic message in the traffic message set of the corresponding audio and video frame. Each message identifier is obtained by numbering according to the sending order of the corresponding traffic message.
[0190] Based on the values of each message identifier contained in each acquired message identifier set, the playback order of each audio and video frame is determined.
[0191] As one possible implementation, when the data receiving end determines that it has received at least one complete frame among the audio and video frames based on the response messages, the frame integrity sensing unit 1202 is specifically used for:
[0192] Obtain the message identifier set of each audio and video frame recorded locally, where each message identifier set contains the message identifiers of each traffic packet in the traffic message set of the corresponding audio and video frame.
[0193] Based on the message identifier carried by each response message, when the data receiving end receives the at least one audio / video frame, the at least one audio / video frame is regarded as at least one complete frame.
[0194] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.
[0195] Regarding the apparatus in the above embodiments, the specific manner in which each unit executes the request has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0196] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0197] Based on the same inventive concept, this application also provides an electronic device. In one embodiment, the electronic device can be a data transmitter or a terminal device. See also... Figure 13 As shown, it is a schematic diagram of a possible electronic device provided in an embodiment of this application. Figure 13 In the electronic device 1300, there are: processor 1310 and memory 1320.
[0198] The memory 1320 stores a computer program that can be executed by the processor 1310. The processor 1310 can execute the steps of the above-mentioned audio and video data transmission method by executing the instructions stored in the memory 1320.
[0199] Memory 1320 may be volatile memory, such as random-access memory (RAM); memory 1320 may also be non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 1320 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1320 may also be a combination of the above-described memories.
[0200] The processor 1310 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 1310 implements the aforementioned audio and video data transmission method when executing a computer program stored in the memory 1320.
[0201] In some embodiments, the processor 1310 and the memory 1320 may be implemented on the same chip, while in other embodiments they may be implemented on separate chips.
[0202] This application embodiment does not limit the specific connection medium between the processor 1310 and the memory 1320. This application embodiment takes the connection between the processor 1310 and the memory 1320 via a bus as an example. Figure 13 The diagram uses thick lines to describe the connections between other components; these are merely illustrative and not intended to be limiting. Buses can be categorized as address buses, data buses, control buses, etc. For ease of description, Figure 13 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.
[0203] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium including a computer program. When the computer program is run on an electronic device, it causes the electronic device to perform the steps of the aforementioned audio and video data transmission method. In some possible implementations, various aspects of the audio and video data transmission method provided in this application can also be implemented as a program product including a computer program. When the program product is run on an electronic device, the computer program causes the electronic device to perform the steps in the aforementioned audio and video data transmission method. For example, the electronic device can perform actions such as... Figure 3 The steps are shown in the figure.
[0204] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0205] The program product of the embodiments of this application may be a CD-ROM and include a computer program, and may run on an electronic device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a computer program that may be used by or in conjunction with a command execution system, apparatus, or device.
[0206] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a readable computer program. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a computer program for use by or in conjunction with a command execution system, apparatus, or device.
[0207] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0208] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for transmitting audio and video data, characterized in that, Applied to the data sending end, including: The system acquires each audio and video frame to be transmitted, sends the traffic packet set of each audio and video frame to the data receiving end, and receives each response packet returned by the data receiving end. When it is determined, based on the response messages, that the data receiving end has received at least one complete frame among the audio and video frames, a playable frame that supports complete playback by the data receiving end is detected from the at least one complete frame based on the playback order of the audio and video frames. Based on the detection results, when it is determined that there is at least one playable frame in the at least one complete frame, a target frame whose playback time meets the set reference conditions is determined from the at least one playable frame based on the playback time of each of the at least one playable frames. Based on the playback time of the audio and video frames currently being played at the data receiving end and the playback time of the target frame, the buffer duration of the audio and video frames cached in the data receiving end is obtained, and the number of the at least one playable frame is taken as the number of audio and video frames cached in the data receiving end. Based on the number of caches and the cache duration, the predicted cache state of the data receiving end is obtained, and a data transmission strategy preset for the predicted cache state is adopted to send new audio and video frames to be transmitted to the data receiving end.
2. The method as described in claim 1, characterized in that, The step of detecting playable frames that support complete playback by the data receiving end from at least one complete frame based on the playback order of the audio and video frames includes: For each complete frame in at least one complete frame, perform the following operations: When it is determined, based on the playback order of the audio and video frames, that there is at least one other frame preceding a complete frame, the complete frame is detected as a playable frame that supports complete playback by the data receiving end, based on the detection results corresponding to each of the at least one other frame.
3. The method as described in claim 2, characterized in that, The step of detecting whether a complete frame is a playable frame that supports complete playback by the data receiving end, based on the detection results corresponding to at least one other frame, includes: If, based on the detection results corresponding to each of the at least one other frame, it is determined that the at least one other frame is a complete frame, then the complete frame is determined to be a playable frame that supports complete playback by the data receiving end. If, based on the detection results corresponding to each of the at least one other frame, it is determined that there are audio or video frames in the at least one other frame that the data receiver has not received, then the complete frame is determined not to be a playable frame that supports complete playback by the data receiver.
4. The method as described in claim 1, characterized in that, The step of obtaining the predicted cache state of the data receiving end based on the cache quantity and the cache duration includes: If, based on the cache quantity and the cache duration, it is determined that the preset cache insufficiency condition is met, then a predicted cache state representing that the data receiving end is in a cache insufficiency state is obtained. If, based on the cache quantity and the cache duration, it is determined that the preset cache sufficiency conditions are met, then a predicted cache state representing the cache sufficiency status of the data receiving end is obtained.
5. The method as described in claim 1, 2, or 3, characterized in that, The step of sending new audio and video frames to be transmitted to the data receiving end using a data transmission strategy preset for the predicted buffer state includes: The initial transmission parameters are determined based on the network transmission performance between the data sender and the data receiver. Based on the data transmission strategy preset for the predicted cache state, the initial transmission parameters are adjusted to obtain the target transmission parameters, and based on the target transmission parameters, new audio and video frames to be transmitted are sent to the data receiving end.
6. The method as described in claim 5, characterized in that, The step of adjusting the initial transmission parameters based on a preset data transmission strategy for the predicted cache state to obtain the target transmission parameters includes: If the predicted buffer state indicates that the data receiving end is in a state of insufficient buffer, then the initial transmission parameters are adjusted according to the data transmission strategy of increasing the amount of transmitted data to obtain the target transmission parameters. If the predicted buffer state indicates that the data receiving end is in a state of sufficient buffer, then the initial transmission parameters are adjusted according to the data transmission strategy of reducing the amount of transmitted data to obtain the target transmission parameters.
7. The method as described in claim 1, 2, or 3, characterized in that, The playback order of the audio and video frames is determined in the following way: Obtain the message identifier set of each audio and video frame recorded locally. Each message identifier set contains the message identifiers of each traffic message in the traffic message set of the corresponding audio and video frame. Each message identifier is obtained by numbering according to the sending order of the corresponding traffic message. Based on the values of each message identifier contained in each acquired message identifier set, the playback order of each audio and video frame is determined.
8. The method as described in claim 1, 2, or 3, characterized in that, The step of determining, based on the response messages, that the data receiving end has received at least one complete frame from the audio and video frames includes: Obtain the message identifier set of each audio and video frame recorded locally, where each message identifier set contains the message identifiers of each traffic packet in the traffic message set of the corresponding audio and video frame. Based on the message identifier carried by each response message, when the data receiving end receives the at least one audio / video frame, the at least one audio / video frame is regarded as at least one complete frame.
9. An audio and video data transmission device, characterized in that, include: The traffic transceiver unit is used to acquire each audio and video frame to be transmitted, and send the traffic packet set of each audio and video frame to the data receiving end respectively, and receive each response packet returned by the data receiving end respectively. The frame integrity sensing unit is used to detect, based on the playback order of the audio and video frames, a playable frame that supports complete playback by the data receiving end when the data receiving end determines that it has received at least one complete frame among the audio and video frames based on the response messages. The player cache prediction unit is configured to, based on the detection results, determine, when at least one playable frame exists in the at least one complete frame, determine, based on the playback time of each of the at least one playable frame, a target frame whose playback time meets a set reference condition from the at least one playable frame; obtain the cache duration of the cached audio and video frames in the data receiving end based on the playback time of the currently playing audio and video frames at the data receiving end and the target frame, and use the number of the at least one playable frame as the cache quantity of the cached audio and video frames in the data receiving end; obtain the predicted cache state of the data receiving end based on the cache quantity and the cache duration, and send new audio and video frames to be transmitted to the data receiving end using a data transmission strategy preset for the predicted cache state.
10. The apparatus as claimed in claim 9, characterized in that, When detecting a playable frame that supports complete playback by the data receiving end from at least one complete frame based on the playback order of the audio and video frames, the frame integrity sensing unit is specifically used for: For each complete frame in at least one complete frame, perform the following operations: When it is determined, based on the playback order of the audio and video frames, that there is at least one other frame preceding a complete frame, the complete frame is detected as a playable frame that supports complete playback by the data receiving end, based on the detection results corresponding to each of the at least one other frame.
11. The apparatus as claimed in claim 10, characterized in that, When detecting whether a complete frame is a playable frame that supports complete playback by the data receiving end based on the detection results corresponding to at least one other frame, the frame integrity sensing unit is specifically used for: If, based on the detection results corresponding to each of the at least one other frame, it is determined that the at least one other frame is a complete frame, then the complete frame is determined to be a playable frame that supports complete playback by the data receiving end. If, based on the detection results corresponding to each of the at least one other frame, it is determined that there are audio or video frames in the at least one other frame that the data receiver has not received, then the complete frame is determined not to be a playable frame that supports complete playback by the data receiver.
12. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of any of the methods described in claims 1 to 8.
13. A computer-readable storage medium, characterized in that, It includes a computer program that, when run on an electronic device, causes the electronic device to perform the steps of any of the methods described in claims 1 to 8.
14. A computer program product, characterized in that, It includes a computer program stored in a computer-readable storage medium, and a processor of an electronic device reads from and executes the computer program, causing the electronic device to perform the steps of any of the methods described in claims 1 to 8.
Citation Information
Patent Citations
Method and device for realizing code rate switching
CN110022498A
Congestion mitigation method and apparatus considering optimization of user satisfaction of video traffic in mobile network
US20160295298A1
