Data transmission method, computing device and storage medium
By generating the second preset transmission protocol header data with high transmission reliability and the UDP protocol data encapsulation, the connectivity and availability of the UDP protocol during peak periods is solved, the transmission performance and service quality are improved, and the operator side is avoided Current limit and ban.
Patent Information
- Application Number
- CN202110070753.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-19
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-01-19
AI Technical Summary
Existing UDP-based services have poor connectivity, low availability and serious service quality jitter under scale, especially during peak hours, which leads to the operator's stream limit, speed limit and port data on UDP protocol. Blocking affects transmission performance.
By generating the second preset transmission protocol header data with higher transmission reliability and encapsulating it with the first preset transmission protocol (such as UDP) data, the affinity on the network operator side is improved, and the current limit is solved. Speed limit and port blocking issues improve the transmission performance of the UDP protocol.
It significantly improves the transmission performance of the UDP protocol, optimizes the product experience, enhances the affinity for the operator side, solves the problems of current limit, speed limit and port bans, and improves service quality.
Smart Images

Figure CN113301007B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a data transmission method, a computing device, and a storage medium. Background Art
[0002] Recently, new protocols and frameworks based on UDP (User Datagram Protocol) such as HTTP (Hypertext Transfer Protocol) 3.0, SRT (Secure Reliable Transport, a low-latency live broadcast protocol), and Webrtc (Web Real-Time Communication, web instant communication) have been gradually constructed, and the Internet industry has developed many service products based on these protocols and frameworks in different scenarios. However, these products have gradually exposed service experience problems in actual scale, mainly manifested in poor connectivity, low availability, and problems with connecting to the server. In addition, the product experience is unstable and the service quality fluctuates greatly, especially during the evening peak. Summary of the invention
[0003] Multiple aspects of the present application provide a data transmission method, a computing device, and a storage medium to improve the transmission performance of the UDP protocol.
[0004] An embodiment of the present application provides a data transmission method, comprising: obtaining data to be sent, wherein the data to be sent is data to be sent based on a first preset transmission protocol; generating header data of a second preset transmission protocol according to the data to be sent and a header preset format of a second preset transmission protocol; sending the 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 the transmission reliability of the first preset transmission protocol.
[0005] An embodiment of the present application also provides a data transmission method, comprising: receiving data to be processed, the data to be processed carrying data of a first preset transmission protocol; when the data to be processed carries header data of a second preset transmission protocol, unpacking 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; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0006] An embodiment of the present application also provides a data transmission method, including: obtaining data to be sent, the data to be sent is data to be sent based on a first preset transmission protocol; generating header data of a second preset transmission protocol according to the data to be sent and a header preset format of a second preset transmission protocol; sending the 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 the transmission reliability of the first preset transmission protocol; receiving data to be processed from a receiving device, and when the data to be processed carries the header data of the second preset transmission protocol, unsealing the header data of the second preset transmission protocol, so that the data to be processed is processed based on the fact that the data to be processed carries the data of the first preset transmission protocol.
[0007] An embodiment of the present application also provides a computing device, including: a memory and a processor; the memory is used to store computer programs; the processor is used to obtain data to be sent, the data to be sent is data to be sent based on a first preset transmission protocol; according to the data to be sent and a header preset format of a second preset transmission protocol, header data of a second preset transmission protocol is generated; based on the generated header data of the second preset transmission protocol and the first preset transmission protocol, the data to be sent is sent; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0008] An embodiment of the present application also provides a computing device, comprising: a memory, a processor and a communication component; the memory is used to store a computer program; the communication component is used to receive data to be processed, and the data to be processed carries data of a first preset transmission protocol; the processor is used to execute the computer program, so as to: when the data to be processed carries header data of a second preset transmission protocol, unpack the header data of the second preset transmission protocol, so as to process the data to be processed based on the fact that the data to be processed carries 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.
[0009] An embodiment of the present application also provides a computing device, comprising: a memory, a processor and a communication component; the memory is used to store a computer program; the processor is used to execute the computer program to: obtain data to be sent, the data to be sent is data to be sent based on a first preset transmission protocol; generate header data of a second preset transmission protocol according to the data to be sent and a header preset format of a second preset transmission protocol; send the 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 the transmission reliability of the first preset transmission protocol; the communication component is used to receive data to be processed from a receiving device; the processor is used to unpack 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 fact that the data to be processed carries the data of the first preset transmission protocol.
[0010] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors implement the steps in the above method.
[0011] In an embodiment of the present application, data to be sent is obtained, and the data to be sent is data to be sent based on a first preset transmission protocol; according to the data to be sent and the header preset format of the second preset transmission protocol, the header data of the second preset transmission protocol is generated; the data to be sent is sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol, and the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol. Since the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol, the second preset transmission protocol has better affinity on the network operator side, so that the data to be sent will not be excessively restricted by the network operator due to the first preset transmission protocol, thereby improving the affinity of the first preset transmission protocol, such as UDP, on the network operator side, solving the flow limit, speed limit, service quality and port blocking problems of the first preset transmission protocol message, greatly improving the transmission performance of the protocol, and optimizing the product experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0013] Figure 1 A schematic diagram of the structure of a data transmission system according to an exemplary embodiment of the present application;
[0014] Figure 2 A flowchart of a data transmission method according to an exemplary embodiment of the present application;
[0015] Figure 3 A schematic diagram of a data transmission direction of an exemplary embodiment of the present application;
[0016] Figure 4 A schematic diagram of a complete header structure of a data message of an exemplary embodiment of the present application;
[0017] Figure 5 A flowchart of a data transmission method according to an exemplary embodiment of the present application;
[0018] Figure 6 A flowchart of a data transmission method according to an exemplary embodiment of the present application;
[0019] Figure 7 A schematic diagram of the structure of a data transmission device provided by an exemplary embodiment of the present application;
[0020] Figure 8 A schematic diagram of the structure of a data transmission device provided by an exemplary embodiment of the present application;
[0021] Fig. 9 A schematic diagram of the structure of a data transmission device provided by an exemplary embodiment of the present application;
[0022] Fig.10 A schematic diagram of the structure of a computing device provided for an exemplary embodiment of the present application;
[0023] Fig.11 A schematic diagram of the structure of a computing device provided for an exemplary embodiment of the present application;
[0024] Fig.12 A schematic diagram of the structure of a computing device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0026] As mentioned above, the root cause of these problems is the low affinity of UDP protocol for operator equipment. This makes it difficult for operators to build a security protection system for UDP protocol, which is prone to violent attacks. In addition, the volume of UDP in the early days was small, so the operator side downgraded the UDP protocol data, which is mainly reflected in: flow limiting - limiting the throughput capacity of UDP flow; low QOS (Quality of Service) - reducing the processing priority of UDP; blocking - blocking specific UDP ports in specific areas, causing link connectivity problems.
[0027] With the increase of UDP-based applications and the gradual increase of user base and volume, the problem of poor experience caused by low operator affinity of UDP protocol has gradually become prominent. This has been fully exposed in the practice of UDP project engineering. Solving the current flow limitation, banning, and low QOS service caused by the affinity of UDP protocol operators and improving the transmission performance of UDP protocol has become a very important issue at present.
[0028] Therefore, the embodiment of the present application provides a data transmission method to improve the transmission performance of a first preset transmission protocol, such as the UDP protocol.
[0029] Figure 1 The following is a schematic diagram of a data transmission system provided by an exemplary embodiment of the present application. Figure 1 As shown, the system 100 may include: a first device 101 and a second device 102 .
[0030] The first device 101 refers to a device that can provide computing and processing services in a network virtual environment, and can refer to a device that uses the network to process and obtain data. In physical implementation, the first device 101 can be any device that can provide computing services, respond to service requests, and process data, such as a cloud server, cloud host, virtual center, conventional server, etc. The first device 101 mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture.
[0031] The second device 102 refers to a device that can provide computing and processing services in a network virtual environment, and can refer to a device that uses the network to process and obtain data. In physical implementation, the second device 102 can be any device that can provide computing services, respond to service requests, and process data, such as a cloud server, cloud host, virtual center, conventional server, etc. The second device 102 mainly includes a processor, a hard disk, a memory, a system bus, etc., which is similar to a general computer architecture.
[0032] In addition, the system 100 may also include a third device 103, which may be a device with certain computing capabilities, which may implement the 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 the device with certain computing capabilities. The device with certain computing capabilities may also include a memory, which may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or may include both types. The memory usually stores an operating system (OS), one or more application programs, and may also store program data, etc. 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, etc. Optionally, some peripheral devices may include, for example, a keyboard, an input pen, etc. Other peripheral devices are well known in the art and will not be described in detail here. Optionally, the third device 103 may be an intelligent terminal, such as a mobile phone, a desktop computer, a notebook, a tablet computer, etc.
[0033] Specifically, the system 100 may be a CND (Content Delivery Network) system.
[0034] Specifically, the second device 102 obtains data to be sent, which is data to be sent based on the first preset transmission protocol; generates header data of the second preset transmission protocol according to the data to be sent and the header preset format of the second preset transmission protocol; sends the 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 the transmission reliability of the first preset transmission protocol. The data to be sent may be a data request.
[0035] The second device 102 sends the data to be sent to the first device 101 according to the above method.
[0036] Specifically, the second device 102 fills the header preset format of the second preset transmission protocol with corresponding data based on the data to be sent and the generated header data of the first preset transmission protocol, and generates the header data of the second preset transmission protocol.
[0037] Specifically, the second device 102 determines the transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol according to the header data of the second preset transmission protocol; encapsulates the header 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 transmits the message according to the determined transmission channel.
[0038] In addition, the second device 102 receives the generated data of the first preset transmission protocol sent by the network transmission layer, and the generated data of the first preset transmission protocol carries the data to be sent.
[0039] In addition, the second device 102 generates header data of the second preset transmission protocol based on the preset data packet processing framework in the network layer and according to the data to be sent and the preset header format of the second preset transmission protocol.
[0040] The first device 101 receives data to be sent from the second device 102, and when the data to be sent carries header data of a second preset transmission protocol, the header data of the second preset transmission protocol is unpacked, so that the data to be sent is processed based on the data to be sent carrying data of the first preset transmission protocol.
[0041] In addition, the first device 101 decapsulates the header data of the second preset transmission protocol based on the preset data packet processing framework in the network layer.
[0042] In addition, the first device 101 sends the data to be sent carrying the data of the first preset transmission protocol to the network transmission layer, so as to process the data to be sent based on the data of the first preset transmission protocol.
[0043] The first preset transmission protocol includes the UDP transmission protocol; the second preset transmission protocol includes the TCP transmission protocol.
[0044] It should be noted that the first device 101 can send target data to the second device 102 in response to the data to be sent by the second device 102. That is, data can be sent to the second device 102 according to the way the second device 102 sends the data to be sent. The second device 102 can also receive the data to be sent sent by the first device 101 according to the way the first device 101 receives the data to be sent. The details will not be repeated.
[0045] In addition, the third device 103 can send a data request to the second device 102 and obtain the target data returned by the second device 102.
[0046] In the data transmission scenario of the embodiment of the present application, Figure 1As shown, in the CDN, the first device 101 can be a source server, and the second device 102 can be an intermediate server, which can also be called an intermediate node server. The third device 103 can be an intelligent terminal, such as a computer. A user can log in to a video website through a web browser of a computer. The user can browse videos of the video website, such as movie videos, entertainment videos, and TV series videos, through the web browser.
[0047] The user can log in to the video website by sending a data request to the intermediate server through the web browser of the computer. The request can be a request to log in to the video website. The intermediate server sends the login page data of the video website to the computer in response to the request, that is, sends the target data. The user can continue to send data requests to the intermediate server through the web browser of the computer. The request can be a request to watch movie A, and the request can carry the ID of the movie A. After receiving the request, the intermediate server searches whether there is a corresponding movie locally according to the ID. If not, the intermediate server needs to send a data request to the source server to obtain the movie.
[0048] The intermediate server can determine the request data for sending movie data to the source server by the application program, and the data can carry the ID of the movie. The network transport layer in the network encapsulates the request data with the UDP protocol. Then, the data is encapsulated with the header data of the TCP protocol through the netfilter subsystem in the network layer (a subsystem that provides a complete set of hook function management mechanisms). The encapsulation method can be encapsulated according to the data encapsulated by the UDP protocol. The header data of the TCP protocol is encapsulated by simulating the header data of the TCP (Transfer Control Protocol) protocol, and is the header data of the pseudo TCP protocol. The format of its 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 the message is sent through the second layer in the network and the network card. In the process of sending, the corresponding TCP transmission channel is found according to the source IP address and the target IP address in the header data, and the message is sent through the transmission channel.
[0049] After the source server receives the message through the network card, it can first pass through the second layer of the network to reach the third layer of the network. The IP message can be unpacked through netfilter, and then the header data of the TCP protocol therein can be unpacked. The encapsulated data of the UDP protocol is sent to the fourth layer of the network, that is, the network transport layer, to be unpacked, and the request data is obtained and sent to the application for processing. Then, according to the above method, the corresponding movie data is returned to the intermediate server, and the intermediate server unpacks the message according to the above method, thereby storing the movie data and sending the movie data to the computer for users to watch.
[0050] It should be noted that in addition to being applied to CDN application scenarios, the embodiments of the present application can also be applied to dynamic content path planning, dynamic acceleration, QUIC (Quick UDP Internet Connection, a low-latency Internet transport layer protocol based on UDP) protocol optimization, video on demand, video live broadcast and many other scenarios.
[0051] Among them, for video on demand and video live broadcast, it can be implemented in CDN as mentioned above. Video live broadcast is similar to video on demand, so it will not be described here.
[0052] In addition, the second preset transmission protocol may also be the QUIC protocol.
[0053] In the above embodiment, the first device 101, the second device 102, and the third device 103 are connected to a network, and the network connection may be a wireless connection. If the first device 101, the second device 102, and the third device 103 are connected for communication, the network standard 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, etc.
[0054] The data transmission process is described in detail below in conjunction with the method embodiment.
[0055] Figure 2 The flowchart of a data transmission method of an exemplary embodiment of the present application is shown in FIG. The method 200 provided in the embodiment of the present application is executed by a computing device, such as a server. The method 200 includes the following steps:
[0056] 201: Acquire data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol.
[0057] 202: Generate header data of the second preset transmission protocol according to the data to be sent and a preset header format of the second preset transmission protocol.
[0058] 203: Send the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
[0059] The transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0060] It should be noted that, according to needs, the method 200 can also be implemented through an intelligent terminal, such as a computer.
[0061] The following is a detailed description of the above steps:
[0062] 201: Acquire data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol.
[0063] The data to be sent refers to data waiting to be sent to an external device or other device, such as movie request data, and the data can be determined by an execution device, such as an application or a corresponding program in a server.
[0064] It should be noted that the operating system of the execution device is applied to different operating systems, such as Linux operating system, Windows operating system, etc. The embodiment of the present application is described by taking the Linux operating system as an example, but it should be understood that no matter which operating system is used, the structure of the network is the same or similar, and data transmission can be achieved through the embodiment of the present application.
[0065] For the Linux operating system, the network structure includes at least the fourth layer (network transmission layer), the third layer (network layer), the second layer and the first layer (network card). The data to be sent can be sent from the upper layer of the fourth layer, and its application or corresponding program belongs to the upper layer of the fourth layer, which can also be called the fifth layer. For the Linux operating system, the above four layers belong to its kernel state. The fifth layer, where the application is located, belongs to the user state.
[0066] Among them, the second layer is used to use the MAC (Media Access Control Address) address capability to exchange data. The third layer is used to use routing networking to achieve data transmission across machines and networks. The fourth layer is mainly used to solve the problem of efficient transmission. When the message through the kernel protocol stack of the Linux operating system does not use bypass, rawsock and other technologies, it needs to pass through the fourth layer, reach the third layer, then reach the second layer, and finally leave the network card. The direction of the packet receiving path is just the opposite, so it will not be repeated here.
[0067] The first preset transmission protocol includes the UDP transmission protocol, and may also be other transmission protocols as long as the transmission reliability of the transmission protocol in network transmission is relatively poor.
[0068] For example, according to the above, in CDN, application A of the intermediate server wants to send movie request data to the source server (i.e., request the source server to send movie data). Then application A first determines the movie request data or writes the data, and transmits the request data to the fourth layer.
[0069] More specifically, the datagram may be sent using the sendmsg() or sendmmsg() system call. At this time, it is the data of the application.
[0070] After the data to be sent is acquired, the data is encapsulated using a first preset transmission protocol, such as UDP protocol.
[0071] Specifically, the method 200 further includes: generating data of the first preset transmission protocol according to the data to be sent and the preset format of the first preset transmission protocol.
[0072] The data of the first preset transmission protocol refers to the data to be sent encapsulated or packaged by the first preset transmission protocol, that is, the data generated by the first preset transmission protocol contains the data to be sent.
[0073] The preset format of the first preset transmission protocol refers to the encapsulation format of the transmission protocol, which may have the header data of the protocol (generated based on the header preset format) and the data to be sent. When the first preset transmission protocol is the UDP transmission protocol, its header preset format is not described in detail, and may have the source port, the destination port, the checksum, and the data length, etc.
[0074] For example, according to the above, after receiving the data to be sent, the fourth layer can first cache the data to be sent, and then set up efficient data transmission, such as the format of data packetization based on the transmission protocol, data packet transmission, process control, detection and inspection of the transmission process, and recovery and retransmission. Here, the fourth layer can encapsulate the data to be sent based on the UDP transmission protocol to generate a datagram of the UDP transmission protocol, that is, data of the UDP transmission protocol.
[0075] The data to be sent can all be sent by the first preset transmission protocol. If there are other transmission protocols that can also be sent, they can be determined here according to the port number.
[0076] Since the above encapsulation occurs at the fourth layer, the data to be sent can also be obtained by the third layer. However, when the third layer receives the data, the data to be sent has been encapsulated by the transmission protocol.
[0077] Specifically, obtaining the data to be sent includes: 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.
[0078] For example, as described above, the third layer receives the datagram, or data segment, of the UDP transport protocol sent by the fourth layer.
[0079] In addition to the above-mentioned data transmission through at least the fourth layer to the second layer of the network, data transmission can also be carried out through the DPDK (Data Plane Development Kit, which is a data plane development tool set that provides library functions and driver support for efficient user-mode data packet processing under the processor architecture. It can also be said to be a software library for accelerating packet data processing) architecture.
[0080] Specifically, the method 200 further includes: based on a preset DPDK architecture, acquiring data to be sent, and generating data of the first preset transmission protocol according to the data to be sent and a preset format of the first preset transmission protocol.
[0081] It should be noted that, for DPDK, the method of obtaining the data to be sent and generating the data of the first preset transmission protocol is similar to that described above, and will not be repeated here. It is only noted that the above process occurs in the DPDK environment.
[0082] 202: Generate header data of the second preset transmission protocol according to the data to be sent and a preset header format of the second preset transmission protocol.
[0083] Among them, the second preset transmission protocol includes the TCP transmission protocol. It can also be other transmission protocols, and the transmission reliability of the other transmission protocols is higher than the transmission reliability of the first preset transmission protocol. That is, 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, port restriction and throughput restriction of the protocol. For example, the higher the processing priority, the fewer port restrictions and the higher the throughput of the transmission protocol, the higher the transmission reliability. For the TCP transmission protocol, it is better than the UDP transmission protocol in terms of processing priority, port restriction and throughput restriction.
[0084] When the second preset transport protocol is TCP, the header preset format of the second preset transport protocol may include source port, destination port, sequence information, checksum (also called check value), flag, notification window information, option value, etc.
[0085] For example, according to the foregoing, after the third layer receives the datagram or data segment of the UDP transport protocol sent by the fourth layer, it is necessary to add new header data of the TCP transport protocol to the datagram or data segment. The header data of the second preset transport protocol can be generated according to the header preset format of the TCP transport protocol.
[0086] It should be noted that the header data of the TCP transmission protocol here belongs to the header data of the pseudo TCP transmission protocol, which is the header data that simulates the TCP transmission protocol.
[0087] In order to better generate the header data of the second preset transmission protocol, it can also be processed through a preset data packet processing framework in the network layer.
[0088] Specifically, the method 200 further includes: based on a preset data packet processing framework in the network layer, generating header data of the second preset transmission protocol according to the data to be sent and a preset header format of the second preset transmission protocol.
[0089] The preset data packet processing framework may refer to a framework that provides rich packet processing capabilities, such as netfilter, or may be other frameworks, such as DPDK architecture.
[0090] like Figure 3 As shown, for the packet sending direction (i.e., the direction of sending messages or data packets), the FTCP header (i.e., pseudo TCP packet, i.e., the header data of the TCP transport protocol) can be encapsulated at the Localout hook point of netfilter, and then the message can be sent out through the second layer and the network card. Conversely, for the packet receiving direction, the FTCP header can be unpacked at the Localin hook point of netfilter, restored to a data packet of the UDP transport protocol, and submitted to the network transport layer, which is then submitted to the corresponding program process without being affected by the network transport layer.
[0091] Therefore, the kernel-mode network is implemented in layers, and the product of the layered implementation is that each layer has its own specific header structure. The above FTCP is equivalent to a subdivision of the netfilter framework, and it does need its own unique header structure. This header structure uses a header that simulates the TCP transport protocol. Conversely, the headers of other transport protocols can be constructed.
[0092] For DPDK, the process is similar. Find the corresponding location that provides rich packet processing capabilities, such as functions or mechanisms, to implement encapsulation of FTCP headers or decapsulation of FTCP headers. For other frameworks or other operating systems, you can find the corresponding location that provides rich packet processing capabilities, such as functions or mechanisms, to implement encapsulation of FTCP headers or decapsulation of FTCP headers.
[0093] In addition, the specific process of generating the header data of the second preset transmission protocol can be generated according to the source port, the destination port, the sequence information, the checksum (also called the check value), the flag bit, the notification window information and the option value.
[0094] The above generation can be directly determined based on the data to be sent, the corresponding port number, and the TCP transmission protocol preset algorithm, etc. This is similar to the generation of the real TCP transmission protocol. In addition, it can also be generated based on the data of the UDP transmission protocol.
[0095] Specifically, according to the data to be sent and the header preset format of the second preset transmission protocol, the header data of the second preset transmission protocol is generated, including: based on the data to be sent and the generated header data of the first preset transmission protocol, the header preset format of the second preset transmission protocol is filled with corresponding data to generate the header data of the second preset transmission protocol.
[0096] Since the data of the UDP transport protocol has the same parts as the header data of the TCP transport protocol, such as the source port and the destination port, the data of the UDP transport protocol can be directly referred to and will not be repeated here.
[0097] In addition, the specific process of generating the header data of the second preset transmission protocol can be generated according to the source port, the destination port, the sequence information, the checksum (also called the check value), the flag bit, the notification window information and the option value.
[0098] Specifically, the header data of the second preset transmission protocol is generated according to the data to be sent and the header preset format of the second preset transmission protocol, including: determining the port data in the header preset format according to the port data of the data to be sent; determining the sequence number data in the header preset format according to the second preset transmission protocol; determining the check data in the header preset format according to the corresponding current data in the header preset format and the data to be sent; and generating the header data of the second preset transmission protocol based on the header preset format and the corresponding data.
[0099] For example, as mentioned above, the Localout hook of netfilter does not need to customize the port for the lightweight TCP mechanism, and can fully use the port information of the data packet of the UDP transport protocol, such as the source port number and the destination port number. Sequence information also contains bidirectional sequence information, such as sequence number and confirmation number. Whenever there is new data to be sent, it corresponds to a set of tuples, which are composed of source IP address, source port, destination (target) IP address, destination (target) port, and protocol. If there is no FTCP channel available for the data to be sent, the simulated TCP connection establishment mechanism needs to be triggered. At this time, the real TCP seq (i.e., Sequence) allocation method will be used to allocate a random seq sequence number according to the TCP preset algorithm. Similarly, when the syn message in the simulated TCP connection establishment mechanism is received by the other end (such as the receiving device), the FTCP layer of the other end needs to simulate the response. When responding, the real TCP seq allocation method will also be used to randomly allocate a seq as the confirmation number ack seq. At this point, complete seq information has been obtained. After that, the seq and ack seq values of each data packet are continuously updated through data transmission accumulation. For the flag bit, except for the simulated TCP connection establishment message, other messages are simply processed as the TCP transport protocol header data of each message carries the ACK and PSH flag bits. The notification window information can be directly encapsulated as a fixed value without much care. Checksum, the checksum needs to be completely rebuilt, otherwise it will be discarded due to abnormal check values when passing through the network operator's equipment. The checksum is fully implemented using the TCP preset algorithm. Option value, no option needs to be encapsulated.
[0100] Thus, a lightweight TCP mechanism can be constructed. After completion, the complete FTCP capability has been constructed, and the transmission performance optimization of the UDP transmission protocol can be realized. During the transmission of the message, when the corresponding message reaches the network operator's equipment, it is identified as a message corresponding to the TCP transmission protocol. The network operator's equipment will enable the high-priority processing logic of the TCP transmission protocol, directly skipping the network operator's equipment's blocking check for the UDP transmission protocol port, and processing it according to the high priority of TCP port 80 or 443, and will not suffer the flow and speed limit penalties of the UDP transmission protocol.
[0101] In order to ensure that the added header data of the second preset transmission protocol is ready to be sent, the application program or the corresponding program may indicate whether to add the header data of the second preset transmission protocol.
[0102] Specifically, the method 200 includes: after obtaining the data to be sent, searching whether the data to be sent carries information for generating header data of a second preset transmission protocol; if such information exists, executing the step of generating header data of a second preset transmission protocol according to the data to be sent and a preset format of the header of the second preset transmission protocol.
[0103] For example, as mentioned above, application A uses sendmsg() or sendmmsg() system calls to send data packets, and encapsulates TOS in the msg_control address of the struct msghdr structure. msg_control is used to transfer auxiliary data, and supports many types. IP_TOS is used in the system. The TOS value of the message is encapsulated in the structmsghdr structure. Encapsulation is required every time sendmsg or sendmmsg is called. The kernel state layer parses the TOS field, and injects the TOS value into the IP tos field when encapsulating skb (socket buffer). If the Localout hook of netfilter parses or reads the TOS value, the header data of the TCP transport protocol can be added, that is, FTCP can be encapsulated. The specific method of adding is not repeated here.
[0104] 203: Send the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
[0105] For example, according to the above, after the Localout hook of netfilter completes the encapsulation of FTCP, it can generate an IP (Internet Protocol) message, then generate the corresponding frame header through the second layer, and send the message with the frame header through the network card. Figure 4 As shown, the complete structure header of the final encapsulated message may include an Ethernet header (layer 2), which is the header data corresponding to the second layer, and is also a frame header. The IP header (layer 3), which is the header data corresponding to the third layer, and the FTCP header (pseudo-layer 4 header), which is the header data corresponding to the pseudo-layer 4, are also header data of the TCP transport protocol. The UDP header (real layer 4 header), which is the header data corresponding to the fourth layer, is also the header data of the UDP transport protocol. In addition to these header data, there is also raw data, that is, the data to be sent written by the corresponding program and other protocol headers.
[0106] Specifically, sending the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol includes: 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.
[0107] Since this has been explained in the previous article, I will not repeat it here.
[0108] In addition, sending the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol includes: determining the transmission channel of the second preset transmission protocol corresponding to the header data according to the header 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.
[0109] The method of determining the transmission channel of the second preset transmission protocol corresponding to the header data may be: selecting the corresponding transmission channel of the TCP transmission protocol, such as a transmission connection, through the source IP address and the destination IP address in the header data.
[0110] Since it has been explained in the previous article, it will not be repeated here. It is only explained that before generating the corresponding message, it is necessary to select a transmission channel, such as the transmission channel of the TCP transmission protocol. Make sure that the corresponding transmission channel exists. Then the corresponding message can be placed in the transmission channel for transmission.
[0111] When the corresponding transmission channel does not exist, it is necessary to establish the corresponding transmission channel.
[0112] Specifically, the method 200 also includes: determining whether there is a transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol according to the header data; if not, creating a transmission channel of the second preset transmission protocol corresponding to the header data.
[0113] The transmission channel establishment mechanism of the TCP transmission protocol can be simulated to establish the transmission channel, such as simulating the three-way handshake establishment mechanism.
[0114] Specifically, creating a transmission channel of a second preset transmission protocol corresponding to the header data includes: 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; receiving a second message in response to the first message through the first preset transmission protocol, and generating a third message based on the second message and the second preset transmission protocol, and sending the third message through the first preset transmission protocol to confirm with the receiving device, and the establishment of the transmission channel is completed after the receiving device receives the third message and the third message takes effect.
[0115] Among them, the first message can be a syn data packet or message. The second message is a syn+ack combined data packet or message. The third message is an ack data packet or message. Thus, the establishment of the transmission channel is completed. It will not be repeated here. Just explain: this process is asynchronous, and the message triggered by the simulation will still be transmitted via the UDP protocol (without encapsulating the header data of the FTCP transmission protocol). After the asynchronous handshake logic is completed, the other data packets of the stream will be sent by constructing the FTCP header data.
[0116] In addition, after the corresponding message is sent, a message in a corresponding format may be received from a receiving device (ie, a peer device).
[0117] Specifically, the method 200 also includes: receiving data to be processed from a receiving device, and when the data to be processed carries header data of a second preset transmission protocol, unpacking 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 data of the first preset transmission protocol.
[0118] The data to be processed may refer to a message having the above-mentioned header data, and processing the data to be processed refers to application data in the data of the first preset transmission protocol (i.e., data written by the application). The data to be processed may also refer to data written by the application in the receiving device. For data written by the application, the data to be processed carrying the data of the first preset transmission protocol means that the data to be processed carries the header data of the first preset transmission protocol in addition to the data itself, so as to constitute the data of the first preset transmission protocol.
[0119] For example, as mentioned above, after the intermediate server receives the message through the network card, it passes through the second layer, unpacks the frame header, uploads it to the third layer, and unpacks the IP message by the third layer to obtain the data packet or data segment of the transport protocol. When there is FTCP header data, the Localin hook point of netfilter can unpack the FTCP header, restore it to the data packet of the UDP transport protocol, and submit it to the network transport layer, which is not sensitive and submits it to the process of the corresponding program.
[0120] It should be noted that, after receiving the above-mentioned message, the opposite device may also unseal and process the data according to the subsequent method.
[0121] Specifically, the method further includes: or, decapsulating the header data of the second preset transmission protocol specifically includes: decapsulating the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
[0122] Since this has been explained in the previous article, I will not repeat it here.
[0123] In addition, the method 200 further includes: 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.
[0124] It should be noted that since it has been explained in the previous article, it will not be repeated here.
[0125] In addition, the method 200 further includes: based on a preset DPDK architecture, based on data of a first preset transmission protocol, processing the data to be processed.
[0126] For example, according to the above description, the way in which the DPDK architecture processes data is similar to the way described above, and will not be repeated here.
[0127] As a result, the data of the UDP transmission protocol can be transmitted via TCP, which improves the affinity of the data of the UDP transmission protocol on the operator side, solves the problems of flow limitation, speed limitation, QOS and port blocking of the data of the UDP transmission protocol, greatly improves the transmission performance of the UDP transmission protocol, and optimizes the product experience.
[0128] Based on the above similar inventive concept, Figure 5 A schematic flow chart of a data transmission method provided by another exemplary embodiment of the present application is shown. The method 500 provided by the embodiment of the present application is executed by a server, and the method 500 includes the following steps:
[0129] 501: Receive data to be processed, where the data to be processed carries data of a first preset transmission protocol.
[0130] 502: When the data to be processed carries header data of the second preset transmission protocol, the header 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 data of the first preset transmission protocol.
[0131] The transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0132] Since the specific implementation of steps 501-502 has been described in detail above, they will not be repeated here. It is only explained that the method 500 can also be applied to smart terminals, such as computers.
[0133] In addition, the method 500 further includes: based on a preset data packet processing framework in the network layer, decapsulating the header data of the second preset transmission protocol.
[0134] In addition, the method 500 further includes: 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.
[0135] In addition, the method 500 further includes: based on a preset DPDK architecture, based on data of a first preset transmission protocol, processing the data to be processed.
[0136] The first preset transmission protocol includes the UDP transmission protocol; the second preset transmission protocol includes the TCP transmission protocol.
[0137] The transmission reliability is determined based on the protocol's processing priority, port restrictions, and throughput restrictions.
[0138] In addition, for the contents not described in detail in the present method 500, reference may also be made to the various steps in the above-mentioned method 200.
[0139] Based on the above similar inventive concept, Figure 6 A flow chart of a data transmission method provided by another exemplary embodiment of the present application is shown. The method 600 provided by the embodiment of the present application is executed by a server, and the method 600 includes the following steps:
[0140] 601: Acquire data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol.
[0141] 602: Generate header data of the second preset transmission protocol according to the data to be sent and a preset header format of the second preset transmission protocol.
[0142] 603: Send the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
[0143] The transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0144] 604: receiving the data to be processed from the receiving device, and when the data to be processed carries the header data of the second preset transmission protocol, decapsulating the header 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.
[0145] Since the specific implementation of steps 601-604 has been described in detail above, they will not be repeated here. It is only to illustrate that the method 600 can also be applied to smart terminals, such as computers.
[0146] In addition, for the contents not described in detail in the method 600 , reference can also be made to the various steps in the above method 200 .
[0147] Figure 7A schematic diagram of the structure framework of a data transmission device provided by an exemplary embodiment of the present application. The device 700 can be applied to a server. The device 700 includes: an acquisition module 701, a generation module 702, and a sending module 703; the functions of each module are described in detail below:
[0148] The acquisition module 701 is used to acquire the data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol.
[0149] The generating module 702 is used to generate header data of the second preset transmission protocol according to the data to be sent and the header preset format of the second preset transmission protocol.
[0150] The sending module 703 is used to send the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
[0151] The transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0152] Specifically, the sending module 703 is used to send 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.
[0153] In addition, the generating module 702 is further configured to generate data of the first preset transmission protocol according to the data to be sent and the preset format of the first preset transmission protocol.
[0154] Specifically, the generating module 702 is used to fill the header preset format of the second preset transmission protocol with corresponding data 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.
[0155] Specifically, the sending module 703 includes: a first determination unit, used to determine the transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol according to the header data of the second preset transmission protocol; an encapsulation unit, used to encapsulate the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; a transmission unit, used to transmit the message according to the determined transmission channel.
[0156] In addition, the device 700 also includes: a creation module, which is used to determine whether there is a transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol; if not, a creation module is used to create a transmission channel of the second preset transmission protocol corresponding to the header data.
[0157] Specifically, the creation module includes: a sending unit, which is used 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; a sending unit, which is used to receive a second message in response to the first message through the first preset transmission protocol, and generate a third message based on the second message and the second preset transmission protocol, and send the third message through the first preset transmission protocol to confirm to the receiving device. After the receiving device receives the third message and the third message takes effect, the establishment of the transmission channel is completed.
[0158] In addition, the device 700 includes: a search module, which is used to search whether the data to be sent carries information for generating header data of a second preset transmission protocol after obtaining the data to be sent; if such information exists, the step of generating header data of the second preset transmission protocol according to the data to be sent and the preset format of the header of the second preset transmission protocol is executed.
[0159] Specifically, the generation module 702 includes: a second determination unit, used to determine the port data in the header preset format according to the port data of the data to be sent; a second determination unit, used to determine the sequence number data in the header preset format according to the second preset transmission protocol; a second determination unit, used to determine the verification data in the header preset format according to the corresponding current data in the header preset format and the data to be sent; a generation unit, used to generate the header data of the second preset transmission protocol based on the header preset format and the corresponding data.
[0160] Specifically, the acquisition module 701 is used to receive the generated data of the first preset transmission protocol sent by the network transmission layer, and the generated data of the first preset transmission protocol carries the data to be sent.
[0161] In addition, the generating module 702 is further configured to generate header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer and according to the data to be sent and a preset header format of the second preset transmission protocol.
[0162] In addition, the acquisition module 701 is further used to acquire the data to be sent based on the preset DPDK architecture, and generate data of the first preset transmission protocol according to the data to be sent and the preset format of the first preset transmission protocol.
[0163] In addition, the device 700 also includes: an unpacking module, which is used to receive the data to be processed from the receiving device, and when the data to be processed carries header data of the second preset transmission protocol, the header data of the second preset transmission protocol is unpacked so that the data to be processed can be processed based on the data to be processed carrying the data of the first preset transmission protocol.
[0164] In addition, the decapsulation module is also used to decapsulate the header data of the second preset transmission protocol based on the preset data packet processing framework in the network layer.
[0165] In addition, the sending module 703 is further used to send 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.
[0166] In addition, the device 700 also includes: a processing module, which is used to process the data to be processed based on the preset DPDK architecture and the data of the first preset transmission protocol.
[0167] The first preset transmission protocol includes the UDP transmission protocol; the second preset transmission protocol includes the TCP transmission protocol.
[0168] The transmission reliability is determined based on the protocol's processing priority, port restrictions, and throughput restrictions.
[0169] Figure 8 A schematic diagram of the structural framework of a data transmission device provided by another exemplary embodiment of the present application is shown. The device 800 can be applied to a server. The device 800 includes: a receiving module 801 and a decapsulation module 802. The functions of each module are described in detail below:
[0170] The receiving module 801 is used to receive data to be processed, where the data to be processed carries data of a first preset transmission protocol.
[0171] The decapsulation module 802 is used to decapsulate 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 as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
[0172] The transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
[0173] In addition, the decapsulation module 802 is further configured to: decapsulate the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
[0174] In addition, the device 800 further includes: a processing module, configured to send 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.
[0175] In addition, the device 800 also includes: a processing module, which is used to process the data to be processed based on the preset DPDK architecture and the data of the first preset transmission protocol.
[0176] The first preset transmission protocol includes the UDP transmission protocol; the second preset transmission protocol includes the TCP transmission protocol.
[0177] The transmission reliability is determined based on the protocol's processing priority, port restrictions, and throughput restrictions.
[0178] It should be noted that for some contents not mentioned in the device 800 , reference may be made to the contents of the above-mentioned device 700 .
[0179] Fig. 9 A schematic diagram of the structural framework of a data transmission device provided by another exemplary embodiment of the present application is shown. The device 900 can be applied to a server. The device 900 includes: an acquisition module 901, a generation module 902, a sending module 903, and a decapsulation module 904. The functions of each module are described in detail below:
[0180] The acquisition module 901 is used to acquire the data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol.
[0181] The generating module 902 is used to generate header data of the second preset transmission protocol according to the data to be sent and the header preset format of the second preset transmission protocol.
[0182] The sending module 903 is used to send the data to be sent based on the generated header data of the second preset transmission protocol and the first preset transmission protocol.
[0183] wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol;
[0184] The decapsulation module 904 is used to receive the data to be processed from the receiving device. When the data to be processed carries header data of the second preset transmission protocol, the header data of the second preset transmission protocol is decapsulated so that the data to be processed can be processed based on the data to be processed carrying the data of the first preset transmission protocol.
[0185] It should be noted that for some contents not mentioned in the device 900 , reference may be made to the contents of the above-mentioned device 700 .
[0186] The above describes Figure 7 The internal functions and structure of the device 700 shown, in one possible design, Figure 7 The structure of the device 700 shown can be implemented as a computing device, such as a server. Fig.10 As shown, the device 1000 may include: a memory 1001, a processor 1002;
[0187] The memory 1001 is used to store computer programs.
[0188] Processor 1002 is used to execute a computer program to: obtain data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol; 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; send the 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 the transmission reliability of the first preset transmission protocol.
[0189] Specifically, the processor 1002 is specifically configured to send 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.
[0190] In addition, the processor 1002 is further configured to generate data of the first preset transmission protocol according to the data to be sent and a preset format of the first preset transmission protocol.
[0191] Specifically, the processor 1002 is specifically configured to: fill the header preset format of the second preset transmission protocol with corresponding data 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.
[0192] Specifically, the processor 1002 is specifically used to: determine the transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol according to the header data of the second preset transmission protocol; encapsulate 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 transmit the message according to the determined transmission channel.
[0193] In addition, the processor 1002 is also used to: determine whether there is a transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol based on the header data of the second preset transmission protocol; if not, create a module for creating a transmission channel of the second preset transmission protocol corresponding to the header data.
[0194] Specifically, the processor 1002 is specifically used 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; a sending unit is used to receive a second message in response to the first message through the first preset transmission protocol, and generate a third message based on the second message and the second preset transmission protocol, and send the third message through the first preset transmission protocol to confirm to the receiving device, and the establishment of the transmission channel is completed after the receiving device receives the third message and the third message takes effect.
[0195] In addition, the processor 1002 is also used to: after obtaining the data to be sent, search whether the data to be sent carries information for generating header data of the second preset transmission protocol; if the information exists, execute the step of generating header data of the second preset transmission protocol according to the data to be sent and the header preset format of the second preset transmission protocol.
[0196] Specifically, processor 1002 is specifically used to: determine the port data in the header preset format according to the port data of the data to be sent; determine the sequence number data in the header preset format according to the second preset transmission protocol; determine the check data in the header preset format according to the corresponding current data and the data to be sent in the header preset format; generate the header data of the second preset transmission protocol based on the header preset format and the corresponding data.
[0197] Specifically, the processor 1002 is specifically configured to: receive generated data of the first preset transmission protocol sent by the network transmission layer, where the generated data of the first preset transmission protocol carries data to be sent.
[0198] In addition, the processor 1002 is further configured to: generate header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer and according to the data to be sent and a preset header format of the second preset transmission protocol.
[0199] In addition, the processor 1002 is further configured to: obtain the data to be sent based on a preset DPDK architecture, and generate data of the first preset transmission protocol according to the data to be sent and a preset format of the first preset transmission protocol.
[0200] In addition, processor 1002 is also used to: receive data to be processed from a receiving device, and when the data to be processed carries header data of a second preset transmission protocol, unpack the header data of the second preset transmission protocol so that the data to be processed can be processed based on the data to be processed carrying data of the first preset transmission protocol.
[0201] In addition, the processor 1002 is further configured to: decapsulate the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
[0202] In addition, the processor 1002 is further configured to send the data to be processed that carries 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.
[0203] In addition, the processor 1002 is further configured to: process the data to be processed based on a preset DPDK architecture and based on data of a first preset transmission protocol.
[0204] The first preset transmission protocol includes the UDP transmission protocol; the second preset transmission protocol includes the TCP transmission protocol.
[0205] The transmission reliability is determined based on the protocol's processing priority, port restrictions, and throughput restrictions.
[0206] In addition, an embodiment of the present invention provides a computer storage medium, when the computer program is executed by one or more processors, causing the one or more processors to implement Figure 1-Figure 4 The present invention provides steps of a data transmission method in a method embodiment.
[0207] The above describes Figure 8 The internal functions and structure of the device 800 shown, in one possible design, Figure 8 The structure of the device 800 shown can be implemented as a computing device, such as a cloud server. Fig.11 As shown, the device 1100 may include: a memory 1101, a processor 1102, and a communication component 1103;
[0208] The memory 1101 is used to store computer programs.
[0209] The communication component 1103 is used to receive data to be processed, where the data to be processed carries data of a first preset transmission protocol.
[0210] Processor 1102 is used to execute the computer program to: when the data to be processed carries header data of a second preset transmission protocol, the header data of the second preset transmission protocol is unsealed so that the data to be processed is processed based on the data to be processed carrying 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.
[0211] In addition, the processor 1102 is further configured to: decapsulate the header data of the second preset transmission protocol based on a preset data packet processing framework in the network layer.
[0212] In addition, the processor 1102 is further configured to send the data to be processed that carries 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.
[0213] In addition, the processor 1102 is further configured to: process the data to be processed based on a preset DPDK architecture and based on data of a first preset transmission protocol.
[0214] The first preset transmission protocol includes the UDP transmission protocol; the second preset transmission protocol includes the TCP transmission protocol.
[0215] The transmission reliability is determined based on the protocol's processing priority, port restrictions, and throughput restrictions.
[0216] It should be noted that for some contents not mentioned in the device 1100 , reference may be made to the contents of the above-mentioned device 1000 .
[0217] In addition, an embodiment of the present invention provides a computer storage medium, when the computer program is executed by one or more processors, causing the one or more processors to implement Figure 5 The present invention provides steps of a data transmission method in a method embodiment.
[0218] The above describes Fig. 9 The internal functions and structure of the device 900 shown, in one possible design, Fig. 9 The structure of the device 900 shown can be implemented as a computing device, such as a cloud server. Fig.12 As shown, the device 1200 may include: a memory 1201, a processor 1202, and a communication component 1203;
[0219] The memory 1201 is used to store computer programs.
[0220] Processor 1202 is used to execute the computer program to: obtain data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol; 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; send the 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 the transmission reliability of the first preset transmission protocol.
[0221] The communication component 1203 is used to receive data to be processed from a receiving device.
[0222] The processor 1202 is configured to decapsulate 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 as to process the data to be processed based on the data to be processed carrying the data of the first preset transmission protocol.
[0223] It should be noted that for some contents not mentioned in the device 1200 , reference may be made to the contents of the above-mentioned device 1000 .
[0224] In addition, an embodiment of the present invention provides a computer storage medium, when the computer program is executed by one or more processors, causing the one or more processors to implement Figure 6 The present invention provides steps of a data transmission method in a method embodiment.
[0225] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 201, 202, 203, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0226] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0227] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0228] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable multimedia data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable multimedia data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0229] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable multimedia data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0230] These computer program instructions may also be loaded onto a computer or other programmable multimedia data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0231] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0232] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0233] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0234] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data transmission method, characterized in that: include: Acquire data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol, wherein the first preset transmission protocol includes a UDP protocol; 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, wherein the second preset transmission protocol includes a TCP transmission protocol; Determine, according to the header data of the second preset transmission protocol, a transmission channel of the second preset transmission protocol corresponding to the header data; encapsulate the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; transmit the message according to the determined transmission channel; 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, characterized in that The method further comprises: Data of the first preset transmission protocol is generated according to the data to be sent and the preset format of the first preset transmission protocol.
3. The method according to claim 1, characterized in that The step of generating header data of the second preset transmission protocol according to the data to be sent and a header preset format of the second preset transmission protocol comprises: Based on the data to be sent and the generated header data of the first preset transmission protocol, the header preset format of the second preset transmission protocol is filled with corresponding data to generate the header data of the second preset transmission protocol.
4. The method according to claim 1, characterized in that: The method further comprises: Determining, according to the header data of the second preset transmission protocol, whether there is a transmission channel of the second preset transmission protocol corresponding to the header data; If it does not exist, create a transmission channel of the second preset transmission protocol corresponding to the header data.
5. The method according to claim 4, characterized in that The step of creating a transmission channel of a second preset transmission protocol corresponding to the header data includes: Based on the second preset transmission protocol, generate a first message, and send the first message through the first preset transmission protocol to request to establish a transmission channel with a receiving device; A second message in response to the first message is received through the first preset transmission protocol, and a third message is generated based on the second message and the second preset transmission protocol, and the third message is sent through the first preset transmission protocol to confirm to the receiving device. After the receiving device receives the third message and the third message takes effect, the establishment of the transmission channel is completed.
6. The method according to claim 1, characterized in that The method comprises: After obtaining the data to be sent, search whether the data to be sent carries information for generating header data of the second preset transmission protocol. If such information exists, execute the step of generating header data of the second preset transmission protocol according to the data to be sent and the header preset format of the second preset transmission protocol.
7. The method according to claim 1, characterized in that The step of generating header data of the second preset transmission protocol according to the data to be sent and a header preset format of the second preset transmission protocol comprises: Determine the port data in the header preset format according to the port data of the data to be sent; Determining, according to the second preset transmission protocol, sequence number data in the header preset format; Determine the check data in the preset format of the header according to the current data and the data to be sent corresponding to the preset format of the header; Based on the preset header format and the corresponding data, header data of a second preset transmission protocol is generated.
8. The method according to claim 1, characterized in that The obtaining of the data to be sent includes: The generated data of the first preset transmission protocol sent by the network transmission layer is received, wherein the generated data of the first preset transmission protocol carries the data to be sent.
9. The method according to claim 1, characterized in that: The method further comprises: Based on a preset data packet processing framework in the network layer, header data of the second preset transmission protocol is generated according to the data to be sent and a preset header format of the second preset transmission protocol.
10. The method according to claim 1, characterized in that The method further comprises: Based on a preset DPDK architecture, data to be sent is acquired, and data of the first preset transmission protocol is generated according to the data to be sent and a preset format of the first preset transmission protocol.
11. The method according to claim 1, characterized in that: The method further comprises: The data to be processed is received from a receiving device. When the data to be processed carries header data of the second preset transmission protocol, the header data of the second preset transmission protocol is unpacked so that the data to be processed is processed based on the data that the data to be processed carries the data of the first preset transmission protocol.
12. The method according to claim 11, characterized in that The method further comprises: Based on a preset data packet processing framework in the network layer, the header data of the second preset transmission protocol is unpacked.
13. The method according to claim 11, characterized in that The method further comprises: The data to be processed carrying the data of the first preset transmission protocol is sent to the network transmission layer, so that the data to be processed is processed based on the data of the first preset transmission protocol.
14. The method according to claim 11, characterized in that The method further comprises: Based on the preset DPDK architecture, the data to be processed is processed based on the data of the first preset transmission protocol.
15. The method according to claim 1, characterized in that The transmission reliability is determined according to the processing priority of the protocol, the port restriction and the throughput restriction.
16. A data transmission method, characterized in that: include: Receiving data to be processed, the data to be processed carrying data of a first preset transmission protocol, wherein the first preset transmission protocol includes a UDP protocol; When the data to be processed carries header data of a second preset transmission protocol, the header data of the second preset transmission protocol is unpacked, so that the data to be processed is processed based on the data of the first preset transmission protocol carried by the data to be processed; wherein the second preset transmission protocol includes a TCP transmission protocol, and the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol; Among them, the transmission method of the data to be processed includes: determining the transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol according to the header 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.
17. The method according to claim 16, characterized in that The method further comprises: Based on a preset data packet processing framework in the network layer, the header data of the second preset transmission protocol is unpacked.
18. The method according to claim 16, characterized in that The method further comprises: The data to be processed carrying the data of the first preset transmission protocol is sent to the network transmission layer, so that the data to be processed is processed based on the data of the first preset transmission protocol.
19. The method according to claim 16, characterized in that The method further comprises: Based on the preset DPDK architecture, the data to be processed is processed based on the data of the first preset transmission protocol.
20. The method according to claim 16, characterized in that The transmission reliability is determined according to the processing priority of the protocol, the port restriction and the throughput restriction.
21. A data transmission method, characterized in that: include: Acquire data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol, wherein the first preset transmission protocol includes a UDP protocol; 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, wherein the second preset transmission protocol includes a TCP transmission protocol; According to the header data of the second preset transmission protocol, determine the transmission channel of the second preset transmission protocol corresponding to the header data; encapsulate the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; according to the determined transmission channel, transmit the message; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol; The data to be processed is received from a receiving device. When the data to be processed carries header data of the second preset transmission protocol, the header data of the second preset transmission protocol is unpacked so that the data to be processed is processed based on the data that the data to be processed carries the data of the first preset transmission protocol.
22. A computing device comprising: Memory, processor; The memory is used to store computer programs; The processor is used to obtain data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol, wherein the first preset transmission protocol includes a UDP protocol; 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, wherein the second preset transmission protocol includes a TCP transmission protocol; Determine, according to the header data of the second preset transmission protocol, a transmission channel of the second preset transmission protocol corresponding to the header data; encapsulate the header data of the second preset transmission protocol and the generated data of the first preset transmission protocol to generate a corresponding message; transmit the message according to the determined transmission channel; The transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol.
23. A computing device comprising: Memory, processor, and communication components; The memory is used to store computer programs; The communication component is used to receive data to be processed, the data to be processed carries data of a first preset transmission protocol, and the first preset transmission protocol includes a UDP protocol; The processor is configured to execute the computer program to: When the data to be processed carries header data of a second preset transmission protocol, the header data of the second preset transmission protocol is unpacked, so that the data to be processed is processed based on the data of the first preset transmission protocol carried by the data to be processed; wherein the second preset transmission protocol includes a TCP transmission protocol, and the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol; Among them, the transmission method of the data to be processed includes: determining the transmission channel of the second preset transmission protocol corresponding to the header data of the second preset transmission protocol according to the header 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.
24. A computing device comprising: Memory, processor, and communication components; The memory is used to store computer programs; The processor is configured to execute the computer program to: Acquire data to be sent, where the data to be sent is data to be sent based on a first preset transmission protocol, where the first preset transmission protocol includes a UDP protocol; 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, wherein the second preset transmission protocol includes a TCP transmission protocol; Determining, according to the header data of the second preset transmission protocol, a transmission channel of the second preset transmission protocol corresponding to the header data; 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; Transmitting the message according to the determined transmission channel; wherein the transmission reliability of the second preset transmission protocol is higher than the transmission reliability of the first preset transmission protocol; The communication component is used to receive the data to be processed from the receiving device; The processor is used to unpack 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 as to process the data to be processed based on the data of the first preset transmission protocol carried by the data to be processed.
25. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by one or more processors, the one or more processors are caused to implement the steps of the method according to any one of claims 1 to 21.
