Method for transmitting data, process method for receiving data and device

A technology for sending data and data, applied in the field of communication, can solve the problems that communication cannot actively notify communication, there is no solution, cannot reliably transmit data with order and structure information, etc., to achieve reliable transmission and overcome sticky packets.

Inactive Publication Date: 2010-06-23
SUMAVISION TECH CO LTD
View PDF0 Cites 21 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, RPC depends to some extent on the operating system and application development tools, and cannot communicate across platforms; in addition, RPC is passive communication and cannot actively notify communication. This method requires different development tools or platforms for different manufac

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for transmitting data, process method for receiving data and device
  • Method for transmitting data, process method for receiving data and device
  • Method for transmitting data, process method for receiving data and device

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0037] Example 1

[0038] This embodiment provides a method for sending data, see figure 1 , The flow chart of the method for sending data provided in this embodiment, the method includes:

[0039] Step S102: Determine the data structure corresponding to the data to be sent;

[0040] In this embodiment, the corresponding data structure is defined in advance according to the type of data to be sent, and the data length in different data structures may be different; when data is to be sent, the data structure corresponding to the data to be sent currently is determined according to the definition;

[0041] Step S104: Determine the command type and data length according to the above data structure;

[0042] Step S106: When sending the data in the above data structure for the first time, store the current data according to the specified data packet format, and send the current data in TCP mode;

[0043] The specified data packet format is shown in Table 1, including a command packet header a...

Example Embodiment

[0049] Example 2

[0050] This embodiment also provides a method for processing received data, which is based on the method for sending data provided in Embodiment 1, see figure 2 , The flow chart of the method for processing received data provided by this embodiment, the method includes:

[0051] Step 202: Buffer the data in the received data packet into the buffer; the data packet includes a command packet header, where the command packet header carries the command type and data length;

[0052] If the command packet header is not included in the received data packet, directly buffer it into the buffer;

[0053] Step 204: packetize the data in the buffer according to the foregoing data length;

[0054] Since the application does not set the TCP_NODELAY attribute for TCP, when transmitting data in TCP mode, in order to improve the transmission efficiency, the sender often has to collect enough data before sending a packet of data. If the data sent several times in a row is very small,...

Example Embodiment

[0064] Example 3

[0065] This embodiment provides a method for sending data, which is similar to that in Embodiment 1. figure 1 The difference between the methods shown is that when sending data in this embodiment, the command header also carries a command header flag to indicate whether the receiver should buffer the currently sent data.

[0066] When the data that needs to be sent is ordinary data, for example, when the data that needs to be sent is continuous stream data without structure (such as: files), the receiver does not need to sub-package these data, so there is no need to deal with these data. After receiving the data, the data can be processed according to the usual processing method. For this reason, this embodiment carries a command header flag in the command packet header to indicate whether the receiver should buffer the current data, for example, the pre-agreed command The header flag is 1, which means that the current data needs to be cached. It is agreed in ad...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a method and a device for transmitting data, and a process method and a device for receiving data, belonging to the field of communication. The method for transmitting the data comprises the steps of: ensuring data structure corresponding to data to be transmitted, ensuring command type and data length, memorizing current data according to the appointed mode of an data packet when firstly transiting the data in the data structure, and transmitting the current data by the means of TCP, wherein the appointed mode of the data packet comprises an command packet head and the current data, and the command packet head carries the command type and the data length. By adopting the appointed mode of the data packet to transmit the data, the invention leads the receiving party to be capable of correctly packaging the received data packet based on the length, and reliably transmitting the data with sequence and structural information.

Description

technical field [0001] The present invention relates to the communication field, and more specifically, to a method and device for sending data, and a method and device for processing received data. Background technique [0002] In the process of application development, it is often necessary to reliably send data from one application to another, and the transmitted data is generally sequenced and structured (fixed or indeterminate) data, and the receiver usually needs to check these The data is processed in packets. [0003] The relevant data transmission technologies include the following methods: [0004] 1) Use UDP (User Datagram Protocol, User Datagram Protocol) for data network transmission [0005] The UDP protocol is a datagram mode. Data is sent one by one through data packets. UDP is used for data network transmission. The data packets are likely to be lost, or the order of the data packets will change, so the UDP protocol is not suitable for the sequence. And d...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L29/06H04L12/56H04L45/50
Inventor 胡长柏刘卫昌
Owner SUMAVISION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products