Data transmission method, device, electronic device and medium based on TCP protocol

By negotiating the data area format with the communication peer in the TCP protocol and establishing a TCP connection, the problem of low transmission efficiency of the TCP protocol is solved, and efficient transmission of data streams between the communication end and the peer is achieved.

CN114500683BActive Publication Date: 2024-10-29SHANGHAI STEP ROBOTICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111658641.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-10-29
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

The byte-based transmission mode of the TCP protocol results in low data transmission efficiency, which cannot meet actual needs, especially when the amount of data is large or real-time requirements are high.

Method used

Create a data area through a pre-negotiated data area format with the communication peer, establish a TCP connection, read data from the communication peer and write it into the data area to achieve efficient transmission of data streams and avoid setting up additional communication protocols.

Benefits of technology

The data transmission efficiency is improved, the inefficiency problem caused by the one-send-one-receive mode in the existing technology is solved, and the efficient transmission of data flow between the communication end and the opposite end is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114500683B_ABST
    Figure CN114500683B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention relate to the field of communication technology, and disclose a data transmission method, device, electronic device, and medium based on the TCP protocol. The data transmission method based on the TCP protocol includes: creating a first data area according to a first data area format pre-negotiated with a communication peer; the first data area is used to store data read from the communication peer; establishing a first transmission control protocol TCP connection with the communication peer; reading data in a first designated area of ​​a first designated data area from the communication peer through the first TCP connection, and writing the read data into the first designated area of ​​the first data area; the format of the first designated data area is the first data area format. By performing data transmission in the data areas of the communication local end and the communication peer end, there is no need to establish TCP communication and the communication protocol format of the communication local end and the communication peer end, so that efficient transmission of data streams between the communication local end and the communication peer end can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communication technology, and in particular to a data transmission method, device, electronic device and medium based on the TCP protocol. Background Art

[0002] The most basic and efficient transmission method between devices is to communicate through the network port using the Transmission Control Protocol (TCP). However, the biggest problem with using the TCP protocol is that TCP is transmitted in a "stream" mode. In the same network stream, TCP can only guarantee the information of bytes, and the order of bytes will not change. TCP uses bytes as the transmission unit. In the engineering application of the STEP robot controller based on CODESYS, the amount of data expressed by a single byte is too small to meet actual needs. If a send-receive mode is adopted to transmit data, when the amount of data is large or the real-time requirements are high, it will lead to low efficiency. The interactive mode of question-and-answer is not advisable. Summary of the invention

[0003] The purpose of the embodiments of the present invention is to provide a data transmission method, device, electronic device and medium based on the TCP protocol, so that data streams can be efficiently transmitted between different programs.

[0004] To solve the above technical problems, an embodiment of the present invention provides a data transmission method based on the TCP protocol, including: creating a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer; establishing a first transmission control protocol TCP connection with the communication peer; reading data in a first specified area of ​​a first specified data area from the communication peer through the first TCP connection, and writing the read data into the first specified area in the first data area; wherein the format of the first specified data area is the first data area format.

[0005] An embodiment of the present invention also provides a data transmission device based on the TCP protocol, including: a creation module, used to create a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer; a connection module, used to establish a first transmission control protocol TCP connection with the communication peer; a reading module, used to read data in a first specified area of ​​a first specified data area from the communication peer through the first TCP connection, and write the read data into the first specified area in the first data area; wherein the format of the first specified data area is the first data area format.

[0006] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data transmission method based on the TCP protocol as described above.

[0007] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the above-mentioned data transmission method based on the TCP protocol when executed by a processor.

[0008] Compared with the prior art, the embodiment of the present invention creates a first data area according to a first data area format pre-negotiated with a communication peer in a data transmission process based on the TCP protocol; wherein the first data area is used to store data read from the communication peer; a first transmission control protocol TCP connection is established with the communication peer; data in a first designated area of ​​a first designated data area is read from the communication peer through the first TCP connection, and the read data is written into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format. By transmitting data in the data areas of the communication local end and the communication peer, there is no need to additionally build TCP communication and the communication protocol format of the communication local end and the communication peer. It is only necessary to point the variable pointers used in the communication local end and the communication peer to the corresponding positions in the data area to realize efficient transmission of data streams between the communication local end and the communication peer; the technical problem of low data transmission efficiency caused by the one-send-one-receive transmission mode adopted by the communication local end and the communication peer in the prior art is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0010] Figure 1 It is a flowchart of a data transmission method based on the TCP protocol provided in an embodiment of the present application;

