CN112953850A - Data transmission method and device, computer readable medium and electronic equipment - Google Patents

Data transmission method and device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN112953850A
CN112953850A CN202110367888.2A CN202110367888A CN112953850A CN 112953850 A CN112953850 A CN 112953850A CN 202110367888 A CN202110367888 A CN 202110367888A CN 112953850 A CN112953850 A CN 112953850A
Authority
CN
China
Prior art keywords
data
tcp
packet
data packet
downlink
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110367888.2A
Other languages
Chinese (zh)
Other versions
CN112953850B (en
Inventor
张富春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110367888.2A priority Critical patent/CN112953850B/en
Publication of CN112953850A publication Critical patent/CN112953850A/en
Application granted granted Critical
Publication of CN112953850B publication Critical patent/CN112953850B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/26Flow control; Congestion control using explicit feedback to the source, e.g. choke packets
    • H04L47/263Rate modification at the source after receiving feedback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/19Flow control; Congestion control at layers above the network layer
    • H04L47/193Flow control; Congestion control at layers above the network layer at the transport layer, e.g. TCP related
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The present application belongs to the field of computer technologies, and in particular, to a data transmission method, a data transmission apparatus, a computer-readable medium, and an electronic device. The method comprises the following steps: packaging the data segment to be sent recorded in the state memory into a downlink TCP data packet with a TCP message format based on a user state protocol stack; sending the downlink TCP data packet to a client through an original socket so that the client receives the downlink TCP data packet through a TCP socket; when an uplink TCP data packet returned by the client is received through the original socket, a target TCP connection matched with the uplink TCP data packet is determined according to the identification information of the TCP connection recorded in the state memory, so that the uplink TCP data packet is transmitted to a server corresponding to the target TCP connection. The method can improve the data transmission efficiency and the transmission reliability.

Description

Data transmission method and device, computer readable medium and electronic equipment
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a data transmission method, a data transmission apparatus, a computer-readable medium, and an electronic device.
Background
Existing audio and video transmission protocols can be generally divided into two categories, namely: based on TCP protocol transport or based on UDP protocol transport. When audio and video data is transmitted based on a TCP protocol, the problem of high data transmission delay is easy to occur due to the fact that buffering waiting is needed after network packet loss, and the method is difficult to be suitable for scenes of audio and video real-time playing. Although the audio and video data transmission based on the UDP protocol can use a scene of audio and video real-time playing, the problem of poor audio and video transmission quality is caused by high packet loss rate due to the lack of a retransmission mechanism. Therefore, how to efficiently and stably transmit audio and video data is a problem to be solved urgently at present.
Disclosure of Invention
The present application aims to provide a data transmission method, a data transmission device, a computer readable medium and an electronic device, which at least to some extent overcome the technical problems of low transmission efficiency, poor transmission stability and the like of audio and video data in the related art.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a data transmission method, including: packaging the data segment to be sent recorded in the state memory into a downlink TCP data packet with a TCP message format based on a user state protocol stack; sending the downlink TCP data packet to a client through an original socket so that the client receives the downlink TCP data packet through a TCP socket; when an uplink TCP data packet returned by the client is received through the original socket, a target TCP connection matched with the uplink TCP data packet is determined according to the identification information of the TCP connection recorded in the state memory, so that the uplink TCP data packet is transmitted to a server corresponding to the target TCP connection.
According to an aspect of an embodiment of the present application, there is provided a data transmission apparatus, including: the encapsulation module is configured to encapsulate the to-be-sent data segment recorded in the state memory into a downlink TCP data packet with a TCP message format based on a user state protocol stack; a sending module configured to send the downlink TCP data packet to a client through an original socket, so that the client receives the downlink TCP data packet through a TCP socket; and the receiving module is configured to determine a target TCP connection matched with the uplink TCP data packet according to the identification information of the TCP connection recorded in the state memory when the uplink TCP data packet returned by the client is received through the original socket, so as to transmit the uplink TCP data packet to a server corresponding to the target TCP connection.
In some embodiments of the present application, based on the above technical solutions, the encapsulation module includes: the data splitting unit is configured to acquire data to be sent generated by a server and split the data to be sent into a plurality of data frames; the data frame segmentation unit is configured to segment the data frame based on a user mode protocol stack to obtain a plurality of data segments with specified byte length, and record the data segments in a state memory; a sequence number determining unit configured to determine a TCP sequence number of each of the data segments according to an arrangement order of the data segments in the data frame and a data amount of the data segments; and the data packet encapsulation unit is configured to add a TCP packet header carrying the TCP serial number to each data segment to obtain a downlink TCP data packet with a TCP message format.
In some embodiments of the present application, based on the above technical solutions, the data transmission apparatus further includes: a connection determining module configured to determine, when an uplink ACK packet returned by the client is received through the original socket, a target TCP connection matching the uplink ACK packet according to the identification information of the TCP connection; a data segment determination module configured to obtain a target data segment, which is recorded in the state memory and corresponds to the target TCP connection and waits for acknowledgement; the data packet analysis module is configured to analyze the uplink ACK data packet to obtain an acknowledgement number carried in the uplink ACK data packet; and the state determining module is configured to update the data confirmation state of the target data segment according to the confirmation number.
In some embodiments of the present application, based on the above technical solutions, the data transmission apparatus further includes: the duration monitoring module is configured to monitor the sending duration of the data segment waiting for confirmation recorded in the state memory in real time; and the data retransmission module is configured to retransmit the data segment based on the user mode protocol stack when the sending time length of the data segment exceeds a time length threshold, wherein the time length threshold is smaller than the timeout time length defined by the TCP protocol stack.
In some embodiments of the present application, based on the above technical solutions, the sending module includes: a node acquisition unit configured to acquire a transmission time node of the downlink TCP packet; a non-redundant sending unit configured to send the downlink TCP packet to a client through an original socket if the sending time node is not in a data transmission peak time, where the data transmission peak time is a time interval dynamically adjusted according to a network transmission state; and the redundancy sending unit is configured to obtain the redundancy proportion of the downlink TCP data packet if the sending time node is in the data transmission peak period, and send the downlink TCP data packet and the redundancy data packet corresponding to the redundancy proportion to a client through an original socket.
In some embodiments of the present application, based on the above technical solutions, the redundancy sending unit includes: the information acquisition subunit is configured to acquire importance information of a data segment corresponding to the downlink TCP data packet and a data length of a data frame where the data segment is located; a redundancy ratio determining subunit configured to determine a redundancy ratio of the downlink TCP packet according to the importance information and the data length.
In some embodiments of the present application, based on the above technical solutions, the sending module further includes: a first redundancy operation unit configured to perform a copy operation on the downlink TCP data packet according to the redundancy ratio, so as to obtain one or more redundancy data packets having the same content as the downlink TCP data packet; a first sending unit configured to send the downlink TCP data packet and the redundant data packet to a client through an original socket.
In some embodiments of the present application, based on the above technical solutions, the sending module further includes: a second redundancy operation unit configured to perform an exclusive or operation on a plurality of downlink TCP packets having consecutive TCP sequence numbers according to the redundancy ratio to obtain one redundancy data packet associated with the plurality of downlink TCP packets; a second sending unit configured to send the plurality of downstream TCP packets and the redundant data packet to a client through an original socket.
In some embodiments of the present application, based on the above technical solutions, the data transmission apparatus further includes: a packet loss rate detection module configured to monitor a packet loss rate of the downlink TCP packet; a sequence number obtaining module configured to obtain a TCP sequence number of a downlink TCP data packet waiting for retransmission when the packet loss rate is greater than a preset packet loss rate threshold; a retransmission packet header generating module configured to generate a retransmission TCP packet header carrying a TCP sequence number of the downlink TCP packet waiting for retransmission; a retransmission data packet generation module configured to add the retransmission TCP packet header to the data segment of the latest video frame recorded in the state memory to obtain a retransmission TCP data packet having a TCP packet format; and the retransmission data packet sending module is configured to send the retransmission TCP data packet to the client through the original socket.
In some embodiments of the present application, based on the above technical solution, the retransmission TCP packet header carries a retransmission identification field, where the retransmission identification field is used to instruct the client to discard data of other video frames before the latest video frame.
In some embodiments of the present application, based on the above technical solutions, the data transmission apparatus further includes: a congestion state determination module configured to determine a network congestion state when a downlink TCP packet is transmitted to the client according to data transmission time and data acknowledgement time of the data segment recorded in the state memory; and the data volume adjusting module is configured to send a dynamic adjusting request carrying the network congestion state to a server generating data to be sent, wherein the dynamic adjusting request is used for indicating the server to adjust the data volume of the data to be sent according to the network congestion state.
In some embodiments of the present application, based on the above technical solution, the data amount adjustment module is further configured to adjust at least one of a code rate and a frame rate used when data encoding is performed on the data to be transmitted.
According to an aspect of the embodiments of the present application, there is provided a computer-readable medium on which a computer program is stored, the computer program, when executed by a processor, implementing the data transmission method as in the above technical solution.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the data transmission method as in the above technical solution via executing the executable instructions.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data transmission method as in the above technical scheme.
In the technical scheme provided by the embodiment of the application, the user mode protocol stack is used for data encapsulation, a TCP data packet simulating a TCP protocol can be generated, and further the TCP data packet is sent and received through the original socket, so that the TCP data packet with a TCP message format is sent based on a UDP (user datagram protocol) mode, reliable transmission can be realized, delay increase caused by data retransmission can be avoided, and the data transmission efficiency and the transmission reliability can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 schematically shows a block diagram of an exemplary system architecture to which the solution of the present application applies.
Fig. 2 shows an overall architecture diagram of the cloud game application scenario according to the embodiment of the present application.
Fig. 3 is an architecture detail diagram of a system architecture for data transmission according to an embodiment of the present application.
Fig. 4 shows a flow chart of steps of a data transmission method in one embodiment of the present application.
Fig. 5 is a flowchart illustrating steps for encapsulating a downstream TCP packet based on a user mode protocol stack according to an embodiment of the present application.
Fig. 6 schematically shows a block diagram of a data transmission apparatus according to an embodiment of the present application.
FIG. 7 schematically illustrates a block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 schematically shows a block diagram of an exemplary system architecture to which the solution of the present application applies.
As shown in fig. 1, system architecture 100 may include a terminal device 110, a network 120, and a server 130. The terminal device 110 may include various electronic devices such as a smart phone, a tablet computer, a notebook computer, and a desktop computer. The server 130 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal device 110 and server 130, such as a wired communication link or a wireless communication link.
The system architecture in the embodiments of the present application may have any number of terminal devices, networks, and servers, according to implementation needs. For example, the server 130 may be a server group composed of a plurality of server devices. In addition, the technical solution provided in the embodiment of the present application may be applied to the terminal device 110, or may be applied to the server 130, or may be implemented by both the terminal device 110 and the server 130, which is not particularly limited in this application.
The technical scheme provided by the embodiment of the application can be applied to cloud game scenes realized based on the cloud technology. Cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The cloud technology is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in the cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.
Cloud computing (cloud computing) refers to a delivery and use mode of an IT infrastructure, and refers to obtaining required resources in an on-demand and easily-extensible manner through a network; the generalized cloud computing refers to a delivery and use mode of a service, and refers to obtaining a required service in an on-demand and easily-extensible manner through a network. Such services may be IT and software, internet related, or other services. Cloud Computing is a product of development and fusion of traditional computers and Network Technologies, such as Grid Computing (Grid Computing), distributed Computing (distributed Computing), Parallel Computing (Parallel Computing), Utility Computing (Utility Computing), Network Storage (Network Storage Technologies), Virtualization (Virtualization), Load balancing (Load Balance), and the like.
With the development of diversification of internet, real-time data stream and connecting equipment and the promotion of demands of search service, social network, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Different from the prior parallel distributed computing, the generation of cloud computing can promote the revolutionary change of the whole internet mode and the enterprise management mode in concept.
Cloud gaming (Cloud gaming), also known as game on demand (gaming), is an online gaming technology based on Cloud computing technology. Cloud game technology enables light-end devices (thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not operated in a player game terminal but in a cloud server, and the cloud server renders the game scene into a video and audio stream which is transmitted to the player game terminal through a network. The player game terminal does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring player input instructions and sending the instructions to the cloud server.
Fig. 2 shows an overall architecture diagram of the cloud game application scenario according to the embodiment of the present application. As shown in fig. 2, the application scenario involves architecture facilities such as a cloud game server 210, a proxy server 220, a cloud game client 230, and the like.
The cloud game server 210 is a real running location of a game program, converts a picture generated by a game into an audio/video stream through a virtualization technology, and transmits the audio/video stream to the proxy server 220 for further processing. The cloud game server 210 may be a cloud server, or may be a cloud game server cluster formed by a plurality of cloud servers.
The proxy server 220 is usually deployed at an edge node close to the user 240, and in the technical solution provided in the embodiment of the present application, the proxy server 220 may use an original socket to simulate a TCP protocol to transmit audio and video downlink data to the cloud game client 230, so as to achieve the effects of high throughput and low delay.
The core capability of the cloud game client 230 may be understood as a network video stream player, which can present the network video stream-based game content to the user 240 when receiving the audio and video downlink data transmitted by the proxy server 220. Meanwhile, the cloud game client 230 may receive game interaction data input by the user 240 through various input devices such as a touch screen, a mouse, a keyboard, a handle, and the like, and sequentially return the game interaction data input by the user to the proxy server 220 and the cloud game server 210 along an uplink path.
The technical solution provided by the embodiment of the present application may be mainly executed by the proxy server 220. Fig. 3 is an architecture detail diagram of a system architecture for data transmission according to an embodiment of the present application. As shown in fig. 3, the proxy server 220 may be divided into two parts for implementing data upstream and data downstream, respectively, as a whole. The part for realizing data downlink comprises the following steps: a cloud game server communication module 221, a state memory module 222, a user state protocol stack 223 and a packet sending module 224. The part for realizing data downlink comprises the following steps: a packet receiving module 225, a congestion detection module 226, and a congestion feedback module 227. The functions of the related architecture modules are described in detail below in connection with the data transmission process.
The downlink traffic data transmission process is as follows.
The cloud game server 210 compresses the picture generated by the game into audio and video streams, and transmits the audio and video streams to the proxy server 220 through the high-speed VPN network.
The cloud game server communication module 221 in the proxy server 220 is responsible for receiving data and splitting the data into multiple video frames.
Each video frame will be recorded by the state memory module 222, and each data segment is sent and confirmed, and the limit size of each data segment is 1500-20 bytes IP header-20 bytes TCP header is 1460 bytes according to the limitation of the IP protocol.
The data segment to be sent recorded in the state memory module 222 can be constructed into a corresponding TCP protocol data packet through the user state protocol stack 223.
After the user mode protocol stack 223 constructs an IP data packet, the IP data packet is sent to the cloud game client 230 through the original socket by the packet sending module 224.
The cloud game client 230 receives the data packet using a TCP socket application program interface (TCP socket API), decodes the data after restoring the data packet to a video frame, and then renders the data frame as a game screen.
The uplink traffic data transmission process is as follows.
The cloud game client 230 sends an ACK packet to the proxy server 220 after receiving a certain number of TCP packets.
The receive packet module 225 in the proxy server 220 uses the raw socket to receive multiple TCP packets returned by the cloud gaming client 230 and needs to distinguish which TCP connection these TCP packets belong to.
The acknowledgement packet (ACK packet) received by the packet receiving module 225 affects the data acknowledgement status in the status memory module 222 and enters the congestion detection module 226. The congestion detection module 226 detects whether the network has started to be congested according to the time when the data segment is completely transmitted and the time when the ACK packet of the data segment is received.
When the network starts to be congested, the congestion feedback module 227 sends the congestion condition to the cloud game server 210, and informs the cloud game server 210 to dynamically adjust the frame rate of the game and adjust the code rate of the video, so as to avoid the network congestion by reducing the data volume as a whole.
Based on the service data transmission process in the application scenario, the technical solution provided in the embodiment of the present application sends a data packet with a TCP packet format through an original socket, and essentially disguises a UDP protocol as a TCP protocol for use. For a data receiving end (such as a cloud game client), the process of receiving the data packet is based on a TCP protocol. For a data sending end (such as a cloud game server or a proxy server), a UDP protocol-based manner is adopted for sending the data packets. Therefore, the scheme of the embodiment of the application can take the advantages of two socket protocols into account, and more efficient and reliable data transmission is realized.
Fig. 4 is a flowchart illustrating steps of a data transmission method in an embodiment of the present application, where the method may be executed by a terminal device or a server, or may be executed by both the terminal device and the server, and the embodiment of the present application is described by taking as an example that the method is executed by the proxy server shown in fig. 2. As shown in fig. 4, the data transmission method may mainly include the following steps S410 to S430.
Step S410: and packaging the data segment to be sent recorded in the state memory into a downlink TCP data packet with a TCP message format based on the user state protocol stack.
Step S420: and sending the downlink TCP data packet to the client through the original socket so that the client receives the downlink TCP data packet through the TCP socket.
Step S430: when an uplink TCP data packet returned by the client is received through the original socket, a target TCP connection matched with the uplink TCP data packet is determined according to the identification information of the TCP connection recorded in the state memory, so that the uplink TCP data packet is transmitted to a server corresponding to the target TCP connection.
In the data transmission method provided by the embodiment of the application, the user mode protocol stack is used for data encapsulation, a TCP data packet simulating a TCP protocol can be generated, and further the TCP data packet is sent and received through the original socket, so that the TCP data packet with a TCP message format is sent based on a UDP (user datagram protocol) mode, reliable transmission can be realized, delay increase caused by data retransmission can be avoided, and the data transmission efficiency and the transmission reliability can be improved.
The following describes each method step of the data transmission method in the above embodiment in detail.
In step S410, the to-be-transmitted data segment recorded in the state memory is encapsulated into a downlink TCP data packet having a TCP packet format based on the user mode protocol stack.
The user mode protocol stack is a network protocol stack processing program realized on a Linux user mode, and the underlying support technology is called kernel bypass technology and can be subdivided into a complete kernel bypass and a partial kernel bypass. The idea is to bypass the kernel and directly give the network hardware device to the application program running in the user mode for use, and common kernel bypass technologies are implemented as PF _ RING, Snabbswitch, Netmap and DPDK. Based on the kernel bypass technology, a user can write a network protocol stack of the user, so that the functions of the protocol stack become more flexible, the user is concentrated on certain advanced characteristics, and data traffic forwarding control and performance improvement are realized according to specific service requirements.
Fig. 5 is a flowchart illustrating steps for encapsulating a downstream TCP packet based on a user mode protocol stack according to an embodiment of the present application. As shown in fig. 5, based on the above embodiment, the step S410 of encapsulating the to-be-sent data segment recorded in the state memory into a downlink TCP data packet having a TCP packet format based on the user mode protocol stack may include the following steps S510 to S540.
Step S510: the method comprises the steps of obtaining data to be sent generated by a server, and splitting the data to be sent into a plurality of data frames.
Taking a cloud game application scene as an example, in the running process of a game program, a cloud game server can compress pictures generated by the game into audio and video streams and transmit the audio and video streams to a proxy server through a high-speed VPN network, and the proxy server splits the received audio and video streams to obtain a plurality of data frames.
Step S520: and segmenting the data frame based on a user mode protocol stack to obtain a plurality of data segments with specified byte length, and recording the data segments in a state memory.
The limit size of each block is 1500-20 bytes IP header-20 bytes TCP header 1460 bytes, depending on the IP protocol constraints. Within the allowed range of each IP packet, removing 20 bytes occupied by the TCP header, and in the rest 1460 bytes (which are equivalent to the body part of the data packet), the first 2 bytes of the body part are the real length of the current data packet; therefore, for the client, every 1460 bytes at most is the length information of the next data segment. On the basis of the user mode protocol stack, the data of the video frame is cut into a plurality of data segments, and the length of each data segment is not more than 1460-2-1458 bytes. The video frames are sent to the client through a plurality of data segments, and finally the client is spliced into a complete video frame.
Step S530: and determining the TCP sequence number of each data segment according to the arrangement sequence of the data segments in the data frame and the data quantity of the data segments.
The TCP sequence number is used to track the amount of data sent over the TCP connection, for example, the TCP sequence number of the first data segment is 100, the data amount thereof is 300 bytes, and then the TCP sequence number of the second data segment after the arrangement thereof is 100+300 ═ 400. The ordering of data segment transmissions may be maintained based on the TCP sequence numbers.
Step S540: and respectively adding a TCP packet header carrying a TCP serial number to each data segment to obtain a downlink TCP data packet with a TCP message format.
For example, the size of a video frame is 100kb, and the maximum value of each data segment is preset to be 1460 bytes-10 bytes reserved to 1450 bytes, so that the 100kb data needs to be divided into 100 × 1024/1450 bytes to 71 data segments.
The 71 segmented data segments represent that the proxy server sends 71 IP data packets, and the TCP headers of the 71 IP data packets are concatenated according to the sequence order using the sequence numbers of the TCP. Eventually, the client receives a complete frame of data in sequence.
Because the user mode protocol stack and the original socket are used, when a TCP data packet is packaged, the problem of layer-by-layer copy does not exist in the data, and the data to be sent can directly enter a sending buffer area of a driver stage, so that the performance acceleration effect similar to zero copy is brought.
In step S420, the downlink TCP packet is sent to the client through the original socket, so that the client receives the downlink TCP packet through the TCP socket.
In one embodiment of the present application, in order to achieve reliable transmission, a redundancy mechanism may be employed for data transmission. According to the embodiment of the application, when the downlink TCP data packet is sent through the original socket, the sending time node of the downlink TCP data packet can be obtained, and the network transmission state of each time node is monitored, so that a data transmission peak period with a certain time length is determined, and the data transmission peak period is a time interval dynamically adjusted according to the network transmission state. And if the sending time node is not in the data transmission peak period, sending the downlink TCP data packet to the client through the original socket. And if the sending time node is in the data transmission peak period, acquiring the redundancy proportion of the downlink TCP data packet, and sending the downlink TCP data packet and the redundancy data packet corresponding to the redundancy proportion to the client through the original socket.
In one embodiment of the application, importance information of a data segment corresponding to a downlink TCP data packet and a data length of a data frame where the data segment is located are obtained; and determining the redundancy proportion of the downlink TCP data packet according to the importance degree information and the data length. For data with a high degree of importance and for data frames with a large amount of data, a relatively large redundancy ratio can be determined.
In one embodiment of the present application, a method for transmitting data based on a redundancy mechanism may include: copying the downlink TCP data packet according to the redundancy proportion to obtain one or more redundancy data packets with the same content as the downlink TCP data packet; and sending the downlink TCP data packet and the redundant data packet to the client through the original socket.
For example, when the redundancy ratio is N: 1, each downstream TCP packet may go through a copy operation to form another N-1 redundant packets with identical contents. The downlink TCP data packet and the redundant data packet are sent to the client together, even if a certain TCP data packet is lost, the redundant data packet can be used for supplementing, and long-time waiting of the client is avoided.
In one embodiment of the present application, a method for transmitting data based on a redundancy mechanism may include: carrying out XOR operation on a plurality of downlink TCP data packets with continuous TCP serial numbers according to the redundancy proportion to obtain a redundancy data packet associated with the plurality of downlink TCP data packets; and sending a plurality of downlink TCP data packets and redundant data packets to the client through the original socket.
For example, when the redundancy ratio is 1: and N, generating a redundant data packet associated with the downlink TCP data packets every N-1 downlink TCP data packets, wherein the redundant data packet is obtained by carrying out XOR operation on the N-1 downlink TCP data packets. After the N-1 downlink TCP data packets and the 1 redundant data packet are sent to the client, when any one downlink TCP data packet is lost, the other N-2 downlink TCP data packets and the redundant data packet can be used for performing reverse operation to obtain the data content of the lost TCP data packet.
In step S430, when an uplink TCP packet returned by the client is received through the original socket, a target TCP connection matching the uplink TCP packet is determined according to the identification information of the TCP connection recorded in the state memory, so as to transmit the uplink TCP packet to the server corresponding to the target TCP connection.
In the state memory, the TCP connections established between the servers and the clients may be recorded by using identification information, which may be, for example, four tuples of the TCP connections, i.e., a source IP address (source _ IP), a source port (source _ port), a destination IP address (destination _ IP), and a destination port (destination _ port).
In one embodiment of the application, when an uplink ACK data packet returned by a client is received through an original socket, a target TCP connection matched with the uplink ACK data packet is determined according to identification information of the TCP connection; acquiring a target data segment which is recorded in a state memory and corresponds to a target TCP connection and waits for confirmation; analyzing the uplink ACK data packet to obtain an acknowledgement number carried in the uplink ACK data packet; and updating the data confirmation state of the target data segment according to the confirmation number.
Different from the UDP protocol, in the embodiment of the present application, the TCP protocol is simulated by using the original socket, and for the client, after receiving the downlink TCP data packet, the uplink ACK data packet may be returned to the server to notify the server that the data packet is correctly received by the client.
In an embodiment of the present application, the proxy server may monitor the sending duration of the data segment waiting for acknowledgement recorded in the state memory in real time; and when the sending time length of the data segment exceeds a time length threshold value, retransmitting the data segment based on the user mode protocol stack, wherein the time length threshold value is smaller than the overtime time length defined by the TCP protocol stack. In the embodiment of the present application, the state memory records the sending condition of the data segment and the condition of receiving the ACK data packet. For a data segment which does not receive an ACK data packet for more than a certain time, the user mode protocol stack executes logic of 'timeout retransmission'. And, the time for the timeout retransmission is far shorter than the time defined by the TCP protocol stack, thereby bringing lower delay.
In an embodiment of the present application, the server may monitor a packet loss rate of a downlink TCP packet; when the packet loss rate is greater than a preset packet loss rate threshold, acquiring a TCP serial number of a downlink TCP data packet waiting for retransmission; generating a retransmission TCP packet header carrying a TCP serial number of a downlink TCP data packet waiting for retransmission; adding a retransmission TCP packet header to a data segment of the latest video frame recorded in the state memory to obtain a retransmission TCP data packet with a TCP message format; and sending the retransmission TCP data packet to the client through the original socket.
In an embodiment of the present application, a retransmission TCP header carries a retransmission identification field, where the retransmission identification field is used to instruct the client to discard data of other video frames before the latest video frame.
In an extreme case, a downlink TCP packet of a certain data segment may be lost many times, so that the client always waits for the packet, and a subsequent packet receiving process cannot be performed. Even if the data packet with this sequence number is finally complemented by a retransmission mechanism, the whole video stream will be stuck for a long time. The embodiment of the application solves the problem by configuring the retransmission TCP data packet carrying the identification field and adopting the technology of 'same sequence number but different content'. Generally, for a TCP packet with the same sequence number, the content of the retransmitted packet is identical to the content of the first transmission. While packets sent through the original socket can bypass this: when the packet loss rate is high, the retransmitted content directly transmits the fragment content of the latest video frame, and is described in the related field of the data header. After receiving the data, the client knows the information of the latest video frame according to the mark, then can discard the data of the old video frame and assemble the video frame data from the latest position. By the method, a certain frame loss phenomenon can occur on the picture, but the continuity of the game picture can be guaranteed.
In an embodiment of the application, a network congestion state when a downlink TCP data packet is transmitted to a client is determined according to data transmission time and data confirmation time of a data segment recorded in a state memory; and sending a dynamic adjustment request carrying a network congestion state to a server generating data to be sent, wherein the dynamic adjustment request is used for indicating the server to adjust the data volume of the data to be sent according to the network congestion state. Adjusting the data amount of the data to be transmitted may include, for example: and adjusting at least one of a code rate and a frame rate used when data encoding is performed on the data to be transmitted.
According to the embodiment of the application, a prediction model of the network bandwidth can be established, and the surplus of the network bandwidth transmitted by the current network is predicted according to the data sending time and the data confirmation time of the data section, so that the network congestion state is judged. When the network congestion degree is higher, the data volume of the data to be sent can be reduced by reducing the code rate and/or the frame rate of the code stream. When the network congestion degree is low, the data volume of the data to be sent can be recovered by improving the code rate and/or the frame rate of the code stream.
From the perspective of the operator, some operators usually drop UDP randomly during peak periods in order to avoid network congestion. For the unfriendly situation of the UDP protocol, the application of the UDP protocol has more experience problems during the peak period. In the embodiment of the application, the TCP protocol packet is simulated based on the user mode protocol stack and the original socket, but the TCP protocol packet is sent in a UDP mode, so that the strategy of an operator is avoided.
In addition, partial network equipment of the operator can modify the sliding window value of the TCP protocol, and the scheme can be successfully bypassed. For the client, although the window is reduced, the data packets from the server still continuously come, and the packet receiving is not influenced; in the aspect of transmission, most uplink data is only ACK data packets, the content is few, and the sliding window does not cause influence. For the server, the packet sending is based on the original socket, the TCP protocol stack is completely bypassed, and the data of the sliding window does not influence the subsequent packet sending strategy.
The embodiment of the application provides a scheme based on an original socket to perform TCP (transmission control protocol) protocol packaging aiming at an application scene that downlink data of a cloud game needs high bandwidth and low delay and the uplink data is very little, and finally achieves the effects of high sending performance, low delay, strong network jitter resistance, redundant sending, avoidance of packet loss of an operator and the like.
It should be noted that although the various steps of the methods in this application are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the shown steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
The following describes embodiments of an apparatus of the present application, which may be used to perform the data transmission method in the above embodiments of the present application. Fig. 6 schematically shows a block diagram of a data transmission apparatus according to an embodiment of the present application. As shown in fig. 6, the data transmission apparatus 600 may mainly include: an encapsulation module 610 configured to encapsulate the to-be-sent data segment recorded in the state memory into a downlink TCP data packet having a TCP packet format based on the user state protocol stack; a sending module 620 configured to send the downlink TCP data packet to a client through an original socket, so that the client receives the downlink TCP data packet through a TCP socket; a receiving module 630, configured to, when an uplink TCP data packet returned by the client is received through the original socket, determine a target TCP connection matching the uplink TCP data packet according to the identification information of the TCP connection recorded in the state memory, so as to transmit the uplink TCP data packet to a server corresponding to the target TCP connection.
In some embodiments of the present application, based on the above embodiments, the encapsulation module 610 includes: the data splitting unit is configured to acquire data to be sent generated by a server and split the data to be sent into a plurality of data frames; the data frame segmentation unit is configured to segment the data frame based on a user mode protocol stack to obtain a plurality of data segments with specified byte length, and record the data segments in a state memory; a sequence number determining unit configured to determine a TCP sequence number of each of the data segments according to an arrangement order of the data segments in the data frame and a data amount of the data segments; and the data packet encapsulation unit is configured to add a TCP packet header carrying the TCP serial number to each data segment to obtain a downlink TCP data packet with a TCP message format.
In some embodiments of the present application, based on the above embodiments, the data transmission apparatus 600 further includes: a connection determining module configured to determine, when an uplink ACK packet returned by the client is received through the original socket, a target TCP connection matching the uplink ACK packet according to the identification information of the TCP connection; a data segment determination module configured to obtain a target data segment, which is recorded in the state memory and corresponds to the target TCP connection and waits for acknowledgement; the data packet analysis module is configured to analyze the uplink ACK data packet to obtain an acknowledgement number carried in the uplink ACK data packet; and the state determining module is configured to update the data confirmation state of the target data segment according to the confirmation number.
In some embodiments of the present application, based on the above embodiments, the data transmission apparatus 600 further includes: the duration monitoring module is configured to monitor the sending duration of the data segment waiting for confirmation recorded in the state memory in real time; and the data retransmission module is configured to retransmit the data segment based on the user mode protocol stack when the sending time length of the data segment exceeds a time length threshold, wherein the time length threshold is smaller than the timeout time length defined by the TCP protocol stack.
In some embodiments of the present application, based on the above embodiments, the sending module 620 includes: a node acquisition unit configured to acquire a transmission time node of the downlink TCP packet; a non-redundant sending unit configured to send the downlink TCP packet to a client through an original socket if the sending time node is not in a data transmission peak time, where the data transmission peak time is a time interval dynamically adjusted according to a network transmission state; and the redundancy sending unit is configured to obtain the redundancy proportion of the downlink TCP data packet if the sending time node is in the data transmission peak period, and send the downlink TCP data packet and the redundancy data packet corresponding to the redundancy proportion to a client through an original socket.
In some embodiments of the present application, based on the above embodiments, the redundant transmitting unit includes: the information acquisition subunit is configured to acquire importance information of a data segment corresponding to the downlink TCP data packet and a data length of a data frame where the data segment is located; a redundancy ratio determining subunit configured to determine a redundancy ratio of the downlink TCP packet according to the importance information and the data length.
In some embodiments of the present application, based on the above embodiments, the sending module 620 further includes: a first redundancy operation unit configured to perform a copy operation on the downlink TCP data packet according to the redundancy ratio, so as to obtain one or more redundancy data packets having the same content as the downlink TCP data packet; a first sending unit configured to send the downlink TCP data packet and the redundant data packet to a client through an original socket.
In some embodiments of the present application, based on the above embodiments, the sending module 620 further includes: a second redundancy operation unit configured to perform an exclusive or operation on a plurality of downlink TCP packets having consecutive TCP sequence numbers according to the redundancy ratio to obtain one redundancy data packet associated with the plurality of downlink TCP packets; a second sending unit configured to send the plurality of downstream TCP packets and the redundant data packet to a client through an original socket.
In some embodiments of the present application, based on the above embodiments, the data transmission apparatus 600 further includes: a packet loss rate detection module configured to monitor a packet loss rate of the downlink TCP packet; a sequence number obtaining module configured to obtain a TCP sequence number of a downlink TCP data packet waiting for retransmission when the packet loss rate is greater than a preset packet loss rate threshold; a retransmission packet header generating module configured to generate a retransmission TCP packet header carrying a TCP sequence number of the downlink TCP packet waiting for retransmission; a retransmission data packet generation module configured to add the retransmission TCP packet header to the data segment of the latest video frame recorded in the state memory to obtain a retransmission TCP data packet having a TCP packet format; and the retransmission data packet sending module is configured to send the retransmission TCP data packet to the client through the original socket.
In some embodiments of the present application, based on the above embodiments, the retransmission TCP header carries a retransmission identification field, where the retransmission identification field is used to instruct the client to discard data of other video frames before the latest video frame.
In some embodiments of the present application, based on the above embodiments, the data transmission apparatus 600 further includes: a congestion state determination module configured to determine a network congestion state when a downlink TCP packet is transmitted to the client according to data transmission time and data acknowledgement time of the data segment recorded in the state memory; and the data volume adjusting module is configured to send a dynamic adjusting request carrying the network congestion state to a server generating data to be sent, wherein the dynamic adjusting request is used for indicating the server to adjust the data volume of the data to be sent according to the network congestion state.
In some embodiments of the present application, based on the above embodiments, the data amount adjustment module is further configured to adjust at least one of a code rate and a frame rate used when data encoding is performed on the data to be transmitted.
The specific details of the data transmission device provided in each embodiment of the present application have been described in detail in the corresponding method embodiment, and are not described herein again.
Fig. 7 schematically shows a block diagram of a computer system of an electronic device for implementing an embodiment of the present application.
It should be noted that the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701 that can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the random access memory 703, various programs and data necessary for system operation are also stored. The cpu 701, the rom 702, and the ram 703 are connected to each other via a bus 704. An Input/Output interface 705(Input/Output interface, i.e., I/O interface) is also connected to the bus 704.
The following components are connected to the input/output interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a local area network card, a modem, and the like. The communication section 709 performs communication processing via a network such as the internet. A driver 710 is also connected to the input/output interface 705 as necessary. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present application, the processes described in the various method flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the central processor 701, performs various functions defined in the system of the present application.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A method of data transmission, comprising:
packaging the data segment to be sent recorded in the state memory into a downlink TCP data packet with a TCP message format based on a user state protocol stack;
sending the downlink TCP data packet to a client through an original socket so that the client receives the downlink TCP data packet through a TCP socket;
when an uplink TCP data packet returned by the client is received through the original socket, a target TCP connection matched with the uplink TCP data packet is determined according to the identification information of the TCP connection recorded in the state memory, so that the uplink TCP data packet is transmitted to a server corresponding to the target TCP connection.
2. The data transmission method according to claim 1, wherein encapsulating the to-be-transmitted data segment recorded in the state memory into a downlink TCP data packet having a TCP packet format based on a user mode protocol stack comprises:
acquiring data to be sent generated by a server, and splitting the data to be sent into a plurality of data frames;
based on a user mode protocol stack, the data frame is segmented to obtain a plurality of data segments with specified byte length, and the data segments are recorded in a state memory;
determining the TCP sequence number of each data segment according to the arrangement sequence of the data segments in the data frame and the data quantity of the data segments;
and respectively adding a TCP packet header carrying the TCP serial number to each data segment to obtain a downlink TCP data packet with a TCP message format.
3. The data transmission method of claim 1, further comprising:
when an uplink ACK data packet returned by the client is received through the original socket, determining a target TCP connection matched with the uplink ACK data packet according to the identification information of the TCP connection;
acquiring a target data segment which is recorded in the state memory and corresponds to the target TCP connection and waits for confirmation;
analyzing the uplink ACK data packet to obtain an acknowledgement number carried in the uplink ACK data packet;
and updating the data confirmation state of the target data segment according to the confirmation number.
4. The data transmission method of claim 1, further comprising:
monitoring the sending duration of the data segment waiting for confirmation recorded in the state memory in real time;
and when the sending time length of the data segment exceeds a time length threshold value, retransmitting the data segment based on the user mode protocol stack, wherein the time length threshold value is smaller than the overtime time length defined by the TCP protocol stack.
5. The data transmission method according to claim 1, wherein sending the downstream TCP packet to the client through the original socket comprises:
acquiring a sending time node of the downlink TCP data packet;
if the sending time node is not in the data transmission peak period, sending the downlink TCP data packet to a client through an original socket, wherein the data transmission peak period is a time interval dynamically adjusted according to the network transmission state;
and if the sending time node is in the data transmission peak period, acquiring the redundancy proportion of the downlink TCP data packet, and sending the downlink TCP data packet and the redundancy data packet corresponding to the redundancy proportion to a client through an original socket.
6. The data transmission method according to claim 5, wherein obtaining the redundancy ratio of the downlink TCP packet comprises:
acquiring importance degree information of a data segment corresponding to the downlink TCP data packet and data length of a data frame where the data segment is located;
and determining the redundancy proportion of the downlink TCP data packet according to the importance degree information and the data length.
7. The data transmission method according to claim 5, wherein sending the downstream TCP packet and the redundancy packet corresponding to the redundancy ratio to a client through an original socket comprises:
copying the downlink TCP data packet according to the redundancy proportion to obtain one or more redundancy data packets with the same content as the downlink TCP data packet;
and sending the downlink TCP data packet and the redundant data packet to a client through an original socket.
8. The data transmission method according to claim 5, wherein sending the downstream TCP packet and the redundancy packet corresponding to the redundancy ratio to a client through an original socket comprises:
carrying out XOR operation on a plurality of downlink TCP data packets with continuous TCP serial numbers according to the redundancy proportion to obtain a redundancy data packet associated with the downlink TCP data packets;
and sending the plurality of downlink TCP data packets and the redundant data packets to a client through an original socket.
9. The data transmission method according to any one of claims 1 to 8, characterized in that the method further comprises:
monitoring the packet loss rate of the downlink TCP data packet;
when the packet loss rate is greater than a preset packet loss rate threshold, acquiring a TCP serial number of a downlink TCP data packet waiting for retransmission;
generating a retransmission TCP packet header carrying the TCP serial number of the downlink TCP data packet waiting for retransmission;
adding the retransmission TCP packet header to the data segment of the latest video frame recorded in the state memory to obtain a retransmission TCP data packet with a TCP message format;
and sending the retransmission TCP data packet to a client through an original socket.
10. The data transmission method according to claim 9, wherein the retransmission TCP header carries a retransmission identification field, and the retransmission identification field is used to instruct the client to discard data of other video frames before the latest video frame.
11. The data transmission method according to any one of claims 1 to 8, characterized in that the method further comprises:
determining a network congestion state when a downlink TCP data packet is transmitted to the client according to the data sending time and the data confirmation time of the data segment recorded in the state memory;
and sending a dynamic adjustment request carrying the network congestion state to a server generating data to be sent, wherein the dynamic adjustment request is used for indicating the server to adjust the data volume of the data to be sent according to the network congestion state.
12. The data transmission method according to claim 11, wherein adjusting the data amount of the data to be transmitted comprises:
and adjusting at least one of a code rate and a frame rate used when the data to be transmitted are subjected to data coding.
13. A data transmission apparatus, comprising:
the encapsulation module is configured to encapsulate the to-be-sent data segment recorded in the state memory into a downlink TCP data packet with a TCP message format based on a user state protocol stack;
a sending module configured to send the downlink TCP data packet to a client through an original socket, so that the client receives the downlink TCP data packet through a TCP socket;
and the receiving module is configured to determine a target TCP connection matched with the uplink TCP data packet according to the identification information of the TCP connection recorded in the state memory when the uplink TCP data packet returned by the client is received through the original socket, so as to transmit the uplink TCP data packet to a server corresponding to the target TCP connection.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the data transmission method of any one of claims 1 to 12.
15. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data transmission method of any one of claims 1 to 12 via execution of the executable instructions.
CN202110367888.2A 2021-04-06 2021-04-06 Data transmission method and device, computer readable medium and electronic equipment Active CN112953850B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110367888.2A CN112953850B (en) 2021-04-06 2021-04-06 Data transmission method and device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110367888.2A CN112953850B (en) 2021-04-06 2021-04-06 Data transmission method and device, computer readable medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112953850A true CN112953850A (en) 2021-06-11
CN112953850B CN112953850B (en) 2022-09-02

Family

ID=76232298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110367888.2A Active CN112953850B (en) 2021-04-06 2021-04-06 Data transmission method and device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112953850B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422823A (en) * 2021-12-27 2022-04-29 炫彩互动网络科技有限公司 Improved cloud game stream stable transmission method
CN114500399A (en) * 2021-12-28 2022-05-13 赛尔网络有限公司 Data transmission method, apparatus, medium and product
CN114821635A (en) * 2022-03-31 2022-07-29 慧之安信息技术股份有限公司 View library deployment alarm method based on deep learning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266426A1 (en) * 2006-05-12 2007-11-15 International Business Machines Corporation Method and system for protecting against denial of service attacks using trust, quality of service, personalization, and hide port messages
US20170206906A1 (en) * 2014-07-08 2017-07-20 Samsung Electronics Co., Ltd. Method and apparatus for sending multimedia data
CN107222793A (en) * 2017-05-05 2017-09-29 浙江大华技术股份有限公司 A kind of method and device of data transfer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266426A1 (en) * 2006-05-12 2007-11-15 International Business Machines Corporation Method and system for protecting against denial of service attacks using trust, quality of service, personalization, and hide port messages
US20170206906A1 (en) * 2014-07-08 2017-07-20 Samsung Electronics Co., Ltd. Method and apparatus for sending multimedia data
CN107222793A (en) * 2017-05-05 2017-09-29 浙江大华技术股份有限公司 A kind of method and device of data transfer

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王天竹 等: "《嗅探模式 Web 过滤器设计与实现》", 《辽宁科技大学学报》 *
祝永晋等: "《基于前向纠错的自适应网络传输机制》", 《计算机应用》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422823A (en) * 2021-12-27 2022-04-29 炫彩互动网络科技有限公司 Improved cloud game stream stable transmission method
CN114500399A (en) * 2021-12-28 2022-05-13 赛尔网络有限公司 Data transmission method, apparatus, medium and product
CN114821635A (en) * 2022-03-31 2022-07-29 慧之安信息技术股份有限公司 View library deployment alarm method based on deep learning

Also Published As

Publication number Publication date
CN112953850B (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN112953850B (en) Data transmission method and device, computer readable medium and electronic equipment
US11770429B2 (en) System and method for streaming content from multiple servers
US20230083441A1 (en) Managing subpacket transmission and reception for advanced interactive services
JP4363847B2 (en) Digital TV application protocol for interactive TV
US9578074B2 (en) Adaptive content transmission
WO2020248649A1 (en) Audio and video data synchronous playback method, apparatus and system, electronic device and medium
US20230060066A1 (en) Data transmission method and apparatus, computer readable medium, and electronic device
US20230118176A1 (en) Data transmission method and apparatus, computer-readable storage medium, electronic device, and computer program product
US20230071243A1 (en) Conserving network resources during transmission of packets of interactive services
JP2004529410A (en) Service gateway for interactive TV
US20230070702A1 (en) Data transmission method and apparatus, computer readable medium, and electronic device
KR20160142850A (en) Method and apparatus for signaling and operation of low delay consumption of media data in mmt
CN113973052A (en) Cloud network system, data transmission method, computing node and storage medium
WO2023217188A1 (en) Livestream data transmission method, apparatus and system, device and medium
CN113285931A (en) Streaming media transmission method, streaming media server and streaming media system
EP1821490A1 (en) Method for transmitting graphical data to a thin client
Patel et al. Performance Analysis of Video On-demand and Live Video Streaming using Cloud based Services
US9942157B2 (en) Method and apparatus to avoid negative compression in consumer internet networks
KR20160087226A (en) System for cloud streaming service, method of image cloud streaming service considering terminal performance and apparatus for the same
WO2023142592A1 (en) Data transmission method and apparatus, computer readable medium, electronic device, and computer program product
WO2023213086A1 (en) Data processing method and apparatus, and computer-readable medium and electronic device
Liberatore et al. GiPSiNet: An open source/open architecture network middleware for surgical simulations
WO2024082882A1 (en) Multimedia content transmission methods, apparatus, device and storage medium
WO2024001451A1 (en) Processing method and apparatus for service data packet, and medium and electronic device
CN113660063B (en) Spatial audio data processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40046429

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant