Data transmission adjustment method and device, computer equipment and storage medium

By carrying the data block limit value in the RTSP message during the RTSP session establishment stage, the IP sharding problem caused by the mismatch between the terminal device and the CPE device MTU is solved, which significantly improves the transmission efficiency and data integrity, and improves the transmission quality of multimedia data.

CN119922170AActive Publication Date: 2025-05-02GUANGZHOU TOZED KANGWEI INTELLIGENT TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411939845.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-05-02
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

The mismatch between the terminal device and the CPE device causes the RTP packets to be split into multiple IP shards, reducing transmission efficiency and increasing packet loss rate, affecting video, audio quality and user experience.

Method used

In the RTSP session establishment stage, by generating block restrictions, carrying the block limit value in the RTSP message, limiting the size of the data packet sent by the terminal device so that it is not larger than the MTU of the CPE device, and avoiding IP sharding.

Benefits of technology

It effectively avoids the IP sharding requirement during RTP data transmission, improves transmission efficiency and data integrity, reduces the risk of packet loss, and improves the transmission quality of multimedia data, especially in application scenarios with high requirements for real-time and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922170A_ABST
    Figure CN119922170A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network communication, and discloses a data transmission adjustment method and device, computer equipment and a storage medium, the method is applied to CPE equipment, the CPE equipment is used for forwarding data of a terminal to a server and / or forwarding data of the server to the terminal, and the method comprises the following steps: obtaining a first RTSP message sent by the server, the first RTSP message is used by the server to request the terminal to establish RTSP connection; a block limiting condition is generated in the first RTSP message, the block limiting condition carries a data block limiting value, and a second RTSP message is obtained; when the terminal transmits data to the server through the CPE by means of the RTP, the block limiting condition is used for limiting the size of a single data packet sent by the terminal in a data subpackage mode to be not larger than a data block limiting value; and sending the second RTSP message to the terminal. According to the invention, the IP fragmentation requirement during data transmission is effectively avoided, the packet loss risk caused by the IP fragmentation is reduced, and the transmission efficiency and the transmission quality are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a data transmission adjustment method, device, computer equipment and storage medium. Background Art

[0002] In modern communication technology, terminal devices, as core devices for the collection and transmission of multimedia data, are widely used in many fields such as video surveillance, remote conferencing, online education, telemedicine, virtual reality and augmented reality. These terminal devices, including but not limited to cameras, microphones, sensors, smart wearable devices, etc., usually use the Real-time Transport Protocol (RTP) as their core transmission protocol to achieve real-time transmission of multimedia data. The RTP protocol is designed to transmit multimedia data streams with real-time characteristics, such as audio, video, sensor data, etc., on IP networks. In the RTP protocol, the size of the media packet (such as a video frame, audio frame, or sensor data packet) is usually determined based on the maximum transmission unit value (MTU) of the terminal device's own network interface.

[0003] However, in actual deployment environments, the RTP messages (usually encapsulated in the UDP protocol) sent by the terminal device may encounter MTU mismatch problems when reaching the CPE (Customer Premises Equipment) gateway device. When the CPE device routes and forwards the RTP message, it will decide whether to fragment the message based on the MTU size of its egress interface. When the MTU of the network where the terminal device is located is larger than the MTU of the CPE device's egress interface, the RTP message will not be able to pass directly and must be split into multiple smaller IP fragments for transmission. Although IP fragment transmission can enable data to be sent to the destination server, this process reduces transmission efficiency on the one hand and increases the packet loss rate on the other. The increase in the packet loss rate will lead to a decrease in video and audio quality, and even cause playback interruptions, greatly affecting the user experience. Summary of the invention

[0004] Based on this, it is necessary to propose a data transmission adjustment method, device, computer equipment and storage medium to address the problem of MTU mismatch between existing terminal equipment and CPE equipment.

[0005] A first aspect of the present invention provides a data transmission adjustment method, which is applied to a CPE device, wherein the CPE device is used to forward data of a terminal to a server and / or forward data of a server to a terminal, and the method comprises:

[0006] Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0007] Generate a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0008] Send the second RTSP message to the terminal.