[0011] Figure 2 It is a schematic diagram of the structure of the data area created by the communication local end and the communication peer end provided in the implementation mode of the present application;

[0012] Figure 3 It is a flowchart of a data transmission method based on the TCP protocol provided in an embodiment of the present application;

[0013] Figure 4 It is a flowchart of a data transmission method based on the TCP protocol provided in an embodiment of the present application;

[0014] Figure 5 It is a schematic diagram of the structure of a data transmission device based on the TCP protocol provided in an embodiment of the present application;

[0015] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0017] When the data transmission method based on the TCP protocol mentioned in the present invention is applied to the client, the client is the communication end, and the communication end is the server; or, when the data transmission method based on the TCP protocol mentioned in the present invention is applied to the server, the server is the communication end, and the communication end is the client.

[0018] The embodiment of the present invention relates to a data transmission method based on TCP protocol. The specific process is as follows Figure 1 shown.

[0019] Step 101, creating a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer.

[0020] In an example implementation, the communication end and the communication peer end need to negotiate the format of the first data area created before the first data transmission. After the communication end and the communication peer end negotiate the format of the first data area created, the communication end and the communication peer end need to create their respective corresponding data areas according to the negotiated data area format, such as Figure 2 As shown, the communication end creates a first data area according to the negotiated first data area format, and the function of the first data area created by the communication end is to store data read from the communication partner end; the communication partner end creates a first designated data area according to the negotiated data area format, and the function of the first designated data area created by the communication partner end is to enable the communication end to read data from the first designated data area.

[0021] In an example implementation, when the communication end is a server and the communication end is a client, first data areas are created for different clients according to a pre-negotiated first data area format, and the created first data areas correspond one-to-one to the clients; the first data areas and the second data areas created by the communication end and the communication end are reusable and are not disposable data areas.

[0022] Step 102: Establish a first Transmission Control Protocol TCP connection with a communication peer.

[0023] In an example implementation, after the communication local end and the communication counterpart end have each created a data area, the communication local end and the communication counterpart end establish a first Transmission Control Protocol TCP connection. The present invention does not specifically limit the method for establishing a TCP connection, and any method for establishing a TCP connection may be applicable.

[0024] In an exemplary implementation, the format of the transmission control protocol established by the communication local end and the communication counterpart end is shown in Table 1.

[0025] Table 1 Transmission Control Protocol Format

[0026]

[0027] Step 103, read data in the first designated area of ​​the first designated data area from the communication peer through the first TCP connection, and write the read data into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format.

[0028] In an example implementation, a communication local end communicates with a first designated data area of ​​a communication counterpart end through a first TCP connection, and the communication local end reads data to be transmitted from a first designated area in the first designated data area of ​​the communication counterpart end. After the communication local end reads the transmitted data, the communication local end writes the read transmitted data into the first designated area in the first data area of ​​the communication local end; wherein the first designated data area of ​​the communication counterpart end and the first data area of ​​the communication local end are data areas with the same data area format.

[0029] In an example implementation, when the communication local end and the communication counterpart end create the first data area and the first designated data area according to the negotiated data area format, the positions of the data in the first data area and the first designated data area have already been planned, namely, the first designated area in the first data area of ​​the communication local end and the first designated area in the first designated data area of ​​the communication counterpart end.

[0030] In an example implementation, during data transmission, the communication local end needs to detect the first TCP connection established with the communication peer end, and release the first TCP connection when it is detected that the communication peer end disconnects the first TCP connection.

[0031] In this embodiment, in the data transmission process based on the TCP protocol, a first data area is created according to the first data area format pre-negotiated with the communication peer; wherein the first data area is used to store data read from the communication peer; a first transmission control protocol TCP connection is established with the communication peer; data in the first designated area of ​​the first designated data area is read from the communication peer through the first TCP connection, and the read data is written into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format. By transmitting data in the data areas of the communication local end and the communication peer end, there is no need to additionally build TCP communication and the communication protocol format of the communication local end and the communication peer end. It is only necessary to point the variable pointers used in the communication local end and the communication peer end to the corresponding positions in the data area to realize efficient transmission of data streams between the communication local end and the communication peer end; the technical problem of low data transmission efficiency caused by the one-send-one-receive transmission mode adopted by the communication local end and the communication peer end in the prior art is solved.

