CN113301007A - Data transmission method, computing device and storage medium - Google Patents

Data transmission method, computing device and storage medium Download PDF

Info

Publication number
CN113301007A
CN113301007A CN202110070753.XA CN202110070753A CN113301007A CN 113301007 A CN113301007 A CN 113301007A CN 202110070753 A CN202110070753 A CN 202110070753A CN 113301007 A CN113301007 A CN 113301007A
Authority
CN
China
Prior art keywords
data
transmission protocol
preset transmission
preset
protocol
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.)
Pending
Application number
CN202110070753.XA
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202110070753.XA priority Critical patent/CN113301007A/en
Publication of CN113301007A publication Critical patent/CN113301007A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/08Protocols for interworking; Protocol conversion
    • 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 embodiment of the application provides a data transmission method, a computing device and a storage medium. In the embodiment of the application, data to be sent is obtained, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol; and sending data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol, wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol. Therefore, the data to be sent is not limited by the network operator due to the first preset transmission protocol, so that the affinity of the first preset transmission protocol, such as UDP, message on the network operator side is improved, the problems of current limitation, speed limitation, service quality and port prohibition of the first preset transmission protocol message are solved, the transmission performance of the protocol is greatly improved, and the product experience is optimized.

Description

Data transmission method, computing device and storage medium
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a data transmission method, a computing device, and a storage medium.
Background
Recently, new protocols and frameworks based on UDP (User Datagram Protocol) Protocol, such as HTTP (HyperText Transfer Protocol)3.0, SRT (Secure Reliable Transport Protocol, which is a low-latency live broadcast Protocol), Webrtc (Web Real-Time Communication), etc., have been gradually constructed, and the internet industry has developed many service products based on these protocols and frameworks in different scenarios, but these products gradually expose the service experience problem in the actual large-scale mass-measuring situation, which mainly shows that connectivity is poor, usability is low, and there is a problem that the server cannot be connected. And the product experience is unstable, the service quality is greatly jittered, and the product is especially popped up at night.
Disclosure of Invention
Aspects of the present disclosure provide a data transmission method, a computing device, and a storage medium, which are used to improve transmission performance of a UDP protocol.
The embodiment of the application provides a data transmission method, which comprises the following steps: acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol; sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
The embodiment of the present application further provides a data transmission method, including: receiving data to be processed, wherein the data to be processed carries data of a first preset transmission protocol; when the data to be processed carries the head data of a second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
The embodiment of the present application further provides a data transmission method, including: acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol; sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol; and receiving data to be processed from a receiving device, and when the data to be processed carries the head data of the second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
An embodiment of the present application further provides a computing device, including: a memory, a processor; the memory for storing a computer program; the processor is used for acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol; sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
An embodiment of the present application further provides a computing device, including: a memory, a processor, and a communication component; the memory for storing a computer program; the communication component is used for receiving data to be processed, and the data to be processed carries data of a first preset transmission protocol; the processor to execute the computer program to: when the data to be processed carries the head data of a second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
An embodiment of the present application further provides a computing device, including: a memory, a processor, and a communication component; the memory for storing a computer program; the processor to execute the computer program to: acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol; sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol; the communication component is used for receiving data to be processed from a receiving device; the processor is configured to decapsulate, when the to-be-processed data carries the header data of the second preset transmission protocol, so that the to-be-processed data is processed based on the to-be-processed data carrying the data of the first preset transmission protocol.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, which when executed by one or more processors causes the one or more processors to implement the steps of the above-mentioned method.
In the embodiment of the application, data to be sent is obtained, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol; and sending data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol, wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol. Because the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol, the affinity of the second preset transmission protocol on the network operator side is better, so that the data to be sent is not greatly limited by the network operator due to the first preset transmission protocol, the affinity of the first preset transmission protocol, such as UDP, on the network operator side is improved, the problems of current limitation, speed limitation, service quality and port prohibition of the first preset transmission protocol message are solved, the transmission performance of the protocol is greatly improved, and the product experience is optimized.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic structural diagram of a data transmission system according to an exemplary embodiment of the present application;
fig. 2 is a schematic flow chart of a data transmission method according to an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating data transmission directions according to an exemplary embodiment of the present application;
FIG. 4 is a diagram illustrating a full header structure of a data packet according to an exemplary embodiment of the present application;
fig. 5 is a flowchart illustrating a data transmission method according to an exemplary embodiment of the present application;
fig. 6 is a flowchart illustrating a data transmission method according to an exemplary embodiment of the present application;
fig. 7 is a schematic structural diagram of a data transmission apparatus according to an exemplary embodiment of the present application;
fig. 8 is a schematic structural diagram of a data transmission device according to an exemplary embodiment of the present application;
fig. 9 is a schematic structural diagram of a data transmission apparatus according to an exemplary embodiment of the present application;
FIG. 10 is a schematic block diagram of a computing device provided in an exemplary embodiment of the present application;
FIG. 11 is a schematic block diagram of a computing device provided in an exemplary embodiment of the present application;
fig. 12 is a schematic structural diagram of a computing device according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As can be seen from the foregoing, the root cause of these problems is the low affinity of the UDP protocol for operator equipment. The safety protection system of the operator for the UDP protocol is difficult to construct and is easy to suffer from brute force attack, and the amount of the early UDP is small, so that the data of the UDP protocol is processed by reducing the right on the operator side, which is mainly reflected in that: flow limiting-limiting the throughput capability of UDP streams; low QOS (Quality of Service) -reduces UDP processing priority; block-specific UDP ports of a specific area are blocked, causing link connectivity problems.
With the increase of applications based on the UDP protocol and the gradual increase of the base number and the volume of users, the problem of poor experience caused by low affinity of UDP protocol operators is gradually highlighted. This has been exposed to the UDP project engineering practice. It is important to solve the problems of current limiting, forbidden and low QOS service caused by UDP operator affinity and to improve the transmission performance of UDP protocol.
Therefore, the embodiment of the application provides a data transmission method, which is used for improving the transmission performance of a first preset transmission protocol, such as a UDP protocol.
Fig. 1 is a schematic structural diagram of a data transmission system according to an exemplary embodiment of the present application. As shown in fig. 1, the system 100 may include: a first device 101 and a second device 102.
The first device 101 may be a device that can provide a computing processing service in a network virtual environment, and may be a device that performs data processing and acquisition using a network. In physical implementation, the first device 101 may be any device capable of providing computing services, responding to service requests, and performing data processing, and may be, for example, a cloud server, a cloud host, a virtual center, a conventional server, and the like. The first device 101 mainly includes a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture.
The second device 102 refers to a device that can provide a computing processing service in a network virtual environment, and may refer to a device that performs data processing and acquisition using a network. In physical implementation, the second device 102 may be any device capable of providing computing services, responding to service requests, and performing data processing, and may be, for example, a cloud server, a cloud host, a virtual center, a regular server, and the like. The second device 102 mainly includes a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture.
Besides, the system 100 may further include a third device 103, where the third device 103 may be a device with certain computing capability, may implement a function of sending data to the second device 102, and may receive data sent by the second device 102. The basic structure of the third device 103 may include: at least one processor. The number of processors may depend on the configuration and type of device with a certain computing power. A device with certain computing capabilities may also include Memory, which may be volatile, such as RAM, non-volatile, such as Read-Only Memory (ROM), flash Memory, etc., or both. The memory typically stores an Operating System (OS), one or more application programs, and may also store program data and the like. In addition to the processing unit and the memory, the device with certain computing capabilities also includes some basic configurations, such as a network card chip, an IO bus, a display component, and some peripheral devices. Alternatively, some peripheral devices may include, for example, a keyboard, a stylus, and the like. Other peripheral devices are well known in the art and will not be described in detail herein. Alternatively, the third device 103 may be a smart terminal, such as a mobile phone, a desktop computer, a notebook, a tablet computer, etc.
Specifically, the system 100 may be a CND (Content Delivery Network) system.
Specifically, the second device 102 acquires data to be sent, where the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol; sending data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol. The data to be sent may be a data request.
The second device 102 sends the number to be sent to the first device 101 according to the above-mentioned manner.
Specifically, the second device 102 performs corresponding data filling on a header preset format of the second preset transmission protocol based on the data to be sent and the generated header data of the first preset transmission protocol, so as to generate the header data of the second preset transmission protocol.
Specifically, the second device 102 determines, according to header data of a second preset transmission protocol, a transmission channel of the second preset transmission protocol corresponding to the header data; encapsulating the head data of the second preset transmission protocol, the generated data of the first preset transmission protocol and the data to be sent to generate a corresponding message; and transmitting the message according to the determined transmission channel.
In addition, the second device 102 receives data of the generated first preset transmission protocol sent by the network transport layer, where the data of the generated first preset transmission protocol carries data to be sent.
In addition, the second device 102 generates, based on a preset packet processing framework in the network layer, header data of a second preset transmission protocol according to data to be transmitted and a header preset format of the second preset transmission protocol.
The first device 101 receives data to be transmitted from the second device 102, and when the data to be transmitted carries header data of a second preset transmission protocol, decapsulates the header data of the second preset transmission protocol, so that the data to be transmitted is processed based on the data to be transmitted carrying the data of the first preset transmission protocol.
Further, the first device 101 decapsulates header data of the second predetermined transport protocol based on a predetermined packet processing framework in the network layer.
In addition, the first device 101 sends data to be sent carrying data of the first preset transmission protocol to the network transport layer, so as to process the data to be sent based on the data of the first preset transmission protocol.
The first preset transmission protocol comprises a UDP transmission protocol; the second predetermined transport protocol comprises the TCP transport protocol.
It should be noted that the first device 101 may send target data to the second device 102 in response to data to be sent by the second device 102. That is, the data may be transmitted to the second device 102 according to the manner in which the second device 102 transmits the data to be transmitted. The second device 102 may also receive the data to be transmitted sent by the first device 101 according to a manner in which the first device 101 receives the data to be transmitted. Details will not be described.
In addition, the third device 103 may send a data request to the second device 102 and obtain target data returned by the second device 102.
In the data transmission scenario of the embodiment of the present application, as shown in fig. 1, in the CDN, the first device 101 may be an origin server, and the second device 102 may be an intermediate server, which may also be referred to as an intermediate node server. The third device 103 may be an intelligent terminal, such as a computer. The user can log in the video website through a web page browser of the computer. The user can browse videos of the video website, such as movie videos, entertainment videos, television videos and the like, through the web page browser.
The user may log in to the video website by sending a data request to the intermediate server through a web browser of the computer, which may be a request to log in to the video website. The intermediate server responds to the request and sends the login page data of the video website, namely the sending target data to the computer. The user may continue to send a request for data, which may be a request to view movie a, to the intermediate server via the computer's web browser, which may carry the ID for movie a. After receiving the request, the intermediate server searches whether the local area has the corresponding movie according to the ID. If not, the intermediate server needs to send a data request to the origin server to obtain the movie.
The intermediate server may be determined by the application to send request data for the movie data to the origin server, which may carry the ID of the movie. And performing data encapsulation of a UDP protocol on the request data by a network transport layer in the network. And then the data is encapsulated by a netfilter subsystem (a subsystem which provides a complete set of management mechanism of hook functions) in a network layer in the network. The encapsulation may be performed according to encapsulated data of the UDP protocol. The header data of the TCP Protocol is encapsulated by simulating header data of a TCP (transmission Control Protocol) Protocol, and belongs to a pseudo TCP Protocol. The format of the header data is the same as the preset format of the real TCP protocol. The final IP message can be generated in the network layer, and then sent out through the second layer and the network card in the network. In the sending process, according to the source IP address and the target IP address in the head data, a corresponding TCP transmission channel is searched, and the message is sent through the transmission channel.
The source server may receive the message through the network card, and may reach the third layer of the network through the second layer of the network. The IP packet may be decapsulated through netfilter, and then decapsulated from the header data of the TCP protocol therein. And sending the encapsulated data of the UDP protocol to a fourth layer of the network, namely a network transmission layer, for decapsulation to obtain request data, and sending the request data to an application program for processing. And then, according to the mode, returning the corresponding movie data to the intermediate server, and according to the mode, the intermediate server decapsulates the message, so that the movie data is stored and a movie data value computer is sent to enable a user to watch the movie data.
It should be noted that the embodiment of the present application may be applied to not only an application scenario of the CDN, but also more scenarios such as dynamic content path planning, dynamic acceleration, quac (Quick UDP Internet Connection, which is a UDP-based low-latency Internet transport layer protocol) protocol optimization, video on demand, and video live broadcast.
For video on demand and live video broadcast, the above description can be implemented in the CDN, and the live video broadcast is similar to the video on demand and is not described here again.
In addition, the second preset transmission protocol may also be a QUIC protocol.
In the present embodiment described above, the first device 101, the second device 102, and the third device 103 perform network connection, and the network connection may be wireless connection. If the first device 101, the second device 102, and the third device 103 are communicatively connected, the network format of the mobile network may be any one of 2G (gsm), 2.5G (gprs), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G + (LTE +), WiMax, 5G, and the like.
The following describes the data transmission process in detail with reference to the method embodiment.
Fig. 2 is a flowchart illustrating a data transmission method according to an exemplary embodiment of the present application. The method 200 provided by the embodiment of the present application is executed by a computing device, such as a server. The method 200 comprises the steps of:
201: and acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol.
202: and generating head data of a second preset transmission protocol according to the data to be transmitted and the head preset format of the second preset transmission protocol.
203: and sending data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
Wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
It should be noted that the method 200 may also be implemented by an intelligent terminal, such as a computer, according to the requirement.
The following is set forth in detail with respect to the above steps:
201: and acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol.
The data to be transmitted refers to data waiting to be transmitted to an external device or other devices, such as movie request data, and the data may be determined by an application program or a corresponding program in an execution device, such as a server.
It should be noted that the operating system of the execution apparatus is applied to different operating systems. Such as Linux operating system, Windows operating system, etc. The embodiments of the present application take Linux operating systems as examples for description, but it should be understood that no matter what operating system, the network structure is the same or similar, data transmission may be implemented by the embodiments of the present application.
For the Linux operating system, the network structure at least includes a fourth layer (i.e., a network transmission layer), a third layer (i.e., a network layer), a second layer, and a first layer (i.e., a network card) of the network. The data to be transmitted may be transmitted from an upper layer of the fourth layer, and the application program or the corresponding program thereof belongs to the upper layer of the fourth layer, which may also be referred to as the fifth layer. For the Linux operating system, the four layers belong to the kernel mode. And the fifth layer, namely the application program belongs to the user mode.
The second layer is used for data exchange by using the capability of Media Access Control Address (MAC) Address. The third layer is used for realizing cross-machine and cross-network transmission of data by utilizing routing networking. The fourth layer is to mainly solve the problem of efficient transmission. When the messages passing through the kernel protocol stack of the Linux operating system do not use bypass, rawsock (original socket) and other technologies, the messages need to pass through the fourth layer, reach the third layer, then reach the second layer, and finally leave from the network card, and the packet receiving path direction is just opposite, which is not described herein again.
The first preset transmission protocol includes a UDP transmission protocol, and may also be another transmission protocol, where the transmission reliability of the transmission protocol in network transmission is poor.
For example, according to the above description, in the CDN, the application a of the intermediate server intends to send movie request data to the origin server (i.e. requests the origin server to send movie data). The application a first determines that the movie requested data or written the data and transfers the requested data to the fourth layer.
More specifically, the data packet may be transmitted using a sendmsg () or sendmsg () system call. At this time, it belongs to the data of the application.
After the data to be sent is obtained, a first preset transmission protocol, such as data encapsulation of a UDP protocol, is performed on the data.
Specifically, the method 200 further includes: and generating data of the first preset transmission protocol according to the data to be transmitted and the preset format of the first preset transmission protocol.
The data of the first preset transmission protocol is data which is to be sent and is encapsulated or packaged through the first preset transmission protocol. That is, the data generating the first preset transmission protocol has data to be transmitted.
The preset format of the first preset transmission protocol refers to an encapsulation format of the transmission protocol, which may have header data of the protocol (generated based on the header preset format) and data to be transmitted. When the first preset transmission protocol is the UDP transmission protocol, the header preset format is not described again, and the first preset transmission protocol may have a source port, a destination port, a checksum, a data length, and the like.
For example, as described above, after receiving the data to be sent, the fourth layer may first buffer the data to be sent, and then set efficient data transmission. Such as the format of data packets based on the transmission protocol, the transmission of data packets, the control of the process, the detection and check of the transmission process, the recovery and retransmission, etc. Here, the fourth layer may encapsulate the data to be sent based on the UDP transport protocol, and generate a datagram of the UDP transport protocol, that is, data of the UDP transport protocol.
The data to be transmitted can be transmitted by a first preset transmission protocol. This can be determined from the port number if there are other transport protocols that can also transmit.
Since the encapsulation occurs at the fourth layer, it may also be obtained by the third layer for obtaining data to be transmitted. However, when the third layer receives, the data to be transmitted is already encapsulated by the transport protocol.
Specifically, acquiring data to be transmitted includes: and receiving the generated data of the first preset transmission protocol sent by the network transmission layer, wherein the generated data of the first preset transmission protocol carries the data to be sent.
For example, according to the above, the third layer receives the datagram of the UDP transport protocol, or the data segment, sent by the fourth layer.
In addition to the above-mentioned Data transmission at least through the fourth layer to the second layer of the network, the Data transmission can also be performed through a DPDK (Data Plane Development Kit, which is a Data Plane Development tool set and provides support for library functions and drivers for user-mode efficient Data packet processing under the processor architecture.
Specifically, the method 200 further includes: and acquiring data to be sent based on a preset DPDK framework, and generating data of a first preset transmission protocol according to the data to be sent and a preset format of the first preset transmission protocol.
It should be noted that, for the DPDK, the manner of acquiring the data to be transmitted and generating the data of the first preset transmission protocol is similar to that described above, and details are not described here. For illustration only, the above process occurs in a DPDK environment.
202: and generating head data of a second preset transmission protocol according to the data to be transmitted and the head preset format of the second preset transmission protocol.
Wherein the second preset transmission protocol comprises a TCP transmission protocol. Other transmission protocols may be used, and the transmission reliability of other transmission protocols may be higher than that of the first preset transmission protocol. I.e. the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol. The transmission reliability is determined according to the processing priority of the protocol, the port limitation condition and the throughput limitation condition. For example, a transmission protocol with higher processing priority, less port restriction, and higher throughput may have higher transmission reliability. For TCP transport protocols, it is superior to UDP transport protocols in handling priority, port-limited situations, and throughput-limited situations.
When the second predetermined transport protocol is TCP, the header preset format of the second predetermined transport protocol may have a source port, a destination port, sequence information, a checksum (which may also be referred to as a checksum), a flag, advertised window information, an option value, and the like.
For example, as described above, after the third layer receives the datagram of the UDP transport protocol, or the data segment, sent by the fourth layer, the header data of the new TCP transport protocol needs to be added to the datagram or the data segment. The header data of the second preset transmission protocol may be generated according to a header preset format of the TCP transmission protocol.
Note that the header data of the TCP transport protocol here belongs to the header data of the pseudo TCP transport protocol. It belongs to header data that simulates the TCP transport protocol.
To better generate the header data of the second preset transport protocol, it can also be processed by a preset packet processing framework in the network layer.
Specifically, the method 200 further includes: and generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol based on a preset data packet processing frame in the network layer.
The preset packet processing framework may refer to a framework providing rich packet processing capability, such as netfilter. Other frameworks are possible, such as the DPDK framework.
As shown in fig. 3, for the packet sending direction (i.e. the direction of sending the packet or the direction of sending the data packet), encapsulating the FTCP header (i.e. the dummy TCP packet, i.e. encapsulating the header data of the TCP transmission protocol) at the Localout hook point of the netfilter may be implemented, and then sending the packet out through the second layer and the network card. Correspondingly, the packet receiving direction can decapsulate the FTCP header at the Localin hook point of the netfilter, reduce the FTCP header into a data packet of the UDP transport protocol, and submit the data packet to the network transport layer, and submit the data packet to the process of the corresponding program after the network transport layer is noninductive.
Therefore, the kernel-mode network is realized in a layered mode, each layer has a specific header structure, the FTCP is equivalently subdivided into one layer in a netfilter framework, a unique header structure is really needed, and the header structure adopts a header simulating a TCP (transmission control protocol). In contrast, other transport protocol headers may be constructed.
For DPDK, the process is similar, and a corresponding location providing rich packet processing capability is found, such as a function or a mechanism, to encapsulate or decapsulate the FTCP header. For other frameworks, or other operating systems, corresponding locations that provide rich packet processing capabilities may be found, such as functions or mechanisms, to implement encapsulating the FTCP header or decapsulating the FTCP header.
In addition, for a specific process of generating the header data of the second preset transfer protocol, the header data may be generated according to a source port, a destination port, sequence information, a checksum (which may also be referred to as a checksum value), a flag, advertised window information, an option value, and the like.
For the generation, the generation can be directly determined according to the data to be transmitted, the corresponding port number, a TCP transport protocol preset algorithm and the like. Similar to the generation of the real TCP transport protocol. In addition to this, the data may be generated based on UDP transport protocol.
Specifically, generating the header data of the second preset transmission protocol according to the data to be transmitted and the header preset format of the second preset transmission protocol includes: and performing corresponding data filling on a header preset format of a second preset transmission protocol based on the data to be transmitted and the generated header data of the first preset transmission protocol to generate the header data of the second preset transmission protocol.
Since the data of the UDP transport protocol has the same portion as the header data of the TCP transport protocol, such as a source port and a destination port, the data of the UDP transport protocol may be directly referred to, and details thereof are not described herein.
In addition, for a specific process of generating the header data of the second preset transfer protocol, the header data may be generated according to a source port, a destination port, sequence information, a checksum (which may also be referred to as a checksum value), a flag, advertised window information, an option value, and the like.
Specifically, generating the header data of the second preset transmission protocol according to the data to be transmitted and the header preset format of the second preset transmission protocol includes: determining port data in a head preset format according to port data of data to be sent; determining serial number data in a head preset format according to a second preset transmission protocol; determining check data in the head preset format according to corresponding current data and data to be sent in the head preset format; and generating the header data of the second preset transmission protocol based on the header preset format and the corresponding data.
For example, as mentioned above, the Localout hook of netfilter does not need to customize ports for the lightweight TCP mechanism, and the port information of the packets of the UDP transport protocol, such as the source port number and the destination port number, can be fully used. Sequence information, also contains bi-directional Sequence information such as Sequence numbers and acknowledgment numbers. Each time there is new data to be sent, it corresponds to a set of tuples consisting of source IP address, source port, destination (destination) IP address, destination (destination) port, protocol. If the data to be transmitted does not have a ready-to-use FTCP channel, a simulated TCP connection mechanism needs to be triggered, at this time, a distribution method of a real TCP seq (Sequence) is used, a random seq serial number is distributed according to a TCP preset algorithm, similarly, when a syn message in the simulated TCP connection mechanism is received by an opposite terminal (such as receiving equipment), an FTCP layer of the opposite terminal needs to simulate a response, and a seq is randomly distributed by adopting the distribution method of the real TCP seq as an acknowledgement number ack seq during the response, so that complete seq information exists, and then the seq and ack seq values of each data packet are continuously updated through data transmission accumulation. For the flag bit, except for the analog TCP connection message, other messages are simply processed to be that the header data of the TCP transmission protocol of each message carries the ACK flag bit and the PSH flag bit. The notification window information can be directly packaged into a fixed value without excessive treatment. And (4) the checksum and the checksum need to be completely reconstructed, otherwise, the checksum is discarded due to abnormal check values when passing through the network operator equipment, and the checksum is completely implemented by adopting a preset algorithm of the TCP. Option value, without encapsulating any options.
Thus, a lightweight TCP mechanism can be constructed. After the completion, the complete FTCP capability is constructed, and the transmission performance optimization of the UDP transmission protocol can be realized. In the transmission process of the message, when the corresponding message reaches the equipment of the network operator, the message is identified as the message corresponding to the TCP transmission protocol, the equipment of the network operator enables the high-priority processing logic of the TCP transmission protocol, directly skips the block check of the equipment of the network operator on the port of the UDP transmission protocol, processes the message according to the high priority of the TCP 80 or 443 port, and does not suffer from the current limiting and speed limiting punishment of the UDP transmission protocol.
In order to guarantee the data to be sent of the added header data of the second preset transmission protocol, whether to add the header data of the second preset transmission protocol may be indicated by an application program or a corresponding program.
Specifically, the method 200 includes: after the data to be sent is obtained, whether the data to be sent carries information for generating head data of a second preset transmission protocol is searched, and if the information exists, a step of generating the head data of the second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol is executed.
For example, as described above, application a sends a data packet using sendmsg () or sendmsg () system calls, encapsulating TOS in the msg _ control address of the struct msghdr structure, which is used to pass auxiliary data, supporting a wide variety of types of IP _ TOS used in the system. And encapsulating the TOS value of the message in a struct msghdr structure, wherein the message is encapsulated when sendmsg or sendmsg is called every time, a kernel mode level analyzes the TOS field, and the TOS value is injected into an IP TOS domain when skb (socket buffer) is encapsulated. The netfilter Localout hook resolves or reads the TOS value, and the addition of the header data of the TCP transport protocol may be performed, i.e. the FTCP is encapsulated. The specific addition method will not be described again.
203: and sending data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
For example, according to the foregoing, after the encapsulating of the FTCP is completed by the Localout hook of the netfilter, an IP (Internet Protocol ) message may be generated, and then the corresponding frame header may be generated by the second layer, and the message with the frame header may be sent out by the network card. As shown in fig. 4, the complete structure header of the finally encapsulated packet may include an ethernet header (layer 2), i.e., header data corresponding to the second layer, and a frame header. The IP header (layer 3) is header data corresponding to the third layer, and the FTCP header (pseudo-fourth layer header) is header data corresponding to the pseudo-fourth layer, and is also header data of the TCP transport protocol. The UDP header (real four-layer header) is header data corresponding to the fourth layer, and is also header data of the UDP transport protocol. In addition to these header data, there are also naked data, i.e. data to be sent written by the corresponding program, and other protocol headers, etc.
Specifically, the sending of data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol includes: and sending data to be sent based on the generated data of the first preset transmission protocol and the generated header data of the second preset transmission protocol.
Since the foregoing has been set forth, further description is omitted herein.
In addition, transmitting data to be transmitted based on the generated header data of the second preset transmission protocol and the first preset transmission protocol includes: determining a transmission channel of a second preset transmission protocol corresponding to the head data according to the head data of the second preset transmission protocol; encapsulating the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; and transmitting the message according to the determined transmission channel.
The manner of determining the transmission channel of the second preset transmission protocol corresponding to the header data may be: and selecting a transmission channel of a corresponding TCP transmission protocol, such as a transmission connection, by the source IP address and the destination IP address in the header data.
Since the foregoing has been set forth, further description is omitted herein. It is only to say that, before generating the corresponding message, a transmission channel, such as a transmission channel of a TCP transmission protocol, needs to be selected. It is determined that a corresponding transmission channel is present. The corresponding message may be put into the transmission channel for transmission.
When the corresponding transmission channel does not exist, the corresponding transmission channel needs to be established.
Specifically, the method 200 further includes: determining whether a transmission channel of a second preset transmission protocol corresponding to the head data exists according to the head data of the second preset transmission protocol; and if not, creating a transmission channel of a second preset transmission protocol corresponding to the header data.
The establishment can be carried out by simulating the establishment mechanism of the transmission channel of the TCP transmission protocol. Such as simulating a three-way handshake set-up mechanism.
Specifically, creating a transmission channel of a second preset transmission protocol corresponding to the header data includes: generating a first message based on a second preset transmission protocol, and sending the first message through the first preset transmission protocol to request to establish a transmission channel with receiving equipment; and receiving a second message responding to the first message through the first preset transmission protocol, generating a third message based on the second message and the second preset transmission protocol, sending the third message through the first preset transmission protocol to confirm to the receiving equipment, and completing the establishment of a transmission channel after the receiving equipment receives the third message and the third message takes effect.
The first message may be a syn packet or a message. The second message is a syn + ack combined data packet or message. The third message is an ack packet or message. Thereby completing the establishment of the transmission channel. And will not be described in detail herein. Only the description is as follows: the process is asynchronous, the above-mentioned message triggered and simulated still goes through UDP protocol transmission (without encapsulating header data of FTCP transmission protocol), and after the asynchronous handshake logic is completed, other data messages of the flow will be sent by constructing the header data of FTCP.
In addition, after the corresponding packet is sent, a packet in a corresponding format may be received from a receiving device (i.e., a peer device).
Specifically, the method 200 further includes: and receiving data to be processed from the receiving equipment, and when the data to be processed carries the head data of the second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
The data to be processed may refer to a packet having the header data, and the processing of the data to be processed refers to application data (i.e., data written by an application) in the data of the first preset transmission protocol. The data to be processed may also refer to data written by an application program in the receiving device, and for the data written by the application program, the data to be processed carrying the first preset transmission protocol means that the data to be processed carries, in addition to itself, header data of the first preset transmission protocol to constitute data of the first preset transmission protocol.
For example, according to the foregoing, after receiving the packet through the network card, the intermediate server decapsulates the frame header through the second layer, uploads the decapsulated frame header to the third layer, and decapsulates the IP packet through the third layer, so as to obtain the data packet or data segment of the transmission protocol. When the header data of the FTCP exists, the header of the FTCP can be decapsulated by a Localin hook point of the netfilter, and is restored to a data packet of the UDP transport protocol and submitted to the network transport layer, and the data packet is submitted to a process of a corresponding program after the network transport layer is noninductive.
It should be noted that, after receiving the sent packet, the peer device may also decapsulate and process data according to a subsequent method.
Specifically, the method further comprises: or, decapsulating the header data of the second preset transmission protocol specifically includes: and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
Since the foregoing has been set forth, further description is omitted herein.
In addition, the method 200 further comprises: and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
It should be noted that, since the foregoing description has already been provided, the description is omitted here.
In addition, the method 200 further comprises: and processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK framework.
For example, according to the foregoing, the manner in which the DPDK architecture processes data is similar to that described above, and is not described herein again.
Therefore, TCP (transmission control protocol) transmission of the data of the UDP (user datagram protocol) transmission protocol is realized, the affinity of the data of the UDP transmission protocol on the operator side is improved, the problems of current limitation, speed limitation, QOS (quality of service) and port prohibition of the data of the UDP transmission protocol are solved, the transmission performance of the UDP transmission protocol is greatly improved, and the product experience is optimized.
Based on the similar inventive concept, fig. 5 shows a flow chart of a data transmission method provided in another exemplary embodiment of the present application. The method 500 provided by the embodiment of the present application is executed by a server, and the method 500 includes the following steps:
501: and receiving data to be processed, wherein the data to be processed carries data of a first preset transmission protocol.
502: when the data to be processed carries the head data of the second preset transmission protocol, the head data of the second preset transmission protocol is unpacked, so that the data to be processed is processed based on the data to be processed carrying the data of the first preset transmission protocol.
Wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
Since the detailed description of the specific implementation of steps 501-502 has been described above, the detailed description thereof is omitted here. Only the description is as follows: the method 500 may also be applied to an intelligent terminal, such as a computer or the like.
In addition, the method 500 further includes: and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
In addition, the method 500 further includes: and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
In addition, the method 500 further includes: and processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK framework.
The first preset transmission protocol comprises a UDP transmission protocol; the second predetermined transport protocol comprises the TCP transport protocol.
Wherein, the transmission reliability is determined according to the processing priority of the protocol, the port limitation condition and the throughput limitation condition.
In addition, reference may also be made to various steps in the method 200 described above, where the method 500 is not described in detail.
Based on the similar inventive concept, fig. 6 shows a flow chart of a data transmission method provided in another exemplary embodiment of the present application. The method 600 provided by the embodiment of the present application is executed by a server, and the method 600 includes the following steps:
601: and acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol.
602: and generating head data of a second preset transmission protocol according to the data to be transmitted and the head preset format of the second preset transmission protocol.
603: and sending data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
Wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
604: and receiving data to be processed from the receiving equipment, and when the data to be processed carries the head data of the second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
Since the detailed description of the specific implementation of steps 601-604 has been described above, it is not repeated here. For illustration only, the method 600 may also be applied to an intelligent terminal, such as a computer.
In addition, reference may also be made to the above-mentioned steps of the method 200 for details which are not described in the method 600.
Fig. 7 is a schematic structural framework diagram of a data transmission device according to an exemplary embodiment of the present application. The apparatus 700 may be applied to a server. The apparatus 700 comprises: an acquisition module 701, a generation module 702, and a sending module 703; the following detailed description is directed to the functions of the various modules:
an obtaining module 701 is configured to obtain data to be sent, where the data to be sent belongs to data to be sent based on a first preset transmission protocol.
A generating module 702, configured to generate header data of a second preset transmission protocol according to data to be sent and a header preset format of the second preset transmission protocol.
A sending module 703, configured to send data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
Wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
Specifically, the sending module 703 is configured to: and sending data to be sent based on the generated data of the first preset transmission protocol and the generated header data of the second preset transmission protocol.
Further, the generating module 702 is further configured to: and generating data of the first preset transmission protocol according to the data to be transmitted and the preset format of the first preset transmission protocol.
Specifically, the generating module 702 is configured to: and performing corresponding data filling on a header preset format of a second preset transmission protocol based on the data to be transmitted and the generated header data of the first preset transmission protocol to generate the header data of the second preset transmission protocol.
Specifically, the sending module 703 includes: a first determining unit, configured to determine, according to header data of a second preset transmission protocol, a transmission channel of the second preset transmission protocol corresponding to the header data; the encapsulation unit is used for encapsulating the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; and the transmission unit is used for transmitting the message according to the determined transmission channel.
In addition, the apparatus 700 further comprises: the creating module is used for determining whether a transmission channel of a second preset transmission protocol corresponding to the head data exists or not according to the head data of the second preset transmission protocol; and if the header data does not exist, a creating module is used for creating a transmission channel of a second preset transmission protocol corresponding to the header data.
Specifically, the creating module includes: a sending unit, configured to generate a first message based on a second preset transmission protocol, and send the first message through the first preset transmission protocol to request to establish a transmission channel with a receiving device; and the sending unit is used for receiving a second message responding to the first message through the first preset transmission protocol, generating a third message based on the second message and the second preset transmission protocol, sending the third message through the first preset transmission protocol to confirm to the receiving equipment, and completing the establishment of the transmission channel after the receiving equipment receives the third message and the third message takes effect.
Further, the apparatus 700 comprises: and the searching module is used for searching whether the data to be sent carries information for generating the head data of the second preset transmission protocol or not after the data to be sent is obtained, and if the information exists, executing the step of generating the head data of the second preset transmission protocol according to the data to be sent and the head preset format of the second preset transmission protocol.
Specifically, the generating module 702 includes: a second determining unit, configured to determine, according to port data of data to be sent, port data in a header preset format; the second determining unit is used for determining serial number data in the head preset format according to a second preset transmission protocol; the second determining unit is used for determining the check data in the head preset format according to the corresponding current data in the head preset format and the data to be sent; and the generating unit is used for generating the header data of the second preset transmission protocol based on the header preset format and the corresponding data.
Specifically, the obtaining module 701 is configured to receive data of a generated first preset transmission protocol sent by a network transport layer, where the data of the generated first preset transmission protocol carries data to be sent.
In addition, the generating module 702 is further configured to generate header data of a second preset transmission protocol according to the data to be sent and a header preset format of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
In addition, the obtaining module 701 is further configured to obtain data to be sent based on a preset DPDK framework, and generate data of a first preset transmission protocol according to the data to be sent and a preset format of the first preset transmission protocol.
In addition, the apparatus 700 further comprises: and the decapsulation module is used for receiving the data to be processed from the receiving device, and decapsulating the header data of the second preset transmission protocol when the data to be processed carries the header data of the second preset transmission protocol, so that the data to be processed is processed based on the data to be processed carrying the data of the first preset transmission protocol.
In addition, the decapsulation module is further configured to decapsulate the header data of the second preset transmission protocol based on a preset packet processing framework in the network layer.
Furthermore, the sending module 703 is further configured to: and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
In addition, the apparatus 700 further comprises: and the processing module is used for processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK framework.
The first preset transmission protocol comprises a UDP transmission protocol; the second predetermined transport protocol comprises the TCP transport protocol.
Wherein, the transmission reliability is determined according to the processing priority of the protocol, the port limitation condition and the throughput limitation condition.
Fig. 8 is a schematic structural framework diagram illustrating a data transmission apparatus according to still another exemplary embodiment of the present application. The apparatus 800 may be applied to a server. The apparatus 800 comprises: the receiving module 801 and the decapsulating module 802, the functions of which are described in detail below:
the receiving module 801 is configured to receive data to be processed, where the data to be processed carries data of a first preset transmission protocol.
The decapsulation module 802 is configured to decapsulate, when the to-be-processed data carries header data of a second preset transmission protocol, the header data of the second preset transmission protocol, so that the to-be-processed data is processed based on the to-be-processed data carrying data of the first preset transmission protocol.
Wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
In addition, the decapsulation module 802 is further configured to: and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
In addition, the apparatus 800 further comprises: and the processing module is used for sending the data to be processed carrying the data of the first preset transmission protocol to the network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
In addition, the apparatus 800 further comprises: and the processing module is used for processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK framework.
The first preset transmission protocol comprises a UDP transmission protocol; the second predetermined transport protocol comprises the TCP transport protocol.
Wherein, the transmission reliability is determined according to the processing priority of the protocol, the port limitation condition and the throughput limitation condition.
For parts that cannot be mentioned by the apparatus 800, reference may be made to the contents of the apparatus 700 described above.
Fig. 9 is a schematic structural framework diagram illustrating a data transmission apparatus according to still another exemplary embodiment of the present application. The apparatus 900 may be applied to a server. The apparatus 900 includes: the functions of the acquiring module 901, the generating module 902, the sending module 903 and the decapsulating module 904 are described in detail below:
an obtaining module 901, configured to obtain data to be sent, where the data to be sent belongs to data to be sent based on a first preset transmission protocol.
A generating module 902, configured to generate header data of a second preset transmission protocol according to data to be sent and a header preset format of the second preset transmission protocol.
A sending module 903, configured to send data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
The transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol;
the decapsulation module 904 is configured to receive data to be processed from the receiving device, and when the data to be processed carries header data of a second preset transmission protocol, decapsulate the header data of the second preset transmission protocol, so that the data to be processed is processed based on the data to be processed carrying the data of the first preset transmission protocol.
For parts of the content that cannot be mentioned by the apparatus 900, reference may be made to the content of the apparatus 700 described above.
While the internal functions and structures of the apparatus 700 shown in FIG. 7 are described above, in one possible design, the structures of the apparatus 700 shown in FIG. 7 may be implemented as a computing device, such as a server. As shown in fig. 10, the apparatus 1000 may include: a memory 1001, a processor 1002;
a memory 1001 for storing a computer program.
A processor 1002 for executing a computer program for: acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol; sending data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
Specifically, the processor 1002 is specifically configured to: and sending data to be sent based on the generated data of the first preset transmission protocol and the generated header data of the second preset transmission protocol.
Further, the processor 1002 is further configured to: and generating data of the first preset transmission protocol according to the data to be transmitted and the preset format of the first preset transmission protocol.
Specifically, the processor 1002 is specifically configured to: and performing corresponding data filling on a header preset format of a second preset transmission protocol based on the data to be transmitted and the generated header data of the first preset transmission protocol to generate the header data of the second preset transmission protocol.
Specifically, the processor 1002 is specifically configured to: determining a transmission channel of a second preset transmission protocol corresponding to the head data according to the head data of the second preset transmission protocol; encapsulating the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; and transmitting the message according to the determined transmission channel.
Further, the processor 1002 is further configured to: determining whether a transmission channel of a second preset transmission protocol corresponding to the head data exists according to the head data of the second preset transmission protocol; and if the header data does not exist, a creating module is used for creating a transmission channel of a second preset transmission protocol corresponding to the header data.
Specifically, the processor 1002 is specifically configured to: generating a first message based on a second preset transmission protocol, and sending the first message through the first preset transmission protocol to request to establish a transmission channel with receiving equipment; and the sending unit is used for receiving a second message responding to the first message through the first preset transmission protocol, generating a third message based on the second message and the second preset transmission protocol, sending the third message through the first preset transmission protocol to confirm to the receiving equipment, and completing the establishment of the transmission channel after the receiving equipment receives the third message and the third message takes effect.
Further, the processor 1002 is further configured to: after the data to be sent is obtained, whether the data to be sent carries information for generating head data of a second preset transmission protocol is searched, and if the information exists, a step of generating the head data of the second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol is executed.
Specifically, the processor 1002 is specifically configured to: determining port data in a head preset format according to port data of data to be sent; determining serial number data in a head preset format according to a second preset transmission protocol; determining check data in the head preset format according to corresponding current data and data to be sent in the head preset format; and generating the header data of the second preset transmission protocol based on the header preset format and the corresponding data.
Specifically, the processor 1002 is specifically configured to: and receiving the generated data of the first preset transmission protocol sent by the network transmission layer, wherein the generated data of the first preset transmission protocol carries the data to be sent.
Further, the processor 1002 is further configured to: and generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol based on a preset data packet processing frame in the network layer.
Further, the processor 1002 is further configured to: and acquiring data to be sent based on a preset DPDK framework, and generating data of a first preset transmission protocol according to the data to be sent and a preset format of the first preset transmission protocol.
Further, the processor 1002 is further configured to: and receiving data to be processed from the receiving equipment, and when the data to be processed carries the head data of the second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
Further, the processor 1002 is further configured to: and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
Further, the processor 1002 is further configured to: and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
Further, the processor 1002 is further configured to: and processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK framework.
The first preset transmission protocol comprises a UDP transmission protocol; the second predetermined transport protocol comprises the TCP transport protocol.
Wherein, the transmission reliability is determined according to the processing priority of the protocol, the port limitation condition and the throughput limitation condition.
In addition, embodiments of the present invention provide a computer storage medium, and the computer program, when executed by one or more processors, causes the one or more processors to implement the steps of one of the transmission methods of data in the method embodiments of fig. 1-4.
While the internal functions and structures of the apparatus 800 shown in fig. 8 are described above, in one possible design, the structures of the apparatus 800 shown in fig. 8 may be implemented as a computing device, such as a cloud server. As shown in fig. 11, the apparatus 1100 may include: memory 1101, processor 1102, and communications component 1103;
a memory 1101 for storing a computer program.
The communication component 1103 is configured to receive data to be processed, where the data to be processed carries data of a first preset transmission protocol.
A processor 1102 for executing the computer program for: when the data to be processed carries the head data of a second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
Further, the processor 1102 is further configured to: and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
Further, the processor 1102 is further configured to: and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
Further, the processor 1102 is further configured to: and processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK framework.
The first preset transmission protocol comprises a UDP transmission protocol; the second predetermined transport protocol comprises the TCP transport protocol.
Wherein, the transmission reliability is determined according to the processing priority of the protocol, the port limitation condition and the throughput limitation condition.
For some contents that the device 1100 fails to mention, reference may be made to the contents of the device 1000 described above.
In addition, embodiments of the present invention provide a computer storage medium, and the computer program, when executed by one or more processors, causes the one or more processors to implement the steps of one data transmission method in the method embodiment of fig. 5.
While the internal functionality and structure of the apparatus 900 shown in fig. 9 are described above, in one possible design, the structure of the apparatus 900 shown in fig. 9 may be implemented as a computing device, such as a cloud server. As shown in fig. 12, the apparatus 1200 may include: memory 1201, processor 1202, and communications component 1203;
a memory 1201 for storing a computer program.
A processor 1202 for executing the computer program for: acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol; generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol; sending data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol.
A communication component 1203 is configured to receive the data to be processed from the receiving device.
The processor 1202 is configured to decapsulate, when the to-be-processed data carries header data of a second preset transmission protocol, the header data of the second preset transmission protocol, so that the to-be-processed data is processed based on the to-be-processed data carrying data of the first preset transmission protocol.
For some contents that cannot be mentioned by the apparatus 1200, reference may be made to the contents of the apparatus 1000 described above.
In addition, embodiments of the present invention provide a computer storage medium, and the computer program, when executed by one or more processors, causes the one or more processors to implement the steps of one data transmission method in the method embodiment of fig. 6.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 201, 202, 203, etc., are merely used for distinguishing different operations, and the sequence numbers themselves do not represent any execution order. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described aspects and portions of the present technology which contribute substantially or in part to the prior art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including without limitation disk storage, CD-ROM, optical storage, and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable multimedia data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable multimedia data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable multimedia data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable multimedia data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (29)

1. A method for transmitting data, comprising:
acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol;
generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol;
sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
2. The method according to claim 1, wherein the transmitting the data to be transmitted based on the generated header data of the second preset transmission protocol and the first preset transmission protocol comprises:
and sending the data to be sent based on the generated data of the first preset transmission protocol and the generated header data of the second preset transmission protocol.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and generating the data of the first preset transmission protocol according to the data to be transmitted and the preset format of the first preset transmission protocol.
4. The method according to claim 1, wherein the generating header data of a second preset transmission protocol according to the data to be transmitted and a header preset format of the second preset transmission protocol comprises:
and performing corresponding data filling on the head preset format of the second preset transmission protocol based on the data to be sent and the generated head data of the first preset transmission protocol to generate the head data of the second preset transmission protocol.
5. The method according to claim 1, wherein the transmitting the data to be transmitted based on the generated header data of the second preset transmission protocol and the first preset transmission protocol comprises:
determining a transmission channel of a second preset transmission protocol corresponding to the head data according to the head data of the second preset transmission protocol;
encapsulating the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message;
and transmitting the message according to the determined transmission channel.
6. The method of claim 5, further comprising:
determining whether a transmission channel of a second preset transmission protocol corresponding to the head data exists according to the head data of the second preset transmission protocol;
and if not, creating a transmission channel of a second preset transmission protocol corresponding to the header data.
7. The method of claim 6, wherein creating the transmission channel of the second preset transmission protocol corresponding to the header data comprises:
generating a first message based on the second preset transmission protocol, and sending the first message through the first preset transmission protocol to request to establish a transmission channel with a receiving device;
and receiving a second message responding to the first message through the first preset transmission protocol, generating a third message based on the second message and the second preset transmission protocol, sending the third message through the first preset transmission protocol to confirm to the receiving equipment, and completing the establishment of the transmission channel after the receiving equipment receives the third message and the third message takes effect.
8. The method according to claim 1, characterized in that it comprises:
after the data to be sent is obtained, whether the data to be sent carries information for generating head data of a second preset transmission protocol is searched, and if the information exists, the step of generating the head data of the second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol is executed.
9. The method according to claim 1, wherein the generating header data of a second preset transmission protocol according to the data to be transmitted and a header preset format of the second preset transmission protocol comprises:
determining port data in the head preset format according to port data of data to be sent;
determining serial number data in the head preset format according to the second preset transmission protocol;
determining the check data in the head preset format according to the corresponding current data and the data to be sent in the head preset format;
and generating header data of a second preset transmission protocol based on the header preset format and the corresponding data.
10. The method of claim 1, wherein the obtaining data to be transmitted comprises:
and receiving data of a generated first preset transmission protocol sent by a network transmission layer, wherein the data of the generated first preset transmission protocol carries the data to be sent.
11. The method of claim 1, further comprising:
and generating head data of a second preset transmission protocol according to the data to be transmitted and a head preset format of the second preset transmission protocol based on a preset data packet processing frame in a network layer.
12. The method of claim 1, further comprising:
acquiring data to be transmitted based on a preset DPDK architecture, and generating the data of the first preset transmission protocol according to the data to be transmitted and the preset format of the first preset transmission protocol.
13. The method of claim 1, further comprising:
and receiving data to be processed from a receiving device, and when the data to be processed carries the head data of the second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
14. The method of claim 13, further comprising:
and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in a network layer.
15. The method of claim 13, further comprising:
and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
16. The method of claim 13, further comprising:
and processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK architecture.
17. The method of claim 1, wherein the first predetermined transport protocol comprises UDP transport protocol; the second predetermined transport protocol comprises a TCP transport protocol.
18. The method of claim 1, wherein the transmission reliability is determined according to a processing priority of a protocol, a port restriction condition, and a throughput restriction condition.
19. A method for transmitting data, comprising:
receiving data to be processed, wherein the data to be processed carries data of a first preset transmission protocol;
when the data to be processed carries the head data of a second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
20. The method of claim 19, further comprising:
and decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in a network layer.
21. The method of claim 19, further comprising:
and sending the data to be processed carrying the data of the first preset transmission protocol to a network transmission layer so as to process the data to be processed based on the data of the first preset transmission protocol.
22. The method of claim 19, further comprising:
and processing the data to be processed based on the data of the first preset transmission protocol based on a preset DPDK architecture.
23. The method of claim 19, wherein the first predetermined transport protocol comprises UDP transport protocol; the second predetermined transport protocol comprises a TCP transport protocol.
24. The method of claim 19, wherein the transmission reliability is determined according to a processing priority of a protocol, a port limit condition, and a throughput limit condition.
25. A method for transmitting data, comprising:
acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol;
generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol;
sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol;
and receiving data to be processed from a receiving device, and when the data to be processed carries the head data of the second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
26. A computing device, comprising: a memory, a processor;
the memory for storing a computer program;
the processor is used for acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol;
generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol;
sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
27. A computing device, comprising: a memory, a processor, and a communication component;
the memory for storing a computer program;
the communication component is used for receiving data to be processed, and the data to be processed carries data of a first preset transmission protocol;
the processor to execute the computer program to:
when the data to be processed carries the head data of a second preset transmission protocol, decapsulating the head data of the second preset transmission protocol so as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
28. A computing device, comprising: a memory, a processor, and a communication component;
the memory for storing a computer program;
the processor to execute the computer program to:
acquiring data to be sent, wherein the data to be sent belongs to data to be sent based on a first preset transmission protocol;
generating head data of a second preset transmission protocol according to the data to be sent and a head preset format of the second preset transmission protocol;
sending the data to be sent based on the generated head data of the second preset transmission protocol and the first preset transmission protocol; wherein the transmission reliability of the second preset transmission protocol is higher than that of the first preset transmission protocol;
the communication component is used for receiving data to be processed from a receiving device;
the processor is configured to decapsulate, when the to-be-processed data carries the header data of the second preset transmission protocol, so that the to-be-processed data is processed based on the to-be-processed data carrying the data of the first preset transmission protocol.
29. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by one or more processors, causes the one or more processors to perform the steps of the method of any one of claims 1-25.
CN202110070753.XA 2021-01-19 2021-01-19 Data transmission method, computing device and storage medium Pending CN113301007A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110070753.XA CN113301007A (en) 2021-01-19 2021-01-19 Data transmission method, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110070753.XA CN113301007A (en) 2021-01-19 2021-01-19 Data transmission method, computing device and storage medium

Publications (1)

Publication Number Publication Date
CN113301007A true CN113301007A (en) 2021-08-24

Family

ID=77318848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110070753.XA Pending CN113301007A (en) 2021-01-19 2021-01-19 Data transmission method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN113301007A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113765919A (en) * 2021-09-07 2021-12-07 深圳市瑞云科技有限公司 Method for improving UDP (user Datagram protocol) message sending efficiency of Linux system
CN114979303A (en) * 2022-04-29 2022-08-30 京东科技信息技术有限公司 Method, device, equipment and readable medium for processing service quality of network data packet
CN115086396A (en) * 2022-04-29 2022-09-20 阿里巴巴(中国)有限公司 Method and system for transmitting media data

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113765919A (en) * 2021-09-07 2021-12-07 深圳市瑞云科技有限公司 Method for improving UDP (user Datagram protocol) message sending efficiency of Linux system
CN113765919B (en) * 2021-09-07 2023-11-03 深圳市瑞云科技有限公司 Method for improving UDP message sending efficiency of Linux system
CN114979303A (en) * 2022-04-29 2022-08-30 京东科技信息技术有限公司 Method, device, equipment and readable medium for processing service quality of network data packet
CN115086396A (en) * 2022-04-29 2022-09-20 阿里巴巴(中国)有限公司 Method and system for transmitting media data
CN114979303B (en) * 2022-04-29 2024-04-05 京东科技信息技术有限公司 Method, device, equipment and readable medium for processing service quality of network data packet

Similar Documents

Publication Publication Date Title
CN113301007A (en) Data transmission method, computing device and storage medium
CN110753072B (en) Load balancing system, method, device and equipment
US10826830B2 (en) Congestion processing method, host, and system
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
CN110177082B (en) Data processing method, device, medium and apparatus
US9015822B2 (en) Automatic invocation of DTN bundle protocol
CN106664290A (en) Data transmission method and device for photoelectric hybrid network
US11799827B2 (en) Intelligently routing a response packet along a same connection as a request packet
TW201737664A (en) Accurate speed limiting method and apparatus for cluster
WO2015106453A1 (en) Service processing method and network device
CN114070833A (en) Multi-protocol service compatible method, system, device, medium, and program product
CN107995233B (en) Method for establishing connection and corresponding equipment
CN114095587A (en) Client, message sending and receiving method, device and storage medium
US10097375B2 (en) Electronic device and transmission method thereof
CN110798366B (en) Task logic processing method, device and equipment
EP4142266A1 (en) Data transmission method and related device
CN113595694B (en) Data transmission method, computing device and storage medium
CN106576085B (en) Transmission Control Protocol (TCP) Acknowledgement (ACK) packet suppression
US11436172B2 (en) Data frame interface network device
CN114125080A (en) Message link terminal protocol stack construction method and analysis method, device and terminal
CN115801739A (en) Data transmission method, data processing method and device, conference terminal and medium
CN113114565B (en) Data message forwarding method and device, storage medium and electronic equipment
CN113973086B (en) Data transmission method, device and storage medium
CN117768388A (en) Device and method for applying virtual router under OpenStack
CN115529348A (en) Data transmission method, system, equipment and computer readable storage medium

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