[0009] Further, the step of generating a block restriction condition in the first RTSP message, wherein the block restriction condition carries a data block restriction value, and obtaining the second RTSP message includes:

[0010] Parsing the first RTSP message;

[0011] Determining whether the first RTSP message contains an initial block restriction condition;

[0012] If the initial block restriction condition is included, extracting the initial data block restriction value from the initial block restriction condition;

[0013] Comparing the initial data block limit value with a preset limit value;

[0014] Determining whether the initial data block limit value is greater than the preset limit value;

[0015] If it is greater than the preset limit value, the preset limit value is used as the data block limit value and replaces the initial data block limit value to update the initial block restriction condition and the first RTSP message, and the updated initial block restriction condition is used as the block restriction condition, and the updated first RTSP message is used as the second RTSP message.

[0016] Further, after the step of determining whether the first RTSP message contains the initial block restriction condition, the method further includes:

[0017] If the initial block restriction condition is not included, the block restriction condition is written into the first RTSP message, the preset restriction value is used as the data block restriction value in the block restriction condition, and the first RTSP message in which the block restriction condition is written is used as the second RTSP message.

[0018] Further, after the step of determining whether the initial data block limit value is greater than the preset limit value, the step further includes:

[0019] If it is not greater than the preset limit value, the initial data block limit value is used as the data block limit value, and the first RTSP message is directly used as the second RTSP message.

[0020] Furthermore, before the step of comparing the initial data block limit value with the preset limit value, the step further includes:

[0021] Obtaining a maximum transmission unit value of a data output interface of the CPE device;

[0022] The preset limit value is calculated by subtracting the first preset header value of the data block from the maximum transmission unit value.

[0023] Furthermore, before the step of obtaining the first RTSP message sent by the server, the step further includes:

[0024] When establishing a TCP connection with the server, obtaining a maximum segment length determined in a TCP three-way handshake process;

[0025] Subtract the second preset header value of the data block from the maximum message segment length to obtain a first calculated value;

[0026] Obtaining a maximum transmission unit value of a data output interface of the CPE device;

[0027] Subtracting a first preset header value of the data block from the maximum transmission unit value to obtain a second calculated value;

[0028] The first calculated value and the second calculated value are compared, and the smaller value between the two is used as the preset limit value.

[0029] Furthermore, the first preset header value is the sum of the sizes of the IP header, the UDP header and the RTP header, and the second preset header value is the sum of the sizes of the UDP header and the RTP header.

[0030] A second aspect of the present invention provides a data transmission adjustment device, which is arranged in a CPE device, wherein the CPE device is used to forward data of a terminal to a server and / or forward data of a server to a terminal, and the device comprises:

[0031] A message acquisition module, used for acquiring a first RTSP message sent by a server, wherein the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0032] A message modification module, used for generating a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtaining a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0033] The message sending module is used to send the second RTSP message to the terminal.

[0034] A third aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:

[0035] Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0036] Generate a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0037] Send the second RTSP message to the terminal.

[0038] A fourth aspect of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0039] Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0040] Generate a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0041] Send the second RTSP message to the terminal.

[0042] The data transmission regulation method, device, computer equipment and storage medium of the present invention effectively avoid the need for IP fragmentation during subsequent RTP data transmission by notifying the terminal of the data block limit value of the CPE device during the RTSP session establishment phase, thereby significantly improving transmission efficiency and data integrity; and reducing the risk of packet loss due to IP fragmentation, thereby improving the transmission quality of multimedia data, especially in application scenarios such as video surveillance and remote conferencing that have high requirements for real-time performance and stability, so that the user experience is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] in:

[0045] Figure 1 is a flow chart of a data transmission adjustment method in one embodiment;

[0046] Figure 2 is a structural block diagram of a data transmission adjustment device in one embodiment;

[0047] Figure 3 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] like Figure 1 As shown, in one embodiment, a data transmission adjustment method is provided, which is applied to a CPE device, wherein the CPE device is used to forward data from a terminal to a server and / or forward data from a server to a terminal. The data transmission adjustment method specifically includes the following steps:

[0050] S1: Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0051] S2: Generate a block restriction condition in the first RTSP message, the block restriction condition carries a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0052] S3: Send the second RTSP message to the terminal.