[0032] The embodiment of the present invention relates to a data transmission method based on TCP protocol. The specific process is as follows Figure 3 shown.

[0033] Step 201, creating a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer.

[0034] In an exemplary implementation, this step is substantially the same as step 101 mentioned in the embodiment of the present invention, and is not described in detail here.

[0035] Step 202: Establish a first Transmission Control Protocol TCP connection with a communication peer.

[0036] In an exemplary implementation, this step is substantially the same as step 102 mentioned in the embodiment of the present invention, and is not described in detail here.

[0037] Step 203, read data in the first designated area of ​​the first designated data area from the communication peer through the first TCP connection, and write the read data into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format.

[0038] In an exemplary implementation, this step is substantially the same as step 103 mentioned in the embodiment of the present invention, and is not described in detail here.

[0039] Step 204, when a change is detected in the first designated area, data in the changed first designated area of ​​the first designated data area is read from the communication peer through the first TCP connection, and the read data is written into the changed first designated area of ​​the first data area.

[0040] In an example implementation, the communication local end will also detect the position of the first designated area in the first designated data area in the communication counterpart, and when it detects that the position of the first designated area in the first designated data area in the communication counterpart has changed, or the communication local end will also detect the position of the first designated area in the first data area in the communication local end, and when it detects that the position of the first designated area in the first data area in the communication local end has changed; the communication local end communicates with the changed first designated data area of ​​the communication counterpart through the first TCP connection, and the communication local end reads the data to be transmitted from the changed first designated area in the first designated data area of ​​the communication counterpart, and after the communication local end reads the transmitted data, the communication local end writes the read transmitted data into the changed first designated area in the first data area of ​​the communication local end; wherein the first designated areas of the communication local end and the communication counterpart are always consistent, and if the first designated area of ​​one side changes, the other side also changes accordingly.

[0041] Based on other embodiments, this embodiment can also, when a designated area changes, only need to read the data after the area change and then write it, without the need to re-establish the communication connection or negotiate the communication format, thereby further improving the efficient transmission of data streams between the communication end and the communication peer end.

[0042] The embodiment of the present invention relates to a data transmission method based on TCP protocol. The specific process is as follows Figure 4 shown.

[0043] Step 301, creating a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer.

[0044] In an exemplary implementation, this step is substantially the same as step 101 mentioned in the embodiment of the present invention, and is not described in detail here.

[0045] Step 302: Establish a first Transmission Control Protocol TCP connection with a communication peer.

[0046] In an exemplary implementation, this step is substantially the same as step 102 mentioned in the embodiment of the present invention, and is not described in detail here.

[0047] Step 303, read data in the first designated area of ​​the first designated data area from the communication peer through the first TCP connection, and write the read data into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format.

[0048] In an exemplary implementation, this step is substantially the same as step 103 mentioned in the embodiment of the present invention, and is not described in detail here.

[0049] Step 304, creating a second data area according to a second data area format pre-negotiated with the communication peer; wherein the second data area is used to store data to be written to the communication peer.

[0050] In an example implementation, the communication end and the communication peer end need to negotiate the format of the created second data area before the first data transmission. After the communication end and the communication peer end negotiate the format of the created second data area, the communication end and the communication peer end need to create their respective corresponding data areas according to the negotiated data area format, such as Figure 2 As shown, the communication local end creates a second data area according to the negotiated data area format, and the purpose of the second data area created by the communication local end is to enable the communication counterpart end to read data from the second data area; the communication counterpart end creates a second designated data area according to the negotiated data area format, and the purpose of the second designated data area created by the communication counterpart end is to store data read from the second data area of ​​the communication local end.

[0051] In an exemplary implementation, the format of the first data area may be the same as or different from the format of the second data area, and the present invention is not limited thereto.

[0052] Step 305: Establish a second TCP connection with the communication peer.

[0053] In an example implementation, after the communication local end and the communication counterpart end have each created their data areas, the communication local end and the communication counterpart end establish a second Transmission Control Protocol TCP connection. The present invention does not impose any specific limitation on the method of establishing a TCP connection, and any method of establishing a TCP connection may be applicable.

