WO2016000138A1 - 一种数据传输方法、终端和服务器 - Google Patents

一种数据传输方法、终端和服务器 Download PDF

Info

Publication number
WO2016000138A1
WO2016000138A1 PCT/CN2014/081180 CN2014081180W WO2016000138A1 WO 2016000138 A1 WO2016000138 A1 WO 2016000138A1 CN 2014081180 W CN2014081180 W CN 2014081180W WO 2016000138 A1 WO2016000138 A1 WO 2016000138A1
Authority
WO
WIPO (PCT)
Prior art keywords
descriptor
file
terminal
data
server
Prior art date
Application number
PCT/CN2014/081180
Other languages
English (en)
French (fr)
Inventor
申一中
张晓光
Original Assignee
北京新媒传信科技有限公司
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 北京新媒传信科技有限公司 filed Critical 北京新媒传信科技有限公司
Priority to CN201480012225.7A priority Critical patent/CN105580334B/zh
Priority to PCT/CN2014/081180 priority patent/WO2016000138A1/zh
Publication of WO2016000138A1 publication Critical patent/WO2016000138A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication

Definitions

  • the present invention relates to the field of network communication technologies, and in particular, to a data transmission method, a terminal, and a server.
  • BACKGROUND OF THE INVENTION In a communication scenario, both parties of a communication often send some files to each other. When the file data is relatively large, the performance of the transmission greatly affects the user experience, and the high-speed and smooth transmission of data is the most basic requirement.
  • FIG. 1 a schematic diagram of a method for transmitting data between clients in an existing scheme is shown.
  • the client C1 needs to transmit data to the client C2
  • the arrow in FIG. 1 shows the path of the data transmission
  • the client C1 transmits the data to the server through the NAT (Network Address Translation) device A, and then The server sends the data to the client C2 via the NAT device A.
  • NAT Network Address Translation
  • an embodiment of the present invention provides a data transmission method, a terminal, and a server.
  • an embodiment of the present invention provides a data transmission method, including:
  • the server When the server establishes a transmission control protocol TCP connection with the transmitting terminal and the receiving terminal, the server generates a first connection descriptor and a second connection descriptor for the sending terminal and the receiving terminal according to the TCP connection established by the sending terminal and the receiving terminal, respectively.
  • the server When the transmitting terminal needs to transmit the data file to the receiving terminal, the server receives the file descriptor transmitted by the sending terminal through the TCP connection and the identifier of the receiving terminal according to the first connection descriptor, and the file descriptor is generated by the sending terminal according to the data file to be transmitted; Transmitting, by the server, the file descriptor to the receiving terminal according to the second connection descriptor, so that the transmitting terminal and the receiving terminal utilize the file descriptor, by using a user data protocol between the transmitting terminal and the receiving terminal
  • the UDP connection transfers data files.
  • an embodiment of the present invention provides a data transmission method, including:
  • the transmitting terminal When the transmitting terminal needs to transmit the data file to the receiving terminal, the transmitting terminal generates a file descriptor according to the data file to be transmitted, and transmits the file descriptor and the identifier of the receiving terminal to the server through the TCP connection established with the server to pass the server. Transmitting the file descriptor to the receiving terminal; the transmitting terminal establishes between the receiving terminal and the receiving terminal according to the file information described in the file descriptor
  • the data file is transmitted to the receiving terminal.
  • an embodiment of the present invention provides a data transmission method, including:
  • the receiving terminal receives the server through
  • the receiving terminal receives the data file transmitted by the transmitting terminal according to the file information described in the file descriptor by using the UDP connection established with the transmitting terminal, and updates the file descriptor according to the receiving result.
  • an embodiment of the present invention provides a server, including:
  • connection establishing unit configured to: when the server establishes a transmission control protocol TCP connection with the sending terminal and the receiving terminal, generate a first connection descriptor and a second connection description for the sending terminal and the receiving terminal according to the TCP connection established by the sending terminal and the receiving terminal respectively Symbol,
  • a descriptor receiving unit configured to: when the transmitting terminal needs to transmit a data file to the receiving terminal, receive, according to the first connection descriptor, a file descriptor transmitted by the transmitting terminal through the TCP connection and an identifier of the receiving terminal, where the file descriptor is used by the sending terminal according to the need The transmitted data file is generated;
  • a descriptor transmission unit configured to transmit the file descriptor to the receiving terminal according to the second connection descriptor, so that the sending terminal and the receiving terminal use the file descriptor to transmit data through a user data protocol UDP connection between the sending terminal and the receiving terminal file.
  • an embodiment of the present invention provides a terminal, including:
  • a descriptor uploading unit configured to: when the transmitting terminal needs to transmit a data file to the receiving terminal, generate a file descriptor according to the data file to be transmitted, and transmit the file descriptor and the identifier of the receiving terminal to the TCP connection established by the server to a server to transmit the file descriptor to the receiving terminal through the server;
  • a UDP connection established between the terminals transmits the data file to the receiving terminal.
  • an embodiment of the present invention provides a terminal, including:
  • a descriptor receiving unit configured to: when the transmitting terminal needs to transmit a data file to the receiving terminal, receive a file descriptor from the sending terminal that is transmitted by the server through the TCP connection, and the file descriptor is generated by the sending terminal according to the data file to be transmitted;
  • a data file transmission unit configured to receive, by using a UDP connection established with the transmitting terminal, a data file transmitted by the transmitting terminal according to the file information described in the file descriptor, and update the file descriptor according to the received result.
  • a direct UDP connection is established between the terminals, and the data file is transmitted between the terminals by the UDP connection, and the file descriptor is transmitted through the TCP connection between the terminal and the server, due to the data of the file descriptor.
  • the amount is much smaller than the data file, which greatly reduces the data processing pressure of the server in the system.
  • the data speed of the UDP direct communication path between the terminals is relatively high, especially the terminals located in the same local area network, so that the data can be quickly transmitted, and the file descriptor ensures the integrity and correctness of the data transmission between the terminals.
  • the solution provided by the embodiment of the present invention can achieve the technical effect of transmitting data at high speed and stably under a large user amount scenario.
  • FIG. 1 is a schematic diagram showing a method for transmitting data between clients in an existing solution
  • FIG. 2 is a system configuration diagram of a communication scenario to which the present solution is applied, according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram showing the workflow of a server according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram showing a data transmission method according to an embodiment of the present invention
  • FIG. 5 shows a schematic diagram of a dual buffer queue according to an embodiment of the present invention
  • FIG. 6 shows a flow chart of a method of data transmission in accordance with one embodiment of the present invention
  • FIG. 7 is a flowchart of still another method for data transmission according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a server according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • FIG. 10 is a block diagram showing the structure of still another terminal according to an embodiment of the present invention.
  • FIG. 2 a system structure diagram of a communication scenario to which the present solution is applied is shown in the embodiment of the present invention.
  • the system includes a terminal C1, a terminal C2, a terminal D1, and a terminal D2; a NAT (Network Address Translation) device A and a NAT device B, and a server.
  • Terminal C1 and terminal C2 are located on the same local area network
  • terminal D1 and terminal D2 are located on the same local area network.
  • the terminal C1 needs to send a data file to the terminal C2, and a UDP (User Datagram Protocol) connection is established between the terminal C1 and the terminal C2.
  • UDP User Datagram Protocol
  • Terminal C1 establishes a TCP (Transmission Control Protocol) connection with the server.
  • TCP Transmission Control Protocol
  • Terminal C2 establishes a TCP connection with the server.
  • the terminal C1 registers the terminal C1 local information on the server, and the registration information includes the connection descriptor corresponding to the terminal C1, and may also include the identifier of the terminal C1.
  • the terminal C2 registers the terminal C2 local information on the secondary server, and the registration information includes the terminal.
  • connection descriptor corresponding to C2 may also include the identifier of the terminal C2.
  • Terminal C1 sends a file descriptor to the server over a TCP connection.
  • the server sends the file descriptor of the terminal C1 to the terminal C2 through the TCP connection.
  • Terminal C1 and terminal C2 use UDP connection between each other according to file descriptors. Multi-threaded send and receive data files.
  • the server Through the TCP transmission mode between the server and the terminal, the data integrity can be ensured, the packet loss error during the data transmission process, the data packet repeated transmission error, and the data breakpoint retransmission information can be synchronized.
  • the main transmission data is some control information, so the server can support high-speed and stable transmission and reception of large connection amount and small data piece.
  • FIG. 3 a workflow diagram of a server according to an embodiment of the present invention is shown, which includes the following steps:
  • step S300 The server determines whether to continue to perform data transmission and reception operations cyclically. If yes, the process goes to step S301, if the data transmission and reception operation is skipped.
  • S301 The server uses the epoll communication model to wait for a method call through the epoll event. When a method call occurs, go to S302.
  • S302 The server determines whether the event invoked by the method includes a trigger event. When the number of trigger events is greater than 0, the process proceeds to S303. Otherwise, the process proceeds to S309.
  • S303 The server determines the triggered event, and determines which events are triggered by the event.
  • the server determines the type of the trigger event. For example, the server can get a pointer to the event data and get the type of trigger event from the pointer.
  • S306 The server establishes a new connection with the terminal, and the terminal registers the local information on the server. After the connection is successfully established, the server receives the data sent by the terminal.
  • S307 The server receives the data sent by the terminal by using a connection established with the terminal.
  • S309 The server processes system events.
  • S310 The server processes the timeout connection.
  • the specific processing manners of S309 and S310 are not limited herein. Referring to FIG. 4, in a data transmission method provided by an embodiment of the present invention, a server may perform the following operations:
  • S400 When the server establishes a transmission control protocol TCP connection with the sending terminal and the receiving terminal, the server generates a first connection descriptor and a second connection descriptor for the sending terminal and the receiving terminal according to the TCP connection established by the sending terminal and the receiving terminal, respectively.
  • Connection Descriptor Used to determine a unique network socket whose definition is represented by the following pseudocode: Connection Descriptor ⁇
  • the server generates a first connection descriptor according to the network socket corresponding to the TCP connection of the sending terminal and the corresponding auxiliary identifier; the server generates the first according to the network socket corresponding to the TCP connection of the receiving terminal and the corresponding auxiliary identifier.
  • Two connection descriptors Two connection descriptors.
  • a network socket and a 64-bit integer increment (auxiliary identifier) combination are used to form a connection descriptor to determine a unique network connection, and when a large number of connections are concurrent, the failed network packet can be avoided to the newly created connection. Cause interference.
  • the server receives, according to the first connection descriptor, a file descriptor transmitted by the sending terminal through the TCP connection and an identifier of the receiving terminal, where the file descriptor is transmitted by the sending terminal according to the data file to be transmitted. generate.
  • the double buffer queue is used to process data transmission and reception, for example, a double buffer queue for writing and sending file descriptors is set on the server side, wherein, at the same time, the state of one cache queue is a write buffer queue, and The status of a cache queue is the send buffer queue; at the current moment, the server uses the forwarding logic processing thread to add the file descriptor to the current write cache queue, such as adding the data descriptor generated for the file descriptor to the write cache.
  • the queue thus implements adding the file descriptor to the write operation, and transmits the corresponding file descriptor in the current transmit buffer queue to the receiving terminal by using the 10 sending thread.
  • the state of the write buffer queue and the send buffer queue may remain unchanged, and the state of the two cache queues may be exchanged, that is, the state of the write buffer queue at the current moment is the send buffer queue at the current moment, the current moment.
  • the status of the send buffer queue at the next moment is the write cache queue to improve the utilization of cache resources.
  • the server can perform data write operations while still being able to perform data write operations. It is enough to perform data transmission operations and improve data transmission performance.
  • the server searches for all terminals that have established a connection with the server according to the identifier of the receiving terminal reported by the sending terminal, and obtains a second connection descriptor of the receiving terminal.
  • the connection descriptor and the identifier of the terminal are saved in the registration information generated when the terminal establishes a connection with the server, and the server searches for the second connection descriptor of the receiving terminal by searching in the registration information.
  • the server processes the thread using the forwarding logic, generates a data descriptor based on the found second terminal descriptor of the receiving terminal and the file descriptor from the transmitting terminal, as follows:
  • Data Descriptor Used to describe the network packets (such as file descriptors) received and to be sent by the server. It can be represented by the following pseudo code:
  • the data start position indicates a starting storage location of the file descriptor and the second connection descriptor in the pre-allocated descriptor pool
  • the data length indicates the size of the file descriptor and the second connection descriptor.
  • the server uses the forwarding logic thread to add the data descriptor to the current write cache queue.
  • the server performs a write operation
  • the corresponding file descriptor is written into the pre-allocated descriptor pool based on the data descriptor in the current write cache queue.
  • This embodiment uses a pool of pre-allocated descriptors to store and manage file descriptors, avoiding performance loss due to descriptor creation and destruction operations.
  • S402 The server transmits the file descriptor to the receiving terminal according to the second connection descriptor, so that the sending terminal and the receiving terminal use the file descriptor to transmit the data file through the UDP connection between the sending terminal and the receiving terminal.
  • this step includes the following operations:
  • the 10 send thread extracts the corresponding file descriptor from the pre-allocated descriptor pool according to the data descriptor in the current send buffer queue, and according to the second connection descriptor in the data descriptor The extracted file descriptor is sent to the receiving terminal.
  • the above server can work in the epoll communication mode of the Linux system, and satisfies the following implementation mode.
  • the server enables the port reuse function by parameter setting, such as the SO_REUSEADDR parameter;
  • the server sets the socket to non-blocking mode by parameter setting, such as 0_NONBLOCK parameter;
  • the server prohibits the combined sending of data by parameter setting, such as the TCP_NODELAY parameter;
  • the epoll mode can provide multiplexed 10 interfaces under Linux, which can improve the CPU utilization of the program when there is only a small amount of active connections in large concurrent connections.
  • the server can set the server to work in the epoll communication mode of the Linux system by calling the Server Operation 10 (Input/Output) control method.
  • the order of parameter setting in the above 1) to 3) is not limited, and the parameter setting in 1) to 3) may be completed before the server performs data monitoring on the transmitting terminal and the receiving terminal.
  • the solution guarantees the data file by combining epoll communication mode, port reuse, non-blocking mode, prohibiting merge sending, pre-allocating descriptor pool and double-buffer sending queue (sending data to the background sending queue while transmitting data). Transmission performance.
  • the descriptor in this embodiment uses a set of key data to represent information such as the position, size, and state of the actual object, but is not the operation object itself.
  • an integer value is used to indicate the path between the two parties, and the system determines the connection between the two parties through the socket.
  • a method for data transmission provided by an embodiment of the present invention, as shown in FIG. 6, includes the following operations:
  • the sending terminal generates a file descriptor according to the data file to be transmitted, and transmits the file descriptor and the identifier of the receiving terminal to the server through a TCP connection established with the server, so as to transmit the file descriptor to the receiving terminal through the server.
  • the transmitting terminal transmits the data control information and the verification information to the server through the file descriptor via a TCP connection established with the server, and the server forwards the information to the receiving terminal.
  • the information includes the data size, the check code, the data file is divided into the number of small data segments, the data segment size, and the check code of the data segment.
  • the data file will be split into small pieces of data, and no data fragments will be generated with serial numbers and verification codes (eg.
  • the CRC verification code), the serial number and the verification code are forwarded by the server to the receiving terminal through the TCP connection.
  • the file information described in the file descriptor includes: a total length of the data file, a check code of the data file, a sequence of segments composed of one or more file segment descriptors, and a number of segments.
  • the checksum of the data file can be implemented using the MD5 value of the data file.
  • the file descriptor can be expressed as follows: File Descriptor ⁇
  • Fragment sequence //composed of multiple file fragment descriptors
  • the file fragment descriptor includes a fragment identifier, a fragment length, a fragment check code, and a fragment status indicating whether the fragment is successfully transmitted.
  • the check code of the clip file can be implemented by using the CRC value of the clip file, and the clip descriptor can be expressed as follows:
  • the transmitting terminal transmits the data file to the receiving terminal by using a UDP connection established with the receiving terminal according to the file information described in the file descriptor.
  • the data segments are sent directly from the sending terminal to the receiving terminal directly by the UDP connection and then reassembled into data files.
  • the data file when the data file is not divided into multiple data segments, the data file itself can be regarded as a segment.
  • the embodiment further includes: in the data file transmission process, the sending terminal receives the updated file descriptor from the receiving terminal transmitted by the server through the TCP connection; and the sending terminal determines whether the data file is successfully transmitted according to the updated file descriptor. If yes, the sending terminal ends the transfer operation. If not, the transmitting terminal retransmits the fragment with the failed transmission to the receiving terminal through the UDP connection.
  • the sending terminal may determine whether the data file is successfully transmitted by: the sending terminal parses the sequence of the segment in the updated file descriptor, and determines whether the segment status in all the file segment descriptors in the parsed segment sequence indicates that the transmission is successful. If yes, if the status value of the fragment status is 1, confirm that the data file transmission is successful; if not, if the status value of the fragment status is 0, obtain a fragment corresponding to the fragment status indicating that the transmission failed, and confirm that it needs to be sent to the receiving terminal. Resend the fragment.
  • FIG. 7 Another method for data transmission provided by an embodiment of the present invention, as shown in FIG. 7, includes the following operations:
  • the receiving terminal receives a file descriptor from the sending terminal that is transmitted by the server through the TCP connection, and the file descriptor is generated by the sending terminal according to the data file to be transmitted.
  • the specific content of the file descriptor can be found in the related description above.
  • the receiving terminal receives the data file transmitted by the sending terminal according to the file information described in the file descriptor through a UDP connection established with the transmitting terminal, and updates the file description according to the received result.
  • the receiving terminal uses the same algorithm as the check code of the generated data file (such as the MD5 algorithm), calculates the check value of the received data file, and obtains the check value of the calculated data file and the check code of the data file. For the reception result of the data file, when the two are the same, it is determined that the reception result is that the data file is correctly received;
  • the check code of the generated data file such as the MD5 algorithm
  • the receiving terminal uses the same algorithm as the check code of the generated segment (such as the CRC algorithm), calculates the check value of the received segment, and obtains the segment based on the calculated check value of the segment and the segment check code. Receiving the result, when the two are the same, it is determined that the reception result is that the segment is correctly received.
  • the check code of the generated segment such as the CRC algorithm
  • the receiving terminal may perform the following operations according to the data receiving result:
  • the receiving terminal may update the file descriptor according to the receiving result, specifically: when the receiving result is that the segment receiving is successful, the receiving terminal updates the corresponding segment state in the file descriptor to be correctly received, for example, the receiving terminal sets the state value of the segment state to 1.
  • the receiving terminal receives the corresponding segment retransmitted by the transmitting terminal through the UDP connection, and updates the file descriptor according to the receiving result of the retransmitted segment.
  • the receiving terminal as the receiving side can also discard the repeated segments when the same segment is repeatedly received according to the file descriptor.
  • the receiving terminal can also write the small file data to the disk once after receiving the small file data. For large file data, write to disk in incremental mode.
  • the above-mentioned terminal (transmitting terminal) as a sender and a terminal (receiving terminal) as a receiving party can transmit and receive data packets by using multiple threads to increase the speed of data transmission.
  • the terminal of the solution has at least the following features:
  • the terminal transmits data files through a UDP connection
  • the terminal can send and receive data packets using multiple threads
  • the receiving terminal checks that the received segment is not correctly received, and synchronizes the status to the sender terminal;
  • the receiving terminal checks the repeatedly received fragments and discards them;
  • the receiving terminal can write the small file data to the disk at one time;
  • the receiving terminal can write large file data to the disk in increments.
  • the technical solution can reduce the data processing pressure of the server, provide services for more users, and can complete the transmission of the data file faster through the UDP direct connection between the terminals (the network delay is small).
  • the embodiment of the present invention further provides a server 800.
  • the server 800 includes: a connection establishing unit 810, configured to: when the server establishes a transmission control protocol TCP connection with the sending terminal and the receiving terminal, according to the sending terminal and the receiving terminal.
  • the established TCP connection generates a first connection descriptor and a second connection descriptor for the transmitting terminal and the receiving terminal, respectively.
  • connection establishing unit 810 is configured to generate a first connection descriptor according to the network socket corresponding to the TCP connection of the sending terminal and the corresponding auxiliary identifier; according to the network socket corresponding to the TCP connection of the receiving terminal, and corresponding The secondary identity generates a second connection descriptor.
  • the descriptor receiving unit 811 is configured to: when the transmitting terminal needs to transmit the data file to the receiving terminal, receive, according to the first connection descriptor, a file descriptor transmitted by the transmitting terminal through the TCP connection and an identifier of the receiving terminal, where the file descriptor is determined by the sending terminal according to the Data file generation that needs to be transferred.
  • the descriptor receiving unit 811 is configured to: according to the identifier of the receiving terminal reported by the sending terminal, find all terminals that have established a connection with the server, and obtain a second connection descriptor of the receiving terminal; a connection descriptor and a file descriptor from the transmitting terminal generate a data descriptor, the data descriptor including a second connection descriptor, a connection IP address, a connection port number, a data start position, and a data length; Add to the current write cache queue; when performing a write operation, write the corresponding file descriptor into the pre-allocated descriptor pool according to the data descriptor in the current write cache queue, where the data start position indication File descriptor and second connection descriptor in the pre-allocated descriptor pool The starting storage location, the data length indicating the size of the file descriptor and the second connection descriptor.
  • the descriptor transmission unit 812 is configured to transmit the file descriptor to the receiving terminal according to the second connection descriptor, so that the sending terminal and the receiving terminal use the file descriptor to transmit through the user data protocol UDP connection between the sending terminal and the receiving terminal. data files.
  • the descriptor transmission unit 812 is configured to use the 10 sending thread to extract the corresponding file descriptor from the pre-allocated descriptor pool according to the data descriptor in the current sending buffer queue, and according to the data descriptor
  • the second connection descriptor sends the extracted file descriptor to the receiving terminal; wherein, the data starting position indicates a starting storage location of the file descriptor and the second connection descriptor in the pre-allocated descriptor pool, and the data length indication file description And the size of the second connection descriptor.
  • the server 800 further includes: a double buffer control unit 813, configured to set a double buffer queue for writing and sending file descriptors, wherein, at the same time, the state of one cache queue is a write cache queue, and the other cache The status of the queue is the transmit buffer queue; at the current time, the forwarding logic processing thread control descriptor receiving unit 811 adds the file descriptor to the current write buffer queue, and the 10 transmit thread control descriptor transmission unit 812 uses the current The corresponding file descriptor in the send buffer queue is sent to the receiving terminal.
  • a double buffer control unit 813 configured to set a double buffer queue for writing and sending file descriptors, wherein, at the same time, the state of one cache queue is a write cache queue, and the other cache The status of the queue is the transmit buffer queue; at the current time, the forwarding logic processing thread control descriptor receiving unit 811 adds the file descriptor to the current write buffer queue, and the 10 transmit thread control descriptor transmission unit 812 uses the current The corresponding file
  • the server 800 provided in this embodiment works in the epoll communication mode of the Linux system; and the server 800 enables the port reuse function by parameter setting; the server 800 sets the socket to the non-blocking mode by parameter setting; the server 800 prohibits the merge by parameter setting. send data.
  • the server invokes the server operation 10 control method to set the server to work in the epoll communication mode of the Linux system and implement the above parameter settings.
  • a terminal 900 as a data sender provided by an embodiment of the present invention includes the following:
  • the descriptor uploading unit 910 is configured to: when the transmitting terminal needs to transmit the data file to the receiving terminal, generate a file descriptor according to the data file to be transmitted, and transmit the file descriptor and the identifier of the receiving terminal by using a TCP connection established with the server. To the server to transmit the file descriptor to the receiving terminal through the server.
  • the file information described in the file descriptor includes: the total length of the data file, the check code of the data file, the sequence of fragments consisting of one or more file fragment descriptors, and the number of fragments.
  • the file fragment descriptor includes the fragment identifier, the fragment length, the fragment check code, and whether the fragment is successfully transmitted. Fragment status.
  • the data file sending unit 911 is configured to transmit the data file to the receiving terminal by using a UDP connection established with the receiving terminal according to the file information described in the file descriptor. Specifically, the data file sending unit 911 is configured to parse the segment sequence in the updated file descriptor, and determine whether the segment status in all the file segment descriptors in the parsed segment sequence indicates that the transmission is successful, and if yes, confirm the current data. The file transmission succeeds; if not, the segment corresponding to the segment status indicating that the transmission failed is obtained, and it is confirmed that the segment needs to be retransmitted to the receiving terminal.
  • the descriptor uploading unit 910 is further configured to receive, by the TCP connection, the updated file descriptor transmitted by the server from the receiving terminal during the data file transmission.
  • the data file sending unit 911 is configured to determine, according to the updated file descriptor, whether the data file is successfully transmitted, and if so, terminate the current transmission operation, and if not, retransmit the fragment with the failed transmission to the receiving terminal through the UDP connection.
  • a terminal 1000 as a data receiver provided by an embodiment of the present invention, as shown in FIG. 10, includes the following:
  • the descriptor receiving unit 1010 is configured to: when the transmitting terminal needs to transmit the data file to the receiving terminal, receive the file descriptor from the sending terminal transmitted by the server through the TCP connection, and the file descriptor is generated by the sending terminal according to the data file to be transmitted.
  • the file information described in the file descriptor includes: a total length of the data file, a check code of the data file, a sequence of fragments consisting of one or more file fragment descriptors, and a number of segments; wherein the file fragment descriptor includes the fragment identifier , fragment length, fragment check code, and fragment status indicating whether the fragment was successfully transmitted;
  • the data file receiving unit 1011 is configured to receive, by using a UDP connection established with the transmitting terminal, a data file transmitted by the transmitting terminal according to the file information described in the file descriptor, and update the file descriptor according to the receiving result. Specifically, the data file receiving unit 1011 is configured to calculate a check value of the received data file, and obtain a receiving result of the data file according to the calculated check value of the data file and a check code of the data file; and, the data The file receiving unit 1011 is configured to calculate a check value of the received segment, and obtain a receiving result of the segment according to the calculated check value of the segment and the segment check code.
  • the data file receiving unit 1011 is configured to update the corresponding segment status in the file descriptor to be correctly received when the receiving result is that the segment receiving is successful.
  • the data file receiving unit 1011 is configured to: when the receiving result is that the segment receiving fails, receive the corresponding segment that the transmitting terminal retransmits through the UDP connection, and update the file descriptor according to the receiving result of the retransmitted segment.
  • the data file receiving unit 1011 is configured to discard the repeated segments when the same segment is repeatedly received according to the file descriptor.
  • a direct UDP connection is established between the terminals, and the data file is transmitted between the terminals by the UDP connection, and the file descriptor is transmitted through the TCP connection between the terminal and the server, due to the data of the file descriptor.
  • the amount is much smaller than the data file, which greatly reduces the data processing pressure of the server in the system.
  • the data speed of the UDP direct communication path between the terminals is relatively high, especially the terminals located in the same local area network, so that the data can be quickly transmitted, and the file descriptor ensures the integrity and correctness of the data transmission between the terminals.
  • the solution provided by the embodiment of the invention can achieve the technical effect of high-speed and stable data transmission in a large-quantity scenario.
  • the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further, they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • combinations of features of different embodiments are intended to be within the scope of the invention and the various embodiments.
  • the words “first” and “second” are used to distinguish the same or similar items whose functions and functions are substantially the same, in the field.
  • the skilled person can understand that the words “first”, “second” and the like do not limit the quantity and execution order.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种数据传输方法、终端和服务器。该传输方法包括:当服务器与发送终端和接收终端建立TCP连接时,服务器根据发送终端和接收终端建立的TCP连接分别为发送终端和接收终端生成第一连接描述符和第二连接描述符,当发送终端需要向接收终端传输数据文件时,服务器根据第一连接描述符接收发送终端通过TCP连接传输的文件描符和接收终端的标识,文件描述符由发送终端根据需要传输的数据文件生成;服务器根据第二连接描述符将文件描述符传输至接收终端,以使发送终端和接收终端利用文件描述符,通过发送终端和接收终端之间的UDP连接传输数据文件。

