CN113328958A - Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization - Google Patents

Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization Download PDF

Info

Publication number
CN113328958A
CN113328958A CN202110487713.5A CN202110487713A CN113328958A CN 113328958 A CN113328958 A CN 113328958A CN 202110487713 A CN202110487713 A CN 202110487713A CN 113328958 A CN113328958 A CN 113328958A
Authority
CN
China
Prior art keywords
data
transmission
sending
link
receiving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110487713.5A
Other languages
Chinese (zh)
Other versions
CN113328958B (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.)
Beijing LSSEC Technology Co Ltd
Original Assignee
Beijing LSSEC 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 Beijing LSSEC Technology Co Ltd filed Critical Beijing LSSEC Technology Co Ltd
Priority to CN202110487713.5A priority Critical patent/CN113328958B/en
Publication of CN113328958A publication Critical patent/CN113328958A/en
Application granted granted Critical
Publication of CN113328958B publication Critical patent/CN113328958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9057Arrangements for supporting packet reassembly or resequencing
    • 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
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5681Pre-fetching or pre-delivering data based on network characteristics
    • 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
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Abstract

The invention provides a multilink mass transmission method and a system based on UDP cache optimization, wherein the method comprises the following steps: initializing port information of a sending end and a receiving end, and respectively setting the sizes of a sending cache and a receiving cache aiming at the sending end and the receiving end; crushing the transmission data to obtain a plurality of fragment data; configuring a delay time and determining a transmission frequency for the fragmented data; transmitting fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined transmitting frequency; receiving the fragment data by using a recvfrom function, and putting the received data into a queue to be processed according to a receiving sequence; and another thread performs data recombination on the received data in the queue to be processed, so as to obtain transmission data and finish data transmission. The invention effectively reduces the packet loss rate and improves the transmission quality by controlling the delay with microsecond order of magnitude at the sending end and adjusting the sending buffer memory of the sending end and the receiving buffer memory of the receiving end.