[0054] Step 306, writing the data in the second designated area of ​​the second data area into the second designated area of ​​the second designated data area of ​​the communication peer through the second TCP connection; wherein the format of the second designated data area is the second data area format.

[0055] In an example implementation, a communication local end communicates with a second designated data area of ​​a communication peer end through a second TCP connection, and the communication peer end reads data to be transmitted from a second designated area in the second data area of ​​the communication local end. After the communication peer end reads the transmitted data, the communication peer end writes the read transmitted data into the second designated area in the second designated data area of ​​the communication peer end; wherein the second designated data area of ​​the communication peer end and the second data area of ​​the communication local end are data areas with the same data area format.

[0056] In an example implementation, when the communication local end and the communication counterpart end create the second data area and the second designated data area according to the negotiated second data area format, the positions of the data in the second data area and the second designated data area have already been planned, namely, the second designated area in the second data area of ​​the communication local end and the second designated area in the second designated data area of ​​the communication counterpart end.

[0057] In an example implementation, during data transmission, the communication local end needs to detect the second TCP connection established with the communication peer end, and release the second TCP connection when it is detected that the communication peer end disconnects the second TCP connection.

[0058] In an example implementation, the communication local end will also detect the position of the second designated area in the second designated data area in the communication counterpart end, and when it is detected that the position of the second designated area in the second designated data area in the communication counterpart end has changed, or the communication local end will also detect the position of the second designated area in the second data area in the communication local end, and when it is detected that the position of the second designated area in the second data area in the communication local end has changed; the communication local end communicates with the second designated data area of ​​the communication counterpart end through a second TCP connection, and the communication counterpart end reads the data to be transmitted from the changed second designated area in the second data area of ​​the communication local end, and after the communication counterpart end reads the transmitted data, the read transmitted data is written into the changed second designated area in the second designated data area of ​​the communication counterpart end; wherein the second designated areas of the communication local end and the communication counterpart end are always kept consistent, and if the second designated area of ​​one side changes, the other side also changes accordingly.

[0059] In a specific implementation, in an example implementation, when the present invention is applied to a CODESYS project, a computer network cable is inserted into a robot control cabinet, the CODESYS project is opened, the communication function library is copied to the corresponding CODESYS project, and a new program is created in the CODESYS project, the communication library method is loaded into the program, and the program is loaded into the corresponding task, and then the present invention can be implemented; a corresponding structure is created in the CODESYS project (the CODESYS project can be the communication end, and the data area format needs to be negotiated with the communication end), which are respectively read and write structures (the read structure is the first data area of ​​the present application, and the write structure is the second data area of ​​the present application), and then the CODESYS project instantiates the structure, and uses the instantiated structure as the input of the communication library function; then the communication library is loaded under the computer program, a new thread is created, and the threads are opened in sequence. Connection method (i.e., the first TCP connection or the second TCP connection), read method (i.e., the communication end reads data from the first designated area in the first designated data area of ​​the communication end, or, the communication end reads data from the second designated area in the second data area of ​​the communication end), write method (i.e., the communication end writes the read data into the first designated area of ​​the first data area, or, the communication end writes the read data into the second designated area of ​​the second designated data area), close connection (i.e., release the first TCP connection or the second TCP connection); wherein, due to the long connection scheme adopted in the communication, opening and closing can be performed once, and the read method and the write method need to be executed cyclically, and two arrays need to be newly created, which are the return of the read function and the input of the write function, respectively, so as to realize the mapping with the manipulator data area; since the real-time program of the manipulator is written by codesys, the server function library only supports codesys. The client function library only supports the .Net platform.

[0060] Based on other embodiments, this embodiment can also establish a second data area at the communication peer end to enable the communication peer end to have the ability to write data streams, thereby enabling the communication end and the communication peer end to have the ability to bidirectionally transmit data streams.

[0061] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0062] The embodiment of the present invention relates to a data transmission device based on the TCP protocol. The details of the model acquisition system of this embodiment are specifically described below. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for the implementation of this example. Figure 5It is a schematic diagram of a data transmission device based on the TCP protocol of this embodiment, including: a creation module 401, a connection module 402 and a reading module 403.

[0063] The creation module 401 is used to create a first data area according to a first data area format pre-negotiated with the communication peer; wherein the first data area is used to store data read from the communication peer;

[0064] A connection module 402, configured to establish a first transmission control protocol TCP connection with a communication peer;