[0053] In this embodiment, the CPE device is used to route and forward the data of the terminal to the server, or forward the data of the server to the terminal. The terminal includes but is not limited to cameras, microphones, sensors, smart wearable devices, etc. The server includes but is not limited to web servers, database servers, cloud servers, etc.

[0054] In the above step S1, the CPE device obtains network traffic from the server and identifies an RTSP (Real-Time Streaming Protocol) session establishment request message whose target is a specific terminal, that is, the above first RTSP message.

[0055] Specifically, the CPE device system is initialized, and the nf_conntrack helper is registered with the netfilter framework in the network subsystem by calling the system function nf_conntrack_helper_register. The helper is associated with the connection flow of the default TCP port 554 of RTSP, and the helper callback function is implemented. When the CPE device system receives the first PTSP message of TCP port 554, the helper callback function will be triggered to execute, and the TCP payload content in the message will be obtained in the helper callback function.

[0056] In the above step S2, the above data block limit value can be a pre-set value, or can be calculated in real time by a predefined method. The preferred solution is to calculate in real time by a predefined method. The data block limit value is less than the MTU value (maximum transmission unit value) of the CPE egress interface. This step is used to modify the first RTSP message to insert a new data block limit value therein, and modify the first RTSP message into a second RTSP message.

[0057] Preferably, the CPE device can recalculate the MTU value of its egress interface periodically or as needed, and dynamically update the data block limit value.

[0058] In the above step S3, the CPE device sends the modified second RSTP (should be RTSP) message to the target terminal through its internal network forwarding mechanism.

[0059] This embodiment effectively avoids the need for IP fragmentation during subsequent RTP data transmission by notifying the terminal of the data block limit value of the CPE device during the RTSP session establishment phase, thereby significantly improving transmission efficiency and data integrity; and reducing the risk of packet loss due to IP fragmentation, thereby improving the transmission quality of multimedia data, especially in application scenarios such as video surveillance and remote conferencing that have high requirements for real-time and stability, thereby significantly improving user experience.

[0060] In a specific embodiment, the step S2 of generating a block restriction condition in the first RTSP message, wherein the block restriction condition carries a data block restriction value, and obtaining the second RTSP message includes:

[0061] S201: parsing the first RTSP message;

[0062] S202: Determine whether the first RTSP message contains an initial block restriction condition;

[0063] S203: If the initial block restriction condition is included, extracting an initial data block restriction value from the initial block restriction condition;

[0064] S204: Compare the initial data block limit value with a preset limit value;

[0065] S205: Determine whether the initial data block limit value is greater than the preset limit value;

[0066] S206: If it is greater than the preset limit value, the preset limit value is used as the data block limit value and replaces the initial data block limit value to update the initial block limit condition and the first RTSP message, and the updated initial block limit condition is used as the block limit condition, and the updated first RTSP message is used as the second RTSP message.

[0067] In this embodiment, in the above steps S201-S202, the received first RTSP message is parsed to extract the payload content therein. The above initial block restriction condition refers to the original restriction condition in the first RTSP message for specifying the data block size. Specifically, a helper callback function can be used to determine whether the TCP payload content contains the "SETUPrtsp: / / " string (indicating a SETUP session of RTSP) and whether it carries the "Transport" field (this field must be carried in a SETUP session).

[0068] In the above step S203, the initial data block limit value is the maximum size of each data block specified in the first RTSP message. During the system initialization or configuration stage, a fixed data block size can be artificially determined as the initial data block limit value based on known conditions such as network bandwidth, device performance, and expected streaming media data transmission requirements. It is also possible to use the data block size set in real time as the initial data block limit value based on the real-time monitoring and feedback mechanism of the system according to factors such as the current network status and device load, and require the terminal to provide a specific data packet size. The terminal can freely use a data packet size that is smaller than the initial data block limit value request. The initial data block limit value does not include the size of low-level headers such as IP, UDP or RTP in the transmitted data packet.

[0069] Specifically, when the helper callback function determines that the RTSP SETUP session carries the "Blocksize" field, the value of the "Blocksize" field carried by the RTSP SETUP session, ie, the above-mentioned initial data block limit value, is obtained through the helper callback function.