Description

Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization
Technical Field
The invention relates to the technical field of information transmission, in particular to a multilink mass transmission method and system based on UDP cache optimization.
Background
Data transmission refers to the process of transferring data between a data source and a data sink via one or more links according to an appropriate protocol, and also refers to the operation of transferring data from one place to another by means of signals on a channel, which is a communication process of transferring data from one place to another.
In the current transmission technical scheme, when the amount of transmitted data is very large, a certain amount of packet loss is generally caused, and the larger the amount is, the higher the packet loss rate is, therefore, the invention provides a multilink mass transmission method and system based on UDP cache optimization.
Disclosure of Invention
The invention provides a multilink mass transmission method and system based on UDP (user Datagram protocol) cache optimization, which effectively reduces the packet loss rate and improves the transmission quality by controlling the delay in microsecond order at a sending end and adjusting the sending cache of the sending end and the receiving cache of a receiving end.
The invention provides a multilink mass transmission method based on UDP cache optimization, which comprises the following steps:
initializing port information of a sending end and a receiving end, and respectively setting a sending cache and a receiving cache aiming at the sending end and the receiving end;
crushing the transmission data to obtain a plurality of fragment data;
configuring a delay time and determining a transmission frequency for the fragmented data;
transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined transmitting frequency;
receiving the fragment data by using a recvfrom function, and putting the received data into a queue to be processed according to a receiving sequence;
and another thread performs data recombination on the received data in the queue to be processed, so as to obtain the transmission data and finish data transmission.
Further, when the sending end and the receiving end are respectively provided with a sending cache and a receiving cache, and when the sending end creates a socket, a setsockopt interface is used for adjusting the size of a read-write buffer area according to the size of a memory of the device; and when the receiving end creates a socket, adjusting the size of a read-write buffer area according to the size of the memory of the device by using a setsockopt interface.
Further, the process of crushing the transmission data to obtain a plurality of fragment data includes:
reading port data and port information of a sending end to obtain transmission data;
and calling a crushing algorithm to crush the transmission data to obtain a plurality of fragment data.
Further, when the delay time is configured for the fragment data and the transmission frequency is determined, the configured delay time is dynamically configured according to the link transmission condition.
Further, the process of performing data reassembly on the received data in the queue to be processed by the another thread includes:
checking the received data for a fragmentation algorithm; checking the received data to obtain a crushing algorithm adopted by the received data when crushing;
determining a recombination algorithm according to the fragmentation algorithm;
calling a function in a set of control function pointers in the recombination algorithm;
and performing data recombination on the received data through the called function to obtain the transmission data, and completing data transmission.
Further, when the received data is subjected to data recombination through the called function, the received data is sequentially subjected to data recombination through the called function, the data after the data recombination is judged, whether the data after the data recombination is successfully recombined is judged, and when the judgment result is that the data after the data recombination is successfully recombined is removed from the queue to be processed and put into a new queue to form the transmission data in the new queue; and when the judgment result is that the recombination fails, continuing to recombine the received data through the called function until the recombination succeeds.
Further, the quantity of the fragment data is determined according to the link data, and when the fragment data is subjected to crushing processing, the fragment data is obtained through a crushing algorithm according to the link performance condition; and the multilink is provided with a monitoring device, and the monitoring device monitors the performance of the link and feeds back the monitoring result to the crushing treatment step in time.
Further, the process of dynamically configuring the delay time includes:
determining an initial transmission time of the fragmented data;
obtaining average time consumption of data transmission from a sending end to a receiving end;
configuring initial delay time of fragment data according to the average time consumption;
receiving and analyzing the link sending condition, judging whether to update the delay time, and obtaining a judgment result;
and dynamically updating the delay time of the fragment data according to the judgment result to obtain the dynamically configured delay time of the fragment data.
Further, the process of receiving and analyzing for the link transmission condition includes:
receiving link sending condition information;
analyzing the received link transmission condition information according to the following formula;
Figure BDA0003051143070000041
in the above formula, HlRepresents the analysis judgment value of the sending condition of the I-th link, exp represents an exponential function, sqrt represents the arithmetic square root, Ti,l,kIndicating that the ith link in the link sending condition information at the k time is received at the receiving end for the ith fragment dataTime of day, ti,l,kRepresents the time when the ith link sends the ith fragment data at the sending end in the received k-th time link sending condition information, aiDenotes the size of the ith patch data, abs denotes a function taking a positive value, Tm,l,k-1Represents the time when the ith link receives the mth fragment data in the received k-1 time link transmission condition information, tm,l,k-1The time of the ith link to the mth fragment data transmitted by the transmitting end in the received link transmission condition information at the k-1 th time is shown, amRepresents the size of the mth fragmentation data;
determining a judgment result;
Figure BDA0003051143070000042
wherein G islThe judgment result value of the sending condition of the l link is represented, y represents a preset judgment threshold value, n represents a parameter, and z represents a variable;
when the sending condition of the l link judges the result value GlWhen the value of (1) is 0, the delay time of the fragment data does not need to be dynamically updated; when the sending condition of the l link judges the result value GlWhen the value of (d) is non-zero, dynamically updating the delay time of the fragmentation data.
The invention provides a multilink mass transmission system based on UDP cache optimization, which comprises: the system comprises an initial setting unit, a crushing processing unit, a sending configuration unit, a data sending unit, a data receiving unit and a data recombining unit;
the initial setting unit is used for initializing port information of a sending end and a receiving end and respectively setting a sending cache and a receiving cache aiming at the sending end and the receiving end;
the crushing processing unit is used for crushing the transmission data to obtain a plurality of fragment data;
the transmission configuration unit is configured to configure a delay time and determine a transmission frequency for the fragmented data;
the sending data unit is used for transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined sending frequency;
the data receiving unit is used for receiving the fragment data by using a recvfrom function and putting the received data into a queue to be processed according to a receiving sequence;
the data recombination unit is used for performing data recombination on the received data in the queue to be processed by another thread so as to obtain the transmission data and finish data transmission.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of a multi-link mass transmission method based on UDP buffer optimization according to the present invention;
fig. 2 is a schematic diagram of a UDP buffer optimization-based multi-link bulk transmission system according to the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
As shown in fig. 1, an embodiment of the present invention provides a method for multilink bulk transmission based on UDP buffer optimization, including:
initializing port information of a sending end and a receiving end, and respectively setting a sending cache and a receiving cache aiming at the sending end and the receiving end;
step two, crushing the transmission data to obtain a plurality of fragment data;
thirdly, configuring delay time and determining sending frequency aiming at the fragment data;
step four, transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined transmitting frequency;
step five, receiving the fragment data by using a recvfrom function, and putting the received data into a queue to be processed according to a receiving sequence;
and sixthly, performing data recombination on the received data in the queue to be processed by another thread so as to obtain the transmission data and finish data transmission.
In the technical scheme, when the UDP cache optimization-based multi-link mass transmission is carried out, firstly, a port of a sending end is initialized, a port of a receiving end is initialized, and then, a sending cache of the sending end and a receiving cache of the receiving end are set in size; then crushing the transmission data to obtain fragment data; then, configuring delay time for the fragment data and determining the sending frequency of the fragment data; then, transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined transmitting frequency; receiving the fragment data by using a recvfrom function, and putting the received data into a queue to be processed according to a receiving sequence; and finally, another thread performs data recombination on the received data in the queue to be processed, so as to obtain the transmission data and finish data transmission. According to the technical scheme, the port information of the sending end and the receiving end is initialized, so that the interference of the retained information on the port of the sending end or the port of the receiving end on the transmission data is reduced, and the purpose of reducing errors is achieved; the transmission data is sent after being crushed, so that the packet loss rate can be reduced, and the transmission efficiency can be improved; the method has the advantages that part of fragment data is sent according to the sending frequency after being delayed for a microsecond through the delay function, the data packet loss phenomenon can be effectively reduced, the delay sending data controlled in the microsecond order of magnitude cannot generate obvious delay, and the fragment data can be better and quickly received by a receiving end due to the hierarchy caused by the microsecond delay and the sending frequency within an acceptable range; and the usleep function is used for transmitting the fragment data after suspending the fragment data in the thread of the transmitting terminal for microsecond time, and is represented as:
void usleep(int micro_seconds);
wherein the parameter micro _ seconds is the number of microseconds to be delayed;
the recvfrom function is used for receiving fragment data transmitted by a socket specified by the sending end and transmitting the received data to a to-be-processed thread pointed by the parameter buf, and is represented as:
int recvfrom(int s,void*buf,int len,unsigned int flags,struct sockaddr*from,int*fromlen)
wherein, recvfrom () is to receive UDP datagram from the specified address; s represents a description word for identifying a connected socket interface, buf represents a data buffer received by a receiving terminal, len represents the length of the buffer, flags represents a calling operation mode, from represents an (optional) pointer, the pointer is a struct sockaddr type variable, the variable stores an IP address and a port number of a source machine, from represents an (optional) pointer, the pointer is usually sizeof (struct sockaddr), when recifrom () returns, the from contains the number of data bytes actually stored in from, for the recifrom () function, the number of received characters is returned if success, if failure, the number of-1 is returned, and the error reason is stored in errno;
in addition, another thread is used for recombining the received data in the queue to be processed after the received data is placed in the queue to be processed, so that the received data in the queue to be processed can be recombined while being received, the purpose of returning as soon as possible after the data is received and carrying out next data receiving is achieved, the efficiency of receiving and obtaining transmitted data by a receiving end can be improved, data loss can be reduced, the packet loss rate is effectively reduced, and the transmission quality is improved.
In an embodiment provided by the present invention, when the sending end and the receiving end are respectively provided with the sending buffer and the receiving buffer, and when the sending end creates a socket, the size of the read-write buffer is adjusted according to the size of the memory of the device by using a setsockopt interface; and when the receiving end creates a socket, adjusting the size of a read-write buffer area according to the size of the memory of the device by using a setsockopt interface.
In the technical scheme, a socket is created at the sending end and/or the receiving end before transmission, and the size of the read-write buffer area is adjusted according to the size of the memory of the device by using a setsockopt port. Above-mentioned technical scheme can make sending end and receiving end when carrying out big data transmission in batches, effectively reduce data packet loss phenomenon through after the size adjustment grow that will read and write the buffer area, moreover, the size of the read and write buffer area of sending end and receiving end generally all is 1M, when the write buffer area size of adjustment sending end, goes on through following procedure:
int send_size=1024*1024;//1M
int optlen=sizeof(send_size);
int ret ═ setsockopt (sock, SOL _ SOCKET, SO _ SNDBUF, (char) & send _ size, open); // set the Transmit buffer size
By combining the delayed transmission and the determined transmission frequency, the normal data transmission is not influenced under the condition of 1-6 microseconds of delay, and the packet loss rate in the data transmission process is reduced. When the write buffer size of the receiving end is adjusted, the following procedures are used for adjusting the write buffer size of the receiving end:
int recv_size=1024*1024;//1M
int optlen=sizeof(recv_size);
int ret ═ setsockopt (sock, SOL _ SOCKET, SO _ RCVBUF, (char) & recv _ size, open); the situation that default cache of the linux system is small can be solved by setting the size of the receiving buffer area, the number of received data packets can be effectively increased, and the packet loss rate is reduced.
In an embodiment provided by the present invention, the process of performing fragmentation processing on the transmission data to obtain a plurality of fragment data includes:
reading port data and port information of a sending end to obtain transmission data;
and calling a crushing algorithm to crush the transmission data to obtain a plurality of fragment data.
In the technical scheme, when transmission data is subjected to crushing processing, the transmission data is obtained by reading port data of a sending end, and port information including a self-machine network port IP, an opposite-end network port IP and the like is read while the transmission data is obtained; the technical scheme reads port information in the process of obtaining transmission data by obtaining port data of a sending end, can enable the fragment data to be transmitted to a corresponding port of a receiving end according to a specified IP, needs to provide information of an effective interface, and carries out crushing according to the state of a link during crushing, wherein the obtained data of the fragment data is also related to the state of the link; in addition, the transmission data is transmitted through the multilink in the form of fragment data, so that the packet loss rate can be effectively reduced, and the transmission quality can be improved.
In an embodiment provided by the present invention, when configuring the delay time for the fragment data and determining the transmission frequency, the configured delay time is dynamically configured according to the link transmission condition.
In the above technical solution, when the delay time is configured for the fragmented data and the transmission frequency is determined, the dynamic configuration is performed according to the state of each link capable of transmitting data. According to the technical scheme, the delay time and the sending frequency are dynamically configured according to the link sending condition, so that data loss is reduced and the packet loss rate is reduced when the multilink transmits the fragment data.
In an embodiment provided by the present invention, the process of performing data reassembly on the received data in the queue to be processed by the another thread includes:
checking the received data for a fragmentation algorithm; checking the received data to obtain a crushing algorithm adopted by the received data when crushing;
determining a recombination algorithm according to the fragmentation algorithm;
calling a function in a set of control function pointers in the recombination algorithm;
and performing data recombination on the received data through the called function to obtain the transmission data, and completing data transmission.
In the technical scheme, after received data are placed in a queue to be processed, another thread is provided, and data recombination is carried out on the received data in the queue to be processed through a new thread, so that the received data can still be received through the original thread when the data are recombined, the first two bytes of a crushing algorithm packet are the packet header length and the algorithm type, and the crushing algorithm in the received data is checked when the new thread carries out the data recombination; determining a recombination algorithm according to a fragmentation algorithm; the recombination algorithm provides a set of control function pointers to the recombination threads, and the recombination threads call functions in a uniform mode to complete data recombination work of received data. When the new thread performs data recombination, the functions irrelevant to the recombination algorithm are all extracted for uniform management and scheduling, the recombination thread can require the recombination algorithm module to provide some simple functional interfaces, and various recombination algorithms can perform data recombination work after the interfaces are provided, so that the recombination algorithm can concentrate on only the work relevant to the algorithm after finishing all the functions required by the recombination thread, and in addition, if the algorithm does not realize some functions, the program can possibly finish the recombination process in advance in order to avoid program crash.
In an embodiment provided by the present invention, when the received data is recombined by the called function, the received data is sequentially recombined by the called function, and the data after data recombination is judged to determine whether the data after data recombination is successfully recombined, and when the result of the judgment is that the data after data recombination is successfully recombined, the data after data recombination is removed from the queue to be processed and put into a new queue to form the transmission data in the new queue; and when the judgment result is that the recombination fails, continuing to recombine the received data through the called function until the recombination succeeds.
In the above technical solution, when the called function performs data reassembly on the received data, the method includes the following steps:
s1, performing data recombination on the received data through the called function to obtain data after the data recombination;
s2, judging the data after data recombination to obtain a judgment result;
s3, carrying out corresponding steps according to the judgment result; when the judgment result is that the data are successfully recombined, removing the data subjected to data recombination from the queue to be processed, and transferring the data to a new queue; and when the recombination is failed as a result of the judgment, performing data recombination on the received data again by repeating the functions called by the S1 and the S2.
According to the technical scheme, data transmission can be completed through transmission data obtained after data recombination, data recombination can be performed on large batches of transmission data on fragment data transmitted to a receiving end from a transmitting end through a multilink through the receiving end to obtain the transmission data, the transmission data successfully obtained through data recombination can be removed from a queue to be processed and transferred to a new queue, and data recombination is continuously performed on the reception data in the queue to be processed.
In one embodiment provided by the invention, the quantity of the fragment data is determined according to the link data, and the fragment data is obtained through a fragmentation algorithm according to the link performance condition when fragmentation processing is carried out; and the multilink is provided with a monitoring device, and the monitoring device monitors the performance of the link and feeds back the monitoring result to the crushing treatment step in time.
In the technical scheme, the fragment data is determined by the link data, and when the fragment processing is carried out, the transmission data is subjected to crushing processing through the link performance fed back by the monitoring device, so that the obtained fragment data is more fit with the link condition in the transmission process, the crushing processing adjustment can be carried out in time according to the feedback of the monitoring device, and the data transmission quality is further improved.
In an embodiment provided by the present invention, the process of dynamically configuring the delay time includes:
determining an initial transmission time of the fragmented data;
obtaining average time consumption of data transmission from a sending end to a receiving end;
configuring initial delay time of fragment data according to the average time consumption;
receiving and analyzing the link sending condition, judging whether to update the delay time, and obtaining a judgment result;
and dynamically updating the fragment data according to the judgment result to obtain the dynamically configured delay time of the fragment data.
In the technical scheme, when the delay time is dynamically configured, the initial transmission time of the fragment data is determined and the average time consumption for transmitting the data from the transmitting end to the receiving end is obtained; then, configuring the initial delay time of the fragment data according to the average time consumption; in the transmission process of the fragment data, monitoring the transmission condition of a link in real time, receiving and analyzing the transmission condition of the link so as to judge whether the delay time needs to be updated, and dynamically updating the fragment data when the delay time needs to be updated to obtain the dynamically configured delay time of the fragment data; otherwise, the delay time for updating the configuration is not carried out. By the technical scheme, the delay time of the fragment data can be adjusted in real time, so that the process of transmitting the fragment data through the link is always kept smooth, and the transmission quality is improved.
In an embodiment provided by the present invention, the process of receiving and analyzing the link transmission condition includes:
receiving link sending condition information;
analyzing the received link transmission condition information according to the following formula;
Figure BDA0003051143070000121
in the above formula, HlAnalysis and judgment value for indicating transmission condition of the I-th linkExp denotes an exponential function, sqrt denotes taking the arithmetic square root, Ti,l,kIndicating the time when the ith link receives the ith fragment data in the received k-th time link transmission condition information, ti,l,kRepresents the time when the ith link sends the ith fragment data at the sending end in the received k-th time link sending condition information, aiDenotes the size of the ith patch data, abs denotes a function taking a positive value, Tm,l,k-1Represents the time when the ith link receives the mth fragment data in the received k-1 time link transmission condition information, tm,l,k-1The time of the ith link to the mth fragment data transmitted by the transmitting end in the received link transmission condition information at the k-1 th time is shown, amRepresents the size of the mth fragmentation data;
determining a judgment result;
Figure BDA0003051143070000131
wherein G islA value representing a result of the determination of the transmission condition of the l-th link, y represents a preset determination threshold, n represents a parameter, and a value of the parameter is a positive integer in a range of [1, + ∞), where 10 is taken, z represents a variable, and a value of the variable is an integer between 1 and n, where the value is: 1. 2, 3, 4, 5, 6, 7, 8, 9, 10;
when the sending condition of the l link judges the result value GlWhen the value of (1) is 0, the delay time of the fragment data does not need to be dynamically updated; when the sending condition of the l link judges the result value GlWhen the value of (d) is non-zero, dynamically updating the delay time of the fragmentation data.
In the technical scheme, in the process of receiving and analyzing the link sending condition and obtaining the judgment result of whether to update the delay time, firstly, receiving link sending condition information; then, analyzing the received link sending condition information; and finally, determining a judgment result. Through the technical scheme, the receiving and the analysis of the link sending condition information can be realized automatically through setting, the efficiency of obtaining the judgment result is extremely high, the judgment can be carried out on each link, in addition, when the received link sending condition information is analyzed, the link sending conditions at two adjacent moments are analyzed, the change of the sending condition of the link is reflected through analyzing the judgment value, the change of the current moment to the previous moment can be obtained in real time, the sending condition of the link is fed back in time, the judgment result is presented in the form of the judgment result value, and the method is visual and high in accuracy.
As shown in fig. 2, the present invention provides a UDP buffer optimization-based multi-link bulk transmission system, which includes: the system comprises an initial setting unit, a crushing processing unit, a sending configuration unit, a data sending unit, a data receiving unit and a data recombining unit;
the initial setting unit is used for initializing port information of a sending end and a receiving end and respectively setting a sending cache and a receiving cache aiming at the sending end and the receiving end;
the crushing processing unit is used for crushing the transmission data to obtain a plurality of fragment data;
the transmission configuration unit is configured to configure a delay time and determine a transmission frequency for the fragmented data;
the sending data unit is used for transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined sending frequency;
the data receiving unit is used for receiving the fragment data by using a recvfrom function and putting the received data into a queue to be processed according to a receiving sequence;
the data recombination unit is used for performing data recombination on the received data in the queue to be processed by another thread so as to obtain the transmission data and finish data transmission.
In the technical scheme, an initial setting unit, a crushing processing unit, a data sending unit, a data receiving unit and a data recombining unit are arranged in a multilink mass transmission system based on UDP (user Datagram protocol) cache optimization; when data transmission is carried out, initializing port information of a sending end and a receiving end through an initial setting unit, and respectively setting sending cache and receiving cache for the sending end and the receiving end; crushing the transmission data through a crushing processing unit to obtain a plurality of fragment data; transmitting fragment data through a multilink by adopting a usleep function through a data transmitting unit according to the configured delay time and the determined transmitting frequency; receiving fragment data by using a recvfrom function through a data receiving unit, and putting the received data into a queue to be processed according to a receiving sequence; and performing data recombination on the received data in the queue to be processed by another thread through the data recombination unit so as to obtain transmission data and finish data transmission. According to the technical scheme, the initial setting unit can initialize the port information of the sending end and the receiving end to reduce the interference of the retention information on the port of the sending end or the port of the receiving end on the transmission data, so that the purpose of reducing errors is achieved. When the fragment data are transmitted to the receiving end by the multilink through the transmitting configuration unit and the transmitting data unit, the fragment data are transmitted in order in the transmission process through the delay and the transmitting frequency of the configured fragment data, the phenomenon of data packet loss can be effectively reduced, the data are transmitted in microsecond-order delay without obvious delay, and the receiving end can receive the fragment data better and quickly by the layers caused by microsecond delay and the transmitting frequency. The receiving data unit and the data recombination unit receive the received data and recombine the received data by using at least two threads, so that the received data can be returned as soon as possible after being received, the next data reception is carried out, meanwhile, the data recombination is carried out on the received data by using another thread, the data recombination on the received data in a queue to be processed is not delayed while the received data are received, the efficiency of receiving and obtaining transmitted data by a receiving end can be improved, the data loss can be reduced, the packet loss rate is effectively reduced, and the transmission quality is improved.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A multilink mass transmission method based on UDP cache optimization is characterized by comprising the following steps:
initializing port information of a sending end and a receiving end, and respectively setting the sizes of a sending cache and a receiving cache aiming at the sending end and the receiving end;
crushing the transmission data to obtain a plurality of fragment data;
configuring a delay time and determining a transmission frequency for the fragmented data;
transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined transmitting frequency;
receiving the fragment data by using a recvfrom function, and putting the received data into a queue to be processed according to a receiving sequence;
and another thread performs data recombination on the received data in the queue to be processed, so as to obtain the transmission data and finish data transmission.
2. The UDP-cache-optimization-based multilink mass transmission method as claimed in claim 1, wherein when a sending cache and a receiving cache are respectively set for a sending end and a receiving end, when a socket is created at the sending end, the size of a read-write buffer area is adjusted according to the size of a memory of a device by using a setsockopt interface; and when the receiving end creates a socket, adjusting the size of a read-write buffer area according to the size of the memory of the device by using a setsockopt interface.
3. The UDP-cache-optimization-based multilink mass transmission method according to claim 1, wherein the process of fragmenting the transmission data to obtain a plurality of fragmented data comprises:
reading port data and port information of a sending end to obtain transmission data;
and calling a crushing algorithm to crush the transmission data to obtain a plurality of fragment data.
4. The UDP-cache-optimization-based multilink mass transfer method as claimed in claim 1, wherein when the delay time is configured for the fragmented data and the transmission frequency is determined, the delay time is dynamically configured according to the link transmission condition.
5. The UDP-cache-optimization-based multilink mass transfer method as claimed in claim 1, wherein the process of performing data reassembly by the another thread on the received data in the queue to be processed comprises:
checking the received data for a fragmentation algorithm; checking the received data to obtain a crushing algorithm adopted by the received data when crushing;
determining a recombination algorithm according to the fragmentation algorithm;
calling a function in a set of control function pointers in the recombination algorithm;
and performing data recombination on the received data through the called function to obtain the transmission data, and completing data transmission.
6. The UDP-cache-optimization-based multilink mass transmission system as claimed in claim 5, wherein when the received data is recombined by the called function, the received data is sequentially recombined by the called function, the data after data recombination is judged, whether the data after data recombination is successfully recombined is judged, and when the judgment result is that the data after data recombination is successfully recombined, the data after data recombination is removed from the queue to be processed and put into a new queue to form the transmission data in the new queue; and when the judgment result is that the recombination fails, continuing to recombine the received data through the called function until the recombination succeeds.
7. The UDP-cache-optimization-based multilink mass transfer system as claimed in claim 1, wherein the amount of the fragment data is determined according to the link data, and the fragment data is obtained through a fragmentation algorithm according to link performance conditions during fragmentation processing; and the multilink is provided with a monitoring device, and the monitoring device monitors the performance of the link and feeds back the monitoring result to the crushing treatment step in time.
8. The UDP-cache-optimization-based multilink mass transfer system of claim 4, wherein the dynamically configuring of the delay time comprises:
determining an initial transmission time of the fragmented data;
obtaining average time consumption of data transmission from a sending end to a receiving end;
configuring initial delay time of fragment data according to the average time consumption;
receiving and analyzing the link sending condition, judging whether to update the delay time, and obtaining a judgment result;
and dynamically updating the delay time of the fragment data according to the judgment result to obtain the dynamically configured delay time of the fragment data.
9. The UDP-cache-optimization-based multilink mass transfer system of claim 8, wherein the receiving and analyzing for link transmission comprises:
receiving link sending condition information;
analyzing the received link transmission condition information according to the following formula;
Figure FDA0003051143060000031
in the above formula, HlRepresents the analysis and judgment value of the sending condition of the I-th link, exp represents an exponential functionNumber, sqrt, denotes taking the arithmetic square root, Ti,l,kIndicating the time when the ith link receives the ith fragment data in the received k-th time link transmission condition information, ti,l,kRepresents the time when the ith link sends the ith fragment data at the sending end in the received k-th time link sending condition information, aiDenotes the size of the ith patch data, abs denotes a function taking a positive value, Tm,l,k-1Represents the time when the ith link receives the mth fragment data in the received k-1 time link transmission condition information, tm,l,k-1The time of the ith link to the mth fragment data transmitted by the transmitting end in the received link transmission condition information at the k-1 th time is shown, amRepresents the size of the mth fragmentation data;
determining a judgment result;
Figure FDA0003051143060000032
wherein G islThe judgment result value of the sending condition of the l link is represented, y represents a preset judgment threshold value, n represents a parameter, and z represents a variable;
when the sending condition of the l link judges the result value GlWhen the value of (1) is 0, the delay time of the fragment data does not need to be dynamically updated; when the sending condition of the l link judges the result value GlWhen the value of (d) is non-zero, dynamically updating the delay time of the fragmentation data.
10. A UDP buffer optimization based multi-link bulk transmission system, comprising: the system comprises an initial setting unit, a crushing processing unit, a sending configuration unit, a data sending unit, a data receiving unit and a data recombining unit;
the initial setting unit is used for initializing port information of a sending end and a receiving end and respectively setting a sending cache and a receiving cache aiming at the sending end and the receiving end;
the crushing processing unit is used for crushing the transmission data to obtain a plurality of fragment data;
the transmission configuration unit is configured to configure a delay time and determine a transmission frequency for the fragmented data;
the sending data unit is used for transmitting the fragment data through a multilink by adopting a usleep function according to the configured delay time and the determined sending frequency;
the data receiving unit is used for receiving the fragment data by using a recvfrom function and putting the received data into a queue to be processed according to a receiving sequence;
the data recombination unit is used for performing data recombination on the received data in the queue to be processed by another thread so as to obtain the transmission data and finish data transmission.
CN202110487713.5A 2021-05-06 2021-05-06 Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization Active CN113328958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110487713.5A CN113328958B (en) 2021-05-06 2021-05-06 Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110487713.5A CN113328958B (en) 2021-05-06 2021-05-06 Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization

