A data merging transmission method and related apparatus
By merging small data packets during data transmission and setting a merge header, the problem of low effective load rate is solved, and efficient data transmission in low-latency scenarios is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-05-29
AI Technical Summary
In data transmission scenarios, especially live streaming scenarios, the frequent sending of small data packets leads to low effective load rate, high packet header overhead, and low transmission efficiency.
By obtaining the maximum data packet length of the transmission network between the sending and receiving devices, multiple small data target data are merged and packaged into a merged data packet. A merged packet header is set in the merged data packet to identify the storage location of the target data in the merged data packet, ensuring that the length of the merged data packet does not exceed the maximum data packet length.
It improves the effective load rate of merged data packets, reduces the number of transmissions and the proportion of packet headers, and enhances data transmission efficiency, especially significantly improving the effective load rate of data transmission in low-latency scenarios.
Smart Images

Figure CN122120216A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission, and in particular to a data merging and transmission method and related apparatus. Background Technology
[0002] In data transmission scenarios, such as live streaming, the sending device needs to transmit data to the receiving device to ensure that users can watch normally.
[0003] Currently, for small amounts of data to be sent, it is directly encapsulated into independent data packets and sent immediately to minimize end-to-end transmission latency.
[0004] However, the frequent transmission of such small data packets leads to high header overhead. The header accounts for a large proportion of the total data, resulting in less effective payload for actual transmission and a low payload rate for individual data packets, which in turn leads to low transmission efficiency. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a data merging and transmission method and related apparatus, which improves data transmission efficiency in low-latency scenarios.
[0006] The embodiments of this application disclose the following technical solutions:
[0007] In a first aspect, this application provides a data merging and transmission method, the method being performed by a transmitting device, the method comprising:
[0008] Obtain the maximum data packet length corresponding to the transmission network between the sending device and the receiving device;
[0009] From the data to be sent to the receiving device, determine the target data whose data length does not reach the maximum data packet length;
[0010] The N target data in the target data are merged and packaged to obtain a merged data packet. The upper limit of the length of the merged data packet is the maximum data packet length. The merged data packet includes a merge header, which is used to identify the storage location of the N target data in the merged data packet. The merged data packet is used to send to the receiving device, where N > 1.
[0011] In one possible implementation, the method further includes:
[0012] The predetermined value and associated adjustment method are determined based on the network parameters of the transmission network, wherein the network parameters include at least one of the network type or network quality of the transmission network.
[0013] In one possible implementation, the first network protocol is the Internet Control Message Protocol (ICP-35), the first probe message carries an identifier prohibiting data fragmentation, and the step of adjusting the data length of the first probe message according to the first response result of the first probe message and retransmitting the first probe message to determine the first maximum data packet undetermined length includes:
[0014] If the first response message returned is a fragmentation error message, adjust the data length of the first probe message and resend the first probe message;
[0015] If the first response message is not returned, the data length of the first probe message sent this time will be determined as the first maximum data packet undetermined length.
[0016] In one possible implementation, the second network protocol is Real-Time Transport Protocol (RTP) or User Datagram Protocol (UDP), the second probe message is obtained by copying the actual data packet to be forwarded, the second probe message carries a type identifier to identify the probe packet type, and the step of adjusting the data length of the second probe message according to the second response result of the second probe message and retransmitting the second probe message to determine the second maximum data packet undetermined length includes:
[0017] If the returned second response message indicates that the second probe message was not completely received, adjust the data length of the second probe message and resend the second probe message;
[0018] If the returned second response message indicates that the second probe message has been received completely, the data length of the second probe message sent this time is determined as the second maximum data packet undetermined length.
[0019] In one possible implementation, the method further includes:
[0020] The maximum data packet length is cached in a length buffer and updated according to update conditions;
[0021] The step of obtaining the maximum data packet length corresponding to the transmission network between the sending device and the receiving device includes:
[0022] The maximum data packet length corresponding to the transmission network between the sending device and the receiving device is retrieved from the length buffer.
[0023] In one possible implementation, the update condition includes at least one of the following: the transmission network experiencing an abnormal network condition or reaching the update cycle.
[0024] In one possible implementation, the N target data have the same data type.
[0025] Secondly, this application provides a data merging and transmission method, the method being executed by a receiving device, the method comprising:
[0026] Acquire the merged data packet sent by the transmitting device, the merged data packet being obtained through the aforementioned data merging and transmission;
[0027] The merged data packet is decapsulated to obtain the N target data.
[0028] In one possible implementation, the method further includes:
[0029] The usage timestamps corresponding to the N target data are obtained by calculating the encoding parameters of the receiving device.
[0030] Alternatively, the usage timestamps corresponding to the N target data can be calculated using the offsets carried in the merged data packets.
[0031] Thirdly, this application provides a transmitting device, the transmitting device comprising:
[0032] The first acquisition unit is used to acquire the maximum data packet length corresponding to the transmission network between the sending device and the receiving device;
[0033] The first determining unit is configured to determine, from the data to be transmitted to the receiving device, target data whose data length does not reach the maximum data packet length;
[0034] The merging unit is used to merge and package N target data in the target data to obtain a merged data packet. The upper limit of the data packet length of the merged data packet is the maximum data packet length. The merged data packet includes a merge header, which is used to identify the storage location of the N target data in the merged data packet. The merged data packet is used to send to the receiving device, where N>1.
[0035] Fourthly, this application provides a receiving device, the receiving device comprising:
[0036] The second acquisition unit is used to acquire the merged data packet sent by the sending device, wherein the merged data packet is obtained by the aforementioned method;
[0037] The decapsulation unit is used to decapsulate the merged data packet to obtain the N target data.
[0038] Fifthly, this application provides a computer device, the computer device including a processor and a memory:
[0039] The memory is used to store computer programs;
[0040] The processor is configured to execute the method according to the computer program.
[0041] In a sixth aspect, this application provides a computer-readable storage medium for storing a computer program that, when executed by a computer device, implements the method described above.
[0042] In a seventh aspect, this application provides a computer program product including a computer program that, when run on a computer device, causes the computer device to perform the method.
[0043] As can be seen from the above technical solution, in order to improve the effective load rate in data transmission scenarios, the data merging and transmission method provided in this application can be executed by the sending device to obtain the maximum data packet length corresponding to the transmission network between the sending device and the receiving device. The maximum data packet length represents the maximum data volume of a single data packet that the transmission network can support. To avoid the frequent separate transmission of small data target data, resulting in a low effective load, this application, after determining the target data whose data length does not reach the maximum data packet length from the data to be sent to the receiving device, can use the maximum data packet length as the upper limit of the data volume when sending a single data packet to determine the data volume of a single data packet transmission. That is, using the maximum data packet length as the upper limit of the data packet length for merging data packets, N target data that meet the transmission timeliness requirements are merged and packaged to obtain a merged data packet, which is then sent to the receiving device. In this way, the transmission network can support the simultaneous transmission of N target data using a single merged data packet, reducing the number of transmissions by N-1 and eliminating the need for N-1 header transmissions. Furthermore, the amount of target data in the merged data packet is significantly increased in a single transmission, resulting in a larger effective payload and a smaller header proportion, thus improving the effective load rate. In addition, a merged header is included in the merged data packet to identify the storage location of the N target data within the merged data packet, facilitating correct packet parsing by the receiving device. In summary, this application, within the maximum data packet length of the transmission network, merges and packages multiple small amounts of data to be transmitted, maximizing the effective load rate of the merged data packet and improving data transmission efficiency. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 An architecture diagram of a computer system for a data merging and transmission method provided in this application embodiment;
[0046] Figure 2 This is a schematic diagram illustrating an application scenario of a data merging and transmission method provided in an embodiment of this application.
[0047] Figure 3 A flowchart illustrating a data merging and transmission method provided in an embodiment of this application;
[0048] Figure 4 An architecture diagram of a data merging and transmission system provided in this application embodiment;
[0049] Figure 5 A flowchart illustrating a method for determining the maximum data packet length provided in an embodiment of this application;
[0050] Figure 6 This is a schematic diagram illustrating a process for merging and packaging as provided in an embodiment of this application;
[0051] Figure 7A A schematic diagram of a single merged packet header provided for an embodiment of this application;
[0052] Figure 7B This is a schematic diagram of a merged data packet provided in an embodiment of this application;
[0053] Figure 8 A schematic diagram illustrating yet another type of data packet merging provided in an embodiment of this application;
[0054] Figure 9 A schematic diagram of a transmitting device provided in an embodiment of this application;
[0055] Figure 10 A schematic diagram of a receiving device provided in an embodiment of this application;
[0056] Figure 11 A schematic diagram of a data merging and transmission system provided in an embodiment of this application;
[0057] Figure 12 A structural diagram of a terminal device provided in an embodiment of this application;
[0058] Figure 13 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation
[0059] The embodiments of this application will now be described with reference to the accompanying drawings.
[0060] As described in the background section, in data transmission scenarios with latency requirements, small amounts of data to be sent are directly encapsulated into independent data packets and sent immediately to minimize end-to-end transmission latency. However, this results in a low payload rate for individual data packets, leading to inefficient transmission.
[0061] Currently, in ultra-low latency live streaming scenarios, a real-time transmission architecture based on WebRTC (Web Real-Time Communication) is typically adopted, combined with a Content Delivery Network (CDN) to achieve media distribution for large-scale concurrent users.
[0062] WebRTC is an open standard and technical framework that supports real-time audio and video communication between browsers and mobile devices. WebRTC uses the RTP / RTCP protocol to transmit media data and combines network traversal technologies such as STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) to complete end-to-end connections.
[0063] Real-time Transport Protocol (RTP): RTP provides end-to-end transmission services for multimedia data such as voice and images that require real-time transmission over Internet Protocol (IP). However, it cannot guarantee the Quality of Service (QoS) itself. Therefore, it is usually used in conjunction with Real-time Transport Control Protocol (RTCP).
[0064] User Datagram Protocol (UDP): A connectionless transport layer protocol used to transmit datagrams over IP networks. UDP features low latency but does not provide reliable transmission or congestion control, and is typically used in conjunction with RTP for real-time multimedia transmission.
[0065] RTCP: The control protocol of RTP, used to periodically exchange transmission quality statistics and control information, such as packet loss rate, latency, and jitter, to help maintain transmission stability.
[0066] Ultra-low latency live streaming (LEB) refers to a live streaming transmission method aimed at minimizing end-to-end playback latency. It is typically based on the UDP transport protocol and uses real-time transport protocol stacks such as RTP / RTCP, enabling clients to quickly decode and play media data after receiving it. This meets the needs of business scenarios with high real-time requirements, such as interactive live streaming, online education, and live sports events.
[0067] NAT Session Traversal Utilities for NAT (STUN): A network traversal protocol used to discover a client's public IP address and port in a Network Address Translation (NAT) or firewall environment, thereby establishing direct peer-to-peer communication.
[0068] Content Delivery Network (CDN): A network architecture that delivers audio, video, and other content to users through distributed edge nodes, used to improve transmission efficiency and stability under large-scale concurrent access.
[0069] Display Time Stamp (DTS): This refers to the point in time during video or audio decoding when a media decoder should process a particular frame or data unit. DTS is used to ensure that frame data is decoded in the correct order.
[0070] I-frame: A keyframe type in video compression technology, typically serving as the first frame in each group of images. Its key feature is that it uses intra-frame compression, allowing for independent compression and reconstruction of the complete image without relying on other frame data.
[0071] In ultra-low latency live streaming scenarios, to meet the stringent requirements of millisecond-level end-to-end playback latency, existing live streaming systems generally adopt a real-time communication technology architecture based on WebRTC. When a client initiates a playback request, it first obtains the network address of the service node through the DNS protocol, and then sends session description protocol signaling such as miniSDP to the service node to complete media capability negotiation, determine key information such as audio and video encoding formats and transmission parameters, and combine it with network penetration protocols such as STUN to complete network connectivity detection and candidate link establishment, thereby quickly establishing a playback link in complex network environments.
[0072] After the playback link is established, the server continuously sends audio and video media data packets to the client via the RTP protocol. Upon receiving the media data, the client performs real-time data parsing, decoding, and rendering, and achieves synchronized audio and video playback based on the timestamp and sequence number information carried in the RTP data packets. Simultaneously, the RTCP protocol is used to periodically exchange transmission quality statistics and control information between the client and server to monitor network conditions such as packet loss rate, latency, and jitter, and to help maintain the stability of media transmission. Through this mechanism, the WebRTC-based ultra-low latency live streaming architecture, to a certain extent, balances the requirements of high concurrency support and low-latency playback.
[0073] However, in existing ultra-low latency live RTP transmission processes, CDN streaming nodes typically employ differentiated transmission strategies based on the size of media units (i.e., data to be sent) and latency requirements. For media units with small data volumes, to avoid latency introduced by additional buffering or processing, the system usually directly encapsulates the encoded data into independent RTP packets for transmission without additional splicing or aggregation. For video frames with large data volumes (such as I-frames), they are typically divided into multiple small payload units and encapsulated into multiple RTP packets for batch transmission to ensure network transmission stability and reliability.
[0074] While this RTP transmission strategy in related technologies achieves a balance between low latency and reliable transmission to some extent, it still has the following shortcomings:
[0075] First, the rapid transmission of small amounts of pending data does not sufficiently reduce overall end-to-end playback latency. Although small amounts of pending data, such as audio, are sent first, in the current playback architecture, audio and video typically require synchronous rendering on the client side before playback can occur. Due to the large size of video frames and their relatively late arrival time, even if audio data arrives earlier, it is often in a waiting state and cannot be played immediately, resulting in limited gains in overall end-to-end latency.
[0076] Secondly, it leads to higher protocol header overhead. Each RTP packet needs to carry a complete RTP header and UDP / IP header. In low-load scenarios, the proportion of protocol headers increases significantly, resulting in a decrease in the effective load rate of unit media data. This not only increases network bandwidth consumption but also raises the overall bitrate cost, affecting the system's ability to be deployed at scale.
[0077] Furthermore, the size of data packets transmitted in RTP transmission strategies is usually fixed or based on experience. When the transmission network (i.e., the transmission path) changes, unreasonable data packet sizes can easily lead to IP fragmentation or even data packet loss, thereby affecting bandwidth utilization efficiency and transmission stability.
[0078] In short, the transmission strategies in related technologies result in low data packet payload, low transmission efficiency, and the risk of data packet loss.
[0079] Based on this, this application provides a data merging and transmission method and related apparatus. This application merges and packages multiple small amounts of data to be sent, based on the maximum data packet length of the transmission network, to maximize the effective load rate of the merged data packet and improve data transmission efficiency in low-latency scenarios.
[0080] It is understood that in the specific implementation of this application, user information such as data to be sent, target data, usage timestamps, actual data packets and other related data are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0081] To facilitate understanding of the data merging and transmission method provided in the embodiments of this application, the computer system used to implement the data merging and transmission method will be described exemplarily below.
[0082] See Figure 1 , Figure 1 This is an architecture diagram of a computer system for a data merging and transmission method provided in an embodiment of this application. The computer system 100 typically includes multiple computer devices, which can be terminal devices 110 or servers 120. Communication between terminal devices 110 and servers 120 can be achieved through a communication network, for example. Figure 1 The computer system 100 includes a terminal device 110, a server 120, a database 130, and a communication network.
[0083] In this application, terminal device 110 can be used as a data transmitting device and server 120 as a data receiving device, thus it can be applied in the uplink. Of course, server 120 can also be used as a transmitting device and terminal device 110 as a receiving device, thus it can be applied in the downlink; the latter will be used as an example here.
[0084] The terminal device 110 has a client application installed and running with the target application. This target application is an application capable of receiving data, such as an application that supports live streaming, video calls, video conferencing, and voice calls. This application does not limit the form of the target application, and it may include, but is not limited to, applications (Apps), mini-programs, etc., installed on the terminal device 110, or even web pages.
[0085] Terminal device 110 can be electronic devices such as smartphones, wearable devices, personal computers (PCs), intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, unmanned vending terminals, and extended reality (XR) devices. Among them, XR devices can include virtual reality (VR) devices, augmented reality (AR) devices, and mixed reality (MR) devices.
[0086] Those skilled in the art will understand that the number of the aforementioned terminal devices 110 may be more or less. For example, there may be only one terminal device 110, or there may be multiple or more terminal devices 110. This application does not limit the number or type of terminal devices 110.
[0087] Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and other basic cloud computing services. Server 120 can be a backend server for the aforementioned target application, used to provide backend services to the clients of the target application.
[0088] The communication network uses standard communication technologies and / or protocols, typically the Internet, but can also be any network, including but not limited to Bluetooth, Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, private network, or any combination of virtual private network. In some embodiments, custom or dedicated data communication technologies may be used to replace or supplement the aforementioned data communication technologies.
[0089] Database 130 can be integrated on a server, or placed in the cloud or on other devices. Simply put, a database can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, shared by multiple users, with minimal redundancy, and independent of applications. A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. Database management systems can be classified according to the database model they support, such as relational or Extensible Markup Language (XML); or according to the type of computer they support, such as server clusters or mobile phones; or according to the query language used, such as Structured Query Language (SQL) or XML Query Language (XQuery); or according to performance priorities, such as maximum scale or highest operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, by simultaneously supporting multiple query languages. Databases can be used to store data from the aforementioned servers or terminal devices.
[0090] The data merging and transmission method provided in this application can be applied to data transmission scenarios with latency requirements, such as ultra-low latency live streaming scenarios. Specifically, it can be applied to business scenarios with extremely high end-to-end latency requirements, such as online education, interactive live streaming, e-sports events, sports event broadcasting, video calls, remote conferencing, and telemedicine. Two typical application scenarios are shown below. Of course, these application scenarios are only illustrative examples, and this method can also be applied to other scenarios.
[0091] Scenario 1: Interactive Live Streaming
[0092] In interactive live streaming scenarios, viewers can watch media data sent by CDN streaming nodes (i.e., sending devices) in real time through mobile phones and other terminal devices (i.e., receiving devices). When CDN streaming nodes send small amounts of media data (i.e., short-length media data) to viewers' terminal devices, in order to improve the effective load rate, they can merge and package multiple small amounts of media data into a merged data packet, which is limited to the maximum data packet length of the transmission network between the CDN streaming node and the viewers' terminal devices. This merged data packet is then sent to the viewers' terminal devices, resulting in a higher effective load in the merged data packet received by the viewers' terminal devices and improving the effective load rate.
[0093] Scenario 2: Esports Event
[0094] In esports live streaming, servers such as CDN streaming nodes (i.e., sending devices) need to transmit data with low latency to viewer terminal devices (i.e., receiving devices) to ensure viewers can watch the real-time battle situation in the game. When transmitting small amounts of media data, to improve the effective load rate, multiple small amounts of media data can be merged and packaged into a merged data packet, based on the maximum data packet length of the network between the server and the viewer terminal device. This merged data packet is then sent to the viewer terminal device, ensuring viewers can watch the intense battle situation in a timely manner.
[0095] The following example, using a server as the execution entity of this data merging and transmission method, illustrates its application scenarios. (See also...) Figure 2 This is a schematic diagram of an application scenario for a data merging and transmission method provided in an embodiment of this application. The application scenario includes a sending device 210 and a receiving device 220. The sending device 210 and the receiving device 220 transmit data through a transmission network, such as transmitting media data related to live content. Here, the sending device 210 is taken as a CDN-deployed server and the receiving device 220 is taken as a terminal device used by the audience.
[0096] The transmitting device 210 can obtain the maximum data packet length corresponding to the transmission network between itself and the receiving device 220 (step 201). The maximum data packet length represents the maximum amount of data in a single data packet that the transmission network can support for transmission; for example, the maximum data packet length is 1000 bits. The transmission network refers to the transmission path between the transmitting device 210 and the receiving device 220. The transmitting device 210 can transmit data packets to the receiving device 220 through the transmission network.
[0097] Among the large amount of data to be sent (e.g., the aforementioned media data) that the sending device 210 is preparing to send to the receiving device 220, some of the data to be sent has a large data volume, i.e., a long data length, while some of the data to be sent has a small data volume, i.e., a short data length. Therefore, the sending device 210 can first determine the target data whose data length has not reached the maximum data packet length from the data to be sent (step 202), that is, determine the target data with a small data volume.
[0098] In this dynamic, low-latency scenario, to avoid frequent individual transmission of small amounts of target data, resulting in low effective payload, the maximum data packet length can be used as the upper limit of the data volume for a single data packet transmission to determine the size of the data volume for a single data packet transmission. That is, using the maximum data packet length as the upper limit of the data packet length for merging data packets, N target data that meet the transmission timeliness requirements are merged and packaged to obtain a merged data packet (step 203).
[0099] As an example, the maximum data packet length is 1000 bits, N is 4, and the data lengths of the four target data are 100 bits, 150 bits, 200 bits, and 300 bits respectively. Their sum of data length is 750 bits, which does not exceed 1000 bits. Therefore, these four target data can be merged and packaged to obtain a merged data packet.
[0100] Furthermore, a merge header is set in the merged data packet. The merge header reveals the storage locations of the N target data items within the merged data packet. (See reference...) Figure 2 As shown, this facilitates the receiving device 220 in correctly parsing data packets.
[0101] The sending device 210 sends the merged data packet to the receiving device 220 through the transmission network (step 204). After receiving the merged data packet, the receiving device 220 can decapsulate the merged data packet to obtain N target data, thereby realizing real-time playback of the live content.
[0102] In this way, the transmission network can support the simultaneous transmission of N target data using a single merged data packet, reducing the number of transmissions by N-1 and eliminating the need for N-1 header transmissions. Furthermore, the amount of target data in the merged data packet is significantly increased in a single transmission, resulting in a larger effective payload and a smaller header proportion, thus improving the effective load rate. In summary, this application, within the maximum data packet length of the transmission network, merges and packages multiple small amounts of data to be sent, maximizing the effective load rate of the merged data packet and improving data transmission efficiency in low-latency scenarios.
[0103] The data merging and transmission method provided in this application embodiment can be executed by a server. However, in other embodiments of this application, the terminal device may also have similar functions to the server to execute the data merging and transmission method provided in this application embodiment, or the terminal device and the server may jointly execute the data merging and transmission method provided in this application embodiment. This embodiment does not limit this.
[0104] See Figure 3This is a flowchart illustrating a data merging and transmission method provided in an embodiment of this application. The method includes steps 301-306. Steps 301-304 can be performed by the sending device, and steps 305-306 can be performed by the receiving device.
[0105] Step 301: Obtain the maximum data packet length corresponding to the transmission network between the sending device and the receiving device.
[0106] Transmitting and receiving devices refer to the same data transmission. A transmitting device is the computer equipment that sends data during data transmission; that is, the data sending end. A receiving device is the computer equipment that receives data during data transmission; that is, the data receiving end.
[0107] When the sending device is a server, the receiving device can be a terminal device. This can be applied to scenarios where the server transmits data downlink to the terminal device. For example, a CDN-deployed server distributes media data to various terminal devices to ensure that viewers using these devices can watch live content in real time. When the sending device is a terminal device and the receiving device is a server, this can be applied to scenarios where the terminal device transmits data uplink to the server. For example, a broadcaster's terminal device uploads media data to a CDN-deployed server to upload live content. Of course, both the sending and receiving devices can be terminal devices or both can be servers to achieve data transmission between terminal devices or between servers. This application does not limit the device types of the sending and receiving devices.
[0108] The data merging and transmission method provided in this application can be applied to data transmission scenarios with latency requirements, such as low-latency and ultra-low-latency scenarios, and of course, it can also be applied to high-latency scenarios. In related technologies, for small amounts of data to be sent, they are directly packaged into individual data packets and sent frequently to achieve data transmission. However, this results in a small payload in each data packet and a high header proportion, leading to a low payload ratio, low transmission efficiency, and wasted transmission resources of computer equipment.
[0109] Based on this, this application obtains the maximum data packet length corresponding to the transmission network between the sending device and the receiving device, so as to maximize the effective load rate and transmission efficiency by using the maximum data packet length as a basis.
[0110] A transmission network refers to the data transmission path between a sending device and a receiving device; it is the "route" that data takes from the sending device to the receiving device, and may include intermediate nodes. Transmission networks are used to transmit data from a sending device to a receiving device.
[0111] The transmission network has a corresponding maximum data packet length, which represents the maximum amount of data in a single data packet that the network can support for transmission. If the data packet length does not exceed the maximum data packet length, the transmission network can transmit the data. If the data packet length exceeds the maximum data packet length, the transmission network cannot directly transmit the large data packet, which may result in transmission failure or the data packet being fragmented into smaller data packets for transmission.
[0112] Additionally, packet length or data length can be understood as the total length of all data in the entire packet, i.e., the total length of the header and payload, or simply the length of the payload within the packet. Since the length of the header is usually negligible compared to the length of the payload, no specific distinction is made here.
[0113] In practical applications, the maximum data packet length can be represented by the Maximum Transmission Unit (MTU), which refers to the maximum byte length of a single data packet that the network layer can transmit. This application performs dynamic MTU detection, which can determine the maximum data packet length that the transmission network can carry, thereby enabling data merging and improving transmission efficiency.
[0114] Step 302: Determine the target data whose data length does not reach the maximum data packet length from the data to be sent to the receiving device.
[0115] Data to be sent refers to data that the sending device is prepared to send to the receiving device, that is, data that needs to be transmitted through a transmission network. Examples of data to be sent include media data (such as audio data, video data, etc.).
[0116] The transmitting device can identify target data from the data to be transmitted to the receiving device via the transmission network. Target data refers to data with a length less than or equal to the maximum data packet length, i.e., small data volume (or small size) data to be transmitted, such as audio frames, video end frames, or signaling. By filtering out the small data volume data to be transmitted, it is easier to subsequently perform targeted data merging, thereby improving the effective load rate of these small data volume target data.
[0117] Step 303: Merge and package the N target data in the target data to obtain the merged data packet.
[0118] Because the length of a single data packet that a transmission network can allow to be transmitted cannot exceed the corresponding maximum data packet length, and the data length of target data with a small amount of data is usually much smaller than the maximum data packet length, the effective load rate is low.
[0119] Therefore, for multiple target data, they can be merged and packaged into a single data packet to increase the payload length of that packet. At the same time, to ensure that the packaged data packet can be transmitted in the network, its length (or packet length) cannot exceed the maximum data packet length. In other words, within the maximum packet length limit, the payload length of the data packet should be maximized to ensure low latency while simultaneously improving the payload ratio, allowing direct transmission of individual data packets.
[0120] Specifically, for N target data points that meet the transmission timeliness requirements (N > 1), the maximum data packet length can be used as a limit to merge and package these N target data points into a merged data packet. The merged data packet is a data packet containing multiple target data points; it can also be understood as a data packet obtained by merging the target data corresponding to multiple data packets. The length of the merged data packet does not exceed the maximum data packet length corresponding to the transmission network; that is, the upper limit of the merged data packet length is the maximum data packet length, to ensure that the transmission network can directly transmit the merged data packet.
[0121] The following example illustrates the merging and packaging process. Taking a maximum data packet length of 1000 bits as an example, the four target data packets with smaller data sizes have lengths of 100 bits, 150 bits, 200 bits, and 300 bits respectively. Their sum of length is 750 bits, which does not exceed 1000 bits. This means that the length of the merged data packet will not exceed the maximum data packet length. Therefore, these four target data packets can be merged and packaged into a single merged data packet. The sending device only needs to send this single merged data packet to the receiving device.
[0122] To avoid frequent, separate transmission of small amounts of target data, which would result in low payload and transmission efficiency, this application uses the maximum data packet length as the upper limit for the data volume in a single data packet transmission to determine the size of the data volume in a single data packet transmission. In this way, the transmission network can support the simultaneous transmission of N target data packets using a single merged data packet, eliminating the need to separately package N small data packets and transmit them one by one, reducing the number of transmissions by N-1 and eliminating the need to transmit N-1 headers. Furthermore, the amount of target data in the merged data packet is significantly increased in a single transmission, resulting in a larger payload and a smaller header proportion, thus improving the payload ratio.
[0123] To ensure that the receiving device can correctly parse the merged data packet, a merge header is included in the merged data packet. The merge header is used to identify the storage location of the N target data in the merged data packet.
[0124] The merge header refers to the message header of a merged data packet. The merge header indicates the location of each target data within the merged data packet, specifically through the block length. The block length indicates the length of each payload, thus distinguishing different target data.
[0125] In one possible implementation, step 303, merging and packaging N target data in the target data to obtain a merged data packet, can specifically involve merging and packaging N target data that meet the sending timeliness requirements to obtain a merged data packet.
[0126] In other words, the merged and packaged N target data sets meet the transmission timeliness requirements, meaning this application can be applied to low-latency data transmission scenarios. The timeliness requirement refers to a certain time constraint on the data's transmission or arrival time; that is, the data must be delivered within a specified timeframe to ensure low latency. The N target data sets meeting the transmission timeliness requirements means that the delivery of these target data sets will meet the timeliness requirements, i.e., they are required to be delivered within a specified time, meaning the transmission of the N target data sets must meet low-latency requirements.
[0127] In short, because N target data points need to meet the timeliness requirements for transmission, i.e., low latency, related technologies are more likely to send these small amounts of N target data points independently, resulting in low data transmission efficiency. In other words, in low-latency scenarios, this application, by merging and packaging the small amounts of N target data points, can balance low transmission latency and high transmission efficiency, avoiding excessive waste of transmission resources in low-latency scenarios.
[0128] Step 304: Send the merged data packet to the receiving device.
[0129] Merged data packets are used to send data to the receiving device; that is, the sending device sends merged data packets to the receiving device through the transmission network.
[0130] Step 305: Obtain the merged data packet sent by the sending device.
[0131] The receiving device receives merged data packets from the sending device via the transmission network.
[0132] Step 306: Decapsulate the merged data packets to obtain N target data packets.
[0133] The receiving device decapsulates the merged data packets to obtain N target data items. Decapsulation refers to decoding the merged data packets to restore the N target data items. The receiving device can then perform rendering and playback based on these N target data items, ensuring the normal playback of video, audio, and other media.
[0134] In summary, this application combines multiple small-volume data packets into a single package, limiting the maximum data packet length of the transmission network, thereby maximizing the effective load rate of the combined data packets and improving data transmission efficiency in low-latency scenarios.
[0135] Next, combined Figure 4 This paper mainly explains the data merging and transmission method from the following aspects, specifically involving determining the maximum data packet length, judging the conditions for merging and packaging, encapsulating and sending merged data packets, and decapsulating merged data packets. Figure 4 This is an architectural diagram of a data merging and transmission system provided in an embodiment of this application. The data merging and transmission method can be applied to the data merging and transmission system, which may include a sending device, a receiving device, and a transmission network. The sending device may be, for example, a CDN streaming node in an ultra-low latency live streaming system, and the receiving device may be, for example, a terminal device used by a user. The sending device may include a dynamic MTU detection module, a merged data packet generation module, and an encapsulation and transmission module. The functions of each module are described in detail below.
[0136] I. Determine the maximum data packet length
[0137] To ensure the accuracy of determining the maximum data packet length, in one possible implementation, step 301, obtaining the maximum data packet length corresponding to the transmission network between the sending and receiving devices, may specifically include steps 3011-3015, as described in the reference. Figure 5 The diagram shown is a flowchart illustrating a method for determining the maximum data packet length provided in an embodiment of this application.
[0138] Step 3011: Send a first probe message based on the first network protocol to the receiving device.
[0139] The first network protocol can be any network protocol, such as the Internet Control Message Protocol (ICMP), or any other network protocol. A probe message is a message used to probe the maximum data packet length supported by the transmission network to determine that the maximum data packet length is. The first probe message is a probe message constructed based on the first network protocol. To determine the maximum data packet length, the sending device can send a first probe message to the receiving device.
[0140] Step 3012: Adjust the data length of the first probe message according to the first response result of the first probe message and resend the first probe message to determine the first maximum data packet undetermined length.
[0141] The response result refers to the receiving device's response to the probe message. Specifically, it can be that the receiving device returns a response message to the sending device, or it can be that the receiving device does not return a response message to the sending device. That is, whether the receiving device returns a response message or not, it can be considered a response result. Please refer to the following explanation for details.
[0142] The first response result refers to the response of the receiving device to the first probe message. It can show whether the receiving device has received the first probe message, that is, whether the transmission network has transmitted the first probe message normally. It further shows whether the data length of the first probe message exceeds the maximum data packet length, and whether and how the data length of the first probe message needs to be adjusted.
[0143] Therefore, the sending device can adjust the data length of the first probe message based on the first response result, and then resend the first probe message with the changed data length to gradually determine the first maximum data packet undetermined length. The first maximum data packet undetermined length refers to the maximum undetermined length of the data packet determined through the first probe message, and can be used to determine the final maximum data packet length. Furthermore, in the process of determining the first maximum data packet undetermined length, it may be necessary to adjust the data length of the first probe message one or more times, that is, adjustments need to be made based on the first response result.
[0144] Step 3013: Send a second probe message based on the second network protocol to the receiving device.
[0145] To avoid the inaccuracy of determining the maximum data packet length using a single method, which makes it difficult to reliably and accurately determine the usable maximum data packet length under various network scenarios, it is necessary to use a second network protocol as a basis and adopt another method to determine the maximum data packet length. The accurate maximum data packet length is obtained by combining the results of the two methods. In other words, the sending device can also send a second probe message to the receiving device.
[0146] The second network protocol refers to a network protocol different from the first network protocol, such as Real-Time Transport Protocol (RTP) or User Datagram Protocol (UDP), or a combination of these two protocols, or other network protocols. A second probe message refers to a probe message constructed based on the second network protocol.
[0147] Step 3014: Adjust the data length of the second probe message according to the second response result of the second probe message, and then resend the second probe message to determine the second maximum data packet undetermined length.
[0148] The second response result refers to the response of the receiving device to the second probe message. It can show whether the receiving device has received the second probe message, that is, whether the transmission network has transmitted the second probe message normally. It further shows whether the data length of the second probe message exceeds the maximum data packet length, and whether and how the data length of the second probe message needs to be adjusted.
[0149] Therefore, the sending device can adjust the data length of the second probe message based on the second response result, and then resend the second probe message with the changed data length in order to gradually determine the second maximum data packet undetermined length.
[0150] The second maximum pending data packet length refers to the maximum pending data packet length determined through the second probe message, and can be used to determine the final maximum data packet length. Furthermore, in determining the second maximum pending data packet length, it may be necessary to adjust the data length of the second probe message one or more times, that is, adjustments need to be made based on the second response result.
[0151] Step 3015: Determine the maximum data packet length using the first maximum data packet undetermined length and the second maximum data packet undetermined length.
[0152] The receiving device can determine the final maximum data packet length based on the first and second maximum data packet undetermined lengths. Furthermore, steps 3011-3012 and steps 3013-3014 can be executed simultaneously or sequentially; this application does not specify the execution steps between these two detection methods.
[0153] In summary, this application achieves complementarity and synergy between two determination methods by sending probe messages using two different network protocols to determine the maximum data packet length for the same transmission network. This further improves the accuracy of the maximum data packet length and avoids the possibility of inaccurate length determination when using only a single method.
[0154] 1.1 Determine the maximum packet length using ICMP and RTP / UDP protocols.
[0155] In one possible implementation, the first network protocol can be the Internet Control Message Protocol (ICMP). The first probe message carries an identifier prohibiting data fragmentation. In step 3012, the data length of the first probe message is adjusted according to the first response result of the first probe message, and then the first probe message is resent to determine the first maximum data packet undetermined length. Specifically, if the returned first response message is a fragmentation error message, the data length of the first probe message is adjusted and the first probe message is resent; if no first response message is returned, the data length of the first probe message sent this time is determined as the first maximum data packet undetermined length.
[0156] To prevent the transmission network or intermediate network nodes from fragmenting the first probe message, which would result in the detected first maximum data packet having a length that is the length of data that can be transmitted after fragmentation, rather than the length of data that can be transmitted without fragmentation, a Don't Fragment (DF) flag can be carried in the first probe message.
[0157] For example, if the maximum allowed data packet length of the transmission network is 1000 bits, and the data length of the first probe message is 1500 bits, and if the transmission network fragments the first probe message into two data packets with lengths of 1000 bits and 500 bits respectively during data transmission, and then transmits them, the sending device may mistakenly believe that 1500 bits is still below the maximum data packet length of the transmission network, when in fact it has exceeded the maximum data packet length, resulting in an inaccurate maximum data length.
[0158] Therefore, the sending device sends a first probe message carrying a flag prohibiting fragmentation, so the transmission network will not fragment the first probe message into multiple small data packets for transmission, thereby achieving accurate determination of the undetermined length of the first maximum data packet.
[0159] Specifically, the first response result refers to the first response message returned by the receiving device, which is the feedback message from the receiving device in response to the first probe packet. If the first response message returned by the receiving device is a fragmentation error message, which means that the packet needs to be fragmented but fragmentation failed, such as the "fragmentation required but DF is set" error message, this indicates that the data length of the first probe packet exceeds the maximum data packet length supported by the transmission network and needs to be fragmented for transmission. In this case, the data length of the first probe packet needs to be reduced, and then the first probe packet needs to be resent to obtain the first maximum data packet undetermined length based on whether a first response message is returned again.
[0160] If the receiving device does not return a first response message after the sending device sends the first probe message, it means that the data length of the first probe message sent this time does not exceed the maximum data packet length, while the data length of the first probe messages sent previously all exceeded the maximum data packet length. Therefore, the data length of the first probe message sent this time can be determined as the first maximum data packet undetermined length.
[0161] As an example, the sending device sends a first probe message with a data length of 2000 bits for the first time, and the receiving device returns a fragmentation error message. The sending device sends a first probe message with a data length of 1800 bits for the second time, and the receiving device still returns a fragmentation error message. The sending device continues to adjust the data length of the first probe message and send it again until the data length of the first probe message sent by the sending device is 1000 bits, and the receiving device does not return a fragmentation error message. This indicates that the receiving device has successfully received the unfragmented first probe message, and the first maximum data packet undetermined length is determined to be 1000 bits.
[0162] In summary, the sending device gradually adjusts the data length of the first probe message until no fragmentation error messages are received. This allows the determination of the maximum unfragmented data packet length supported by the transmission network, i.e., the first maximum undetermined data packet length, ensuring the accuracy of the probe. Furthermore, this ICMP probe method eliminates the need for additional application layer interaction at the sending device, enabling rapid acquisition of the transmission network's maximum capacity.
[0163] In other possible implementations, the first response result can also be that the receiving device does not return a successful reception message for the first probe message within a certain period of time. That is, if the receiving device does not return a successful reception message to the sending device, it means that the receiving device has not received the first probe message, the data length of the first probe message exceeds the maximum data packet length, and it is necessary to adjust the data length of the first probe message and resend the first probe message until the receiving device returns a successful reception message to the sending device, thereby determining the data length of this first probe message as the first maximum data packet undetermined length.
[0164] In one possible implementation, the second network protocol can be Real-time Transport Protocol (RTP) or User Datagram Protocol (UDP). The second probe message is obtained by copying the actual data packet to be forwarded. The second probe message carries a type identifier to identify the probe packet type. In step 3014, the data length of the second probe message is adjusted according to the second response result of the second probe message, and then the second probe message is retransmitted to determine the second maximum data packet undetermined length. Specifically, if the returned second response message indicates that the second probe message was not completely received, the data length of the second probe message is adjusted and the second probe message is retransmitted; if the returned second response message indicates that the second probe message was completely received, the data length of the second probe message sent this time is determined as the second maximum data packet undetermined length.
[0165] To avoid potential filtering or loss of ICMP messages and to improve probing accuracy, this application can also probe the maximum packet length again based on RTP / UDP. The second probe message can be obtained by copying the actual data packet to be forwarded. That is, a real data packet (e.g., an audio frame packet) can be used to construct the second probe message. Specifically, data can be padded to a specified length after the media data in the real data packet to obtain a second probe message with a certain data length. The second probe message can be, for example, an RTP probe packet. Furthermore, to ensure that the receiving device can distinguish between the second probe message and the actual data packet, a unique identifier, such as RTPPT, can be set for the second probe message.
[0166] To ensure that the media data in the actual data packets can be played correctly, the actual data packets are sent normally to ensure that the receiving device can decode and render them for proper playback. A second probe message, obtained by copying the actual data packets, is also sent to detect the maximum data packet length.
[0167] When determining the second maximum pending data packet length, the second response result specifically refers to the receiving device returning a second response message. The second response message is another type of response message sent by the receiving device to the sending device, indicating that the second probe packet was not completely received. For example, the second response message can be a response message sent via a receiver report (RTCPReceiver Report). The RTCPReceiver Report is a control message periodically sent by the receiving device to the sending device to indicate whether the second probe packet has been completely received. Another example of a second response message is a lost second probe packet, indicating that the data length of the second probe packet is too large to be transmitted over the network.
[0168] In other words, if the second response message returned by the receiving device to the sending device indicates that the second probe message was not completely received by the receiving device, it means that the data length of the second probe message is too large, exceeding the maximum data packet length of the transmission network. The data length of the second probe message needs to be adjusted, and the second probe message needs to be retransmitted. This process continues until the second response message returned by the receiving device to the sending device indicates that the second probe message has been completely received. At this point, the data length of the second probe message sent in this instance is determined as the second maximum data packet length.
[0169] As an example, the sending device first sends a second probe message with a data length of 2000 bits. The receiving device returns a second response message indicating that the second probe message was not completely received. The second probe message sent has a data length of 1800 bits, and the receiving device still reports that it was not completely received. The sending device continues to adjust the data length of the second probe message and sends it until the data length of the second probe message sent by the sending device is 900 bits. The receiving device reports that it has been completely received, indicating that the receiving device has successfully received the second probe message. Therefore, the second maximum data packet undetermined length is determined to be 900 bits.
[0170] In summary, by re-probing the maximum data length of the transmission network using RTP / UDP probing, and generating a second probe message from actual data packets, this method can reflect the actual data packet carrying capacity of the transmission network. Furthermore, it has higher adaptability to ICMP-restricted or complex network environments, ensuring the accuracy and stability of the probing results.
[0171] To further improve the accuracy of determining the maximum data packet length, in one possible implementation, step 3015, determining the maximum data packet length using the first maximum data packet undetermined length and the second maximum data packet undetermined length, can specifically involve determining the minimum value between the first maximum data packet undetermined length and the second maximum data packet undetermined length as the maximum data packet length.
[0172] In other words, the two maximum data packet lengths determined by the two detection methods can be compared, and the minimum value can be taken as the maximum data packet length of the transmission network. By taking the minimum value as the maximum data packet length, the accuracy of the maximum data packet length can be ensured. This avoids situations where the actual allowable maximum data packet length of the real-time changing transmission network is inconsistent with the detected maximum data packet length, thus preventing data transmission delays. This ensures that the maximum data packet length can provide a certain degree of backup for real-time changes in the transmission network.
[0173] Combination Figure 4The data merging and transmission system illustrated describes the process for determining the maximum data packet length. The dynamic MTU detection module can employ a first detection method, based on a first network protocol, to determine a first maximum data packet length to be determined, and a second detection method, based on a second network protocol, to determine a second maximum data packet length to be determined. During the detection process, the transmitting device can send a first detection message and a second detection message to the receiving device. The receiving device returns a response result, and based on the response result, the data packet length is continuously adjusted to obtain the maximum data packet length to be determined.
[0174] 1.2 Data length adjustment method for probe messages
[0175] In one possible implementation, the data length of the first probe message and the data length of the second probe message are adjusted as follows: when the target probe message is sent for the first time, the data length of the target probe message is set to a predetermined value, and the target probe message is either the first probe message or the second probe message; when the target probe message is sent for subsequent times, the data length of the target probe message is adjusted by increasing or decreasing the data length, and the adjustment method is related to the predetermined value.
[0176] In other words, the data length of both the first and second probe messages can be adjusted in this way. For ease of explanation, we will use the target probe message as an example to illustrate how to adjust the data message; the target probe message can be either the first or second probe message.
[0177] When the sending device first sends a target probe message to the receiving device to determine the maximum data packet length, the data length of the target probe message can be set to a predetermined value, i.e., a preset length, such as 2000 bits. The predetermined value serves as the starting point for continuously adjusting the data length.
[0178] When the transmitting device retransmits a target detection message to the receiving device, the data length of the target detection message can be adjusted by gradually increasing or decreasing the data length. The adjustment method refers to how the data length of the target detection message is adjusted. The adjustment method is related to a predetermined value, and the size of the predetermined value will affect the selection of the adjustment method.
[0179] As an example, the initial value (i.e., the predetermined value) of the data length of the target probe message is 2000 bits. It can be adjusted incrementally or incrementally from 2000 bits, and repeated attempts to transmit data through the transmission network are made until the maximum data packet length of the transmission network is determined.
[0180] In summary, by first setting an initial value for the data length of the first or second probe message, and then adjusting the data length incrementally or incrementally until the maximum data packet length of the transmission network is determined, the simplicity and logic of the adjustment method are ensured, thereby improving the efficiency and accuracy of determining the maximum data packet length.
[0181] To further improve the efficiency of determining the maximum data packet length, in one possible implementation, when the predetermined value is the theoretical maximum value of the transmission network, the associated adjustment method is a decreasing adjustment method; when the predetermined value is the theoretical minimum value of the transmission network, the associated adjustment method is an increasing adjustment method.
[0182] Since transmission networks typically have a theoretical data packet length, or theoretical value, this represents the data packet length that the transmission network can support, calculated theoretically. This theoretical value may be the maximum or minimum theoretical value. The maximum theoretical value refers to the maximum data packet length that the transmission network can theoretically support for transmission, while the minimum theoretical value refers to the minimum data packet length that the transmission network can theoretically support for transmission. However, in practical applications, the data packet length that a transmission network can support often differs from the theoretical maximum data packet length, thus requiring adjustments based on the theoretical value.
[0183] If the predetermined value is the theoretical maximum value of the transmission network, meaning the data packet length of the target probe message initially sent by the sending device to the receiving device is the theoretical maximum value, then in practical applications, the actual maximum allowed data packet length of the transmission network will be smaller than the theoretical maximum value and will not exceed it. Therefore, when sending target probe messages with different data packet lengths subsequently, the data packet length is adjusted by decreasing from the theoretical maximum value until the maximum data packet length of the transmission network in practical applications is determined.
[0184] If the predetermined value is the theoretical minimum of the transmission network, meaning the data packet length of the first target probe message sent by the sending device to the receiving device is the theoretical minimum, then in practical applications, the actual maximum allowable data packet length of the transmission network will usually be larger than the theoretical minimum, but not lower. Therefore, when sending target probe messages with different data packet lengths subsequently, the data packet length will be adjusted incrementally starting from the theoretical minimum until the maximum data packet length of the transmission network in practical applications is determined.
[0185] As an example, the initial target probe message sent by the sending device may have a data length of the theoretical maximum, such as 1500 bits. Subsequent messages can be gradually adjusted downwards from 1500 bits until the maximum data packet length supported by the transmission network is determined. Alternatively, the initial target probe message sent by the sending device may have a data length of the theoretical minimum, such as 300 bits. Subsequent messages can be gradually adjusted upwards from 300 bits until the maximum data packet length supported by the transmission network is determined.
[0186] In summary, when adjusting the data length of target detection messages, adjustments can be made incrementally based on the theoretical minimum value or incrementally based on the theoretical maximum value. This ensures that the maximum data packet length that the transmission network can actually support can be found more quickly and efficiently, thus improving the efficiency of determining the maximum data packet length.
[0187] In other possible implementations, adjustments can be made incrementally based on the theoretical maximum value, or by first decreasing and then increasing, to handle situations where the theoretical maximum value is miscalculated, resulting in the transmission network actually supporting a maximum data packet length greater than the theoretical maximum value. Similarly, adjustments can be made by decreasing based on the theoretical minimum value, or by first increasing and then decreasing, to handle situations where the theoretical minimum value is miscalculated, resulting in the transmission network actually supporting a maximum data packet length less than the theoretical minimum value.
[0188] To further improve the efficiency of determining the maximum data packet length, in one possible implementation, a predetermined value and associated adjustment method can also be determined based on network parameters of the transmission network, including at least one of the network type or network quality of the transmission network.
[0189] Network parameters refer to the parameters used to characterize the network conditions of the transmission network; they are essentially the configuration parameters of the transmission network. Network parameters can include network type or network quality. Network type refers to the type of transmission network, such as wireless or cellular network. Network quality refers to the quality of the transmission network, which may include transmission speed, latency, and packet loss rate. Both network type and network quality affect the data transmission capacity of the transmission network, i.e., they affect the maximum data packet length.
[0190] Because different network parameters can cause variations in the data packet carrying capacity of a transmission network, the sending device can determine predetermined values and associated adjustment methods based on these network parameters. Specifically, under certain network parameters, the maximum data packet length supported by the transmission network may be too low or too high. Therefore, to determine the maximum data packet length more quickly, the predetermined value for the data length of the initial target probe message can also be set accordingly, for example, by setting a smaller or larger value. Furthermore, since the predetermined value is affected by the network parameters, the adjustment methods associated with the predetermined value will also be affected.
[0191] As an example, some network parameters indicate that the transmission network has a weaker capacity to carry data packets, meaning the maximum data packet length is relatively small. Therefore, a small predetermined value can be set and gradually increased. Conversely, some network parameters indicate that the transmission network has a stronger capacity to carry data packets, meaning the maximum data packet length is relatively large. Therefore, a large predetermined value can be set and gradually decreased.
[0192] In summary, by estimating the maximum data packet length based on network type or network quality, and then selecting a predetermined value close to it and adjusting it according to an appropriate adjustment method, the accuracy of the predetermined value is improved, and the efficiency of determining the maximum data packet length is greatly improved.
[0193] 1.3 Cache and Update of Maximum Data Packet Length
[0194] To ensure the real-time performance of the maximum data packet length, one possible implementation could be to cache the maximum data packet length in a length buffer and update it according to update conditions; specifically, to retrieve the maximum data packet length corresponding to the transmission network between the sending and receiving devices by retrieving it from the length buffer.
[0195] The length buffer refers to a storage area used to cache data lengths. The length buffer can be a storage area allocated from the sending device. To facilitate subsequent retrieval of the maximum data packet length, the sending device can store the determined maximum data packet length in the length buffer. For example, the minimum value obtained through the two aforementioned probing methods can be stored in the length buffer.
[0196] In addition, the sending device can update the maximum data packet length according to update conditions to ensure the real-time performance and accuracy of the maximum data packet length stored in the length buffer. Update conditions refer to the conditions that must be met when the maximum data packet length in the length buffer is updated, such as reaching a certain time or a network anomaly. Update conditions can be set based on actual needs and are not limited here.
[0197] Furthermore, when the sending device obtains the maximum data packet length, it can directly obtain the up-to-date maximum data packet length from the length buffer. This maximum data packet length can be reused within a certain period of time and can be used to guide the generation of subsequent merged data packets.
[0198] In summary, by storing the maximum data packet length in a length buffer and updating it in a timely manner, this application not only facilitates the acquisition of the maximum data packet length without recalculation, but also ensures that the upper limit of the data packet length of the merged data packets always matches the real-time carrying capacity of the transmission network. This improves the real-time performance and accuracy of the maximum data packet length, and can meet the requirements of high effective load and low latency.
[0199] In one possible implementation, the update conditions may include at least one of the following: an abnormal network condition in the transmission network or the arrival of the update cycle.
[0200] Abnormal network conditions refer to unusual network situations in the transmission network. These abnormal conditions can cause changes in the maximum data packet length. Therefore, when abnormal network conditions occur, it indicates that the update conditions have been met, and the maximum data packet length can be updated, i.e., recalculated. Examples of abnormal network conditions include path switching, increased packet loss rate, or latency fluctuations in the transmission network.
[0201] The update cycle represents the time at which the maximum data packet length is updated, such as every hour or every 5 minutes. To avoid inaccurate maximum data packet lengths due to prolonged periods without updates, the maximum data packet length is considered to have met the update condition and is updated when the update cycle is reached. For example, the maximum data packet length of the transmission network can be recalculated every 5 minutes.
[0202] In summary, when an abnormal network condition is detected in the transmission network or the update cycle is reached, the maximum data packet length in the cache is updated to ensure that the maximum data packet length can match the network condition in real time. This also ensures the real-time performance of the maximum data packet length and avoids a decrease in the reliability of the maximum data packet length due to prolonged periods without updates.
[0203] As an example, combined Figure 4 The document explains the caching and updating of the maximum packet length. The dynamic MTU detection module can cache the detection results (i.e., the maximum packet length) and update them when the update conditions are met.
[0204] II. Conditions for Merging Packages
[0205] 2.1. Divide large data packets into smaller packets.
[0206] In one possible implementation, the following steps can also be performed: determining sendable data with a length reaching the maximum data packet length from the data to be sent; repackaging the sendable data into packets; and sending the repackaged data packets to the receiving device.
[0207] In this context, transmitable data refers to data whose length exceeds the maximum data packet length. Because the amount of transmitable data is large, exceeding the maximum data packet length supported by the transmission network, it is segmented and encapsulated into smaller data packets, which are then sent to the receiving device. Segmentation and encapsulation involves dividing the transmitable data into segments and independently encapsulating each segment to obtain multiple data packets.
[0208] In summary, for transmittable data exceeding the maximum data packet length, it can be segmented and encapsulated into multiple smaller data packets, which are then transmitted sequentially to the receiving device. This ensures both network transmission stability and meets end-to-end low latency requirements.
[0209] 2.2 Merging and packaging small data packets
[0210] To improve the accuracy of merging and packaging small data packets, in one possible implementation, the sending device is equipped with a merging buffer. The cached data in the merging buffer is the target data waiting to be merged and packaged. For the first data in the target data, in step 303, the maximum data packet length is used as the upper limit of the data packet length of the merged data packet, and N target data in the target data are merged and packaged to obtain the merged data packet. This can specifically include steps 3031-3033 (not shown in the figure).
[0211] Step 3031: When processing the first data, if there is cached data in the merge cache, determine the total data length of the first data and the cached data.
[0212] The transmitting device includes a merging buffer, which is a storage area for caching target data. Since the target data is a small amount of data to be transmitted, the target data located in the merging buffer will be merged and packaged later. For ease of description, the data in the merging buffer is referred to as cached data, which is the target data waiting to be merged and packaged.
[0213] The first data refers to any single target data. Taking the first data as an example, the merging and packaging process will be explained. When the sending device processes the first data, if the merging buffer contains cached data, that is, other target data waiting to be merged and packaged, then, in order to determine whether the first data should be merged and packaged together with them, the total data length of the first data and the cached data can be determined first.
[0214] Step 3032: In response to the total data length not reaching the maximum data packet length, the first data is stored in the merge buffer as cached data.
[0215] Next, it is determined whether the total data length exceeds the maximum data packet length corresponding to the transmission network. If the total data length does not exceed the maximum data packet length, it means that the first data can be merged and packaged with the cached data in the merging buffer without exceeding the upper limit of the data packet length. Therefore, the first data can be stored in the merging buffer and also treated as cached data that can be merged and packaged. Subsequently, the first data and other cached data that were originally in the merging buffer can be merged and packaged together. Of course, it is also possible to wait for the cached data added after the first data to be merged and packaged, but this must be considered within the limit of the maximum data packet length.
[0216] Step 3033: In response to the total data length reaching the maximum data packet length, merge and package the cached data to obtain a merged data packet, and store the first data in the merged cache area as cached data.
[0217] If the total data length exceeds the maximum data packet length, it means that forcibly merging the first data and the cached data in the merge buffer would cause the merged data packet to exceed the maximum data packet length, preventing the transmission network from directly transmitting the merged data packet. Therefore, the cached data in the merge buffer can be merged to obtain a merged data packet. At this time, the cached data in the merge buffer will be cleared, and then the first data will be stored in the merge buffer as new cached data. The first data can wait for other target data to be stored so that it can be merged with them.
[0218] In short, when merging and packaging N target data, if the total length of the first data and the cached data in the merge buffer does not exceed the maximum data packet length, the first data and the cached data can be merged and packaged as N target data. If the maximum data packet length is exceeded, the cached data can be merged and packaged as N target data, and the first data is not involved in this merge and packaging.
[0219] In summary, by setting up a merge buffer in the sending device, the total data length of the first data not added to the merge buffer is calculated together with the existing cached data in the merge buffer to determine whether they can be merged and packaged. This ensures the clarity of the merge and packaging decision logic and improves merging efficiency. Furthermore, the merge buffer can cache the target data to be merged and packaged, preventing the target data from becoming mixed with other data.
[0220] In one possible implementation, it can also be performed that, when processing the first data, if there is no cached data in the merge cache, the first data is stored in the merge cache as cached data.
[0221] In other words, if the sending device processes the first data and there is no cached data stored in the merge buffer at that time, i.e., the merge buffer is empty, the first data can be directly stored in the merge buffer and used as cached data, waiting to be merged and packaged with other cached data stored later.
[0222] In summary, by directly storing the first piece of data into an empty merge cache, the first piece of data can wait in the merge cache for other cached data to be stored. This avoids resource waste when the merge cache is empty and also provides independent data storage space for merging and packaging.
[0223] Combination Figure 6 As shown, the overall process of merging and packaging small data packets is explained.
[0224] refer to Figure 6 The diagram shown is a schematic representation of a process for merging and packaging according to an embodiment of this application.
[0225] When the sending device processes the first data in the target data (step 601), it can determine whether there is already cached data in the merging buffer (step 602). If so, it can further determine whether the total data length of the first data and the cached data reaches the maximum data packet length (step 603). If the maximum data packet length is reached, the cached data can be merged and packaged, and then stored in the first data (step 604). If the maximum data packet length is not reached, the first data can be stored in the merging buffer as cached data (step 605). If there is no cached data in the merging buffer, the first data can be directly stored in the merging buffer as cached data (step 605).
[0226] To avoid excessively long waiting times for cached data in the merging buffer, which could delay subsequent playback, one possible implementation could include second and third data in the cached data. Furthermore, if the waiting time for the second data in the merging buffer reaches a first timeliness threshold, the cached data can be merged and packaged to obtain a merged data packet. If the second data is the first target data added to the merging buffer and the third data is the last target data added to the merging buffer, and the difference in usage timestamps between the second and third data reaches a second timeliness threshold, the cached data can be merged and packaged to obtain a merged data packet.
[0227] In one scenario, the second data can be any cached data in the merge cache. If the waiting time of the second data in the merge cache reaches the first timeliness threshold, it means that the second data has been waiting for merging and packaging for a long time and needs to be merged and packaged as soon as possible. Therefore, the cached data in the merge cache can be merged and packaged to obtain the merged data packet.
[0228] The waiting time refers to the duration for which cached data resides in the merge cache, specifically the time it waits to be merged and packaged. The first timeliness threshold is the maximum waiting time for merging and packaging, for example, 10ms. If the waiting time for the second data exceeds the first timeliness threshold, it means that the second data needs to be merged and packaged immediately, and the second data does not need to continue waiting, in order to avoid excessively long waiting times that would prevent low-latency transmission.
[0229] In another scenario, the second data can be the target data added first to the merge buffer, and the third data can be the target data added last. If the usage timestamps of the second and third data differ significantly, reaching the second timeliness threshold, it indicates that there are significant differences in usage timestamps among the cached data awaiting merging. Failure to merge and package this data promptly will affect the normal playback of the receiving device. Based on this, the cached data in the merge buffer can be merged and packaged to obtain a merged data packet.
[0230] The second timeliness threshold refers to the maximum difference in the timestamps of two cached data. If the difference in the timestamps of two cached data exceeds the second timeliness threshold, it means that they need to be merged and packaged as soon as possible. If they do not exceed the second timeliness threshold, it means that we can continue to wait for the addition of other cached data, and the merging and packaging can be postponed.
[0231] In summary, if the waiting time of cached data in the merge buffer exceeds the specified maximum waiting time, or if the timestamp difference between the latest and oldest cached data in the merge buffer exceeds the threshold, the cached data in the merge buffer can be merged and packaged immediately. This avoids late merging and packaging, which would affect low-latency transmission and prevent the receiving device from being able to quickly decapsulate the data, thus missing the playback time of the target data and avoiding problems such as audio and video desynchronization or stuttering.
[0232] In one possible implementation, when the total length of the cached data reaches the sending threshold, the cached data is merged and packaged to obtain a merged data packet, and the sending threshold is less than the maximum data packet length.
[0233] The sending threshold refers to a smaller data packet length set based on the maximum data packet length. In other words, the sending threshold is smaller than the maximum data packet length; for example, if the maximum data packet length is 1000 bits, the sending threshold is 900 bits. If the total length of all buffered data in the merge buffer is greater than or equal to the sending threshold, the buffered data can be merged and packaged to obtain a merged data packet.
[0234] In short, although the total length of the cached data has not yet reached the maximum data packet length, since the maximum data packet length and the sending threshold are relatively close, the possibility of adding new cached data to the merged cache area is even smaller. Therefore, there is no need to waste time waiting, and the existing cached data can be directly merged and packaged.
[0235] In summary, when the total length of the cached data in the merge buffer is close to the maximum data packet length, the cached data can be directly merged and packaged without waiting to confirm whether the total data length exceeds the maximum data packet length. This improves the merging timeliness and efficiency, and ensures low-latency transmission.
[0236] As an example, combined Figure 4 The process of merging and packaging target data is described below. The merged data packet generation module first identifies the target data, determining whether the data to be sent is a small amount of data that needs to be merged and packaged, or a large amount of data that does not need to be merged and packaged. Next, it determines whether the merging conditions are met, specifically checking whether there is already cached data in the merge buffer, whether the total length of the first data and the cached data exceeds the maximum data packet length, whether the waiting time for a single cached data is too long, and whether the difference in usage timestamps between the latest and oldest cached data is too large. Then, the N target data can be arranged in order of usage timestamps to achieve payload splicing and generate the corresponding number of merged packet headers.
[0237] 2.3. Packet header structure for merging data packets
[0238] In one possible implementation, N target data are arranged in the merged data packet according to the order of their timestamps. The number of merge headers is N-1. For the i-th merge header, the i-th merge header is used to identify the i-th target data and the (i+1)-th target data in the merged data packet. The N-1 merge headers are arranged in the order of the identified target data to form a merge header sequence, 1≤i≤N-1. The i-th merge header includes a flag field, an offset field, and a data range field. The flag field is used to indicate whether there is a merge header after the i-th merge header in the merge header sequence. The offset field is used to indicate the offset of the timestamp of the (i+1)-th target data relative to the timestamp of the i-th target data. The data range field is used to indicate the data length of the (i+1)-th target data.
[0239] Specifically, the merged data packet has a merge header used to identify the storage location of N target data in the merged data packet. The number of merge headers is N-1. Taking the i-th merge header as an example, the merge header will be explained in detail.
[0240] The i-th merge header identifies the i-th and (i+1)-th target data points. In other words, a single merge header contains both its corresponding target data and the next target data point. Since the N target data points are sorted according to their timestamps (e.g., from largest to smallest or smallest to largest), the N-1 merge headers are also correspondingly sorted, arranged according to the order of the identified target data to form the merge header sequence.
[0241] A merge header sequence refers to the sequence of N-1 merge headers arranged according to the order of their corresponding target data. For example, if N target data are sorted by their usage timestamps in ascending order, then in the N-1 merge headers, the usage timestamps of the target data identified from the first merge header to the (N-1)th merge header will gradually increase. The usage timestamp refers to the time when the target data is processed; that is, the point in time when the media decoder should process the target data during video or audio decoding. The usage timestamp ensures that the N target data are decoded in the correct order. For example, the usage timestamp could be the Decoding Time Stamp (DTS).
[0242] The i-th merge header may include a flag field, an offset field, and a data range field. The flag field indicates whether there are any more merge headers following this one, i.e., whether this is the last merge header. As an example, the flag field can be an F flag bit, which can occupy 1 bit. When F is 1, it indicates that there are still merge headers to follow; when F is 0, it indicates that this is the last merge header.
[0243] The offset field represents the timestamp offset, indicating the offset of the (i+1)th target data relative to the ith target data, thus describing the temporal relationship between adjacent target data. When i is 1, the offset field in the first merge header reflects the offset of the second target data relative to the first target data. When i is N-1, the offset field in the (N-1)th merge header reflects the offset of the Nth target data relative to the (N-1)th target data. As an example, the offset field can be represented using the display timestamp offset (Dts offset), occupying 5 bits with a value range of 0-3. Of course, the number of bits can be set according to the actual situation.
[0244] The data range field indicates the length of the target data, specifically the (i+1)th target data, allowing the receiving device to distinguish between different target data and perform decoding. When i is 1, the data range field in the first merge header indicates the length of the second target data. When i is N-1, the data range field in the (N-1)th merge header indicates the length of the Nth target data. Additionally, the length of the first target data can be indicated in other header sections, such as extension headers. For example, the data range field can be represented using the block length, occupying 10 bits and ranging from 0 to 1023, thus representing a maximum data length of 1023.
[0245] In short, during the merging and packaging process, a corresponding number of merge headers can be generated according to the usage timestamps of each target data, and the merge headers are written sequentially into the header area of the merged data packet. Subsequently, the corresponding target data is written in sequence, thus realizing the splicing of the payload and the generation of the merge header, thereby achieving efficient merging and low-latency transmission of small amounts of target data.
[0246] As an example, see reference Figure 7A The diagram shown is a schematic of a single merged header provided in an embodiment of this application. From left to right, it includes a flag field, an offset field, and a data range field. The first number at the top represents the flag field, and the following numbers represent the offset field and the data range field, respectively.
[0247] Another example, see reference Figure 7B The diagram shown is a schematic of a merged data packet provided in an embodiment of this application. The merged data packet includes at least N-1 merged packet headers and N target data located after the merged packet headers. Each merged packet header includes a flag bit, an offset field, and a data range field.
[0248] In summary, by setting appropriate merge headers for merged data packets, each merge header can reflect the offset of the timestamps of adjacent target data and the length of the target data. This allows the receiving device to correctly decapsulate and repackage the merged data packets based on the merge headers without changing the existing RTP transmission framework, ensuring that the receiving device can render and play the target data normally.
[0249] To further improve the accuracy of the maximum data packet length, in one possible implementation, step 301, obtaining the maximum data packet length corresponding to the transmission network between the sending device and the receiving device, can specifically involve obtaining the maximum candidate length of the maximum data packet that the transmission network between the sending device and the receiving device can carry; if the maximum candidate length of the maximum data packet is less than or equal to the maximum data length that can be identified by the data range field, the maximum candidate length of the maximum data packet is taken as the maximum data packet length; if the maximum candidate length of the maximum data packet is greater than the maximum data length that can be identified by the data range field, the maximum data length is taken as the maximum data packet length.
[0250] The maximum candidate packet length refers to the maximum packet length that the transmission network can carry. This is primarily determined by the network conditions and is unrelated to the merge header. Since a merge header is generated during the merging process, the data range field in the merge header indicates the data length of each target data item. Typically, the data range field also has a corresponding value range to avoid it occupying too many digits, resulting in an excessively large merge header. In other words, the data range field limits the length of the identified data.
[0251] As an example, the data range field has 10 bits, and the corresponding data length range is 0-1023. That is, the data range field can only express a data length of up to 1023 bits. If the data length exceeds 1023 bits, it cannot be represented using the data range field.
[0252] To avoid situations where the maximum candidate length of the transmission network is too large, exceeding the maximum data length that the data range field can represent, thus preventing the generation of a merged header and the merging and packaging process, the following measures are taken: If the maximum candidate length of the transmission network is greater than the maximum data length that the data range field can represent, then the maximum data length is determined as the maximum data packet length of the transmission network. If the maximum candidate length of the transmission network is not greater than the maximum data length, then the maximum candidate length of the transmission network can be determined as the maximum data packet length.
[0253] As an example, the maximum candidate length of a data packet that the transmission network can carry is 1500 bits, and the maximum data length that the data range field can represent is 1023 bits. In this case, 1023 bits can be determined as the maximum data packet length, and 1023 bits can be used as the upper limit of the length for merging and packaging.
[0254] In another example, if the maximum candidate length of a data packet that the transmission network can carry is 1000 bits, and the maximum data length that the data range field can represent is 1023 bits, then 1000 bits can be determined as the maximum data packet length, and 1000 bits can be used as the upper limit for merging and packaging.
[0255] In summary, by comparing the maximum candidate packet length carried by the transmission network with the maximum data length represented by the data range field in the merge header, and taking the minimum of the two as the maximum packet length, we can ensure that the maximum packet length reflects the maximum carrying capacity of the transmission network as accurately as possible, and also guarantee that the data range field in the merge header can correctly represent the data length. This avoids situations where the transmission network can support the transmission of merged packets with the maximum packet length, but the receiving device cannot correctly decapsulate the packets due to the inability to generate a merge header.
[0256] III. Encapsulation and Transmission of Merged Data Packets
[0257] To ensure the integrity and accuracy of the header portion of the merged data packet, in one possible implementation, it is also possible to select a representative data from N target data; use the corresponding data packet header of the representative data as the extended header of the merged data packet and encapsulate it into the merged data packet; the extended header encapsulated into the merged data packet includes a type identifier for identifying the merged data packet.
[0258] Here, the representative data refers to any one of the N target data sets, used as a representative of the N target data sets. For example, the representative data could be the target data with the largest timestamp among the N target data sets, or it could be the target data with the smallest timestamp. This ensures that the merged data packets are consistent with the original media data stream in terms of temporal semantics, avoiding ambiguity during the time rearrangement and decoding stages of the receiving device.
[0259] The transmitting device can use the header of the data packet corresponding to the representative data packet as the extension header of the merged data packet, and encapsulate it within the merged data packet. This extension header may include a type identifier for the merged data packet, which identifies the data type of the target data in the merged data packet. For example, the type identifier could be a Synchronization Source (SSRC). Furthermore, the extension header, inherited from the header of the data packet representing the representative data packet, may also include continuously incrementing sequence numbers, media-related extension fields such as timestamps, and encoding parameters.
[0260] In addition, the merged data packet mainly includes the following parts: an extended header, a merge header sequence, and N target data items concatenated in sequence. The merge header sequence is used to identify the data length and timestamp offset of each target data item in the merged data packet. The N target data items are arranged sequentially according to the timestamp order. In this way, when the receiving device parses the merged data packet, it can accurately locate the storage location of each target data item and determine the corresponding playback time based on the information recorded in the merge header sequence.
[0261] Furthermore, to enable the receiving device to distinguish between merged and unmerged ordinary data packets, the sending device can assign a unique identifier to the merged data packet, such as the RTP Payload Type (RT). The PT value can be a pre-agreed value used to identify that the RTP data packet uses the merged transmission protocol, for example: a=rtpmap:127MERGE-Data Merged Transmission C / 48000 / 2. When the receiving device parses the RTP data packet with the corresponding PT, it can decapsulate the merged data packet according to the parsing rules of the merged protocol.
[0262] In summary, by inheriting the header of the target data packet as the extended header of the merged data packet, it is possible to ensure that the extended header matches the target data, avoid decapsulation failure due to errors in the extended header, and ensure that the merged data packet accurately represents the target data.
[0263] In one possible implementation, the N target data sets have the same data type. Specifically, the N target data sets can all be audio data or all be video data, thus ensuring that the target data being merged and packaged have the same media type (i.e., data type), improving the efficiency and standardization of the merging and packaging process.
[0264] As an example, combined Figure 4This section describes the encapsulation and transmission of merged data packets. The encapsulation and transmission module can reuse the header of the target data packet to obtain the extended header of the merged data packet. It can also encapsulate the data packets to obtain the merged data packet, which the transmitting device then sends to the receiving device.
[0265] As an example, see reference Figure 8 The diagram illustrates another type of merged data packet provided in this application embodiment. Taking an RTP data packet as an example, the packet header includes an RTP header (lines 1 to 9), an extended header (lines 10 to 20), a merged header (lines 21 to 24), and a payload, i.e., the target data (line 25 onwards). Both the RTP header and the extended header can be considered to be inherited from the target data. Specifically, four merged headers are shown, each containing a flag field (value 0 or 1), an offset field (dts off), and a data range field (blocklength1-3).
[0266] IV. Decapsulation of merged data packets
[0267] After receiving the merged data packet, the receiving device can decapsulate the merged data packet to obtain N target data. To ensure the rapid determination of the usage timestamp of each target data, in one possible implementation, the usage timestamp corresponding to each of the N target data can be calculated using the encoding parameters of the receiving device; or, the usage timestamp corresponding to each of the N target data can be calculated using the offset carried in the merged data packet.
[0268] Because in the merged data packet, the N target data that were originally scattered in multiple data packets are packaged into the same data packet, the receiving device cannot directly obtain the usage timestamp of each target data and cannot quickly determine the playback time of each target data. Therefore, in order to ensure the continuity of audio and video rendering and playback, it is necessary to quickly and accurately determine the usage timestamp of each target data.
[0269] In one scenario, some receiving devices require the recovery of N ordinary data packets for processing, necessitating the determination of the usage timestamps for each target data. In this case, the timestamp offset of the target data is directly related to the encoding parameters (e.g., the sampling rate of the target data). Therefore, the receiving device can calculate the usage timestamps for each target data based on the encoding parameters. For example, the encoding parameters may include the encoding sampling rate and the number of sampling points per frame; based on these, the usage timestamps for each target data can be calculated. Here, the encoding parameters refer to the encoding parameters used when packaging the target data.
[0270] In another approach, since the merged data packets contain timestamp offsets, the usage timestamps of each target data can be calculated based on the timestamp offsets (e.g., offset fields) and the usage timestamp of the first target data. This ensures that, even when the data is sent in a merged manner, each target data can still be rendered and played in its original order and at the same time intervals.
[0271] In summary, the receiving device can use the above two methods to determine the usage timestamp of each target data. Without changing the decoding process of the receiving device, it can achieve fast and accurate decapsulation of merged data packets. It can be applied to audio and video packet scenarios, improving the transmission efficiency of audio and video data.
[0272] Next, the data merging and transmission method provided in this application will be described in general. This method can be applied to a data merging and transmission system, which includes a transmitting device, a receiving device, and a transmission network between the two.
[0273] In practical applications, the sending device can be deployed as a CDN streaming node or a transmission control module on the edge server side of a live streaming system, while the receiving device is, for example, the terminal device used by the user. Furthermore, this method works in conjunction with existing audio and video encoding, RTP encapsulation, and transmission processes, without relying on specific encoding formats or service types, and does not require the receiving device to modify its protocol stack or player logic, thus enabling it to take effect directly within the existing Web RTC / RTP transmission architecture.
[0274] To improve the effective load rate of target data with small data volumes, the transmitting device can identify target data whose length does not reach the maximum data packet length corresponding to the transmission network from the data to be transmitted. Then, using the maximum data packet length as the upper limit of the data packet length for merging, the N target data that meet the transmission timeliness requirements are merged and packaged to obtain a merged data packet. The transmitting device sends the merged data packet to the receiving device, and the receiving device decapsulates the merged data packet to obtain the N target data, enabling normal playback of the target data.
[0275] In this way, the transmission network can support the simultaneous transmission of N target data using a single merged data packet, reducing the number of transmissions by N-1 and eliminating the need for N-1 additional header transmissions. This effectively reduces redundant transmission of RTP and UDP / IP headers while ensuring playback latency and stability. Furthermore, the amount of target data in the merged data packet increases significantly in a single transmission, resulting in a larger effective payload and a smaller header proportion. This reduces the transmission bitrate cost per unit of media data, thereby improving the effective payload ratio and enhancing the overall transmission efficiency and network resource utilization of the ultra-low latency live streaming system.
[0276] The process for determining the maximum data packet length is explained. Specifically, the maximum data packet length can be determined through two probing methods.
[0277] The first detection method involves the sending device sending a first probe message based on a first network protocol (e.g., ICMP) to the receiving device. This first probe message carries an identifier prohibiting data fragmentation. If the returned first response message is a fragmentation error message, the data length of the first probe message can be adjusted and retransmitted. If no first response message is returned, the data length of the previously sent first probe message can be determined as the first maximum data packet candidate length.
[0278] The second probing method involves the sending device sending a second probe message based on a second network protocol (e.g., UDP / RTP) to the receiving device. This second probe message is obtained by copying the actual data packet to be forwarded. If the returned second response message indicates that the second probe message was not completely received, the data length of the second probe message can be adjusted and retransmitted. If the returned second response message indicates that the second probe message was completely received, the data length of the second probe message sent this time can be determined as the second maximum data packet undetermined length.
[0279] The minimum of the maximum undetermined packet lengths obtained from these two probing methods is taken as the maximum packet length of the transmission network. The maximum packet length can be stored in the length buffer of the sending device and can be updated when the transmission network experiences an anomaly or reaches its update cycle. Furthermore, the data length of the first or second probe message sent for the first time can be set to a predetermined value. Subsequent transmissions can adjust this predetermined value incrementally or decrementally. If the predetermined value is the theoretical maximum value of the transmission network, a decremental adjustment is made; if the predetermined value is the theoretical minimum value, an incremental adjustment is made. The predetermined value and adjustment method can be determined based on the network type and network quality of the transmission network.
[0280] The following explains the logic for determining the merging and packaging of target data stored in the merge buffer. The sending device has a merge buffer, and the cached data in the merge buffer is the target data waiting to be merged and packaged.
[0281] When processing the first piece of data, if the merge buffer is empty, the first piece of data can be directly added to the merge buffer, awaiting the storage of other cached data for merging and packaging. If the merge buffer is not empty, the total data length of the first piece of data and the cached data in the merge buffer can be calculated. If the total data length exceeds the maximum data packet length, the cached data can be merged and packaged before being stored as the first piece of data. If the total data length does not exceed the maximum data packet length, the first piece of data can be stored in the merge buffer and merged and packaged.
[0282] To ensure timely merging and packaging, and to avoid delaying the normal playback of audio and video by the receiving device, if the waiting time of the second data in the merging buffer is too long, or the difference in the usage timestamps of the latest and oldest cached data is too large, or the total length of the cached data exceeds the sending threshold, then merging and packaging can be performed immediately to obtain a merged data packet.
[0283] The merge header of the merged data packets is described. There are N-1 merge headers. The i-th merge header identifies the i-th and (i+1)-th target data. The merge headers are arranged in the order of the usage timestamps of the identified target data, resulting in a merge header sequence. A single merge header may include a flag field indicating whether there are subsequent merge headers, an offset field indicating the usage timestamp offset of adjacent target data, and a data range field indicating the length of a single target data. Furthermore, the maximum data packet length of the transmission network can be determined by taking the minimum value between the maximum data length indicated by the data range field and the maximum candidate data packet length that the transmission network can carry. Additionally, the extended header of the merged data packet can inherit from the header of the target data.
[0284] In this way, without changing the existing transmission architecture (such as the UDP / RTP transmission framework), this application can inherit the data packet header of the target data (such as the original RTP header and extension header information) to complete the encapsulation of the merged data packet, so that the merged data packet remains compatible at the protocol level and can be normally recognized and forwarded by the existing ultra-low latency live broadcast transmission link.
[0285] The receiving device can decapsulate the merged data packets, calculate the usage timestamps corresponding to each target data, and restore the multiple target data before merging, thereby ensuring the correct parsing and synchronized playback of audio and video data.
[0286] In summary, this application can have the following beneficial effects:
[0287] 1) Significantly improves packet payload rate
[0288] By obtaining the maximum data packet length of the transmission network and using it as an upper limit to adaptively adjust the size of the merged data packets, the merged data packets can carry more effective payload, reduce the proportion of protocol headers, and improve network transmission efficiency.
[0289] 2) Reduce end-to-end transmission bit rate cost
[0290] This reduces the amount of repetitive RTP / UDP / IP header transmission, lowering the bitrate consumption per unit of media data. Network bandwidth utilization is improved, especially in scenarios where audio, video end frames, and small video segments are frequently transmitted.
[0291] 3) Ensure low latency and playback stability
[0292] By setting a merge timestamp offset threshold and a timeout mechanism, it is ensured that small amounts of target data will not experience excessive latency due to waiting for merging. The client can accurately reconstruct the playback time of each target data based on the usage timestamp and offset in the merge packet header, ensuring audio and video synchronization and continuous rendering.
[0293] 4) Compatible with existing RTP / UDP transport frameworks
[0294] Merging data packets (e.g., RTP packet merging) reuses the packet headers of the target data without requiring modifications to existing players or transmission links. It can be smoothly deployed within existing ultra-low latency live streaming systems, achieving seamless optimization.
[0295] 5) Dynamically adapt to network changes
[0296] If the transmission network experiences network path switching, increased packet loss rate, or latency fluctuations, the dynamic detection mechanism will update the maximum data packet length to ensure that the merging strategy always matches the network's carrying capacity.
[0297] refer to Figure 9 The diagram shown is a schematic of a transmitting device provided in an embodiment of this application. The transmitting device 900 includes:
[0298] The first acquisition unit 901 is used to acquire the maximum data packet length corresponding to the transmission network between the sending device and the receiving device;
[0299] The first determining unit 902 is used to determine, from the data to be sent to the receiving device, target data whose data length does not reach the maximum data packet length;
[0300] The merging unit 903 is used to merge and package N target data in the target data to obtain a merged data packet. The upper limit of the data packet length of the merged data packet is the maximum data packet length. The merged data packet includes a merge header, which is used to identify the storage location of the N target data in the merged data packet. The merged data packet is used to send to the receiving device, where N>1.
[0301] In one possible implementation, the merging unit 903 is used for:
[0302] The N target data that meet the timeliness requirements are merged and packaged to obtain a merged data packet.
[0303] In one possible implementation, the N target data are arranged in the merged data packet in the order of using timestamps, and the number of merge headers is N-1. For the i-th merge header, the i-th merge header is used to identify the i-th target data and the (i+1)-th target data in the merged data packet. The N-1 merge headers are arranged into a merge header sequence based on the order of the identified target data, where 1≤i≤N-1.
[0304] The i-th merge header includes a flag field, an offset field, and a data range field. The flag field is used to identify whether there is a merge header after the i-th merge header in the merge header sequence. The offset field is used to identify the offset of the usage timestamp of the (i+1)-th target data relative to the usage timestamp of the i-th target data. The data range field is used to identify the data length of the (i+1)-th target data.
[0305] In one possible implementation, the sending device is provided with a merging buffer, the cached data in the merging buffer being the target data awaiting merging and packaging, and the merging unit 903 is used for: For the first data in the target data,
[0306] When processing the first data, if the cached data is present in the merged cache area, the total data length of the first data and the cached data is determined;
[0307] In response to the total data length not reaching the maximum data packet length, the first data is stored in the merged buffer as the cached data;
[0308] In response to the total data length reaching the maximum data packet length, the cached data is merged and packaged to obtain a merged data packet, and the first data is stored in the merged cache area as the cached data.
[0309] In one possible implementation, the transmitting device further includes:
[0310] The first storage unit is used to store the first data into the merged cache as the cached data when processing the first data if the cached data is not in the merged cache.
[0311] In one possible implementation, the cached data includes second data and third data, and the sending device further includes:
[0312] The first packaging unit is used to merge and package the cached data to obtain a merged data packet when the waiting time of the second data in the merged cache area reaches a first timeliness threshold.
[0313] The second packaging unit is used to merge and package the cached data to obtain a merged data packet when the second data is the target data that was first added to the merged cache area in the cached data and the third data is the target data that was last added to the merged cache area in the cached data.
[0314] In one possible implementation, the transmitting device further includes:
[0315] The third packaging unit is used to merge and package the cached data to obtain a merged data packet when the total length of the cached data reaches the sending threshold, wherein the sending threshold is less than the maximum data packet length.
[0316] In one possible implementation, the first acquisition unit 901 is used for:
[0317] Obtain the maximum candidate data packet length that the transmission network between the sending device and the receiving device can carry;
[0318] If the maximum data packet candidate length is less than or equal to the maximum data length that the data range field can identify, the maximum data packet candidate length shall be used as the maximum data packet length;
[0319] If the maximum candidate data packet length is greater than the maximum data length that can be identified by the data range field, the maximum data length shall be used as the maximum data packet length.
[0320] In one possible implementation, the first acquisition unit 901 is used for:
[0321] Send a first probe message based on a first network protocol to the receiving device;
[0322] After adjusting the data length of the first probe message based on the first response result of the first probe message, the first probe message is retransmitted to determine the first maximum data packet undetermined length.
[0323] Send a second probe message based on a second network protocol to the receiving device;
[0324] After adjusting the data length of the second probe message based on the second response result of the second probe message, the second probe message is retransmitted to determine the second maximum data packet undetermined length.
[0325] The maximum data packet length is determined by the first maximum data packet undetermined length and the second maximum data packet undetermined length.
[0326] In one possible implementation, the first acquisition unit 901 is used for:
[0327] The minimum value between the first maximum data packet undetermined length and the second maximum data packet undetermined length is determined as the maximum data packet length.
[0328] In one possible implementation, the transmitting device further includes a setting unit for:
[0329] When sending a target detection message for the first time, the data length of the target detection message is set to a predetermined value, and the target detection message is either the first detection message or the second detection message;
[0330] When sending the target detection message for the first time, the data length of the target detection message is adjusted by increasing or decreasing the length, and the adjustment method is associated with the predetermined value.
[0331] In one possible implementation, when the predetermined value is the theoretical maximum value of the transmission network, the associated adjustment method is a decreasing adjustment method; when the predetermined value is the theoretical minimum value of the transmission network, the associated adjustment method is an increasing adjustment method.
[0332] In one possible implementation, the transmitting device further includes:
[0333] The second determining unit is configured to determine the predetermined value and the associated adjustment method based on the network parameters of the transmission network, wherein the network parameters include at least one of the network type or network quality of the transmission network.
[0334] In one possible implementation, the first network protocol is the Internet Control Message Protocol (ICP-35), the first probe message carries an identifier prohibiting data fragmentation, and the first acquisition unit 901 is used for:
[0335] If the first response message returned is a fragmentation error message, adjust the data length of the first probe message and resend the first probe message;
[0336] If the first response message is not returned, the data length of the first probe message sent this time will be determined as the first maximum data packet undetermined length.
[0337] In one possible implementation, the second network protocol is Real-Time Transport Protocol (RTP) or User Datagram Protocol (UDP), the second probe message is obtained by copying the actual data packet to be forwarded, and the second probe message carries a type identifier for identifying the probe packet type. The first acquisition unit 901 is used for:
[0338] If the returned second response message indicates that the second probe message was not completely received, adjust the data length of the second probe message and resend the second probe message;
[0339] If the returned second response message indicates that the second probe message has been received completely, the data length of the second probe message sent this time is determined as the second maximum data packet undetermined length.
[0340] In one possible implementation, the transmitting device further includes:
[0341] The third determining unit is used to determine, from the data to be sent, data whose length reaches the maximum data packet length that can be sent;
[0342] The packet sub-unit is used to sub-encapsulate the transmitable data and send the encapsulated data packets to the receiving device.
[0343] In one possible implementation, the transmitting device further includes:
[0344] A caching unit is used to cache the maximum data packet length through a length buffer and update the maximum data packet length according to update conditions;
[0345] The first acquisition unit 901 is used for:
[0346] The maximum data packet length corresponding to the transmission network between the sending device and the receiving device is retrieved from the length buffer.
[0347] In one possible implementation, the update condition includes at least one of the following: the transmission network experiencing an abnormal network condition or reaching the update cycle.
[0348] In one possible implementation, the transmitting device further includes:
[0349] The selection unit is used to select a representative data from the N target data;
[0350] An encapsulation unit is used to encapsulate the corresponding data packet header of the representative data packet as the extended header of the merged data packet into the merged data packet. The extended header encapsulated into the merged data packet includes a type identifier for identifying the merged data packet.
[0351] In one possible implementation, the N target data have the same data type.
[0352] refer to Figure 10 The diagram shown is a schematic of a receiving device according to an embodiment of this application. The receiving device 1000 includes:
[0353] The second acquisition unit 1001 is used to acquire the merged data packet sent by the sending device, wherein the merged data packet is obtained by the aforementioned method;
[0354] The decapsulation unit 1002 is used to decapsulate the merged data packet to obtain the N target data.
[0355] In one possible implementation, the receiving device further includes:
[0356] The calculation unit is used to calculate the N target data based on the encoding parameters of the receiving device to obtain the usage timestamps corresponding to the N target data respectively;
[0357] Alternatively, the usage timestamps corresponding to the N target data can be calculated using the offsets carried in the merged data packets.
[0358] This application also provides a data merging and transmission system, referenced... Figure 11 This is a schematic diagram of a data merging and transmission system provided in an embodiment of this application. The data merging and transmission system includes a transmitting device 1101 and a receiving device 1102.
[0359] Transmitting device 1101 is used to perform the corresponding data merging and transmission method;
[0360] The receiving device 1102 is used to perform the corresponding data merging and transmission method.
[0361] This application also provides a computer device, including a terminal device or a server, in which the aforementioned transmitting or receiving device can be configured. The computer device will now be described in conjunction with the accompanying drawings.
[0362] If the computer device is a terminal device, please refer to Figure 12 As shown, this application provides a terminal device, taking a mobile phone as an example:
[0363] Figure 12 The diagram shown is a block diagram of a portion of the structure of a mobile phone provided in an embodiment of this application. (Reference) Figure 12 The mobile phone includes components such as a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a Wi-Fi module 1470, a processor 1480, and a power supply 1490. Those skilled in the art will understand that... Figure 12 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0364] The following is combined with Figure 12 A detailed introduction to each component of a mobile phone:
[0365] The RF circuit 1410 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1480; in addition, it transmits uplink data to the base station.
[0366] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0367] The input unit 1430 can be used to receive input numeric or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432.
[0368] The display unit 1440 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
[0369] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.
[0370] Audio circuitry 1460, speaker 1461, and microphone 1462 provide an audio interface between the user and the mobile phone.
[0371] WiFi is a short-range wireless transmission technology. Through the WiFi module 1470, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access.
[0372] The processor 1480 is the control center of the mobile phone. It connects various parts of the mobile phone through various interfaces and lines. It performs various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 1420 and calling data stored in the memory 1420.
[0373] The phone also includes a power supply 1490 (such as a battery) that powers the various components.
[0374] In this embodiment, the processor 1480 included in the terminal device is also used to execute the steps in the methods of the various embodiments of this application.
[0375] If the computer device is a server, this application embodiment also provides a server; please refer to [link to relevant documentation]. Figure 13 As shown, Figure 13 This is a structural diagram of a server 1500 provided in an embodiment of this application. The server 1500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1522 (e.g., one or more processors) and memory 1532, and one or more storage media 1530 (e.g., one or more mass storage devices) for storing application programs 1542 or data 1544. The memory 1532 and storage media 1530 can be temporary or persistent storage. The program stored in the storage media 1530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1522 may be configured to communicate with the storage media 1530 and execute the series of instruction operations in the storage media 1530 on the server 1500.
[0376] Server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input / output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0377] The steps performed by the server in the above embodiments can be based on Figure 13 The server structure shown.
[0378] In addition, this application embodiment also provides a storage medium for storing a computer program for executing the method provided in the above embodiment.
[0379] This application also provides a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the method provided in the above embodiments.
[0380] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk or optical disk, and other media that can store computer programs.
[0381] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0382] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0383] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Moreover, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.
Claims
1. A data merging and transmission method, characterized in that, The method is performed by a transmitting device, and the method includes: Obtain the maximum data packet length corresponding to the transmission network between the sending device and the receiving device; From the data to be sent to the receiving device, determine the target data whose data length does not reach the maximum data packet length; The N target data in the target data are merged and packaged to obtain a merged data packet. The upper limit of the length of the merged data packet is the maximum data packet length. The merged data packet includes a merge header, which is used to identify the storage location of the N target data in the merged data packet. The merged data packet is used to send to the receiving device, where N > 1.
2. The method according to claim 1, characterized in that, The step of merging and packaging N target data points from the target data to obtain a merged data packet includes: The N target data that meet the timeliness requirements are merged and packaged to obtain the merged data packet.
3. The method according to claim 1 or 2, characterized in that, The N target data are arranged in the merged data packet in the order of using timestamps. The number of merge headers is N-1. For the i-th merge header, the i-th merge header is used to identify the i-th target data and the (i+1)-th target data in the merged data packet. The N-1 merge headers are arranged into a merge header sequence based on the order of the identified target data, where 1≤i≤N-1. The i-th merge header includes a flag field, an offset field, and a data range field. The flag field is used to identify whether there is a merge header after the i-th merge header in the merge header sequence. The offset field is used to identify the offset of the usage timestamp of the (i+1)-th target data relative to the usage timestamp of the i-th target data. The data range field is used to identify the data length of the (i+1)-th target data.
4. The method according to claim 1, characterized in that, The transmitting device is equipped with a merging buffer, and the cached data in the merging buffer is the target data waiting to be merged and packaged. For the first data in the target data, the step of merging and packaging N target data in the target data to obtain a merged data packet includes: When processing the first data, if the cached data is present in the merged cache area, the total data length of the first data and the cached data is determined; In response to the total data length not reaching the maximum data packet length, the first data is stored in the merged buffer as the cached data; In response to the total data length reaching the maximum data packet length, the cached data is merged and packaged to obtain a merged data packet, and the first data is stored in the merged cache area as the cached data.
5. The method according to claim 4, characterized in that, The method further includes: When processing the first data, if the cached data is not in the merged cache area, the first data is stored in the merged cache area as the cached data.
6. The method according to claim 4 or 5, characterized in that, The cached data includes second data and third data, and the method further includes: When the waiting time of the second data in the merged cache reaches the first timeliness threshold, the cached data is merged and packaged to obtain a merged data packet. When the second data is the target data that is first added to the merged cache area in the cached data, and the third data is the target data that is last added to the merged cache area in the cached data, if the difference in usage timestamps between the second data and the third data reaches a second timeliness threshold, the cached data is merged and packaged to obtain a merged data packet.
7. The method according to claim 4 or 5, characterized in that, The method further includes: When the total length of the cached data reaches the sending threshold, the cached data is merged and packaged to obtain a merged data packet, where the sending threshold is less than the maximum data packet length.
8. The method according to claim 4 or 5, characterized in that, The step of obtaining the maximum data packet length corresponding to the transmission network between the sending device and the receiving device includes: Obtain the maximum candidate data packet length that the transmission network between the sending device and the receiving device can carry; If the maximum data packet candidate length is less than or equal to the maximum data length that the data range field can identify, the maximum data packet candidate length shall be used as the maximum data packet length; If the maximum candidate data packet length is greater than the maximum data length that can be identified by the data range field, the maximum data length shall be used as the maximum data packet length.
9. The method according to claim 1, characterized in that, The step of obtaining the maximum data packet length corresponding to the transmission network between the sending device and the receiving device includes: Send a first probe message based on a first network protocol to the receiving device; After adjusting the data length of the first probe message based on the first response result of the first probe message, the first probe message is retransmitted to determine the first maximum data packet undetermined length. Send a second probe message based on a second network protocol to the receiving device; After adjusting the data length of the second probe message based on the second response result of the second probe message, the second probe message is retransmitted to determine the second maximum data packet undetermined length. The maximum data packet length is determined by the first maximum data packet undetermined length and the second maximum data packet undetermined length.
10. The method according to claim 9, characterized in that, The step of determining the maximum data packet length using the first maximum data packet undetermined length and the second maximum data packet undetermined length includes: The minimum value between the first maximum data packet undetermined length and the second maximum data packet undetermined length is determined as the maximum data packet length.
11. The method according to claim 9 or 10, characterized in that, The data lengths of the first probe message and the second probe message are adjusted in the following way: When sending a target detection message for the first time, the data length of the target detection message is set to a predetermined value, and the target detection message is either the first detection message or the second detection message; When sending the target detection message for the first time, the data length of the target detection message is adjusted by increasing or decreasing the length, and the adjustment method is associated with the predetermined value.
12. The method according to claim 11, characterized in that, When the predetermined value is the theoretical maximum value of the transmission network, the associated adjustment method is a decreasing adjustment method; when the predetermined value is the theoretical minimum value of the transmission network, the associated adjustment method is an increasing adjustment method.
13. The method according to claim 9 or 10, characterized in that, The method further includes: From the data to be sent, determine the sendable data whose length reaches the maximum data packet length; The transmittable data is divided into packets and encapsulated, and the encapsulated data packets are sent to the receiving device.
14. The method according to claim 1, characterized in that, The method further includes: Select one representative data point from the N target data points; The header of the data packet corresponding to the representative data is used as the extended header of the merged data packet and encapsulated into the merged data packet. The extended header encapsulated into the merged data packet includes a type identifier for identifying the merged data packet.
15. A data merging and transmission method, characterized in that, The method is performed by a receiving device, and the method includes: Acquire the merged data packet sent by the transmitting device, wherein the merged data packet is obtained by any one of claims 1-14; The merged data packet is decapsulated to obtain the N target data.
16. A transmitting device, characterized in that, The transmitting device includes: The first acquisition unit is used to acquire the maximum data packet length corresponding to the transmission network between the sending device and the receiving device; The first determining unit is configured to determine, from the data to be transmitted to the receiving device, target data whose data length does not reach the maximum data packet length; The merging unit is used to merge and package N target data in the target data to obtain a merged data packet. The upper limit of the data packet length of the merged data packet is the maximum data packet length. The merged data packet includes a merge header, which is used to identify the storage location of the N target data in the merged data packet. The merged data packet is used to send to the receiving device, where N>1.
17. A receiving device, characterized in that, The receiving device includes: The second acquisition unit is used to acquire the merged data packet sent by the sending device, wherein the merged data packet is obtained by any one of claims 1-14; The decapsulation unit is used to decapsulate the merged data packet to obtain the N target data.
18. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store computer programs; The processor is configured to perform the method according to any one of claims 1-14 or 15 according to the computer program.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when executed by a computer device, performs the method described in any one of claims 1-14 or 15.
20. A computer program product comprising a computer program, which, when run on a computer device, causes the computer device to perform the method of any one of claims 1-14 or 15.