Description

一种数据传输方法、 终端和服务器 技术领域 本发明涉及网络通信技术领域, 特别涉及一种数据传输方法、 终端和服务 器。 发明背景 在通信场景中, 通信的双方经常会发送一些文件给对方, 当文件数据比较 大时, 传输的性能就很影响用户体验, 能高速平稳传输数据是最基本的需求。
目前一些通信软件, 如即时通信软件, 釆用服务器中转的方式发送数据文 件。 参见图 1 , 示出了现有方案中客户端之间传输数据的方法示意图。 客户端 C1需要向客户端 C2传输数据时, 图 1中的箭头示出了数据传输的路径, 客户 端 C1将数据先通过 NAT ( Network Address Translation, 网络地址转换)设备 A 传输至服务器, 再由服务器将数据经由 NAT设备 A发送至客户端 C2。
现有方案至少具有如下缺陷:
整个系统中, 对文件服务器的性能要求比较高, 如果同时发送文件的用户 量大, 文件服务器会成为影响系统性能的瓶颈, 导致系统中数据传输速度緩慢。 在一些极端情况下, 即使位于局域网内的两个用户, 经由服务器中转发送数据 时, 也会出现非常严重的网络延迟。 发明内容 为了解决上述问题, 或者部分地解决上述问题, 本发明实施例提供了一种 数据传输方法、 终端和服务器。
为了达到上述目的, 本发明实施例釆用的技术方案如下:
一方面, 本发明实施例提供了一种数据传输方法, 包括:
当服务器与发送终端和接收终端建立传输控制协议 TCP连接时, 服务器根 据发送终端和接收终端建立的 TCP连接分别为发送终端和接收终端生成第一连 接描述符和第二连接描述符,
当发送终端需要向接收终端传输数据文件时, 服务器根据第一连接描述符 接收发送终端通过 TCP连接传输的文件描述符和接收终端的标识, 文件描述符 由发送终端根据需要传输的数据文件生成; 服务器根据第二连接描述符将文件描述符传输至接收终端, 以使发送终端 和接收终端利用文件描述符, 通过发送终端和接收终端之间的用户数据协议
UDP连接传输数据文件。
再一方面, 本发明实施例提供了一种数据传输的方法, 包括:
当发送终端需要向接收终端传输数据文件时, 发送终端根据需要传输的数 据文件生成文件描述符, 并通过与服务器建立的 TCP连接, 将文件描述符和接 收终端的标识传输至服务器, 以通过服务器将文件描述符传输至接收终端; 发送终端按照文件描述符中描述的文件信息, 通过与接收终端之间建立的
UDP连接, 将数据文件传输至接收终端。
再一方面, 本发明实施例提供了一种数据传输的方法, 包括:
当发送终端需要向接收终端传输数据文件时, 接收终端接收服务器通过
TCP 连接传输的来自发送终端的文件描述符, 文件描述符由发送终端根据需要 传输的数据文件生成;
接收终端通过与发送终端之间建立的 UDP连接, 接收发送终端按照文件描 述符中描述的文件信息传输的数据文件, 并根据接收结果更新文件描述符。
再一方面, 本发明实施例提供了一种服务器, 包括:
连接建立单元, 用于当服务器与发送终端和接收终端建立传输控制协议 TCP连接时, 根据发送终端和接收终端建立的 TCP连接分别为发送终端和接收 终端生成第一连接描述符和第二连接描述符,
描述符接收单元, 用于当发送终端需要向接收终端传输数据文件时, 根据 第一连接描述符接收发送终端通过 TCP连接传输的文件描述符和接收终端的标 识, 文件描述符由发送终端根据需要传输的数据文件生成;
描述符传输单元, 用于根据第二连接描述符将文件描述符传输至接收终端, 以使发送终端和接收终端利用文件描述符, 通过发送终端和接收终端之间的用 户数据协议 UDP连接传输数据文件。
再一方面, 本发明实施例提供了一种终端, 包括:
描述符上传单元, 用于当发送终端需要向接收终端传输数据文件时, 根据 需要传输的数据文件生成文件描述符, 并通过与服务器建立的 TCP连接, 将文 件描述符和接收终端的标识传输至服务器, 以通过服务器将文件描述符传输至 接收终端;
数据文件传输单元, 用于按照文件描述符中描述的文件信息, 通过与接收 终端之间建立的 UDP连接, 将数据文件传输至接收终端。
再一方面, 本发明实施例提供了一种终端, 包括:
描述符接收单元, 用于当发送终端需要向接收终端传输数据文件时, 接收 服务器通过 TCP连接传输的来自发送终端的文件描述符, 文件描述符由发送终 端根据需要传输的数据文件生成;
数据文件传输单元, 用于通过与发送终端之间建立的 UDP连接, 接收发送 终端按照文件描述符中描述的文件信息传输的数据文件, 并根据接收结果更新 文件描述符。
本发明实施例的有益效果是:
本发明实施例通过在终端之间建立直接的 UDP连接, 由 UDP连接进行终 端之间数据文件的传输, 而通过终端与服务器之间的 TCP连接负责文件描述符 的传输, 由于文件描述符的数据量远小于数据文件, 大大降低了系统中服务器 的数据处理压力。 终端之间的 UDP直连通路的数据速度较高, 尤其是位于同一 局域网的终端, 从而能够实现数据的快速传输, 而通过文件描述符又保证了终 端之间数据传输的完整性和正确性。
由上, 本发明实施例提供的方案能够达到大用户量场景下高速、 稳定地传 输数据的技术效果。
上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发明的技术 手段, 而可依照说明书的内容予以实施, 并且为了让本发明的上述和其它目的、 特征和优点能够更明显易懂, 以下特举本发明的具体实施方式。 附图简要说明 通过阅读下文优选实施方式的详细描述, 各种其他的优点和益处对于本领 域普通技术人员将变得清楚明了。 附图仅用于示出优选实施方式的目的, 而并 不认为是对本发明的限制。 而且在整个附图中, 用相同的参考符号表示相同的 部件。 在附图中:
图 1示出了现有方案中客户端之间传输数据的方法示意图;
图 2 示出了根据本发明一个实施例的一个应用本方案的通信场景的系统结 构图;
图 3示出了根据本发明一个实施例的一种服务器的工作流程示意图; 图 4示出了根据本发明一个实施例的一种数据传输方法示意图; 图 5示出了根据本发明一个实施例的双緩存队列示意图;
图 6示出了根据本发明一个实施例的数据传输的方法流程图;
图 7示出了根据本发明一个实施例的又一种数据传输的方法流程图; 图 8示出了根据本发明一个实施例的一种服务器的结构示意图;
图 9示出了根据本发明一个实施例的一种终端的结构示意图;
图 10示出了才艮据本发明一个实施例的又一种终端的结构示意图。
实施本发明的方式 下面将参照附图更详细地描述本公开的示例性实施例。 虽然附图中显示了 本公开的示例性实施例, 然而应当理解, 可以以各种形式实现本公开而不应被 这里阐述的实施例所限制。 相反, 提供这些实施例是为了能够更透彻地理解本 公开, 并且能够将本公开的范围完整的传达给本领域的技术人员。 参见图 2, 示出了本发明实施例的一个应用本方案的通信场景的系统结构 图。示例性的 ,系统中包括终端 C1、终端 C2、终端 D1和终端 D2; NAT ( Network Address Translation, 网络地址转换 )设备 A和 NAT设备 B , 以及服务器。 终端 C1和终端 C2位于同一局域网, 终端 D1和终端 D2位于同一局域网。 图 2所示 的场景中, 终端 C1需要向终端 C2发送数据文件, 终端 C1和终端 C2之间建立 有 UDP ( User Datagram Protocol, 用户数据报协议)连接。
本系统所对应的数据传输流程要分为以下操作:
1 : 终端 C1与月良务器建立 TCP ( Transmission Control Protocol, 传输控制协 议)连接。
2: 终端 C2与服务器建立 TCP连接。
3: 终端 C1在服务器上注册终端 C1本机信息, 该注册信息包括终端 C1对 应的连接描述符, 还可以包括终端 C1的标识。
4: 终端 C2在辅助服务器上注册终端 C2本机信息, 该注册信息包括终端
C2对应的连接描述符, 还可以包括终端 C2的标识。
5: 终端 C1通过 TCP连接发送文件描述符到服务器。
6: 服务器将终端 C1的文件描述符通过 TCP连接发送给终端 C2。
7: 终端 C1与终端 C2根据文件描述符, 通过彼此之间的 UDP连接, 釆用 多线程发送和接收数据文件。
相比于图 1 所示的现有技术的系统架构, 本发明整体系统硬件架构中传统 的文件服务器的角色起了变化, 不再承担数据转发任务, 仅仅作为数据传输过 程的监控者, 承担了辅助服务器的角色, 负责为双方终端同步文件描述符。
下面分别对系统中的服务器和终端进行具体说明。 服务器
服务器通过与终端之间的 TCP传输方式, 能够保证数据的完整性, 通知数 据发送过程中丟包错误、 数据包重复发送错误, 并可以同步数据断点续传信息。 本方案中的服务器不再承担数据文件转发工作后, 主要传输数据是一些控制信 息, 因此服务器可支持大连接量、 小数据片高速稳定的收发。
参见图 3 , 示出了本发明一个实施例一种服务器的工作流程示意图, 包括如 下步骤:
S300: 服务器判断是否继续循环执行数据收发操作, 若是, 进入步骤 S301 , 若否跳过数据收发操作。
S301 : 服务器使用 epoll通信模型, 通过 epoll事件等待方法的调用。 当发 生了方法调用时, 进入 S302。
S302: 服务器判断方法调用的事件是否包括触发事件, 当包括时, 即触发 事件的数量大于 0时, 进入 S303 , 否则, 进入 S309。
S303: 服务器确定被触发的事件, 判断处触发事件都是哪些事件。
S304: 服务器判断触发事件的类型。 例如, 服务器可以获取事件数据的指 针, 从指针中获取触发事件的类型。
S305: 当触发事件为读事件时, 即服务器接收终端发送来的数据时, 服务 器判断是否已经与该终端建立了连接, 若是, 进入 S307, 若否, 进入 S306。
S306: 服务器与终端建立新连接, 终端在服务器上注册本机信息。 连接建 立成功后, 服务器接收终端发送的数据
S307: 服务器利用与终端已经建立的连接, 接收终端发送的数据。
S308: 当触发事件为写事件时, 服务器将相关的数据发送给对应的终端。
S309: 服务器处理系统事件。
S310: 服务器处理超时连接。 对 S309和 S310的具体处理方式, 在此不进 行限定。 参见图 4, 本发明一个实施例提供的一种数据传输方法中,服务器可执行如 下操作:
S400: 当服务器与发送终端和接收终端建立传输控制协议 TCP连接时, 服 务器根据发送终端和接收终端建立的 TCP连接分别为发送终端和接收终端生成 第一连接描述符和第二连接描述符。
连接描述符: 用来确定唯一的网络套接字, 其定义用以下伪码表示: 连接描述符 {
网络套接字; //由调用 socket方法创建的套接字
辅助标识; //64位整型自增量, 和网络套接字组合成唯一 ID
}
具体的, 服务器根据与发送终端的 TCP连接对应的网络套接字和相应的辅 助标识生成第一连接描述符; 服务器根据与接收终端的 TCP连接对应的网络套 接字和相应的辅助标识生成第二连接描述符。
本实施例使用网络套接字和 64位整型递增量(辅助标识 )组合来构成连接 描述符, 确定唯一的网络连接, 在大量连接并发时, 可避免失效的网络数据包 对新创建的连接造成干扰。
S401 : 当发送终端需要向接收终端传输数据文件时, 服务器根据第一连接 描述符接收发送终端通过 TCP连接传输的文件描述符和接收终端的标识, 文件 描述符由发送终端根据需要传输的数据文件生成。
参见图 5, 示出了本实施例的一种双緩存队列示意图。 本实施例釆用双緩存 队列处理数据收发, 如在服务器侧设置用于写入和发送文件描述符的双緩存队 列, 其中, 在同一时刻下, 一个緩存队列的状态为写入緩存队列, 另一个緩存 队列的状态为发送緩存队列; 服务器在当前时刻下, 利用转发逻辑处理线程将 文件描述符增加至当前的写入緩存队列中, 如将为文件描述符生成的数据描述 符加入写入緩存队列从而实现将文件描述符加入写入操作中, 利用 10发送线程 将当前的发送緩存队列中对应的文件描述符发送给接收终端。 在当前时刻之后, 写入緩存队列和发送緩存队列的状态可能保持不变, 也可能交换两个緩存队列 的状态, 即当前时刻的写入緩存队列在下一时刻的状态为发送緩存队列, 当前 时刻的发送緩存队列在下一时刻的状态为写入緩存队列, 以提高緩存资源的利 用率。
通过上述的双緩存队列处理机制, 服务器在执行数据写操作的同时, 还能 够执行数据发送操作, 提高了数据的发送性能。
首先, 服务器根据发送终端上报的接收终端的标识, 查找所有与服务器已 建立连接的终端, 得到接收终端的第二连接描述符。 例如, 在终端与服务器建 立连接时生成的注册信息中会保存终端的连接描述符和标识, 服务器在注册信 息中进行查找可以得到接收终端的第二连接描述符。
再次, 服务器利用转发逻辑处理线程, 根据查找到的接收终端的第二连接 描述符和来自发送终端的文件描述符生成数据描述符, 具体如下:
数据描述符: 用来描述服务器收到的和将要发送的网络数据包 (如文件描 述符), 可以用以下伪码表示:
数据描述符 {
连接描述符; //上述连接描述符
连接 IP地址;
连接端口号;
数据起始位置;
数据长度;
}
其中, 数据起始位置指示文件描述符和第二连接描述符在预分配描述符池 中的起始存储位置, 数据长度指示文件描述符和第二连接描述符的大小。
其次, 服务器利用转发逻辑线程将所述数据描述符添加至当前的写入緩存 队列中。
最后, 服务器执行写入操作时, 根据当前的写入緩存队列中的数据描述符 将对应的文件描述符写入预分配描述符池中。 本实施例使用预分配描述符池来 存储和管理文件描述符, 避免描述符的创建和销毁操作带来的性能损耗。
S402: 服务器根据第二连接描述符将文件描述符传输至接收终端, 以使发 送终端和接收终端利用文件描述符, 通过发送终端和接收终端之间的 UDP连接 传输数据文件。
具体的, 本步骤中包括如下操作:
服务器执行传输操作时, 利用 10发送线程根据当前的发送緩存队列中的数 据描述符将对应的文件描述符从预分配描述符池中提取出来, 并根据数据描述 符中的第二连接描述符将提取出来的文件描述符发送给接收终端。
上述服务器可以工作在 Linux系统的 epoll通信方式下, 并满足如下实现模 式:
1 )服务器通过参数设置, 如 SO_REUSEADDR参数, 开启端口重用功能;
2 )服务器通过参数设置, 如 0_NONBLOCK参数, 使套接字为非阻塞模式;
3 )服务器通过参数设置, 如 TCP_NODELAY参数, 禁止合并发送数据;
4 )仅对 epoll事件处理使用单线程, 避免上下文切换的损耗和内存锁争用;
5 )使用双緩存队列处理数据收发;
6 )使用预分配数据描述符池, 避免创建和销毁操作带来的性能损耗;
8 )使用数据描述符控制数据收发, 避免内存拷贝
9 )保持连接及维护心跳数据包收发;
10 )检查超时的无效连接并关闭端口、 释放资源。
其中, epoll方式能提供 Linux下多路复用 10接口, 能提高程序在大并发连 接中只有少量活跃时 CPU 的利用率。 服务器可以通过调用服务器操作 10 ( Input/Output, 输入 /输出)控制方法设置该服务器工作在 Linux 系统的 epoll 通信方式下。 对上述 1 )至 3 ) 中参数设置的次序不进行限定, 只要在服务器执 行对发送终端和接收终端的数据监控之前, 完成 1 )至 3 ) 中参数设置即可。
本方案通过 epoll通信方式、 端口重用、 非阻塞模式、 禁止合并发送、 预分 配描述符池和双緩存发送队列 (发送数据的同时向后台发送队列写数据)等操 作的组合, 保证了数据文件的传输性能。
本实施例中的描述符, 是用一组关键数据表示实际对象的位置、 大小和状 态等信息, 但并不是操作对象本身。 而套接字, 用一个整型值表示通信双方之 间的通路, 系统通过套接字确定通信双方的连接。 终端
终端作为一次数据文件传输中的发送方时, 如发送终端需要向接收终端传 输数据文件时, 本发明一个实施例提供的一种数据传输的方法, 参见图 6, 包括 如下操作:
S600: 发送终端根据需要传输的数据文件生成文件描述符, 并通过与服务 器建立的 TCP连接, 将文件描述符和接收终端的标识传输至服务器, 以通过服 务器将文件描述符传输至接收终端。
本实施例发送终端经由与服务器建立的 TCP连接, 通过文件描述符将数据 控制信息和验证信息发送给服务器, 并由服务器将这些信息转发至接收终端。 这些信息包括数据大小、 校验码, 数据文件被分为小的数据片段的数量、 数据 片段大小和数据片段的校验码等。
数据文件会被拆分为小的数据片段, 并未数据片段生成序号和验证码(如
CRC验证码 ), 序号和验证码通过 TCP连接由服务器转发到接收终端。
其中, 文件描述符中描述的文件信息包括: 数据文件的总长度、 数据文件 的校验码、 由一个或多个文件片段描述符组成的片段序列、 片段数量。 数据文 件的校验码可以釆用数据文件的 MD5值实现, 则文件描述符可以表示如下: 文件描述符 {
文件总长度;
MD5校验码;
片段序列; //由多个文件片段描述符组成
片段数量; //指明文件片段序列的个数
}
其中, 文件片段描述符包括片段标识符、 片段长度、 片段校验码和指示片 段是否传输成功的片段状态。 片段文件的校验码可以釆用片段文件的 CRC值实 现, 则片段描述符可以表示如下:
文件片段描述符{
标识符;
片段长度;
CRC校验码;
片段状态; //状态值(0表示未接收成功, 1 表示已正确接收)
}
S601 : 发送终端按照文件描述符中描述的文件信息, 通过与接收终端之间 建立的 UDP连接, 将所述数据文件传输至接收终端。
数据片段直接由 UDP连接从发送终端直接发给接收终端, 然后重新组合成 数据文件。
可以理解, 当数据文件没有被划分为多个数据片段的场景, 数据文件本身 可视为一个片段。
另外, 本实施例还包括: 在数据文件传输过程中, 发送终端通过 TCP连接 接收服务器传输的来自接收终端的更新后的文件描述符; 发送终端根据更新后 的文件描述符判断数据文件是否传输成功, 若是, 发送终端结束本次传输操作, 若否, 发送终端将传输失败的片段通过 UDP连接重新传输至接收终端。
具体的, 发送终端可通过如下方式判断数据文件是否传输成功: 发送终端 解析更新后的文件描述符中的片段序列, 判断解析出的片段序列中所有文件片 段描述符中的片段状态是否指示传输成功, 若是, 如片段状态的状态值为 1时, 确认本次数据文件传输成功; 若否, 如片段状态的状态值为 0 时, 获取指示传 输失败的片段状态对应的片段, 确认需要向接收终端重发该片段。
终端作为一次数据文件传输中的接收方时, 如接收终端需要接收发送终端 传输来的数据文件时, 本发明一个实施例提供的又一种数据传输的方法, 参见 图 7, 包括如下操作:
S700: 接收终端接收服务器通过 TCP连接传输的来自发送终端的文件描述 符, 该文件描述符由发送终端根据需要传输的数据文件生成。 文件描述符的具 体内容可参见上文相关描述。
S701 : 接收终端通过与发送终端之间建立的 UDP连接, 接收发送终端按照 文件描述符中描述的文件信息传输的数据文件, 并根据接收结果更新文件描述 付。
接收终端釆用与生成数据文件的校验码相同的算法(如 MD5算法), 计算 接收到的数据文件的校验值, 根据计算出的数据文件的校验值和数据文件的校 验码获取对数据文件的接收结果, 当两者相同时, 确定接收结果为数据文件正 确接收;
接收终端釆用与生成片段的校验码相同的算法(如 CRC算法), 计算接收 到的片段的校验值, 根据计算出的片段的校验值和所述片段校验码获取对片段 的接收结果, 当两者相同时, 确定接收结果为片段正确接收。
本实施例中, 接收终端根据数据的接收结果, 可执行如下操作:
接收终端可以根据接收结果更新文件描述符, 具体包括: 当接收结果为片 段接收成功时, 接收终端将文件描述符中相应的片段状态更新为正确接收, 如 接收终端将片段状态的状态值设置为 1。
以及, 当接收结果为片段接收失败时, 接收终端接收发送终端通过 UDP连 接重传的相应片段, 并根据重传片段的接收结果更新文件描述符。
另外, 作为接收方的接收终端还可以根据文件描述符检查到重复接收了相 同的片段时, 丟弃重复的片段。 接收终端还可以在对小文件数据完成接收后, 将小文件数据一次性写入磁盘。 而对大文件数据, 釆用增量方式写入磁盘。 上述作为发送方的终端 (发送终端)和作为接收方的终端 (接收终端)之 间可釆用多线程发送和接收数据包, 以提高数据传输的速度。
由上述内容可知, 本方案的终端至少具有如下特点:
1 )作为发送方与接收方的终端之间通过服务器来同步文件描述符;
2 )终端之间通过 UDP连接传输数据文件;
3 )终端可以使用多线程发送和接收数据包;
4 )接收终端检查未正确接收收到片段, 并同步状态给发送方终端;
5 )接收终端检查重复接收的片段并丟弃;
6 )接收终端可以将小文件数据一次性写入磁盘;
7 )接收终端可以将大文件数据以增量方式写入磁盘。
本技术方案, 能够降低服务器的数据处理压力, 可为更多的用户提供服务, 并且, 通过终端之间的 UDP直连连接(网络延迟小), 能够更快地完成数据文 件的发送。 本发明实施例还提供了一种服务器 800, 参见图 8, 该服务器 800包括: 连接建立单元 810,用于当服务器与发送终端和接收终端建立传输控制协议 TCP连接时, 根据发送终端和接收终端建立的 TCP连接分别为发送终端和接收 终端生成第一连接描述符和第二连接描述符。 具体的, 连接建立单元 810, 用于 根据与发送终端的 TCP连接对应的网络套接字和相应的辅助标识生成第一连接 描述符; 根据与接收终端的 TCP连接对应的网络套接字和相应的辅助标识生成 第二连接描述符。
描述符接收单元 811 , 用于当发送终端需要向接收终端传输数据文件时, 根 据第一连接描述符接收发送终端通过 TCP连接传输的文件描述符和接收终端的 标识, 文件描述符由发送终端根据需要传输的数据文件生成。 具体的, 描述符 接收单元 811 , 用于根据发送终端上报的接收终端的标识, 查找所有与服务器已 建立连接的终端, 得到接收终端的第二连接描述符; 根据查找到的接收终端的 第二连接描述符和来自发送终端的文件描述符生成数据描述符, 该数据描述符 中包括第二连接描述符、 连接 IP地址、 连接端口号、数据起始位置和数据长度; 将所述数据描述符添加至当前的写入緩存队列中; 执行写入操作时, 根据当前 的写入緩存队列中的数据描述符将对应的文件描述符写入预分配描述符池中, 其中, 数据起始位置指示文件描述符和第二连接描述符在预分配描述符池中的 起始存储位置, 数据长度指示文件描述符和第二连接描述符的大小。 描述符传输单元 812,用于根据第二连接描述符将文件描述符传输至接收终 端, 以使发送终端和接收终端利用文件描述符, 通过发送终端和接收终端之间 的用户数据协议 UDP连接传输数据文件。 具体的, 描述符传输单元 812, 用于 利用 10发送线程根据当前的发送緩存队列中的数据描述符将对应的文件描述符 从预分配描述符池中提取出来, 并根据数据描述符中的第二连接描述符将提取 出来的文件描述符发送给接收终端; 其中, 数据起始位置指示文件描述符和第 二连接描述符在预分配描述符池中的起始存储位置, 数据长度指示文件描述符 和第二连接描述符的大小。
上述服务器 800还包括: 双緩存控制单元 813 , 用于设置用于写入和发送文 件描述符的双緩存队列, 其中, 在同一时刻下, 一个緩存队列的状态为写入緩 存队列, 另一个緩存队列的状态为发送緩存队列; 在当前时刻下, 利用转发逻 辑处理线程控制描述符接收单元 811 将文件描述符增加至当前的写入緩存队列 中, 利用 10发送线程控制描述符传输单元 812将当前的发送緩存队列中对应的 文件描述符发送给接收终端。
本实施例提供的服务器 800工作在 Linux系统的 epoll通信方式下; 以及, 服务器 800通过参数设置开启端口重用功能; 服务器 800通过参数设置使套接 字为非阻塞模式; 服务器 800通过参数设置禁止合并发送数据。 例如, 服务器 调用服务器操作 10控制方法设置该服务器工作在 Linux系统的 epoll通信方式 下并实现上述参数设置。
本发明产品实施例中服务器各单元的具体工作方式, 可以参见本发明方法 实施例中服务器执行的操作的相关内容, 不再赘述。 本发明一个实施例提供的一种作为数据发送方的终端 900 , 参见图 9, 包括 如下:
描述符上传单元 910, 用于当发送终端需要向接收终端传输数据文件时, 根 据需要传输的数据文件生成文件描述符, 并通过与服务器建立的 TCP连接, 将 文件描述符和接收终端的标识传输至服务器, 以通过服务器将文件描述符传输 至接收终端。 文件描述符中描述的文件信息包括: 数据文件的总长度、 数据文 件的校验码、 由一个或多个文件片段描述符组成的片段序列、 片段数量。 文件 片段描述符包括片段标识符、 片段长度、 片段校验码和指示片段是否传输成功 的片段状态。
数据文件发送单元 911 , 用于按照文件描述符中描述的文件信息, 通过与接 收终端之间建立的 UDP连接, 将数据文件传输至接收终端。 具体的, 数据文件 发送单元 911 , 用于解析更新后的文件描述符中的片段序列, 判断解析出的片段 序列中所有文件片段描述符中的片段状态是否指示传输成功, 若是, 确认本次 数据文件传输成功; 若否, 获取指示传输失败的片段状态对应的片段, 确认需 要向接收终端重发该片段。
进一步的, 描述符上传单元 910还用于在数据文件传输过程中, 通过 TCP 连接接收服务器传输的来自接收终端的更新后的文件描述符。 相应的, 数据文 件发送单元 911 , 用于根据更新后的文件描述符判断数据文件是否传输成功, 若 是, 结束本次传输操作, 若否, 将传输失败的片段通过 UDP连接重新传输至接 收终端。
本发明一个实施例提供的一种作为数据接收方的终端 1000 , 参见图 10 , 包 括如下:
描述符接收单元 1010, 用于当发送终端需要向接收终端传输数据文件时, 接收服务器通过 TCP连接传输的来自发送终端的文件描述符, 文件描述符由发 送终端根据需要传输的数据文件生成。 文件描述符中描述的文件信息包括: 数 据文件的总长度、 数据文件的校验码、 由一个或多个文件片段描述符组成的片 段序列、 片段数量; 其中, 文件片段描述符包括片段标识符、 片段长度、 片段 校验码和指示片段是否传输成功的片段状态;
数据文件接收单元 1011 , 用于通过与发送终端之间建立的 UDP连接,接收 发送终端按照文件描述符中描述的文件信息传输的数据文件, 并根据接收结果 更新文件描述符。 具体的, 数据文件接收单元 1011 , 用于计算接收到的数据文 件的校验值, 根据计算出的数据文件的校验值和数据文件的校验码获取对数据 文件的接收结果; 以及, 数据文件接收单元 1011 , 用于计算接收到的片段的校 验值, 根据计算出的片段的校验值和片段校验码获取对片段的接收结果。 以及, 数据文件接收单元 1011 , 用于当接收结果为片段接收成功时, 将文件描述符中 相应的片段状态更新为正确接收。 数据文件接收单元 1011 , 用于当接收结果为 片段接收失败时, 接收发送终端通过 UDP连接重传的相应片段, 并根据重传片 段的接收结果更新文件描述符。 数据文件接收单元 1011 , 用于根据文件描述符 检查到重复接收了相同的片段时, 丟弃重复的片段。 本发明产品实施例中终端各单元的具体工作方式, 可以参见本发明方法实 施例中终端执行的操作的相关内容, 不再赘述。
本发明实施例通过在终端之间建立直接的 UDP连接, 由 UDP连接进行终 端之间数据文件的传输, 而通过终端与服务器之间的 TCP连接负责文件描述符 的传输, 由于文件描述符的数据量远小于数据文件, 大大降低了系统中服务器 的数据处理压力。 终端之间的 UDP直连通路的数据速度较高, 尤其是位于同一 局域网的终端, 从而能够实现数据的快速传输, 而通过文件描述符又保证了终 端之间数据传输的完整性和正确性。
本发明实施例提供的方案能够达到大用户量场景下高速、 稳定地传输数据 的技术效果。 本领域的技术人员可以理解, 可以对实施例中的设备中的模块进行自适应 性地改变并且把它们设置在与该实施例不同的一个或多个设备中。 可以把实施 例中的模块或单元或组件组合成一个模块或单元或组件, 以及此外可以把它们 分成多个子模块或子单元或子组件。 此外, 不同实施例的特征的组合意味着处 于本发明的范围之内并且形成不同的实施例。
为了便于清楚描述本发明实施例的技术方案, 在发明的实施例中, 釆用了 "第一"、 "第二" 等字样对功能和作用基本相同的相同项或相似项进行区分, 本领域技术人员可以理解 "第一"、 "第二" 等字样并不对数量和执行次序进行 限定。
以上所述仅为本发明的较佳实施例而已, 并非用于限定本发明的保护范围。 凡在本发明的精神和原则之内所作的任何修改、 等同替换、 改进等, 均包含在 本发明的保护范围内。