[0070] In the above step S204, the preset limit value is a predefined threshold value for limiting the size of data blocks. The preset limit value is associated with the export MTU value of the CPE device. When the data packet transmitted from the terminal is smaller than the preset limit value, there is no need to perform IP fragmentation transmission on the data packet when the CPE device forwards it. As a preferred solution, the above preset limit value adopts a dynamic adjustment mechanism and is dynamically adjusted according to the network status, device performance, etc. of the CPE device. For example, when the network bandwidth is sufficient and the device performance is high, the preset limit value can be appropriately increased; otherwise, the preset limit value should be reduced.

[0071] In the above steps S205-S206, if the initial data block limit value is greater than the preset limit value, it means that the initial data block limit value given in the first RTSP message is too large and needs to be adjusted. The preset limit value is used as the new data block limit value and replaces the initial data block limit value in the original message. In this way, the updated initial block limit condition becomes the new block limit condition, and the updated RTSP message becomes the second RTSP message.

[0072] In a specific embodiment, after the step S202 of determining whether the first RTSP message contains the initial block restriction condition, the method further includes:

[0073] S213: If the initial block restriction condition is not included, the block restriction condition is written into the first RTSP message, the preset restriction value is used as the data block restriction value in the block restriction condition, and the first RTSP message in which the block restriction condition is written is used as the second RTSP message.

[0074] In this embodiment, if the first RTSP message does not contain the initial block restriction condition, for example, does not carry the "Transport" field, the above preset restriction value is inserted into the first RTSP message through the helper callback function, that is, the "Blocksize" field and the corresponding preset restriction value are inserted.

[0075] In a specific embodiment, after the step S205 of determining whether the initial data block limit value is greater than the preset limit value, the method further includes:

[0076] S216: If it is not greater than the preset limit value, the initial data block limit value is used as the data block limit value, and the first RTSP message is directly used as the second RTSP message.

[0077] In this embodiment, if it is not greater than the preset limit value, there is no need to modify the content of the first RTSP message, and the first RTSP message is directly forwarded to the terminal as the second RTSP message.

[0078] In a specific embodiment, before the step S204 of comparing the initial data block limit value with the preset limit value, the method further includes:

[0079] S207: Obtaining a maximum transmission unit value of a data output interface of the CPE device;

[0080] S208: Subtract the first preset header value of the data block from the maximum transmission unit value to calculate the preset limit value.

[0081] In this embodiment, the first preset header value is the sum of the sizes of the IP header, UDP header and RTP header. The maximum transmission unit value (MTU) refers to the maximum size of a data packet allowed to be transmitted by the network layer protocol, including the data of the data packet itself and necessary header information.

[0082] In step S207, the maximum transmission unit value supported by the data output interface of the CPE device is queried, which can be achieved by reading the MTU value preset in the device configuration file.

[0083] In step S208: the first preset header value refers to the sum of the sizes of the header information that needs to be attached during the transmission of the data packet. For example, it includes the sizes of the IP header, UDP header and RTP header. Among them, the IP header is the header information of the IP data packet, including key information such as the source address, destination address, and protocol type. The UDP header (User Datagram Protocol) is used to encapsulate user data and some necessary control information. The RTP header (Real-time Transport Protocol) is a protocol header for real-time data transmission, including information such as timestamp and sequence number. The MTU value obtained from the CPE device is subtracted from the first preset header value (i.e., the sum of the sizes of the IP header, UDP header and RTP header) to calculate the preset limit value. Specifically, the MTU of the CPE device egress interface is converted into a Blocksize value; Blocksize represents the size of each block of the data packet, excluding the IP, UDP, and RTP headers, so the conversion relationship between MTU and Blocksize is as follows: MTU = IP header + UDP header + RTP header + Blocksize. Therefore, this embodiment can ensure that the data packets transmitted by the terminal can be directly forwarded by the CPE device without the need to split the data packets, thereby avoiding the problem of reduced transmission performance.

[0084] In a specific embodiment, before the step S1 of acquiring the first RTSP message sent by the server, the method further includes:

