CN111769910B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN111769910B
CN111769910B CN202010596329.4A CN202010596329A CN111769910B CN 111769910 B CN111769910 B CN 111769910B CN 202010596329 A CN202010596329 A CN 202010596329A CN 111769910 B CN111769910 B CN 111769910B
Authority
CN
China
Prior art keywords
proxy server
message
sent
client
signaling
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.)
Active
Application number
CN202010596329.4A
Other languages
Chinese (zh)
Other versions
CN111769910A (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN202010596329.4A priority Critical patent/CN111769910B/en
Publication of CN111769910A publication Critical patent/CN111769910A/en
Application granted granted Critical
Publication of CN111769910B publication Critical patent/CN111769910B/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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0023Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the signalling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The embodiment of the invention provides a data transmission method and a device, wherein the method comprises the following steps: the proxy server determines that the message to be sent is in accordance with an upper application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message of a client and an application server in the process of establishing connection; the proxy server packages the message to be sent through upper layer application to obtain a signaling package; wherein the deferred sending mechanism of the proxy server is set to be disabled; and the proxy server sends the signaling packet through the kernel. Compared with the mode of packaging by a delay sending mechanism and confirming by a delay confirming mechanism in the prior art, the method reduces the delay generated when the client and the application server establish the connection, and accelerates the speed of data transmission.

Description

Data transmission method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data transmission method and apparatus.
Background
With the development and popularization of the internet, the requirements for the information transmission speed and efficiency in the internet are relatively increased. For example, an ACK delayed acknowledgement mechanism and a nagle algorithm are arranged in a computer to ensure the accuracy of information transmission and the utilization rate of a broadband in the information transmission process, so that the waste of network resources is reduced.
For the transmission of the RTMP protocol, before the audio and video data starts, the client and the application server generate a plurality of small messages for communication so as to establish network connection, the length of the small messages is very short, a large number of small messages are sent independently, and accordingly a large number of network resources are occupied. In order to reduce network bandwidth occupation and improve network utilization rate, a mainstream TCP/IP protocol stack at present starts a nagle algorithm under a certain condition for transmission of small messages of the communications, and thus, the small messages of the communications are sent after being packaged in a kernel. In addition, in order to prevent the situations of repeated transmission or missed transmission of the small messages and the like, an ACK delay confirmation mechanism is started, so that the client and the application server reply an ACK confirmation response every time the small messages or the message packets are received. However, the nagle algorithm and the ACK delayed acknowledgement mechanism are simultaneously turned on, which increases the network connection time between the client and the application server, and slows down the subsequent data transmission.
Therefore, there is a need for a data transmission method and apparatus for increasing the speed of data transmission.
Disclosure of Invention
The embodiment of the invention provides a data transmission method and device, which are used for accelerating the data transmission speed.
In a first aspect, an embodiment of the present invention provides a data transmission method, where the method includes:
the proxy server determines that the message to be sent is in accordance with an upper application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message of a client and an application server in the process of establishing connection; the proxy server packs the message to be sent through upper layer application to obtain a signaling packet; wherein the deferred sending mechanism of the proxy server is set to be disabled; and the proxy server sends the signaling packet through the kernel.
By adopting the method, the proxy server packs the set signaling message through an upper-layer application packet packing mechanism, acquires the signaling packet and sends the signaling packet to the kernel; because the delayed sending mechanism is set to be disabled, the core directly sends the signaling packet. That is, after the core receives the signaling packet, the core directly sends the signaling packet correspondingly without judging the size of the signaling packet, so that the timeliness of signaling transmission is ensured. Compared with the prior art that the delayed sending mechanism and the delayed acknowledgement mechanism are simultaneously enabled. Wherein, the delayed sending mechanism: aiming at a plurality of small message packets, a single small message is sent firstly, and then one or a plurality of message packets consisting of the small messages are sent in sequence. A delayed acknowledgement mechanism: when the client confirms that the size of the received small message or packet is smaller than the set threshold, the client waits for 40ms and then sends an acknowledgement response, where 40ms is the delayed acknowledgement time of the linux system, and the delayed acknowledgement time of the windows system is 200ms, and therefore, the delayed acknowledgement time is not particularly limited, and the following content takes the 40ms delayed acknowledgement time of the linux system as an example for description. Taking the example that the delay sending mechanism is nagle algorithm and the delay confirmation mechanism is ACK delay confirmation mechanism, when the small messages of the communication are packed in the kernel by the nagle algorithm, one small message is sent first, and then the remaining small messages are packed into one or more message packets to be sent after the confirmation response of the receiving client or application server. In this case, when the small message or packet received by the client or the application server is smaller than the set threshold, the client or the application server delays for 40ms according to the ACK delay acknowledgement mechanism, and then sends an ACK acknowledgement response, and the application server or the client continues to send the remaining packet after receiving the ACK acknowledgement response. Therefore, a large 40ms delay is generated in the whole communication process, and the speed of subsequent data transmission is slowed down. Therefore, the present application applies the upper layer packet mechanism by disabling the delayed sending mechanism in the proxy server. Therefore, a large amount of 40ms delay generated when the client and the application server establish connection is eliminated, and the data transmission speed is increased. In one possible design, before the determining that the message to be sent conforms to the upper-layer application packaging mechanism by the proxy server, the method further includes: the proxy server receives a first connection request sent by a client; the first connection request is used for establishing network connection between the client and the proxy server; the message to be sent is a response signaling generated by the proxy server aiming at the first connection request; the proxy server sets a first delayed sending mechanism to be disabled; the first deferred sending mechanism is for information transfer between the proxy server and the client.
By adopting the method, before the proxy server sends the message, the proxy server establishes the network connection between the client and the proxy server by receiving the first connection request sent by the client, generates the response signaling aiming at the first connection request, packages at least one small message of the response by an upper application package mechanism to obtain the signaling package, sends the signaling package to the kernel, and further sends the signaling package by the kernel. And, in this process, the first deferred sending mechanism is set to be disabled. Therefore, the confirmation delay generated when the first delay sending mechanism sends the response signaling is eliminated, and the subsequent data transmission speed is accelerated.
In a possible design, after the proxy server receives the first connection request sent by the client, the method further includes: the proxy server sets a first delayed acknowledgement mechanism to be disabled; the first delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the client.
By adopting the method, after the proxy server receives the first connection request sent by the client, the first delayed acknowledgement mechanism is set to be forbidden. Here, the first delayed acknowledgement mechanism: and when the size of a small message or a message packet is smaller than a set threshold value, the system waits for 40ms to determine whether the small message or the message packet to be received still exists, and if the small message or the message packet to be received does not exist, a determination response is sent. Wherein, the waiting time is 40ms to expect that a plurality of small messages or message packets can be received in a short time, and then acknowledgement responses are returned for the plurality of small messages or message packets. The method and the device prevent the situation that the confirmation response is inundated and occupies a large amount of network bandwidth because the message receiving interval is small and the confirmation response is sent immediately after each message is received. Because the signaling packet sent by the proxy server through the upper layer application packet packaging mechanism is large, and correspondingly, most signaling packets received by the client are large, the client usually does not have a delay of waiting for 40ms, and the condition of delayed acknowledgement of the small message can be greatly eliminated; therefore, the effect of opening the first delayed acknowledgement mechanism to reduce the occupation of a large amount of network bandwidth by the acknowledgement response of the small message is limited, and on the contrary, unnecessary delay of data transmission is increased in the upper-layer application packet packaging mechanism; for the above reasons, when the upper layer application mechanism is applied, the first delayed acknowledgement mechanism is set to be disabled, so as to eliminate the data transmission delay increased by the starting of the first delayed acknowledgement mechanism and speed up the data transmission speed.
In one possible design, before the determining that the message to be sent conforms to the upper application packaging mechanism by the proxy server, the method further includes: the proxy server sends a second connection request to the application server side; the second connection request is used for establishing network connection between the proxy server and the application server; the message to be sent is a network flow creating parameter sent by the client to the proxy server; the proxy server sets a second deferred sending mechanism to be disabled; the second deferred sending mechanism is for information transfer between the proxy server and the application server.
By adopting the method, before the proxy server sends the message, the proxy server sends a second connection request to the application server so as to establish network connection between the proxy server and the application server, aiming at the small message of the network flow creation parameter corresponding to the second connection request, at least one small message of the network flow creation parameter is packaged through an upper-layer application packaging mechanism to obtain a signaling packet, and the signaling packet is sent to the kernel and further sent by the kernel. And the proxy server will set the second deferred delivery mechanism to disabled before sending the signaling packet to the kernel. In this way, the acknowledgement delay generated by the second deferred sending mechanism when sending the small packets and packet packets of the network flow creation parameters is eliminated. The timeliness of signaling packet transmission is increased, and the transmission mechanism is delayed to accelerate the transmission speed of subsequent data.
In one possible design, after the sending, by the proxy server, the second connection request to the application server, the method further includes: the proxy server sets a second delayed acknowledgement mechanism to be disabled; the second delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the application server.
By adopting the method, the second delayed confirmation mechanism is set to be forbidden after the second connection request is sent to the application server side by the proxy server. Here, the second delayed acknowledgement mechanism: and when the size of a small message or a message packet is smaller than a set threshold value, the system waits for 40ms to determine whether the small message or the message packet to be received still exists, and if the small message or the message packet to be received does not exist, a determination response is sent. Waiting for 40ms to expect that a plurality of small messages can be received in a short time, and then returning confirmation responses to the plurality of small messages. The method and the device prevent the condition that the message receiving interval is small, and the acknowledgement response is sent immediately after receiving one message, thereby causing the flooding of the acknowledgement response and occupying a large amount of network bandwidth. Because the signaling packet sent by the proxy server through the upper-layer application packet packaging mechanism is large, and correspondingly, most of the signaling packets received by the client are large, the client usually does not have a delay of waiting for 40ms, and the condition of delayed acknowledgement of the small message is greatly eliminated; therefore, the second delayed acknowledgement mechanism is opened to reduce the effect that the acknowledgement response of the small message occupies a large amount of network bandwidth, and on the contrary, unnecessary delay of data transmission is increased in the upper-layer application packet packaging mechanism; based on the above reasons, when the upper layer application mechanism is applied, the second delayed acknowledgement mechanism is set to be disabled, so as to eliminate the data transmission delay increased by the starting of the second delayed acknowledgement mechanism and accelerate the data transmission speed.
In one possible design, the proxy server setting the first delayed acknowledgment mechanism to disabled includes: the proxy server sets the first delayed acknowledgement mechanism to be disabled in a kernel reset function; the proxy server sets the second delayed acknowledgement mechanism to disabled, including: the proxy server sets the second delayed acknowledgement mechanism to disabled in a kernel reset function.
By adopting the method, the proxy server sets the first delay confirmation mechanism and the second delay confirmation mechanism to be forbidden through the kernel reset function, so that the first delay confirmation mechanism and the second delay confirmation mechanism are forbidden through the kernel reset function subsequently. Therefore, the delay confirmation response to the transmission of the smaller data packet is still prevented in the data transmission process, the time for establishing the network connection is increased, and the transmission of data is delayed.
In one possible design, after the proxy server sends the signaling packet through the kernel, the method further includes: the proxy server receives a first data message, wherein the data message is sent by the client or the application server; the proxy server enables the first delayed sending mechanism, the second delayed sending mechanism, the first delayed acknowledgement mechanism, and the second delayed acknowledgement mechanism.
By adopting the method, after the proxy server receives the first data message, the first delay sending mechanism, the second delay sending mechanism, the first delay confirmation mechanism and the second delay confirmation mechanism are started. Because, the size of the data packet during data transmission is generally much larger than the size of the signaling packet generated according to the set signaling message, but occasionally the data packet is smaller. Therefore, the first delayed sending mechanism, the second delayed sending mechanism, the first delayed confirmation mechanism and the second delayed confirmation mechanism are enabled, and the data transmission speed can be accelerated under the condition of ensuring the accuracy of data packet transmission.
In a second aspect, an embodiment of the present invention provides a data transmission apparatus, where the apparatus includes:
the processing module is used for determining that the message to be sent conforms to an upper application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message of a client and an application server in the process of establishing connection;
the processing module is also used for packing the message to be sent through upper layer application to obtain a signaling packet; wherein a deferred delivery mechanism of the proxy server is set to disabled;
and the transceiver module is used for sending the signaling packet through the kernel.
In a third aspect, an embodiment of the present invention further provides a computing device, including: a memory for storing a computer program; a processor for invoking the computer program stored in said memory for executing the method as described in the various possible designs of the first aspect according to the obtained program.
In a fourth aspect, embodiments of the present invention also provide a computer-readable non-volatile storage medium, which includes a computer-readable program, which, when read and executed by a computer, causes the computer to perform the method as set forth in the various possible designs of the first aspect.
These and other implementations of the invention will be more readily understood from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an architecture of a data transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for a proxy server to receive client push data according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for receiving client pull data by a proxy server according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a data transmission apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an architecture diagram of a data transmission method according to an embodiment of the present invention is provided; when data transmission is required between the client 102 and the application server 103, the data transmission is performed through the proxy server 101. Before data transmission occurs between the client 102 and the application server 103, the proxy server 101 establishes network connection with the client 102; during establishing network connection between the proxy server 101 and the client 102, the proxy server 101 receives a first connection request sent by the client 102, disables a first delayed sending mechanism, and generates a response signaling according to the first connection request; the response signaling comprises at least one small message which is a set signaling message needing to be packaged; the proxy server 101 packages the response signaling into a signaling package through an upper-layer application packaging mechanism, and sends the signaling package to the kernel of the proxy server 101, and further sends the signaling package to the client 102 through the kernel. After receiving the signaling packet corresponding to the response signaling, the client 102 sends a network flow creation parameter to the proxy server 101, and the proxy server 101 receives the network flow creation parameter and establishes network connection with the application server 103; during the network connection between the proxy server 101 and the application server 103, the proxy server 101 sends a second connection request to the application server 103, disables the second delayed sending mechanism, generates a signaling packet corresponding to the network flow creation parameter through an upper-layer application packaging mechanism according to a plurality of small messages in the received network flow creation parameter, sends the signaling packet to a kernel of the proxy server 101, and further sends the signaling packet to the application server 103 through the kernel. It should be noted here that the first connection request and the second connection request include: TCP3 handshake, and a protocol related to service logic, wherein the protocol related to service logic may be RTMP handshake, connection signaling, and the content of the first connection request and the second connection request is not limited.
Based on this, an embodiment of the present application provides a flow of a data transmission method, as shown in fig. 2, including:
step 201, the proxy server determines that the message to be sent is in accordance with the upper application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message of a client and an application server in the process of establishing connection;
here, the proxy server generates or receives a message to be sent, and determines that the message to be sent belongs to a signaling message known by the proxy server and can be set by an upper-layer application packaging mechanism. The message to be sent is a message of the client and the application server in the process of establishing connection.
Step 202, the proxy server packs the message to be sent through upper layer application to obtain a signaling packet; wherein a deferred delivery mechanism of the proxy server is set to disabled;
here, before the proxy server packages the message to be sent by the upper layer application, the proxy server sets the delayed sending mechanism to be disabled.
Step 203, the proxy server sends the signaling packet through the kernel.
By adopting the method, the proxy server packs the set signaling message through an upper-layer application packet packing mechanism to obtain the signaling packet, and sends the signaling packet to the kernel, wherein the signaling packet is a packet of a plurality of small messages; that is, after the kernel receives the signaling packet, the kernel directly sends the signaling packet correspondingly without judging the size of the signaling packet, so as to ensure the timeliness of signaling transmission. Compared with the prior art that the delayed sending mechanism and the delayed acknowledgement mechanism are simultaneously enabled. Wherein, the delayed sending mechanism: aiming at a plurality of small message packets, a single small message is sent firstly, and then one or a plurality of message packets consisting of the small messages are sent in sequence. The delayed acknowledgement mechanism acknowledges: when the client confirms that the size of the received small message or packet is smaller than the set threshold, the client sends an acknowledgement response after waiting for 40ms, where 40ms is the delay acknowledgement time of the linux system, and the delay acknowledgement time of the windows system is 200ms, and therefore the delay acknowledgement time is not specifically limited, and the following content takes the 40ms delay acknowledgement time of the linux system as an example for description. Taking the example that the delay sending mechanism is nagle algorithm and the delay confirmation mechanism is ACK delay confirmation mechanism, when the small messages of the communication are packed in the kernel by the nagle algorithm, one small message is sent first, and then the remaining small messages are packed into one or more message packets to be sent after the confirmation response of the receiving client or application server. In this case, when the small message or packet received by the client or the application server is smaller than the set threshold, the client or the application server delays for 40ms according to the ACK delay acknowledgement mechanism, and then sends an ACK acknowledgement response, and the application server or the client continues to send the remaining packet after receiving the ACK acknowledgement response. Therefore, a large 40ms delay is generated in the whole communication process, and the speed of subsequent data transmission is slowed down. Therefore, the application applies the upper layer packet mechanism by disabling the delayed sending mechanism in the proxy server. Therefore, a large amount of 40ms delay generated when the client and the application server establish connection is eliminated, and the data transmission speed is increased.
The embodiment of the application provides a method for establishing network connection between a proxy server and a client, wherein before the proxy server determines that a message to be sent conforms to an upper application packaging mechanism, the method further comprises the following steps:
the proxy server receives a first connection request sent by a client; the first connection request is used for establishing network connection between the client and the proxy server; the message to be sent is a response signaling generated by the proxy server aiming at the first connection request; the proxy server sets a first delayed sending mechanism to be disabled; the first deferred sending mechanism is for information transfer between the proxy server and the client. That is, when the proxy server establishes network connection with the client, the proxy server receives a first connection request sent by the client, and then generates a response signaling, wherein the response signaling is a message to be sent; after the first delay sending mechanism is set to be forbidden by the proxy server, the response signaling is packaged through an upper application packaging mechanism to obtain a signaling packet of the response signaling, and the signaling packet is sent to the kernel and sent to the client by the kernel. In this way, by disabling the first deferred sending mechanism and using the upper-layer application packet packaging mechanism, the acknowledgement response for the small message or the message packet does not need to be received, and the acknowledgement delay generated when the first deferred sending mechanism sends the response signaling is eliminated.
The embodiment of the present application provides another method for establishing a network connection between a proxy server and a client, where after the proxy server receives a first connection request sent by the client, the method further includes: the proxy server sets a first delayed acknowledgement mechanism to be disabled; the first delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the client. The ACK delayed acknowledgement mechanism, that is, the proxy server sets the first delayed acknowledgement mechanism to disabled after receiving the first connection request. The first delay confirmation mechanism is used for preventing the confirmation response from being sent immediately when receiving a small message or a message packet, so that the confirmation response is flooded, and a large amount of network bandwidth is occupied. After the small message packets are grouped into the signaling packet, if the signaling packet is small, the first delayed acknowledgement mechanism still waits for 40ms to return an acknowledgement response. Therefore, the opening of the first delayed acknowledgement mechanism may increase unnecessary delay of data transmission in the upper layer application packet packaging mechanism; based on the above reasons, when the upper layer application mechanism is applied, the first delayed acknowledgement mechanism is set to be disabled, so as to eliminate the data transmission delay increased by the starting of the first delayed acknowledgement mechanism and accelerate the data transmission speed.
The embodiment of the application provides a method for establishing network connection between a proxy server and an application server, wherein before the proxy server determines that a message to be sent conforms to an upper-layer application packaging mechanism, the method further comprises the following steps: the proxy server sends a second connection request to the application server side; the second connection request is used for establishing network connection between the proxy server and the application server; the message to be sent is a network flow establishing parameter sent by the client to the proxy server; the proxy server sets the second deferred sending mechanism to be disabled; the second deferred sending mechanism is for information transfer between the proxy server and the application server. That is to say, when the proxy server establishes network connection with the application server, the proxy server receives a network flow creation parameter sent by the client, sends a second connection request to the application server, and determines a message to be sent according to the network flow creation parameter; after the second delay sending mechanism is set to be forbidden by the proxy server, the message to be sent determined by the network flow creating parameters is packaged through an upper application packaging mechanism to obtain a signaling packet, and the signaling packet is sent to the kernel and sent to the application server side by the kernel. Therefore, by disabling the second delay sending mechanism and using the upper-layer application packet packaging mechanism, the confirmation delay generated when the second delay sending mechanism sends the small message and the message packet determined by the network flow creating parameter is reduced, the establishment of the network connection between the proxy server and the application server is accelerated, and the subsequent data transmission is accelerated.
The embodiment of the present application provides another method for establishing a network connection between a proxy server and an application server, where after the proxy server sends a second connection request to the application server, the method further includes: the proxy server sets a second delayed acknowledgement mechanism to be disabled; the second delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the application server. The ACK delayed acknowledgement mechanism means that the proxy server sets the second delayed acknowledgement mechanism to disabled after sending the second connection request. The second delay confirmation mechanism is used for preventing the confirmation response from being sent immediately when receiving a small message or a message packet, so that the confirmation response is flooded, and a large amount of network bandwidth is occupied. After the small message packets are grouped into the signaling packet, if the signaling packet is small, the second delayed acknowledgement mechanism still waits for 40ms to return an acknowledgement response. Therefore, the second delayed acknowledgement mechanism is started to add unnecessary delay of data transmission in the upper application packet packaging mechanism; for the above reasons, when the upper layer application mechanism is applied, the second delayed acknowledgement mechanism is set to be disabled, so as to eliminate the data transmission delay increased by the starting of the second delayed acknowledgement mechanism and accelerate the data transmission speed.
The embodiment of the application provides a method for setting a delayed acknowledgement mechanism, wherein the proxy server sets a first delayed acknowledgement mechanism to be forbidden, and the method comprises the following steps: the proxy server sets the first delayed acknowledgement mechanism to be disabled in a kernel reset function; the proxy server sets the second delayed acknowledgement mechanism to disabled, including: the proxy server sets the second delayed acknowledgement mechanism to disabled in a kernel reset function. Therefore, the first delay confirmation mechanism and the first delay confirmation mechanism are disabled through the kernel reset function, the time for establishing the network connection is shortened in the data transmission process, and the data transmission speed is accelerated.
An embodiment of the present application provides a data transmission method, where after the proxy server sends the signaling packet through a kernel, the method further includes: the proxy server receives a first data message, wherein the data message is sent by the client or the application server; the proxy server enables the first delayed sending mechanism, the second delayed sending mechanism, the first delayed acknowledgement mechanism, and the second delayed acknowledgement mechanism. That is, when the proxy server receives the first data packet, determines that the network connection is established and starts to transmit data, the first delayed sending mechanism, the second delayed sending mechanism, the first delayed acknowledgement mechanism and the second delayed acknowledgement mechanism are started. Since the size of the data packet is generally much larger than that of the signaling packet, and occasionally smaller data packets are generated, the first delayed transmission mechanism, the second delayed transmission mechanism, the first delayed acknowledgement mechanism and the second delayed acknowledgement mechanism are turned on to ensure the speed and accuracy of data packet transmission.
Based on the above processes, an embodiment of the present application provides a method process for a proxy server to receive data pushed by a client, where a first connection request and a second connection request are made to be connect signaling of TCP three-way handshake, RTMP handshake, and RTMP connection signaling, a first delayed sending mechanism and a second delayed sending mechanism are made to be nagle algorithm, and a first delayed acknowledgement mechanism and a second delayed acknowledgement mechanism are made to be ACK delayed acknowledgement mechanism, as shown in fig. 3, including:
step 301, the client sends a TCP three-way handshake to the proxy server, and the proxy server disables the nagle algorithm and ACK delayed acknowledgement mechanism of the proxy server and the client by setting TCP _ NODELAY =0 to TCP _ NODELAY =1 and TCP _ QUICKACK =0 to TCP _ quickak = 1. Wherein, TCP _ QUICKACK is a setting option after the proxy server receives the recv function of the client, and is applied to the proxy server of the Linux system. Also, because the kernel level resets each time it receives it, this option requires that it must be reset after each recv function.
Step 302, the client sends a connect signaling to the proxy server, and the proxy server generates a response signaling for the connect signaling after receiving the connect signaling. The response signaling at least includes a small message, for example, set Chunk size, set Peer Bandwidth, stream Begin, result of network connection, etc.
Step 303, the proxy server packs at least one small message corresponding to the response signaling through an upper layer application packet packing mechanism to obtain a signaling packet.
Step 304, the proxy server sends the signaling packet of the response signaling to the client.
Step 305, after receiving the signaling packet of the response signaling, the client sends the network flow creating parameter to the proxy server. The network stream creation parameter may comprise at least one small message, such as a releaseStream, FCPublish, createstrream, checkbw, etc.
Step 306, after receiving the network flow creating parameter, the proxy server generates a response signaling according to the network flow creating parameter and sends the response signaling to the client.
And 307, the client sends Publish signaling to the proxy server after receiving the response signaling corresponding to the network creation parameter.
And step 308, after receiving the Publish signaling, the proxy server sends a TCP three-way handshake to the application server, and the proxy server sets TCP _ NODELAY =0 to TCP _ NODELAY =1 and sets TCP _ QUICKACK =0 to TCP _ QUICKACK =1, so as to disable the nagle algorithm and the ACK delay acknowledgement mechanism of the proxy server and the application server. Wherein, TCP _ QUICKACK is a setting option after the proxy server sends the recv function of the application server side, and is applied to the proxy server of the Linux system. Also, because the kernel level resets each time it is sent, this option needs to be reset after each recv function.
Step 309, the proxy server arranges at least one small message corresponding to the network flow creating parameter, packages the small message by an upper-layer application packaging mechanism, and sends the small message to an application server; if the Publish signaling contains a plurality of small messages, packaging the small messages contained in the Publish signaling through an upper application group packaging mechanism, and sending the packaged small messages to an application server; or, at least one small message corresponding to the network flow creation parameter and a plurality of small messages contained in the Publish signaling may be packaged together by an upper layer application packaging mechanism and sent to the application server.
In step 310, the client receives a response signaling of the Publish signaling sent by the application server through the proxy server.
And 311, after receiving the response signaling of the Publish signaling, the client sends the onMetaData, the AVC header and the AAC header to the application server through the proxy server.
And step 312, the client sends the first audio and video data packet to the proxy server.
Step 313, after the proxy server receives the first audio/video data packet sent by the client, enabling a nagle algorithm and an ACK delay confirmation mechanism of the proxy server and the client, setting TCP _ NODELAY =1 as TCP _ NODELAY =0, and setting TCP _ QUICKACK =1 as TCP _ QUICKACK =0; and enabling a nagle algorithm and an ACK delay confirmation mechanism of the proxy server and the application server, setting TCP _ NODELAY =1 to TCP _ NODELAY =0, and setting TCP _ QUICKACK =1 to TCP _ QUICKACK =0.
And step 314, the agent server sends the first audio/video data packet to the application server, and continues the subsequent audio/video data packet transmission.
Based on the above process, an embodiment of the present application provides a method process for a proxy server to receive data pulled by a client, where a first connection request and a second connection request are connection signaling corresponding to TCP triple handshake, a first delayed sending mechanism and a second delayed sending mechanism are nagle algorithms, and a first delayed acknowledgement mechanism and a second delayed acknowledgement mechanism are ACK delayed acknowledgement mechanisms, as shown in fig. 4, the method process includes:
step 401, the client sends a TCP three-way handshake to the proxy server, and the proxy server disables the nagle algorithm and ACK delayed acknowledgement mechanism of the proxy server and the client by setting TCP _ NODELAY =0 to TCP _ NODELAY =1 and TCP _ QUICKACK =0 to TCP _ quickak = 1.
Wherein, TCP _ QUICKACK is a setting option after the proxy server receives the recv function of the client, and is applied to the proxy server of the Linux system. Also, because the kernel level resets each time it receives it, this option requires that it must be reset after each recv function.
Step 402, the client sends a connect signaling to the proxy server, and the proxy server generates a response signaling for the connect signaling after receiving the connect signaling. The response signaling at least includes one small message, for example, set Chunk size, set Window Acknowledgement size, and the like.
Step 403, the proxy server packages at least one small message corresponding to the response signaling through an upper-layer application packaging mechanism to obtain a signaling package.
Step 404, the proxy server sends the signaling packet of the response signaling to the client.
Step 405, after receiving the signaling packet of the response signaling, the client sends the network flow creating parameter to the proxy server. The network Stream creation parameter may include at least one small packet, such as createStream, get Stream length, and the like.
Step 406, after receiving the network flow creating parameter, the proxy server generates a response signaling according to the network flow creating parameter and sends the response signaling to the client.
Step 407, the client receives the response signaling corresponding to the network creation parameter and then sends the Play signaling and the Set Buffer Length signaling to the proxy server.
And step 408, after receiving the Play signaling and the Set Buffer Length signaling, the proxy server sends a TCP three-way handshake to the application server, and the proxy server disables the nagle algorithm and the ACK delayed acknowledgement mechanism of the proxy server and the application server by setting TCP _ NODELAY =0 to TCP _ NODELAY =1 and setting TCP _ QUICKACK =0 to TCP _ QUICKACK = 1. Wherein, TCP _ QUICKACK is a setting option after the proxy server receives the recv function of the client, and is applied to the proxy server of the Linux system. Also, because the kernel level resets each time it receives it, this option requires that it must be reset after each recv function. Step 409, the proxy server arranges at least one small message corresponding to the network flow creation parameter, packages the small message through an upper-layer application packaging mechanism, and sends the small message to an application server; if the Play signaling and the Set Buffer Length signaling contain a plurality of small messages, packaging the Play signaling and the Set Buffer Length signaling containing a plurality of small messages through an upper application packaging mechanism, and sending the packaged small messages to an application server; or at least one small message corresponding to the network flow creating parameter, a Play signaling and a Set Buffer Length signaling can be packaged together by an upper-layer application packaging mechanism and sent to an application server.
And step 410, the client receives the response signaling of the Play signaling sent by the application server and the onMetaData, the AVC header and the AAC header sent by the application server through the proxy server.
Step 411, the application server sends the first audio/video data packet to the proxy server.
Step 412, after the proxy server receives the first audio and video data packet sent by the application server, enabling a nagle algorithm and an ACK delay confirmation mechanism of the proxy server and the client, setting TCP _ NODELAY =1 as TCP _ NODELAY =0, and setting TCP _ QUICKACK =1 as TCP _ QUICKACK =0; and enabling a nagle algorithm and an ACK delay confirmation mechanism of the proxy server and the application server, setting TCP _ NODELAY =1 to TCP _ NODELAY =0, and setting TCP _ QUICKACK =1 to TCP _ QUICKACK =0.
And 413, the agent server sends the first audio and video data packet to the client, and continues the subsequent audio and video data packet transmission.
Based on the same concept, an embodiment of the present application provides a data transmission device, and fig. 5 is a schematic diagram of the data transmission device provided in the embodiment of the present application, as shown in fig. 5, including:
a processing module 501, configured to determine that a message to be sent conforms to an upper-layer application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message of a client and an application server in the process of establishing connection;
the processing module 501 is further configured to package the message to be sent through an upper layer application to obtain a signaling packet; wherein the deferred sending mechanism of the proxy server is set to be disabled;
a transceiver module 502, configured to send the signaling packet through the kernel.
In one possible design, the processing module 501 is further configured to: the proxy server receives a first connection request sent by a client; the first connection request is used for establishing network connection between the client and the proxy server; the message to be sent is a response signaling generated by the proxy server aiming at the first connection request; the proxy server sets a first delayed sending mechanism to be disabled; the first deferred sending mechanism is for information transfer between the proxy server and the client.
In one possible design, the processing module 501 is further configured to: the proxy server sets a first delayed acknowledgement mechanism to be disabled; the first delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the client.
In one possible design, the processing module 501 is further configured to: the proxy server sends a second connection request to the application server side; the first connection request is used for establishing network connection between the client and the proxy server; the message to be sent is a network flow creating parameter sent by the client to the proxy server; the proxy server sets a second deferred sending mechanism to be disabled; the second deferred sending mechanism is for information transfer between the proxy server and the application server.
In one possible design, the processing module 501 is further configured to: the proxy server sets a second delayed acknowledgement mechanism to be disabled; the second delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the application server.
In one possible design, the processing module 501 is specifically configured to: the proxy server sets the first delayed acknowledgement mechanism to be disabled in a kernel reset function; the proxy server sets the second delayed acknowledgement mechanism to disabled, including: the proxy server sets the second delayed acknowledgement mechanism to disabled in a kernel reset function.
In one possible design, the transceiver module 502 is further configured to: the proxy server receives a first data message, wherein the data message is sent by the client or the application server; the proxy server enables the first delayed sending mechanism, the second delayed sending mechanism, the first delayed acknowledgement mechanism, and the second delayed acknowledgement mechanism.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method of data transmission, the method comprising:
the proxy server determines that the message to be sent conforms to an upper application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message in the connection establishing process of a client and an application server, and is used for packaging at least one sub-message in the message to be sent; the proxy server packages the message to be sent through upper layer application to obtain a signaling package; wherein a deferred delivery mechanism of the proxy server is set to disabled;
and the proxy server sends the signaling packet through the kernel.
2. The method of claim 1, wherein the proxy server determining that the message to be sent is compliant with an upper layer application packaging mechanism further comprises:
the proxy server receives a first connection request sent by a client; the first connection request is used for establishing network connection between the client and the proxy server; the message to be sent is a response signaling generated by the proxy server aiming at the first connection request;
the proxy server sets a first delayed sending mechanism to be disabled; the first deferred sending mechanism is for information transfer between the proxy server and the client.
3. The method of claim 2, wherein after the proxy server receives the first connection request sent by the client, the method further comprises:
the proxy server sets a first delayed acknowledgement mechanism to be disabled; the first delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the client.
4. The method according to any one of claims 1 to 3,
before the proxy server determines that the message to be sent conforms to the upper-layer application packaging mechanism, the method further includes:
the proxy server sends a second connection request to the application server side; the second connection request is used for establishing network connection between the proxy server and the application server side; the message to be sent is a network flow creating parameter sent by the client to the proxy server;
the proxy server sets a second deferred sending mechanism to be disabled; the second deferred sending mechanism is for information transfer between the proxy server and the application server.
5. The method of claim 4, wherein after the proxy server sends the second connection request to the application server, further comprising:
the proxy server sets the second delayed acknowledgement mechanism to disabled; the second delayed acknowledgement mechanism is for an information acknowledgement mechanism between the proxy server and the application server.
6. The method of claim 3 or 5,
the proxy server sets the first delayed acknowledgement mechanism to be disabled, including:
the proxy server sets a first delay confirmation mechanism in a kernel reset function as forbidden;
the proxy server sets the second delayed acknowledgement mechanism to disabled, including:
the proxy server sets the second delayed acknowledgement mechanism to disabled in the kernel reset function.
7. The method of claim 4, wherein after the proxy server sends the signaling packet through a kernel, further comprising:
the proxy server receives a first data message, wherein the data message is sent by the client or the application server;
the proxy server enables a first delayed sending mechanism, a second delayed sending mechanism, a first delayed acknowledgement mechanism and a second delayed acknowledgement mechanism.
8. A data transmission apparatus, characterized in that the apparatus comprises:
the processing module is used for determining that the message to be sent is in accordance with an upper application packaging mechanism; the upper layer application packaging mechanism is suitable for a set signaling message in the connection establishing process of a client and an application server, and is used for packaging at least one sub-message in the message to be sent;
the processing module is further used for packing the message to be sent through an upper layer application to obtain a signaling packet; wherein the delayed sending mechanism of the proxy server is set to be disabled;
and the transceiver module is used for sending the signaling packet through the kernel.
9. A computer-readable storage medium, characterized in that the storage medium stores a program which, when run on a computer, causes the computer to carry out the method of any one of claims 1 to 7.
10. A computer device, comprising:
a memory for storing a computer program;
a processor for invoking a computer program stored in said memory for executing the method of any of claims 1 to 7 in accordance with the obtained program.
CN202010596329.4A 2020-06-28 2020-06-28 Data transmission method and device Active CN111769910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010596329.4A CN111769910B (en) 2020-06-28 2020-06-28 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010596329.4A CN111769910B (en) 2020-06-28 2020-06-28 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN111769910A CN111769910A (en) 2020-10-13
CN111769910B true CN111769910B (en) 2023-04-18

Family

ID=72722143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010596329.4A Active CN111769910B (en) 2020-06-28 2020-06-28 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN111769910B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596167A (en) * 2021-08-02 2021-11-02 北京金山云网络技术有限公司 Data transmission method and device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8171124B2 (en) * 2008-11-25 2012-05-01 Citrix Systems, Inc. Systems and methods for GSLB remote service monitoring
JP6126311B2 (en) * 2013-08-26 2017-05-10 ヴイエムウェア インコーポレイテッドVMware,Inc. CPU scheduler configured to support latency sensitive virtual machines
US10666534B2 (en) * 2015-06-29 2020-05-26 Citrix Systems, Inc. Systems and methods for measuring round trip time in network devices between the device and an endpoint

Also Published As

Publication number Publication date
CN111769910A (en) 2020-10-13

Similar Documents

Publication Publication Date Title
US9300733B2 (en) System and/or method for client-driven server load distribution
EP3547580B1 (en) Data sending method and apparatus, and data receiving method and apparatus
US8793384B2 (en) Recovery of disconnected channels over a reliable protocol
CN108494817A (en) Data transmission method, relevant apparatus and system
CN106790221B (en) Internet protocol security IPSec protocol encryption method and network equipment
JP7344315B2 (en) fire-and-forget offload mechanism for network-based services
CN107995233B (en) Method for establishing connection and corresponding equipment
WO2017185615A1 (en) Method for determining service status of service processing device and scheduling device
CN111769910B (en) Data transmission method and device
CN113301007A (en) Data transmission method, computing device and storage medium
CN111885004A (en) Application layer message transmission method and communication interface platform
CN110753035B (en) FPGA (field programmable Gate array) ultralow-delay communication transmission method based on TCP (Transmission control protocol)
CN114500528A (en) Data transmission method and device based on cloud platform
CN104811420A (en) Method and apparatus for preventing distributed denial of service (DDoS) attacks
CN112994848B (en) MCS (modulation and coding scheme) adjusting method and device, storage medium and wireless node
CN112311694A (en) Priority adjustment method and device
CN112667359B (en) Data transparent transmission method, electronic equipment and storage medium
CN116319569A (en) Network parameter updating method, network parameter updating device, medium and electronic equipment
WO2021103822A1 (en) Method for acquiring common maximum segment size (mss), and device
CN107172179B (en) Bilateral acceleration transmission method and system
CN113489775A (en) VPP-based seven-layer load balancing server and load balancing method
US8676993B1 (en) Bundled transmission control protocol connections
CN107506491B (en) OSD data distribution method and device of distributed file system
CN115396372B (en) Data stream rate control method, intelligent network card, cloud device and storage medium
CN116915860B (en) Instruction transmission method, device, equipment and medium based on UDP

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
GR01 Patent grant
GR01 Patent grant