Claims

权利要求书
1、 一种数据传输方法, 其特征在于, 所述方法包括:
当服务器与发送终端和接收终端建立传输控制协议 TCP连接时, 服务器根 据发送终端和接收终端建立的 TCP连接分别为发送终端和接收终端生成第一连 接描述符和第二连接描述符,
当发送终端需要向接收终端传输数据文件时, 服务器根据第一连接描述符 接收发送终端通过所述 TCP连接传输的文件描述符和接收终端的标识, 所述文 件描述符由发送终端根据需要传输的数据文件生成;
服务器根据第二连接描述符将所述文件描述符传输至接收终端, 以使发送 终端和接收终端利用所述文件描述符, 通过发送终端和接收终端之间的用户数 据协议 UDP连接传输数据文件。
2、 如权利要求 1所述的方法, 其特征在于, 所述服务器根据发送终端和接 收终端建立的 TCP连接分别为发送终端和接收终端生成第一连接描述符和第二 连接描述符包括:
服务器根据与发送终端的 TCP连接对应的网络套接字和相应的辅助标识生 成第一连接描述符;
服务器根据与接收终端的 TCP连接对应的网络套接字和相应的辅助标识生 成第二连接描述符。
3、 如权利要求 1所述的方法, 其特征在于, 还包括:
服务器设置用于写入和发送文件描述符的双緩存队列, 其中, 在同一时刻 下, 一个緩存队列的状态为写入緩存队列, 另一个緩存队列的状态为发送緩存 队列;
服务器在当前时刻下, 利用转发逻辑处理线程将文件描述符增加至当前的 写入緩存队列中, 利用 10发送线程将当前的发送緩存队列中对应的文件描述符 发送给接收终端。
4、 如权利要求 3所述的方法, 其特征在于, 所述服务器根据第一连接描述 符接收发送终端通过所述 TCP连接传输的文件描述符和接收终端的标识包括: 服务器利用转发逻辑处理线程, 根据发送终端上报的接收终端的标识, 查 找所有与服务器已建立连接的终端 , 得到接收终端的第二连接描述符;
服务器利用转发逻辑处理线程, 根据查找到的接收终端的第二连接描述符 和来自发送终端的文件描述符生成数据描述符, 所述数据描述符中包括第二连 接描述符、 连接 IP地址、 连接端口号、 数据起始位置和数据长度;
服务器利用转发逻辑线程将所述数据描述符添加至当前的写入緩存队列 中;
服务器执行写入操作时, 根据当前的写入緩存队列中的数据描述符将对应 的文件描述符写入预分配描述符池中;
其中, 所述数据起始位置指示文件描述符和第二连接描述符在预分配描述 符池中的起始存储位置, 所述数据长度指示文件描述符和第二连接描述符的大 小。
5、 如权利要求 3所述的方法, 其特征在于, 所述服务器根据第二连接描述 符将该文件描述符传输至接收终端包括:
服务器执行传输操作时, 利用 10发送线程根据当前的发送緩存队列中的数 据描述符将对应的文件描述符从预分配描述符池中提取出来, 并根据数据描述 符中的第二连接描述符将提取出来的文件描述符发送给接收终端。
6、 如权利要求 1至 5任一项所述的方法, 其特征在于, 还包括: 服务器调用服务器操作 10控制方法设置所述服务器工作在 Linux 系统的 epoll通信方式下; 以及,服务器调用服务器操作 10控制方法通过参数设置开启 所述服务器的端口重用功能; 并且, 通过参数设置将所述服务器的套接字设置 为非阻塞模式; 以及, 通过参数设置禁止所述服务器合并发送数据。
7、 一种数据传输的方法, 其特征在于, 所述方法包括:
当发送终端需要向接收终端传输数据文件时, 发送终端根据需要传输的数 据文件生成文件描述符, 并通过与服务器建立的 TCP连接, 将所述文件描述符 和接收终端的标识传输至服务器, 以通过服务器将所述文件描述符传输至接收 终端;
发送终端按照文件描述符中描述的文件信息, 通过与接收终端之间建立的 UDP连接, 将所述数据文件传输至接收终端。
8、 如权利要求 7所述的方法, 其特征在于, 所述方法还包括:
在数据文件传输过程中, 发送终端通过 TCP连接接收服务器传输的来自接 收终端的更新后的文件描述符;
发送终端根据更新后的文件描述符判断数据文件是否传输成功, 若是, 发 送终端结束本次传输操作, 若否, 发送终端将传输失败的片段通过 UDP连接重 新传输至接收终端;
其中, 所述文件描述符中描述的文件信息包括:
数据文件的总长度、 数据文件的校验码、 由一个或多个文件片段描述符组 成的片段序列、 片段数量;
其中, 所述文件片段描述符包括片段标识符、 片段长度、 片段校验码和指 示片段是否传输成功的片段状态。
9、 如权利要求 7所述的方法, 其特征在于, 所述发送终端根据更新后的文 件描述符判断数据文件是否传输成功包括:
发送终端解析更新后的文件描述符中的片段序列, 判断解析出的片段序列 中所有文件片段描述符中的片段状态是否指示传输成功, 若是, 确认本次数据 文件传输成功; 若否, 获取指示传输失败的片段状态对应的片段, 确认需要向 接收终端重发该片段。
10、 一种数据传输的方法, 其特征在于, 所述方法包括:
当发送终端需要向接收终端传输数据文件时, 接收终端接收服务器通过 TCP 连接传输的来自发送终端的文件描述符, 所述文件描述符由发送终端根据 需要传输的数据文件生成;
接收终端通过与发送终端之间建立的 UDP连接, 接收发送终端按照文件描 述符中描述的文件信息传输的数据文件, 并根据接收结果更新文件描述符。
11、 如权利要求 10所述的方法, 其特征在于, 所述文件描述符中描述的文 件信息包括: 数据文件的总长度、 数据文件的校验码、 由一个或多个文件片段 描述符组成的片段序列、 片段数量; 其中, 所述文件片段描述符包括片段标识 符、 片段长度、 片段校验码和指示片段是否传输成功的片段状态; 所述根据接收结果更新文件描述符包括:
接收终端计算接收到的数据文件的校验值, 根据计算出的数据文件的校验 值和所述数据文件的校验码获取对数据文件的接收结果; 以及,
接收终端计算接收到的片段的校验值, 根据计算出的片段的校验值和所述 片段校验码获取对片段的接收结果。
12、 如权利要求 11所述的方法, 其特征在于, 所述根据接收结果更新文件 描述符还包括:
当接收结果为片段接收成功时, 接收终端将文件描述符中相应的片段状态 更新为正确接收所述方法还包括:
当接收结果为片段接收失败时, 接收终端接收发送终端通过 UDP连接重传 的相应片段, 并根据重传片段的接收结果更新文件描述符; 以及,
接收终端根据文件描述符检查到重复接收了相同的片段时, 丟弃重复的片 段。
13、 一种服务器, 其特征在于, 包括:
连接建立单元, 用于当服务器与发送终端和接收终端建立传输控制协议 TCP连接时, 根据发送终端和接收终端建立的 TCP连接分别为发送终端和接收 终端生成第一连接描述符和第二连接描述符;
描述符接收单元, 用于当发送终端需要向接收终端传输数据文件时, 根据 第一连接描述符接收发送终端通过所述 TCP连接传输的文件描述符和接收终端 的标识, 所述文件描述符由发送终端根据需要传输的数据文件生成;
描述符传输单元, 用于根据第二连接描述符将所述文件描述符传输至接收 终端, 以使发送终端和接收终端利用所述文件描述符, 通过发送终端和接收终 端之间的用户数据协议 UDP连接传输数据文件。
14、 如权利要求 13所述的服务器, 其特征在于, 所述连接建立单元, 用于 根据与发送终端的 TCP连接对应的网络套接字和相应的辅助标识生成第一连接 描述符; 根据与接收终端的 TCP连接对应的网络套接字和相应的辅助标识生成 第二连接描述符。
15、 如权利要求 13所述的服务器, 其特征在于, 还包括: 双緩存控制单元, 用于设置用于写入和发送文件描述符的双緩存队列, 其中, 在同一时刻下, 一 个緩存队列的状态为写入緩存队列, 另一个緩存队列的状态为发送緩存队列; 在当前时刻下, 利用转发逻辑处理线程控制所述描述符接收单元将文件描述符 增加至当前的写入緩存队列中, 利用 10发送线程控制所述描述符传输单元将当 前的发送緩存队列中对应的文件描述符发送给接收终端;
其中, 所述描述符接收单元, 用于根据发送终端上报的接收终端的标识, 查找所有与服务器已建立连接的终端, 得到接收终端的第二连接描述符; 根据 查找到的接收终端的第二连接描述符和来自发送终端的文件描述符生成数据描 述符, 所述数据描述符中包括第二连接描述符、 连接 IP地址、 连接端口号、 数 据起始位置和数据长度; 将所述数据描述符添加至当前的写入緩存队列中; 执 行写入操作时, 根据当前的写入緩存队列中的数据描述符将对应的文件描述符 写入预分配描述符池中; 所述描述符传输单元, 用于利用 10发送线程根据当前 的发送緩存队列中的数据描述符将对应的文件描述符从预分配描述符池中提取 出来, 并根据数据描述符中的第二连接描述符将提取出来的文件描述符发送给 接收终端;
其中, 所述数据起始位置指示文件描述符和第二连接描述符在预分配描述 符池中的起始存储位置, 所述数据长度指示文件描述符和第二连接描述符的大 小。
16、 如权利要求 13至 15任一项所述的服务器, 其特征在于,
所述服务器调用服务器操作 10控制方法设置该服务器工作在 Linux系统的 epoll通信方式下; 以及,
所述服务器调用服务器操作 10控制方法,通过参数设置开启端口重用功能; 并且, 通过参数设置使套接字为非阻塞模式; 以及, 通过参数设置禁止合并发 送数据。
17、 一种终端, 其特征在于, 包括:
描述符上传单元, 用于当发送终端需要向接收终端传输数据文件时, 根据 需要传输的数据文件生成文件描述符, 并通过与服务器建立的 TCP连接, 将所 述文件描述符和接收终端的标识传输至服务器, 以通过服务器将所述文件描述 符传输至接收终端;
数据文件发送单元, 用于按照文件描述符中描述的文件信息, 通过与接收 终端之间建立的 UDP连接, 将所述数据文件传输至接收终端。
18、 如权利要求 17所述的终端, 其特征在于,
所述描述符上传单元, 用于在数据文件传输过程中, 通过 TCP连接接收服 务器传输的来自接收终端的更新后的文件描述符;
所述数据文件发送单元, 用于根据更新后的文件描述符判断数据文件是否 传输成功, 若是, 结束本次传输操作, 若否, 将传输失败的片段通过 UDP连接 重新传输至接收终端;
其中, 所述文件描述符中描述的文件信息包括: 数据文件的总长度、 数据 文件的校验码、 由一个或多个文件片段描述符组成的片段序列、 片段数量; 其中, 所述文件片段描述符包括片段标识符、 片段长度、 片段校验码和指 示片段是否传输成功的片段状态;
以及, 所述数据文件发送单元, 用于解析更新后的文件描述符中的片段序 列, 判断解析出的片段序列中所有文件片段描述符中的片段状态是否指示传输 成功, 若是, 确认本次数据文件传输成功; 若否, 获取指示传输失败的片段状 态对应的片段, 确认需要向接收终端重发该片段。
19、 一种终端, 其特征在于, 包括:
描述符接收单元, 用于当发送终端需要向接收终端传输数据文件时, 接收 服务器通过 TCP连接传输的来自发送终端的文件描述符, 所述文件描述符由发 送终端根据需要传输的数据文件生成;
数据文件接收单元, 用于通过与发送终端之间建立的 UDP连接, 接收发送 终端按照文件描述符中描述的文件信息传输的数据文件, 并根据接收结果更新 文件描述符。
20、 如权利要求 19所述的终端, 其特征在于, 所述文件描述符中描述的文 件信息包括: 数据文件的总长度、 数据文件的校验码、 由一个或多个文件片段 描述符组成的片段序列、 片段数量; 其中, 所述文件片段描述符包括片段标识 符、 片段长度、 片段校验码和指示片段是否传输成功的片段状态; 所述数据文件接收单元, 用于计算接收到的数据文件的校验值, 根据计算 出的数据文件的校验值和所述数据文件的校验码获取对数据文件的接收结果; 以及,
所述数据文件接收单元, 用于计算接收到的片段的校验值, 根据计算出的 片段的校验值和所述片段校验码获取对片段的接收结果;
以及, 所述数据文件接收单元, 还用于当接收结果为片段接收成功时, 将 文件描述符中相应的片段状态更新为正确接收;
所述数据文件接收单元, 还用于当接收结果为片段接收失败时, 接收发送 终端通过 UDP连接重传的相应片段, 并根据重传片段的接收结果更新文件描述 符; 所述数据文件传输单元, 还用于根据文件描述符检查到重复接收了相同的 片段时, 丟弃重复的片段。
PCT/CN2014/081180 2014-06-30 2014-06-30 一种数据传输方法、终端和服务器 WO2016000138A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201480012225.7A CN105580334B (zh) 2014-06-30 2014-06-30 一种数据传输方法、终端和服务器
PCT/CN2014/081180 WO2016000138A1 (zh) 2014-06-30 2014-06-30 一种数据传输方法、终端和服务器

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/081180 WO2016000138A1 (zh) 2014-06-30 2014-06-30 一种数据传输方法、终端和服务器