[0085] S01: when establishing a TCP connection with the server, obtaining a maximum segment length determined in a TCP three-way handshake process;

[0086] S02: subtracting a second preset header value of the data block from the maximum segment length to obtain a first calculated value;

[0087] S03: Obtaining a maximum transmission unit value of a data output interface of the CPE device;

[0088] S04: subtracting a first preset header value of the data block from the maximum transmission unit value to obtain a second calculated value;

[0089] S05: Compare the first calculated value and the second calculated value, and use the smaller value between the two as the preset limit value.

[0090] In this embodiment, the second preset header value is the sum of the sizes of the UDP header and the RTP header.

[0091] In the above step S01, the maximum segment size (MSS) determined during the three-way handshake of TCP is obtained. This value is usually determined by negotiation between the two parties during the three-way handshake of the TCP connection. Specifically, the MSS value of each TCP stream during the three-way handshake is added to the nf_conntrack connection tracking record table of the network subsystem. If the data packet sent by the terminal device meets the MTU of the CPE device, but exceeds the MSS value when the CPE device forwards it to the server, the data packet will still be transmitted in packets, increasing transmission delay and additional processing.

[0092] In the above step S02, the second preset header value refers to the sum of the sizes of the additional header information required in addition to the TCP header during the transmission of the data packet. In this embodiment, it includes the size of the UDP header and the RTP header. The second preset header value (i.e., the sum of the sizes of the UDP header and the RTP header) is subtracted from the MSS value to calculate the first calculated value.

[0093] Specifically, the helper callback function reads the system's nf_conntrack connection tracking record table to obtain the MSS value of the TCP connection flow, and converts the MSS value into a Blocksize value; Blocksize indicates the size of each block of a data packet, excluding the IP, UDP, and RTP headers, so the MTU and Blocksize conversion relationship is as follows: MTU = IP header + UDP header + RTP header + Blocksize. Since MTU = IP header + MSS, the MSS and Blocksize conversion relationship is as follows: MSS = UDP header + RTP header + Blocksize.

[0094] Steps S03 to S04 are the same as the execution process of S207 and S208 in the above embodiment, and will not be repeated here. The MTU of the CPE device egress interface is converted into a Blocksize value; Blocksize indicates the size of each block of a data packet, excluding the IP, UDP, and RTP headers, so the MTU and Blocksize conversion relationship is as follows: MTU = IP header + UDP header + RTP header + Blocksize.

[0095] In step S05, the smaller value of the first calculated value and the second calculated value is used as the preset limit value. Specifically, the minimum value of the converted Blocksize values ​​is used as the "minimum Blocksize value (ie, the preset limit value)" for the basis of modifying the first RTSP message in subsequent steps.

[0096] Furthermore, the helper callback function is used to insert the "minimum Blocksize value" into the "Blocksize" field of the first RTSP message. The helper callback function is used to call the system function nf_nat_mangle_tcp_packet to readjust the TCP packet of the TCP connection flow (mainly to adjust the seq sequence and record mapping relationship of TCP). After the helper callback function is processed, the CPE device performs the next forwarding process on the network message.

[0097] By calculating and determining the preset limit value, this embodiment can ensure that the data packets sent in the TCP connection and the network layer will not exceed their respective maximum limit values ​​due to the addition of header information, effectively avoiding problems such as data packet splitting, transmission delay and packet loss, thereby improving the stability and efficiency of data transmission.

[0098] Figure 2 A data transmission adjustment device in an embodiment is shown, which is arranged in a CPE device, and the CPE device is used to forward the data of the terminal to the server and / or forward the data of the server to the terminal. The device includes:

[0099] The message acquisition module 10 is used to acquire a first RTSP message sent by the server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0100] The message modification module 20 is used to generate a block restriction condition in the first RTSP message, the block restriction condition carries a data block restriction value, and obtains a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal to be no larger than the data block restriction value;

[0101] The message sending module 30 is used to send the second RTSP message to the terminal.

[0102] In a specific embodiment, the message modification module 20 includes:

[0103] A message parsing unit, used for parsing the first RTSP message;

[0104] A first judging unit, configured to judge whether the first RTSP message contains an initial block restriction condition;