Publications (2)

Publication Number Publication Date
CN113328958A true CN113328958A (en) 2021-08-31
CN113328958B CN113328958B (en) 2022-03-11

Family

ID=77414372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110487713.5A Active CN113328958B (en) 2021-05-06 2021-05-06 Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization

Country Status (1)

Country Link
CN (1) CN113328958B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116709432A (en) * 2022-11-22 2023-09-05 荣耀终端有限公司 Cache queue adjusting method and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7315900B1 (en) * 2001-06-20 2008-01-01 Juniper Networks, Inc. Multi-link routing
CN103561472A (en) * 2013-10-30 2014-02-05 中国人民解放军理工大学 Multi-service link distribution and reorganization device and method
CN103685243A (en) * 2013-11-28 2014-03-26 许继电气股份有限公司 Fault recording data transmission method based on UDP
CN103825689A (en) * 2014-03-03 2014-05-28 中国人民解放军理工大学 Delay determinacy message retransmission method with local cache
CN106209883A (en) * 2016-07-21 2016-12-07 连山管控(北京)信息技术有限公司 Based on link selection and the multi-chain circuit transmission method and system of broken restructuring
CN106850188A (en) * 2017-01-24 2017-06-13 中国航天系统科学与工程研究院 A kind of data transmission system based on multichannel isomery one-way transmission path
CN110022261A (en) * 2019-05-20 2019-07-16 北京邮电大学 Multi-path transmission method and apparatus based on SCTP-CMT transport protocol
CN111225021A (en) * 2019-11-13 2020-06-02 北京连山时代科技有限公司 Multilink concurrent transmission method and system based on file fragmentation and recombination

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7315900B1 (en) * 2001-06-20 2008-01-01 Juniper Networks, Inc. Multi-link routing
CN103561472A (en) * 2013-10-30 2014-02-05 中国人民解放军理工大学 Multi-service link distribution and reorganization device and method
CN103685243A (en) * 2013-11-28 2014-03-26 许继电气股份有限公司 Fault recording data transmission method based on UDP
CN103825689A (en) * 2014-03-03 2014-05-28 中国人民解放军理工大学 Delay determinacy message retransmission method with local cache
CN106209883A (en) * 2016-07-21 2016-12-07 连山管控(北京)信息技术有限公司 Based on link selection and the multi-chain circuit transmission method and system of broken restructuring
CN106850188A (en) * 2017-01-24 2017-06-13 中国航天系统科学与工程研究院 A kind of data transmission system based on multichannel isomery one-way transmission path
CN110022261A (en) * 2019-05-20 2019-07-16 北京邮电大学 Multi-path transmission method and apparatus based on SCTP-CMT transport protocol
CN111225021A (en) * 2019-11-13 2020-06-02 北京连山时代科技有限公司 Multilink concurrent transmission method and system based on file fragmentation and recombination

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116709432A (en) * 2022-11-22 2023-09-05 荣耀终端有限公司 Cache queue adjusting method and electronic equipment
CN116709432B (en) * 2022-11-22 2024-04-16 荣耀终端有限公司 Cache queue adjusting method and electronic equipment