Publications (1)

Publication Number Publication Date
WO2016000138A1 true WO2016000138A1 (zh) 2016-01-07

Family

ID=55018232

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/081180 WO2016000138A1 (zh) 2014-06-30 2014-06-30 一种数据传输方法、终端和服务器

Country Status (2)

Country Link
CN (1) CN105580334B (zh)
WO (1) WO2016000138A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113315797A (zh) * 2020-02-26 2021-08-27 新开普电子股份有限公司 一种局域网批量远程升级方法、系统及节点
CN114629891A (zh) * 2021-12-17 2022-06-14 亚信科技(中国)有限公司 文件传输方法、装置、电子设备及计算机可读存储介质
CN114979040A (zh) * 2022-05-07 2022-08-30 成都数之联科技股份有限公司 一种udp报文写入方法及系统及装置及介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10880046B2 (en) * 2016-10-24 2020-12-29 Aptpod, Inc. Data collection system, data collection method, client apparatus, server apparatus, and program
CN109818748A (zh) * 2018-12-28 2019-05-28 北京奇安信科技有限公司 数据传输方法、设备、系统和介质
CN112631788B (zh) * 2021-01-06 2023-11-28 上海哔哩哔哩科技有限公司 数据传输方法及数据传输服务器
CN112637382B (zh) 2021-01-06 2022-04-26 上海哔哩哔哩科技有限公司 数据发送方法及装置、建立p2p连接的方法及系统
CN115086441B (zh) * 2022-06-09 2024-03-19 北京百度网讯科技有限公司 信息传输方法、装置、电子设备及存储介质
CN114928634B (zh) * 2022-06-29 2023-12-29 肇庆小鹏新能源投资有限公司广州分公司 泊车控制方法和计算机可读存储介质
CN116599953B (zh) * 2023-07-13 2024-02-02 苏州浪潮智能科技有限公司 一种文件上传的方法、装置、系统、设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369987A (zh) * 2007-08-16 2009-02-18 阿里巴巴集团控股有限公司 一种建立通信通道的方法及装置
CN102215240A (zh) * 2010-04-02 2011-10-12 中国移动通信集团公司 流媒体信令发送方法及设备、以及点对点流媒体系统
CN102355448A (zh) * 2011-06-29 2012-02-15 北京原力创新科技有限公司 云流媒体数据传输方法及系统
CN102868665A (zh) * 2011-07-05 2013-01-09 华为软件技术有限公司 数据传输的方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2328124B (en) * 1997-08-02 2002-04-24 Ibm Packet data communications protocol with reduced acknowledgements in a client/server computing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369987A (zh) * 2007-08-16 2009-02-18 阿里巴巴集团控股有限公司 一种建立通信通道的方法及装置
CN102215240A (zh) * 2010-04-02 2011-10-12 中国移动通信集团公司 流媒体信令发送方法及设备、以及点对点流媒体系统
CN102355448A (zh) * 2011-06-29 2012-02-15 北京原力创新科技有限公司 云流媒体数据传输方法及系统
CN102868665A (zh) * 2011-07-05 2013-01-09 华为软件技术有限公司 数据传输的方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113315797A (zh) * 2020-02-26 2021-08-27 新开普电子股份有限公司 一种局域网批量远程升级方法、系统及节点
CN114629891A (zh) * 2021-12-17 2022-06-14 亚信科技(中国)有限公司 文件传输方法、装置、电子设备及计算机可读存储介质
CN114979040A (zh) * 2022-05-07 2022-08-30 成都数之联科技股份有限公司 一种udp报文写入方法及系统及装置及介质
CN114979040B (zh) * 2022-05-07 2024-02-20 成都数之联科技股份有限公司 一种udp报文写入方法及系统及装置及介质