[0105] a data extraction unit, configured to extract an initial data block restriction value from the initial block restriction condition if the initial block restriction condition is included;

[0106] A value comparison unit, used for comparing the initial data block limit value with a preset limit value;

[0107] A second judging unit, configured to judge whether the initial data block limit value is greater than the preset limit value;

[0108] The first generating unit is configured to use the preset limit value as the data block limit value and replace the initial data block limit value if it is greater than the preset limit value, so as to update the initial block limit condition and the first RTSP message, and use the updated initial block limit condition as the block limit condition, and use the updated first RTSP message as the second RTSP message.

[0109] In a specific embodiment, the message modification module 20 further includes:

[0110] The second generating unit is used for writing the block restriction condition into the first RTSP message if the initial block restriction condition is not included, using the preset restriction value as the data block restriction value in the block restriction condition, and using the first RTSP message in which the block restriction condition is written as the second RTSP message.

[0111] In a specific embodiment, the message modification module 20 further includes:

[0112] The third generating unit is configured to use the initial data block limit value as the data block limit value and directly use the first RTSP message as the second RTSP message if the value is not greater than the preset limit value.

[0113] In a specific embodiment, the message modification module 20 further includes:

[0114] An MTU acquisition unit, used to obtain a maximum transmission unit value of a data output interface of the CPE device;

[0115] The first calculation unit is used to subtract the first preset header value of the data block from the maximum transmission unit value to calculate the preset limit value.

[0116] In a specific embodiment, the data transmission adjustment device further includes:

[0117] An MSS acquisition module, used to obtain the maximum segment length determined in the TCP three-way handshake process when establishing a TCP connection with the server;

[0118] A first calculation module, configured to calculate a first calculated value by subtracting a second preset header value of a data block from the maximum message segment length;

[0119] An MTU acquisition module is used to obtain the maximum transmission unit value of the data output interface of the CPE device;

[0120] A second calculation module, configured to subtract a first preset header value of a data block from the maximum transmission unit value to calculate a second calculated value;

[0121] The data determination module is used to compare the first calculated value and the second calculated value, and use the smaller value between the two as the preset limit value.

[0122] In a specific embodiment, the first preset header value is the sum of the sizes of the IP header, the UDP header and the RTP header, and the second preset header value is the sum of the sizes of the UDP header and the RTP header.

[0123] The device of this embodiment effectively avoids the need for IP fragmentation during subsequent RTP data transmission by notifying the terminal of the data block limit value of the CPE device during the RTSP session establishment phase, thereby significantly improving transmission efficiency and data integrity; and reducing the risk of packet loss due to IP fragmentation, thereby improving the transmission quality of multimedia data, especially in application scenarios such as video surveillance and remote conferencing that have high requirements for real-time and stability, thereby significantly improving user experience.

[0124] Figure 3 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 3 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor may implement the data transmission adjustment method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor may implement the data transmission adjustment method. Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0126] Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0127] Generate a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0128] Send the second RTSP message to the terminal.

[0129] This embodiment effectively avoids the need for IP fragmentation during subsequent RTP data transmission by notifying the terminal of the data block limit value of the CPE device during the RTSP session establishment phase, thereby significantly improving transmission efficiency and data integrity; and reducing the risk of packet loss due to IP fragmentation, thereby improving the transmission quality of multimedia data, especially in application scenarios such as video surveillance and remote conferencing that have high requirements for real-time and stability, thereby significantly improving user experience.

[0130] In one embodiment, a computer-readable storage medium is provided, storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:

[0131] Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection;

[0132] Generate a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value;

[0133] Send the second RTSP message to the terminal.

[0134] This embodiment effectively avoids the need for IP fragmentation during subsequent RTP data transmission by notifying the terminal of the data block limit value of the CPE device during the RTSP session establishment phase, thereby significantly improving transmission efficiency and data integrity; and reducing the risk of packet loss due to IP fragmentation, thereby improving the transmission quality of multimedia data, especially in application scenarios such as video surveillance and remote conferencing that have high requirements for real-time and stability, thereby significantly improving user experience.