Also Published As

Publication number Publication date
CN113328958B (en) 2022-03-11

Similar Documents

Publication Publication Date Title
US8326988B2 (en) Systems and methods for data alignment
US8427945B2 (en) SoC device with integrated supports for Ethernet, TCP, iSCSI, RDMA and network application acceleration
US20030076850A1 (en) Determining packet size in networking
US6947997B2 (en) Method for controlling ethernet data flow on a synchronous digital hierarchy transmission network
US20080295098A1 (en) System Load Based Dynamic Segmentation for Network Interface Cards
EP1434386A2 (en) Protocol testing system and protocol testing method
KR20040062882A (en) Optimizing System Resources
EP1262043B1 (en) Selective address table aging in a network switch
US20100098099A1 (en) Ppp terminating equipment, network equipment and method of responding to lcp echo requirement
CN113328958B (en) Multi-link mass transmission method and system based on UDP (user Datagram protocol) cache optimization
US20170331755A1 (en) Discovering Path Maximum Transmission Unit
US7969977B2 (en) Processing apparatus and method for processing IP packets
CN113141281A (en) FPGA accelerator, network parameter measurement system, method and medium
KR20050084869A (en) Method and apparatus for intermediate buffer segmentation and reassembly
US20210168076A1 (en) Congestion control method and related device
CN113114580A (en) User mode transport protocol development framework and method for 5G network congestion control
US7463595B1 (en) Optimization methods and systems for a networked configuration
CN105162657A (en) Network testing performance optimization method
CN110297785A (en) A kind of finance data flow control apparatus and flow control method based on FPGA
JP2020088517A (en) Communication apparatus, and control method and program of communication apparatus
US7426589B2 (en) Network interface card for reducing the number of interrupts and method of generating interrupts
CN111371692A (en) Window control method and device based on TCP (Transmission control protocol) and electronic equipment
US20040249933A1 (en) Network interface parameters
WO2004077727A2 (en) Method and apparatus of maximizing packet throughput
KR102082484B1 (en) Apparatus for transmitting and receiving data

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