[0065] The reading module 403 is used to read data in the first specified area of ​​the first specified data area from the communication peer through the first TCP connection, and write the read data into the first specified area in the first data area; wherein the format of the first specified data area is the first data area format.

[0066] It is not difficult to find that this embodiment is a system embodiment corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the first embodiment.

[0067] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.

[0068] Another embodiment of the present invention relates to an electronic device, such as Figure 6 As shown, it includes: at least one processor 501; and a memory 502 that is communicatively connected to the at least one processor 501; wherein the memory 502 stores instructions that can be executed by the at least one processor 501, and the instructions are executed by the at least one processor 501 so that the at least one processor 501 can execute the data transmission method based on the TCP protocol in the above-mentioned embodiments.

[0069] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art, and therefore, are not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna. Further, the antenna also receives data and transmits the data to the processor. The memory and processor in the electronic device can also be devices that support any communication mode, such as: the memory and processor in the electronic device support Ethernet communication mode.

[0070] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0071] The embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiment is implemented.

[0072] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0073] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.

Claims

1. A data transmission method based on TCP protocol, It is characterized in that include: Creating a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer; Establishing a first Transmission Control Protocol TCP connection with the communication peer; Reading data in a first designated area of ​​a first designated data area from the communication peer through the first TCP connection, and writing the read data into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format; Wherein, after writing the read data into the first designated area in the first data area, the method further includes: When a change is detected in the first designated area, data in the changed first designated area of ​​the first designated data area is read from the communication peer through the first TCP connection, and the read data is written into the changed first designated area in the first data area.

2. The data transmission method based on the TCP protocol according to claim 1, It is characterized in that The method further comprises: Creating a second data area according to a second data area format pre-negotiated with the communication peer; wherein the second data area is used to store data to be written to the communication peer; Establishing a second TCP connection with the communication peer; The data in the second designated area of ​​the second data area is written into the second designated area of ​​the second designated data area of ​​the communication peer through the second TCP connection; wherein the format of the second designated data area is the format of the second data area.

3. The data transmission method based on the TCP protocol according to claim 2, It is characterized in that After writing the data in the second designated area of ​​the second data area into the second designated area of ​​the second designated data area of ​​the communication peer through the second TCP connection, the method further includes: When a change is detected in the second designated area, the data in the changed second designated area of ​​the second data area is written into the changed second designated area of ​​the second designated data area of ​​the communication peer through the second TCP connection.

4. The data transmission method based on the TCP protocol according to claim 3, It is characterized in that The method further comprises: In the case of detecting that the communication peer disconnects the first TCP connection, releasing the first TCP connection; or, When it is detected that the communication peer disconnects the second TCP connection, the second TCP connection is released.

5. The data transmission method based on the TCP protocol according to any one of claims 1 to 3, It is characterized in that The method is applied to a client, and the communication counterpart is a server; or, the method is applied to a server, and the communication counterpart is a client.

6. The data transmission method based on the TCP protocol according to claim 5, It is characterized in that When the method is applied to a server, the communication peer is a client, and the step of creating the first data area according to the first data area format pre-negotiated with the communication peer includes: The first data areas are respectively created for different clients according to the pre-negotiated first data area format, and the created first data areas correspond one-to-one to the clients.

7. A data transmission device based on TCP protocol, It is characterized in that include: A creation module, used to create a first data area according to a first data area format pre-negotiated with a communication peer; wherein the first data area is used to store data read from the communication peer; A connection module, used to establish a first transmission control protocol TCP connection with the communication peer; A reading module, configured to read data in a first designated area of ​​a first designated data area from the communication peer through the first TCP connection, and write the read data into the first designated area of ​​the first data area; wherein the format of the first designated data area is the first data area format; Wherein, after writing the read data into the first designated area in the first data area, the method further includes: When a change is detected in the first designated area, data in the changed first designated area of ​​the first designated data area is read from the communication peer through the first TCP connection, and the read data is written into the changed first designated area in the first data area.

8. An electronic device, It is characterized in that include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the data transmission method based on the TCP protocol as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the data transmission method based on the TCP protocol described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Metadata read-write method and device

    CN105488047A

  • Information processing apparatus, control method for information processing apparatus, and program

    JP2018106418A

  • Parallel TCP without lock between sender and receiver

    US20070061466A1

  • Document management system for transferring a plurality of documents

    US20100088581A1