[0135] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0136] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0137] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A data transmission adjustment method, characterized in that: Applied to a CPE device, the CPE device is used to forward terminal data to a server and / or forward server data to a terminal, the method comprising: Acquire a first RTSP message sent by a server, where the first RTSP message is used by the server to request the terminal to establish an RTSP connection; Generate a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtain a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value; Send the second RTSP message to the terminal.

2. The data transmission adjustment method according to claim 1, characterized in that: The step of generating a block restriction condition in the first RTSP message, wherein the block restriction condition carries a data block restriction value, and obtaining a second RTSP message comprises: Parsing the first RTSP message; Determining whether the first RTSP message contains an initial block restriction condition; If the initial block restriction condition is included, extracting the initial data block restriction value from the initial block restriction condition; Comparing the initial data block limit value with a preset limit value; Determining whether the initial data block limit value is greater than the preset limit value; If it is greater than the preset limit value, the preset limit value is used as the data block limit value and replaces the initial data block limit value to update the initial block restriction condition and the first RTSP message, and the updated initial block restriction condition is used as the block restriction condition, and the updated first RTSP message is used as the second RTSP message.

3. The data transmission adjustment method according to claim 2, characterized in that: After the step of determining whether the first RTSP message contains the initial block restriction condition, the method further includes: If the initial block restriction condition is not included, the block restriction condition is written into the first RTSP message, the preset restriction value is used as the data block restriction value in the block restriction condition, and the first RTSP message in which the block restriction condition is written is used as the second RTSP message.

4. The data transmission adjustment method according to claim 2, characterized in that: After the step of determining whether the initial data block limit value is greater than the preset limit value, the method further includes: If it is not greater than the preset limit value, the initial data block limit value is used as the data block limit value, and the first RTSP message is directly used as the second RTSP message.

5. The data transmission adjustment method according to claim 2, characterized in that: Before the step of comparing the initial data block limit value with the preset limit value, the method further comprises: Obtaining a maximum transmission unit value of a data output interface of the CPE device; The preset limit value is calculated by subtracting the first preset header value of the data block from the maximum transmission unit value.

6. The data transmission adjustment method according to claim 2, characterized in that: Before the step of obtaining the first RTSP message sent by the server, the method further includes: When establishing a TCP connection with the server, obtaining a maximum segment length determined in a TCP three-way handshake process; Subtract the second preset header value of the data block from the maximum message segment length to calculate a first calculated value; Obtaining a maximum transmission unit value of a data output interface of the CPE device; Subtracting a first preset header value of the data block from the maximum transmission unit value to obtain a second calculated value; The first calculated value and the second calculated value are compared, and the smaller value between the two is used as the preset limit value.

7. The data transmission adjustment method according to claim 6, characterized in that: The first preset header value is the sum of the sizes of the IP header, the UDP header and the RTP header, and the second preset header value is the sum of the sizes of the UDP header and the RTP header.

8. A data transmission adjustment device, characterized in that: The device is arranged in a CPE device, the CPE device is used to forward the data of the terminal to the server, and / or forward the data of the server to the terminal, and the device includes: A message acquisition module, used for acquiring a first RTSP message sent by a server, wherein the first RTSP message is used by the server to request the terminal to establish an RTSP connection; A message modification module, used for generating a block restriction condition in the first RTSP message, the block restriction condition carrying a data block restriction value, and obtaining a second RTSP message; when the terminal transmits data to the server via the CPE device through the RTP protocol, the block restriction condition is used to limit the size of a single data packet sent by the terminal in packetizing the data to not be greater than the data block restriction value; The message sending module is used to send the second RTSP message to the terminal.

9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor is caused to execute the steps of the data transmission adjustment method according to any one of claims 1 to 7.

10. A computer device, characterized in that: The device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the data transmission adjustment method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Transmission method for MPEG-4 code based multimedia data stream self-adapting network bandwidth

    CN101562615A

  • RTP rapid packet accumulation method based on AMR audio frame

    CN101814973A

  • Method for providing maximum transmission unit length for terminal and packet switch gateway

    CN102036304A

  • Maximum transmission unit consultation method and data terminal

    CN102868609A

  • Method and device for dynamically adjusting MTU of communication protocol for transmitting data message, and terminal

    CN106789717A