Data communication method, device, computer equipment and storage medium
By using a dedicated data processor to manage TCP connections and encapsulation processing on the terminal device, the resource occupation problem caused by the simultaneous working of multiple TCP/IP protocol stacks is solved, and the speed and efficiency of TCP data communication is improved.
Patent Information
- Application Number
- CN202311620735.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-11-30
AI Technical Summary
When the terminal device conducts TCP data communication, multiple TCP/IP protocol stacks are encapsulated at the same time, resulting in an increase in resource usage, affecting processing speed and delay.
Through a dedicated data processor, TCP connection is established and managed on the terminal device and data encapsulation is carried out to reduce the resource usage of the terminal device and improve data communication efficiency.
In TCP data communication, the resource occupation of terminal devices is reduced, the communication speed is improved, and the delay is reduced, especially when multiple data are transmitted simultaneously.
Smart Images

Figure CN117615042B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission, and in particular to a data communication method, apparatus, computer equipment and storage medium. Background Art
[0002] When a terminal device performs data communication, in order to reduce the resource occupation of the terminal device, a dedicated data processor is usually coupled to the terminal device. When the terminal device sends data to be transmitted to the peer device, the terminal device will establish a Transmission Control Protocol (TCP) connection with the peer device, and then the TCP / IP protocol stack in the terminal device will perform TCP encapsulation processing on the data to be transmitted, that is, add a TCP / IP header to obtain an encapsulated message, and forward the encapsulated message to the peer device via a dedicated data processor, and then the peer device will process the received encapsulated message to obtain the data to be transmitted.
[0003] In the prior art, a terminal device needs to establish a TCP connection, and the TCP / IP protocol stack in the terminal device needs to encapsulate and process the data to be transmitted, which will occupy terminal device resources. In particular, there are usually multiple TCP / IP protocol stacks in a terminal device, and different TCP / IP protocol stacks are used to encapsulate the data to be transmitted generated by different business container groups in the terminal device. If the terminal device transmits the data to be transmitted generated by different business container groups to the opposite device at the same time, the multiple TCP / IP protocol stacks in the terminal device will perform encapsulation processing at the same time, so as to occupy more terminal device resources, affect the normal processing speed of the terminal device, and increase the delay. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a data communication method, apparatus, computer equipment and storage medium, which can reduce the resource occupation of terminal equipment in TCP data communication, improve the TCP data communication speed and reduce the delay.
[0005] According to a first aspect of an embodiment of the present application, a data communication method is provided, which is applied to a first dedicated data processor coupled to a first device, wherein the first device performs data communication with the second device through the first dedicated data processor, and the data communication method includes:
[0006] Obtaining, from the first device, a transmission control protocol connection establishment request for a second device through a first dedicated data channel between the first dedicated data processor and the first device;
[0007] In response to the transmission control protocol connection establishment request, establishing a transmission control protocol connection with the second device;
[0008] Acquire data to be transmitted from the first device through the first dedicated data channel;
[0009] The data to be transmitted is encapsulated by a transmission control protocol to obtain a first encapsulated message, and the first encapsulated message is sent to the second device through the transmission control protocol connection.
[0010] According to a second aspect of an embodiment of the present application, a data communication apparatus is provided, which is applied to a first dedicated data processor coupled to a first device, wherein the first device performs data communication with the second device through the first dedicated data processor, and the data communication apparatus includes:
[0011] a request unit, configured to obtain, from the first device, a transmission control protocol connection establishment request for establishing a connection with a second device through a first dedicated data channel between the first dedicated data processor and the first device;
[0012] a connection unit, configured to establish a transmission control protocol connection with the second device in response to the transmission control protocol connection establishment request;
[0013] an acquiring unit, configured to acquire data to be transmitted from the first device through the first dedicated data channel;
[0014] The sending unit is used to perform transmission control protocol encapsulation on the data to be transmitted to obtain a first encapsulated message, and send the first encapsulated message to the second device through the transmission control protocol connection.
[0015] According to a third aspect of an embodiment of the present application, a computer device is provided, including:
[0016] A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the data communication method as described above is implemented.
[0017] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, wherein the computer storage medium stores a computer program code, and when the computer program code is executed by a processor, the processor executes the data communication method as described above.
[0018] According to the embodiment of the present application, the first device does not need to send the encapsulated message to the first dedicated data processor, but uses a dedicated data channel to directly send the bare package of the data to be transmitted to the first dedicated data processor. The channel ensures communication security and does not occupy the terminal device resources, thereby improving data communication efficiency. There is no need to establish and encapsulate the TCP connection on the first device for the data to be transmitted. Instead, the TCP connection establishment work on the first device is moved to the first dedicated data processor for execution, and the TCP encapsulation work of the TCP / IP protocol stack on the first device for the data to be transmitted is moved to the TCP / IP protocol stack of the first dedicated data processor for execution, thereby reducing the resource occupation of the terminal device in TCP data communication, improving the TCP data communication speed, and reducing the communication delay. In particular, when the first device transmits multiple data to be transmitted to the opposite device at the same time, the TCP / IP protocol stack in the first dedicated data processor will encapsulate different data to be transmitted to replace the multiple TCP / IP protocol stacks in the first device for encapsulation, and then the data communication method of the embodiment of the present application can further reduce the resource occupation of the terminal device, further improve the TCP data communication speed, and reduce the communication delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0020] Figure 1 A system architecture diagram for implementing the data communication method of the embodiment of the present disclosure;
[0021] Figure 2 is a flow chart of a data communication method according to an embodiment of the present disclosure;
[0022] Figure 3 for Figure 2 An implementation detail diagram of a data communication method;
[0023] Figure 4 for Figure 2 Another implementation detail diagram of the data communication method;
[0024] Figure 5 is a block diagram of a data communication device according to an embodiment of the present disclosure;
[0025] Figure 6 For implementation Figure 2 The computer device structure diagram of the data communication method shown. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0027] The Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte stream-based transport layer communication protocol. When the terminal device performs TCP communication, the TCP protocol must be processed.
[0028] In order to improve the efficiency of TCP communication in terminal devices, a dedicated data processor will be coupled to the terminal devices. When the terminal device sends data to be transmitted to the opposite device, the terminal device will establish a Transmission Control Protocol (TCP) connection with the opposite device, and then the TCP / IP protocol stack in the terminal device will perform TCP encapsulation processing on the data to be transmitted, that is, add a TCP / IP header. The terminal device needs to establish a TCP connection, and the TCP / IP protocol stack in the terminal device needs to encapsulate the data to be transmitted, which will occupy the terminal device resources, affect the normal processing speed of the terminal device, and increase the delay.
[0029] Therefore, there is a need for a technology that can increase the speed of TCP data communication of terminal devices and reduce the communication delay of terminal devices.
[0030] Figure 1 A system architecture diagram for implementing the data communication method of the embodiment of the present disclosure. The system architecture includes a first device, a second device, a first dedicated data processor, and a second dedicated data processor, wherein the first dedicated data processor is coupled to the first device, and the second dedicated data processor is coupled to the second device, and the first dedicated data processor and the second dedicated data processor are used for TCP data communication between the first device and the second device.
[0031] The first device is a device for establishing TCP data communication. It can be a client or a server. Specifically, it can be a desktop computer, a laptop computer, a mobile phone, a PDA, a dedicated terminal, or a cluster composed of several terminals. In addition, it can also be a part divided from a terminal, such as a virtual machine.
[0032] The second device refers to a device that establishes TCP communication with the first device in response to the TCP communication request of the first device. It can be a client or a server. Generally speaking, when the first device is a client, the second device is a server; when the first device is a server, the second device is a client. Specifically, it can also be embodied as a desktop computer, a laptop computer, a mobile phone, a PDA, a dedicated terminal, or a cluster composed of several terminals. In addition, it can also be a part divided from a terminal, such as a virtual machine.
[0033] TCP data communication refers to communication using the TCP protocol, which is a connection-oriented, reliable, byte-stream-based transport layer communication protocol.
[0034] The first dedicated data processor and the second dedicated data processor are both dedicated data processors (DPUs). DPUs are dedicated processors constructed with data as the center, using software-defined technology to support infrastructure layer resource virtualization, and supporting infrastructure layer services such as storage, security, and service quality management. Since TCP data communication requires the establishment of a TCP connection between the first device and the second device, and data transmission through the TCP connection, the first device and the second device here achieve the establishment of a TCP connection and data transmission between the two through the first dedicated data processor and the second dedicated data processor, thereby saving computing resources of the first device and the second device.
[0035] The first dedicated data processor and the second dedicated data processor perform TCP data communication through the network port. Since the first device is connected to the second dedicated data processor via TCP through the first dedicated data processor, the first device can transmit data to the second device through the TCP connection established between the first dedicated data processor and the second dedicated data processor.
[0036] like Figure 2 As shown, according to an embodiment of the present disclosure, a data communication method 200 is provided. The method is executed by a first dedicated data processor, and a first device communicates data with a second device through the first dedicated data processor. The data communication method includes:
[0037] Step 210: Obtain, from the first device, a transmission control protocol connection establishment request for the second device through a first dedicated data channel between the first dedicated data processor and the first device;
[0038] Step 220: In response to the transmission control protocol connection establishment request, establish a transmission control protocol connection with the second device;
[0039] Step 230: Obtain data to be transmitted from the first device through the first dedicated data channel;
[0040] Step 240: perform transmission control protocol encapsulation on the data to be transmitted to obtain a first encapsulated message, and send the first encapsulated message to the second device through a transmission control protocol connection.
[0041] Establishing a transmission control protocol connection with the second device in step 220 refers to the process of establishing a TCP connection with the second device through the running TCP / IP protocol stack. For example, a first TCP / IP protocol stack is running in the first dedicated data processor, and a second TCP / IP protocol stack is running in the second dedicated data processor. After the first dedicated data processor obtains a transmission control protocol connection establishment request, a TCP connection can be established with the second TCP / IP protocol stack through the first TCP / IP protocol stack to achieve the establishment of a transmission control protocol connection with the second dedicated data processor, that is, a transmission control protocol connection can be established with the second device.
[0042] The step 240 of performing transmission control protocol encapsulation on the data to be transmitted refers to encapsulating the data to be transmitted through the TCP / IP protocol stack. For example, if the first dedicated data processor runs a first TCP / IP protocol stack, when performing transmission control protocol encapsulation on the data to be transmitted, the first TCP / IP protocol stack performs encapsulation processing such as TCP / IP header on the data to be transmitted to obtain a first encapsulated message.
[0043] The advantage of steps 210-240 is that the first device does not need to send the encapsulated message to the first dedicated data processor, but uses a dedicated data channel to directly send the bare package of the data to be transmitted to the first dedicated data processor. The channel ensures communication security and does not occupy the terminal device resources, thereby improving data communication efficiency. It is not necessary to establish and encapsulate the TCP connection on the first device for the data to be transmitted. Instead, the TCP connection establishment work on the first device is moved to the first dedicated data processor for execution, and the TCP encapsulation work of the TCP / IP protocol stack on the first device for the data to be transmitted is moved to the TCP / IP protocol stack of the first dedicated data processor for execution, thereby reducing the resource occupation of the terminal device in TCP data communication, improving the TCP data communication speed, and reducing the communication delay. In particular, when the first device transmits multiple data to be transmitted to the opposite device at the same time, the TCP / IP protocol stack in the first dedicated data processor will encapsulate different data to be transmitted to replace the multiple TCP / IP protocol stacks in the first device for encapsulation, and then the data communication method of the embodiment of the present application can further reduce the resource occupation of the terminal device, further improve the TCP data communication speed, and reduce the communication delay.
[0044] The implementation process of step 210 and step 230 is described in detail below.
[0045] like Figure 3 As shown, in one embodiment, the first dedicated data channel includes a shared memory inside the first dedicated data processor, based on which, step 210 includes:
[0046] Step 2101: Periodically poll the shared memory to obtain the transmission control protocol connection establishment request in the shared memory.
[0047] Correspondingly, step 230 includes:
[0048] Step 2301: Periodically poll the shared memory to obtain the data to be transmitted in the shared memory.
[0049] The transmission control protocol connection establishment request in step 2101 is generated by the first device and placed in the shared memory. Specifically, after the transmission control protocol connection establishment request is generated in the first device, the transmission control protocol connection establishment request can be copied to the shared memory according to the shared memory address shared by the first dedicated data processor to the first device.
[0050] The data to be transmitted in step 2301 is generated by the first device and placed in the shared memory. Specifically, after the data to be transmitted is generated in the first device, the data to be transmitted can be copied to the shared memory according to the shared memory address shared by the first dedicated data processor to the first device.
[0051] It should be noted that the first device may copy the transmission control protocol connection establishment request to the shared memory and the first device may copy the data to be transmitted to the shared memory simultaneously or successively, which is not limited in the embodiments of the present disclosure.
[0052] The beneficial effect of step 2101 and step 2301 is that the embodiment of the present disclosure adopts a solution of setting up a shared memory inside the first dedicated data processor, thereby not occupying the storage resources of the first device while ensuring the communication security between the first device and the first dedicated data processor as much as possible, thereby reducing the resource occupation of the first device, improving the TCP data communication speed, and reducing the communication delay.
[0053] like Figure 4 As shown, in another embodiment, the first dedicated data channel includes a system on a chip inside the first dedicated data processor, based on which, step 210 includes:
[0054] Step 2102: Obtain a transmission control protocol connection establishment request forwarded by the system on chip.
[0055] Correspondingly, step 230 includes:
[0056] Step 2302: Obtain the data to be transmitted forwarded by the system on chip.
[0057] The transmission control protocol connection establishment request in step 2102 is generated by the first device and then sent to the system on chip. Specifically, after the transmission control protocol connection establishment request is generated in the first device, the transmission control protocol connection establishment request can be sent to the system on chip in the first dedicated data processor through the interface corresponding to the system on chip in the first device.
[0058] The data to be transmitted in step 2302 is generated by the first device and then sent to the on-chip system. Specifically, after the data to be transmitted is generated in the first device, the data to be transmitted can be sent to the on-chip system of the first dedicated data processor through the interface corresponding to the on-chip system in the first device.
[0059] It should be noted that the first device sending the transmission control protocol connection establishment request to the system on chip and the first device sending the data to be transmitted to the system on chip can be performed simultaneously or one after another, and the embodiments of the present disclosure are not limited to this.
[0060] The advantage of step 2102 and step 2302 is that the embodiment of the present disclosure adopts a solution of setting up a system on chip inside the first dedicated data processor. Since the system on chip can send the received transmission control protocol connection establishment request and the data to be transmitted directly to the first dedicated data processor, compared with the above-mentioned solution of the first dedicated data processor periodically polling the shared memory, the solution of the system on chip directly sending data adopted in the embodiment of the present disclosure can shorten the data communication time and improve the data communication efficiency.
[0061] Refer to the following Figure 1 , a detailed description of the architecture within the first device is given.
[0062] The first device includes at least one source service container group, each source service container group has a source data interface unit; a transmission control protocol connection establishment request and data to be transmitted are generated by a target source service container group in at least one source service container group, and are sent to a first dedicated data channel through the source data interface unit inside the target source service container group.
[0063] The source business container group is a pod in the first device, and each source business container group can run a third TCP / IP protocol stack. For each source business container group, the source data interface unit in the source business container group can be a socket interface of the third TCP / IP protocol stack in the source business container group, or a data interface that replaces the socket interface, which is not limited in the embodiment of the present disclosure. Each source business container group runs an active business program, and the transmission control protocol connection establishment request and the data to be transmitted are generated by any source business program running in the target source business container group, and are sent to the source data interface unit of the target source business container group so as to be sent from the source data interface unit to the first dedicated data channel.
[0064] As a result, the source data interface unit in the target source business container group can directly obtain data such as the transmission control protocol connection establishment request and the data to be transmitted, and the source data interface unit sends the data to the first dedicated data channel, so that the data to be transmitted does not need to be encapsulated or processed in the first device, thereby reducing the resource usage of the first device, improving the TCP data communication speed, and reducing the communication delay.
[0065] In addition, the source data interface unit in the source business container group can be a socket interface of the third TCP / IP protocol stack in the source business container group, or a data interface that replaces the socket interface, so that data to be transmitted and other data generated by the source business program running in the source business container group can be directly acquired by the source data interface unit, and then the data to be transmitted generated by the source business program can be sent to the second device through the first dedicated data channel without being perceived, without adaptive modification on the application side, thereby improving user experience.
[0066] The implementation process of step 220 is described in detail below.
[0067] like Figure 3 and Figure 4 As shown, in one embodiment, the transmission control protocol connection establishment request has a source service container group identifier and a second device identifier. Based on this, step 220 includes:
[0068] Step 2201: Based on the second device identifier, obtain a second identifier of a second dedicated data processor coupled to the second device;
[0069] Step 2202: Send a transmission control protocol handshake request to the second dedicated data processor based on the second identifier;
[0070] Step 2203: Receive the destination service container group identifier allocated in the second device from the second dedicated data processor;
[0071] Step 2204: Bind the source service container group identifier, the first identifier and the second identifier of the first dedicated data processor, and the destination service container group identifier, thereby establishing a transmission control protocol connection.
[0072] Among them, Figure 6 As shown, the second device includes at least one destination service container group, each destination service container group has a destination data interface unit; a second dedicated data channel is arranged between the second dedicated data processor and the second device, and the second dedicated data channel can be a shared memory arranged inside the second dedicated data processor or an on-chip system inside the second dedicated data processor.
[0073] The destination service container group is a pod in the second device, and each destination service container group can run a fourth TCP / IP protocol stack. For each source service container group, the destination data interface unit in the destination service container group can be a socket interface of the fourth TCP / IP protocol stack in the destination service container group, or a data interface that replaces the socket interface. The disclosed embodiment does not limit this. Thus, the destination service program running in the destination service container group can directly obtain the data to be transmitted through the destination data interface unit, and then the application can obtain the data sent by the first device through the first dedicated data channel without perception, without adaptive modification on the application side, thereby improving the user experience.
[0074] In a specific implementation, the second device includes a destination service container group. Based on this, after step 2202 and before step 2203, the second dedicated data processor can receive a transmission control protocol handshake request. At this time, the second data processor can send identification request information to the second device through the second dedicated data channel and the destination data interface unit of the destination service container group, so that the second device sends the destination service container group identifier to the second dedicated data processor through the second dedicated data channel and the destination data interface unit.
[0075] In another specific implementation, the second device includes multiple destination service container groups. Based on this, after step 2202 and before step 2203, the second dedicated data processor can receive a transmission control protocol handshake request. At this time, the second data processor can send identification request information to the second device through the second dedicated data channel and the destination data interface unit of the destination service container group, so that the second device determines any destination service container group with the smallest load capacity or any destination service container group with the largest free capacity among the multiple destination service container groups, and the second dedicated data channel and the destination data interface unit send the destination service container group identifier of the destination service container group to the second dedicated data processor, and the destination service container group identifier is the destination service container group identifier allocated in the second device.
[0076] The advantage of steps 2201-2204 is that by adopting a scheme of establishing a transmission control protocol connection between the first dedicated data processor and the second dedicated data processor, it is unnecessary to connect the second device to the first dedicated data processor via the transmission control protocol, thereby reducing the resource usage of the second device, improving the efficiency of TCP communication, and reducing communication delay.
[0077] The implementation process in step 240 is described in detail below.
[0078] like Figure 3 and Figure 4 As shown, step 240 includes:
[0079] Encapsulate the data to be transmitted using the transmission control protocol to obtain a first encapsulated message (step 2401);
[0080] The first encapsulated message is sent to the second dedicated data processor corresponding to the second identifier through a transmission control protocol connection (step 2402), so that the second dedicated data processor decapsulates the first encapsulated message (step 2403), and then sends it to the destination service container group corresponding to the destination service container group identifier through a second dedicated data channel between the second dedicated data processor and the second device (step 2404).
[0081] Specifically, based on the second TCP / IP protocol stack running in the second dedicated data processor, in the above step 2403, the second dedicated data processor decapsulates the first encapsulated message through the second TCP / IP protocol stack.
[0082] The advantage of steps 2401-2404 is that a TCP connection between the first device and the second device can be achieved by establishing a TCP connection between the first dedicated data processor and the second dedicated data processor, and then encapsulation and decapsulation processing can be performed in the first dedicated data processor and the second dedicated data processor to reduce the occupancy of terminal device resources and improve the TCP data communication efficiency.
[0083] Optionally, the first dedicated data processor may be provided with a first application for processing the received data, and the second dedicated data processor may be provided with a second application for processing the received data, based on which:
[0084] After receiving the data to be transmitted, the first dedicated data processor can determine whether the data to be transmitted needs to be processed by the first application. If so, the data to be transmitted is sent to the first application. After the first application processes the data to be transmitted and obtains updated data to be transmitted, the data to be transmitted is sent to the first TCP / IP protocol stack in the first dedicated data processor so that the first TCP / IP protocol stack encapsulates the data to be transmitted to obtain a first encapsulated message. Otherwise, the data to be transmitted is directly encapsulated by the first TCP / IP protocol stack to obtain a first encapsulated message.
[0085] After the first dedicated data processor sends the first encapsulated message to the second dedicated data processor corresponding to the second identifier through the transmission control protocol connection, the second dedicated data processor can determine whether the first encapsulated message needs to be processed by the second application. If so, the first encapsulated message is decapsulated through the second TCP / IP protocol stack to obtain the data to be transmitted, and the data to be transmitted is sent to the second application. After the second application processes the data to be transmitted to obtain updated data to be transmitted, the data to be transmitted is sent to the destination business container group corresponding to the destination business container group identifier through the second dedicated data channel between the second dedicated data processor and the second device; otherwise, the second TCP / IP protocol stack in the second dedicated data processor directly decapsulates the first encapsulated message to obtain the data to be transmitted, and then sends the data to be transmitted to the destination business container group corresponding to the destination business container group identifier through the second dedicated data channel between the second dedicated data processor and the second device.
[0086] Among them, the first application and the second application can be applications that perform update processing on the data to be transmitted, and the embodiment of the present application does not limit the specific update method of the update processing.
[0087] Compared with the related art in which the first dedicated data processor receives the encapsulated data to be transmitted, and the first dedicated data processor needs to decapsulate the data and then process it through the first application, the first application in the present application can directly process the bare package of the data to be transmitted, which simplifies the data processing process of the first dedicated data processor and improves data communication efficiency.
[0088] like Figure 3 and Figure 4 As shown, in one embodiment, the data communication method further includes:
[0089] Receive a second encapsulated message sent by a second dedicated data processor corresponding to the second identifier through a transmission control protocol connection (step 250);
[0090] The second encapsulated message is decapsulated using the transmission control protocol to restore the response data (step 260 ), and the response data is sent to the source service container group corresponding to the source service container group identifier through the first dedicated data channel (step 270 ).
[0091] The second encapsulated message in step 250 is generated by the second dedicated data processor corresponding to the second identifier receiving the response data from the destination service container group corresponding to the destination service container group identifier through the second dedicated data channel and performing transmission control protocol encapsulation on the response data.
[0092] Specifically, before step 250, the second device can generate response data based on the received data to be transmitted, and then send the response data to the second dedicated data processor through the destination data interface unit and the second dedicated data channel, so that the second TCP / IP protocol stack in the second dedicated data processor encapsulates the response data to obtain a second encapsulated message, and the second dedicated data processor can send the second encapsulated message to the first dedicated data processor through the transmission control protocol connection, so that in step 250, the first dedicated data processor can receive the second encapsulated message.
[0093] In step 260, after the first dedicated data processor receives the second encapsulated message, the first TCP / IP protocol stack may be used to perform transmission control protocol decapsulation on the second encapsulated message to recover the response data.
[0094] The advantage of steps 250-270 is that when the response data sent by the second device is sent to the first device through the first dedicated data processor, the second device does not need to send the encapsulated message to the second dedicated data processor, but uses a dedicated data channel to directly send the bare package of the response data to the second dedicated data processor. The channel ensures communication security and does not occupy terminal device resources, thereby improving the efficiency of TCP data communication. And the first device does not need to decapsulate the received message. Instead, the TCP decapsulation work of the encapsulated message of the TCP / IP protocol stack on the first device is moved to the TCP / IP protocol stack of the first dedicated data processor for execution, thereby reducing the resource occupation of the terminal device in TCP data communication, improving the TCP data communication speed, and reducing the communication delay.
[0095] According to another aspect of the embodiments of the present application, referring to Figure 5 , shows a data communication device 300 provided in this embodiment, which is applied to a first dedicated data processor coupled to a first device, and the first device communicates data with a second device through the first dedicated data processor. The data communication device 300 includes:
[0096] The request unit 310 is configured to obtain, from the first device, a transmission control protocol connection establishment request for the second device through a first dedicated data channel between the first dedicated data processor and the first device;
[0097] The connection unit 320 is configured to establish a transmission control protocol connection with the second device in response to the transmission control protocol connection establishment request;
[0098] The acquisition unit 330 is used to acquire the data to be transmitted from the first device through the first dedicated data channel;
[0099] The sending unit 340 is used to encapsulate the data to be transmitted using the transmission control protocol to obtain a first encapsulated message, and send the first encapsulated message to the second device through the transmission control protocol connection.
[0100] Optionally, the first dedicated data channel includes a shared memory inside the first dedicated data processor;
[0101] The request unit 310 is specifically used for:
[0102] Periodically polling the shared memory to obtain a transmission control protocol connection establishment request in the shared memory, where the transmission control protocol connection establishment request is generated by the first device and placed in the shared memory;
[0103] The acquisition unit 330 is specifically used for:
[0104] The shared memory is polled periodically to obtain the data to be transmitted in the shared memory, where the data to be transmitted is generated by the first device and placed in the shared memory.
[0105] Optionally, the first dedicated data channel includes a system on chip within the first dedicated data processor;
[0106] The request unit 310 is specifically used for:
[0107] Acquire a transmission control protocol connection establishment request forwarded by the system on chip, where the transmission control protocol connection establishment request is generated by the first device and then sent to the system on chip;
[0108] The acquisition unit 330 is specifically used for:
[0109] The data to be transmitted forwarded by the system on chip is obtained, and the data to be transmitted is generated by the first device and then sent to the system on chip.
[0110] Optionally, the first device includes at least one source service container group, each source service container group has a source data interface unit; the transmission control protocol connection establishment request and the data to be transmitted are generated by a target source service container group in at least one source service container group, and sent to the first dedicated data channel through the source data interface unit inside the target source service container group.
[0111] Optionally, the transmission control protocol connection establishment request has a source service container group identifier and a second device identifier;
[0112] The connection unit 320 is specifically used for:
[0113] Based on the second device identifier, obtaining a second identifier of a second dedicated data processor coupled to the second device;
[0114] Based on the second identifier, sending a transmission control protocol handshake request to the second dedicated data processor;
[0115] receiving, from the second dedicated data processor, a destination service container group identifier allocated in the second device;
[0116] The source service container group identifier, the first identifier and the second identifier of the first dedicated data processor, and the destination service container group identifier are bound to establish a transmission control protocol connection.
[0117] Optionally, the acquiring unit 330 is specifically configured to:
[0118] The first encapsulated message is sent to the second dedicated data processor corresponding to the second identifier through a transmission control protocol connection, so that the second dedicated data processor decapsulates the first encapsulated message and sends it to the destination service container group corresponding to the destination service container group identifier through a second dedicated data channel between the second dedicated data processor and the second device.
[0119] Optionally, the data communication method further includes a recovery unit, and the recovery unit is specifically used to:
[0120] receiving a second encapsulated message sent by a second dedicated data processor corresponding to the second identifier through a transmission control protocol connection, wherein the second encapsulated message is generated by the second dedicated data processor corresponding to the second identifier receiving response data from the destination service container group corresponding to the destination service container group identifier through a second dedicated data channel, and performing transmission control protocol encapsulation on the response data;
[0121] The second encapsulated message is decapsulated by transmission control protocol to restore the response data, and the response data is sent to the source service container group corresponding to the source service container group identifier through the first dedicated data channel.
[0122] The data communication device 300 of this embodiment is used to implement the corresponding data communication methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each unit in the data communication device 300 of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.
[0123] Refer to the following Figure 6 The computer device 400 according to the embodiment of the present disclosure is described below. The computer device 400 is the first dedicated data processor mentioned above. Figure 6 The computer device 400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0124] Figure 6 The computer device 400 shown may include, but is not limited to, at least one processing unit 410, at least one storage unit 420, and a bus 430 connecting different system components (including the storage unit 420 and the processing unit 410). The storage unit 420 stores program codes, which can be executed by the processing unit 410, so that the processing unit 410 performs the steps according to various exemplary embodiments of the present invention described in the description part of the exemplary method above in this specification.
[0125] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and / or a cache storage unit 4202 , and may further include a read-only storage unit (ROM) 4203 .
[0126] The storage unit 420 may also include a program / utility 4204 having a set (at least one) of program modules 8205, such program modules 4205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0127] Bus 430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0128] The computer device 400 may also communicate with one or more external devices 500 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable users to interact with the computer device 400, and / or communicate with any device (e.g., routers, modems, etc.) that enables the computer device 400 to communicate with one or more other computing devices. This communication may be performed through an input / output (I / O) interface 450. In addition, the computer device 400 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 460. As shown, the network adapter 460 communicates with other modules of the computer device 400 through a bus 430. It should be understood that, although not shown in the figure, the computer device 400 may be implemented using other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0129] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0130] In an exemplary embodiment of the present disclosure, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method described in the above method embodiment.
[0131] According to one embodiment of the present disclosure, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0132] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0133] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0134] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0135] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0136] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0137] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0138] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0139] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A data communication method, characterized in that: A first dedicated data processor coupled to a first device, wherein the first device performs data communication with a second device through the first dedicated data processor, and the data communication method includes: Obtaining, from the first device, a transmission control protocol connection establishment request for a second device through a first dedicated data channel between the first dedicated data processor and the first device; In response to the transmission control protocol connection establishment request, establishing a transmission control protocol connection with the second device; Acquire data to be transmitted from the first device through the first dedicated data channel; Encapsulating the data to be transmitted using a transmission control protocol to obtain a first encapsulated message, and sending the first encapsulated message to the second device through the transmission control protocol connection; The first device comprises at least one source service container group; The transmission control protocol connection establishment request has a source service container group identifier and a second device identifier; The step of establishing a transmission control protocol connection with the second device in response to the transmission control protocol connection establishment request includes: Based on the second device identifier, obtaining a second identifier of a second dedicated data processor coupled to the second device; Based on the second identifier, sending a transmission control protocol handshake request to the second dedicated data processor; receiving, from the second dedicated data processor, a destination service container group identifier allocated in the second device; The source service container group identifier, the first identifier of the first dedicated data processor, the second identifier, and the destination service container group identifier are bound to establish the transmission control protocol connection.
2. The data communication method according to claim 1, characterized in that: The first dedicated data channel includes a shared memory inside the first dedicated data processor; The step of obtaining a transmission control protocol connection establishment request for a second device from the first device through a first dedicated data channel between the first dedicated data processor and the first device comprises: periodically polling the shared memory to obtain the transmission control protocol connection establishment request in the shared memory, wherein the transmission control protocol connection establishment request is generated by the first device and placed in the shared memory; The obtaining the data to be transmitted from the first device through the first dedicated data channel includes: periodically polling the shared memory to obtain the data to be transmitted in the shared memory, wherein the data to be transmitted is generated by the first device and placed in the shared memory.
3. The data communication method according to claim 1, characterized in that: The first dedicated data channel includes a system on a chip within the first dedicated data processor; The step of obtaining, from the first device, a transmission control protocol connection establishment request for establishing a connection with a second device through a first dedicated data channel between the first dedicated data processor and the first device comprises: obtaining the transmission control protocol connection establishment request forwarded by the system on chip, wherein the transmission control protocol connection establishment request is generated by the first device and then sent to the system on chip; The obtaining the data to be transmitted from the first device through the first dedicated data channel includes: obtaining the data to be transmitted forwarded by the system on chip, wherein the data to be transmitted is generated by the first device and then sent to the system on chip.
4. The data communication method according to claim 1, characterized in that: Each of the source service container groups has a source data interface unit; The transmission control protocol connection establishment request and the data to be transmitted are generated by a target source service container group in at least one of the source service container groups, and are sent to the first dedicated data channel through the source data interface unit inside the target source service container group.
5. The data communication method according to claim 4, characterized in that: The sending the first encapsulated message to the second device through the transmission control protocol connection includes: The first encapsulated message is sent to the second dedicated data processor corresponding to the second identifier through the transmission control protocol connection, so that the second dedicated data processor decapsulates the first encapsulated message and sends it to the destination service container group corresponding to the destination service container group identifier through the second dedicated data channel between the second dedicated data processor and the second device.
6. The data communication method according to claim 5, characterized in that: After sending the first encapsulated message to the second device through the transmission control protocol connection, the data communication method further includes: receiving a second encapsulated message sent by the second dedicated data processor corresponding to the second identifier through the transmission control protocol connection, wherein the second encapsulated message is generated by the second dedicated data processor corresponding to the second identifier receiving response data from the destination service container group corresponding to the destination service container group identifier through the second dedicated data channel and performing transmission control protocol encapsulation on the response data; The second encapsulated message is decapsulated by the transmission control protocol to restore the response data, and the response data is sent to the source service container group corresponding to the source service container group identifier through the first dedicated data channel.
7. A data communication device, characterized in that: A first dedicated data processor coupled to a first device, wherein the first device performs data communication with a second device through the first dedicated data processor, and the data communication apparatus comprises: a request unit, configured to obtain, from the first device, a transmission control protocol connection establishment request for establishing a connection with a second device through a first dedicated data channel between the first dedicated data processor and the first device; a connection unit, configured to establish a transmission control protocol connection with the second device in response to the transmission control protocol connection establishment request; an acquiring unit, configured to acquire data to be transmitted from the first device through the first dedicated data channel; a sending unit, configured to perform transmission control protocol encapsulation on the data to be transmitted to obtain a first encapsulated message, and send the first encapsulated message to the second device through the transmission control protocol connection; The first device comprises at least one source service container group; The transmission control protocol connection establishment request has a source service container group identifier and a second device identifier; The step of establishing a transmission control protocol connection with the second device in response to the transmission control protocol connection establishment request includes: Based on the second device identifier, obtaining a second identifier of a second dedicated data processor coupled to the second device; Based on the second identifier, sending a transmission control protocol handshake request to the second dedicated data processor; receiving, from the second dedicated data processor, a destination service container group identifier allocated in the second device; The source service container group identifier, the first identifier of the first dedicated data processor, the second identifier, and the destination service container group identifier are bound to establish the transmission control protocol connection.
8. A computer device, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the data communication method according to any one of claims 1 to 6 is implemented.
9. A computer storage medium, characterized in that The computer storage medium stores computer program codes, and when the computer program codes are executed by a processor, the processor executes the data communication method according to any one of claims 1 to 6.