Also Published As

Publication number Publication date
CN105580334B (zh) 2018-10-26
CN105580334A (zh) 2016-05-11

Similar Documents

Publication Publication Date Title
WO2016000138A1 (zh) 一种数据传输方法、终端和服务器
US7502860B1 (en) Method and apparatus for client-side flow control in a transport protocol
TW419919B (en) TCP resegmentation
US9900168B2 (en) System and method for reliable multicast data transport
TWI306711B (en) Message context based tcp transmission
US10244084B2 (en) Reducing TCP connection establishment time in an overlay network
US9003053B2 (en) Message acceleration
US8935336B2 (en) Optimizing program requests over a wide area network
US20180004705A1 (en) Selective acknowledgment of RDMA packets
US20120287944A1 (en) RoCE PACKET SEQUENCE ACCELERATION
US20060029000A1 (en) Connection establishment in a proxy server environment
TW200537877A (en) Retransmission system and method for a transport offload engine
JP2008085932A (ja) データ通信方法
US20070291782A1 (en) Acknowledgement filtering
WO2011015020A1 (zh) 文件传输方法、系统及客户端
JP6994110B2 (ja) データ配信方法及び配信サーバ
JP2020537454A5 (zh)
WO2019243890A2 (en) Multi-port data transmission via udp
US7535916B2 (en) Method for sharing a transport connection across a multi-processor platform with limited inter-processor communications
CN116074401B (zh) 一种在可编程交换机上的传输层协议实现方法
US20200379834A1 (en) Covertly storing a payload of data within a network
CN103607311A (zh) 一种无缝重建tcp连接的系统及方法
Shieh et al. A stateless approach to connection-oriented protocols
JP4415391B2 (ja) データをネットワークに送信する方法及び装置並びにデータをネットワークから受信する方法及び装置
CN111314447B (zh) 代理服务器及其处理访问请求的方法

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201480012225.7

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14896392

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14896392

Country of ref document: EP

Kind code of ref document: A1