CN107135167A - Data transmission method, data transmission device and server - Google Patents
Data transmission method, data transmission device and server Download PDFInfo
- Publication number
- CN107135167A CN107135167A CN201710256091.9A CN201710256091A CN107135167A CN 107135167 A CN107135167 A CN 107135167A CN 201710256091 A CN201710256091 A CN 201710256091A CN 107135167 A CN107135167 A CN 107135167A
- Authority
- CN
- China
- Prior art keywords
- length
- inclusion
- packet header
- equal
- buffering area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/31—Flow control; Congestion control by tagging of packets, e.g. using discard eligibility [DE] bits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention proposes a kind of data transmission method, data transmission device and server, wherein, the data transmission method includes:When receiving data by TCP, the data received are stored in buffering area;When the buffering area includes packet header, the inclusion length set in the packet header is obtained;Judge whether the length of inclusion corresponding with the packet header in the buffering area is equal to the inclusion length;If the length of the inclusion is equal to the inclusion length, the data content in the inclusion is obtained;If the length of the inclusion is less than the inclusion length, circulation performs whether the length for judging inclusion corresponding with the packet header in the buffering area is equal to the inclusion length, untill when the length of the inclusion is equal to the inclusion length.It by technical scheme, can efficiently and reliably avoid data from occurring packet splicing and situation about unpacking in transmitting procedure, and ensure that implementation is more flexible, disclosure satisfy that the application under complex scene.
Description
Technical field
The present invention relates to server technology field, filled in particular to a kind of data transmission method, a kind of data transfer
Put and a kind of server.
Background technology
In the today in mobile Internet epoch, increasing application adds social attribute, especially instant messaging work(
Can, in order to be linked up anywhere or anytime between user.It is real and with the increase of customer volume, message data volume is consequently increased
The TCP (Transmission Control Protocol, transmission control protocol) of existing instant messaging bottom, just faces to tight
High test.What is particularly highlighted is TCP packet splicings and the problem of unpack.As shown in figure 1, Client is client, Server is clothes
Be engaged in device end, when Client to Server by TCP transmission data when, have following a variety of situations:The first situation, Data1 and
Data2 is respectively sent to Server, data normal transmission.Second of situation, Data1 and Data2 have been bonded at together, are sent to
, there is packet splicing in Server during data transfer.The third situation, Data2 has been split into Data2_1 and Data2_2, data transfer
When unpack.
In correlation technique, it is to avoid the processing mode for packet splicing occur and unpacking includes:Message fixed length, each message content length
Equally, spcial character polishing is not enough used.Using special symbol segmentation bag, distinctive mark, such as FTP (File are increased in each bag tail
Transfer Protocol, FTP).Interval time hair packet, each packet interval regular hour, with
Avoid association.
The problem of these traditional modes, is it is clear that message fixed length and the special symbol separation bag underaction of use, are unsatisfactory for
Application under complex scene.Interval time send out packet, it is less efficient, and and it is unreliable, it is impossible to meet mass data request under
Demand.
Therefore, how efficiently and reliably to avoid data from occurring packet splicing and situation about unpacking in transmitting procedure, and ensure
Implementation is more flexible, disclosure satisfy that the application under complex scene turns into technical problem urgently to be resolved hurrily.
The content of the invention
The present invention is based on above mentioned problem, it is proposed that a kind of new technical scheme, can efficiently and reliably avoid data
Occur packet splicing and situation about unpacking in transmitting procedure, and ensure that implementation is more flexible, disclosure satisfy that under complex scene
Application.
In view of this, the first aspect of the present invention proposes a kind of data transmission method, including:Number is being received by TCP
According to when, the data received are stored in buffering area;When the buffering area includes packet header, obtain in the packet header and set
Inclusion length;Judge whether the length of inclusion corresponding with the packet header in the buffering area is equal to the inclusion length;If
The length of the inclusion is equal to the inclusion length, then obtains the data content in the inclusion;If the length of the inclusion is small
In the inclusion length, then circulation perform the length for judging inclusion corresponding with the packet header in the buffering area whether etc.
In the inclusion length, untill when the length of the inclusion is equal to the inclusion length.
In the technical scheme, packet is made up of packet header and inclusion, if the length of inclusion is less than packet header in buffer area
The inclusion length of middle setting, illustrates that some inclusion is not stored in buffer area also, for example, the inclusion length set in packet header
For 5 bytes, and the length of the inclusion in buffer area is 3 bytes, illustrate also have the inclusion of 2 bytes not receive, then after
It is continuous to judge.If judging, the length of inclusion in buffer area is equal to the inclusion length set in packet header, illustrates that inclusion is all deposited
It has been put into buffer area, has then carried out unpacking work to obtain the data content in inclusion, so as to efficiently and reliably avoids number
According to the situation for occurring packet splicing in transmitting procedure He unpacking, and ensure that the mode of data transfer is more flexible, disclosure satisfy that multiple
Application under miscellaneous scene, for example, the scene of mass data transfers.
In the above-mentioned technical solutions, it is preferable that it is described obtain the inclusion length set in packet header before, in addition to:
Judge whether the length in the packet header is equal to default packet header length;If the length in the packet header is equal to the packet header length,
Obtain the inclusion length;If the length in the packet header is less than the packet header length, circulation performs the judgement packet header
Length whether be equal to the packet header length that sets in the packet header, be when the length in the packet header is equal to the packet header length
Only.
In the technical scheme, if the length of buffer area middle wrapping head is less than the packet header length set in packet header, illustrate not
Packet header is received entirely, for example, the length of buffer area middle wrapping head is 1 byte, and the packet header length set in packet header is 2 words
Section, illustrates that the packet header of also 1 byte is not received, then continues to judge.If judging, the length of buffer area middle wrapping head is equal to
The packet header length set in packet header, illustrates to be received entirely packet header, then obtains the inclusion length set in packet header.Therefore, pass through
Above scheme, the inclusion length set in packet header can be obtained exactly.
In any of the above-described technical scheme, it is preferable that the data content obtained in the inclusion, specifically include:From
The inclusion and the packet header are copied out in the buffering area;Data content in the inclusion is obtained according to the packet header.
In the technical scheme, the data content in inclusion is obtained by packet header, so as to ensure that in the data got
The accuracy and integrality of appearance.
In any of the above-described technical scheme, it is preferable that described that the inclusion and the bag are copied out from the buffering area
After head, in addition to:The packet header and the inclusion are deleted from the buffering area.
In the technical scheme, by the way that packet header and inclusion are deleted from buffering area, by the number behind packet header and inclusion
According to the initial address of buffering area is moved to, processing of unpacking is carried out to data below so as to realize, and avoid packet header and inclusion
Take the space of buffering area.
In any of the above-described technical scheme, it is preferable that described when receiving data by TCP, the data received are deposited
Before being put into buffering area, in addition to:By the socket (socket) for realizing network service between client and server
Associated with the buffering area.
In the technical scheme, server is that each client connects one buffering area of dynamically distributes, by by socket
Associated with buffering area, the socket is used for the network service for realizing client and server, so as to ensure the uniformity of data.
The second aspect of the present invention proposes a kind of data transmission device, including:Memory cell, for being connect by TCP
When receiving data, the data received are stored in buffering area;First acquisition unit, for including packet header when the buffering area
When, obtain the inclusion length set in the packet header;First judging unit, for judge in the buffering area with the packet header pair
Whether the length for the inclusion answered is equal to the inclusion length;Second acquisition unit, if judging institute for first judging unit
The length for stating inclusion is equal to the inclusion length, then obtains the data content in the inclusion;First judging unit is also used
In if first judging unit judges that the length of the inclusion is less than the inclusion length, circulation performs the judgement institute
Whether the length for stating inclusion corresponding with the packet header in buffering area is equal to the inclusion length, until length of the inclusion etc.
Untill when the inclusion length.
In the technical scheme, packet is made up of packet header and inclusion, if the length of inclusion is less than packet header in buffer area
The inclusion length of middle setting, illustrates that some inclusion is not stored in buffer area also, for example, the inclusion length set in packet header
For 5 bytes, and the length of the inclusion in buffer area is 3 bytes, illustrate also have the inclusion of 2 bytes not receive, then after
It is continuous to judge.If judging, the length of inclusion in buffer area is equal to the inclusion length set in packet header, illustrates that inclusion is all deposited
It has been put into buffer area, has then carried out unpacking work to obtain the data content in inclusion, so as to efficiently and reliably avoids number
According to the situation for occurring packet splicing in transmitting procedure He unpacking, and ensure that the mode of data transfer is more flexible, disclosure satisfy that multiple
Application under miscellaneous scene, for example, the scene of mass data transfers.
In the above-mentioned technical solutions, it is preferable that also include:Second judging unit, for judging that the length in the packet header is
It is no to be equal to default packet header length;The first acquisition unit is specifically for if second judging unit judges the packet header
Length be equal to the packet header length, then obtain the inclusion length;Second judging unit is additionally operable to, if described second sentences
Disconnected unit judges that the length in the packet header is less than the packet header length, then whether circulation performs the length for judging the packet header
Equal to the packet header length set in the packet header, untill when the length in the packet header is equal to the packet header length.
In the technical scheme, if the length of buffer area middle wrapping head is less than the packet header length set in packet header, illustrate not
Packet header is received entirely, for example, the length of buffer area middle wrapping head is 1 byte, and the packet header length set in packet header is 2 words
Section, illustrates that the packet header of also 1 byte is not received, then continues to judge.If judging, the length of buffer area middle wrapping head is equal to
The packet header length set in packet header, illustrates to be received entirely packet header, then obtains the inclusion length set in packet header.Therefore, pass through
Above scheme, the inclusion length set in packet header can be obtained exactly.
In any of the above-described technical scheme, it is preferable that the second acquisition unit from the buffering area specifically for copying
Shellfish goes out the inclusion and the packet header, and the data content in the inclusion is obtained according to the packet header.
In the technical scheme, the data content in inclusion is obtained by packet header, so as to ensure that in the data got
The accuracy and integrality of appearance.
In any of the above-described technical scheme, it is preferable that also include:Unit is deleted, for by the packet header and the inclusion
Deleted from the buffering area.
In the technical scheme, by the way that packet header and inclusion are deleted from buffering area, by the number behind packet header and inclusion
According to the initial address of buffering area is moved to, processing of unpacking is carried out to data below so as to realize, and avoid packet header and inclusion
Take the space of buffering area.
In any of the above-described technical scheme, it is preferable that also include:Associative cell, for that will be used to realize client kimonos
The socket of network service is associated with the buffering area between business device.
In the technical scheme, server is that each client connects one buffering area of dynamically distributes, by by socket
Associated with buffering area, the socket is used for the network service for realizing client and server, so as to ensure the uniformity of data.
The third aspect of the present invention proposes a kind of server, including the data biography any one of above-mentioned technical proposal
Defeated device, therefore, the server have and the data transmission device identical technology effect any one of above-mentioned technical proposal
Really, it will not be repeated here.
By technical scheme, data can be efficiently and reliably avoided to occur packet splicing in transmitting procedure and tear open
The situation of bag, and ensure that implementation is more flexible, it disclosure satisfy that the application under complex scene.
Brief description of the drawings
Fig. 1 shows the schematic diagram of packet transmission of the prior art;
Fig. 2 shows the schematic flow sheet of data transmission method according to an embodiment of the invention;
Fig. 3 shows the block diagram of data transmission device according to an embodiment of the invention;
Fig. 4 shows the block diagram of server according to an embodiment of the invention.
Embodiment
It is below in conjunction with the accompanying drawings and specific real in order to which the above objects, features and advantages of the present invention can be more clearly understood that
Mode is applied the present invention is further described in detail.It should be noted that in the case where not conflicting, the implementation of the application
Feature in example and embodiment can be mutually combined.
Many details are elaborated in the following description to facilitate a thorough understanding of the present invention, still, the present invention may be used also
Implemented with being different from other modes described here using other, therefore, protection scope of the present invention is not by described below
Specific embodiment limitation.
Fig. 2 shows the schematic flow sheet of data transmission method according to an embodiment of the invention.
As shown in Fig. 2 data transmission method according to an embodiment of the invention, including:
Step 202, when receiving data by TCP, the data received are stored in buffering area.
Step 204, when the buffering area includes packet header, the inclusion length set in the packet header is obtained.
Step 206, judge whether the length of inclusion corresponding with the packet header in the buffering area is long equal to the inclusion
Degree, if it is determined that the length of inclusion corresponding with the packet header is equal to the inclusion length in the buffering area, then performs step
208, if it is determined that the length of inclusion corresponding with the packet header is less than the inclusion length in the buffering area, then re-execute step
The length of inclusion corresponding with packet header is equal to inclusion length in rapid 206, i.e. pending buffer area.
Step 208, the data content in the inclusion is obtained.
In the technical scheme, if the length of inclusion is less than the inclusion length set in packet header in buffer area, illustrate there is one
Part inclusion is not stored in buffer area also, for example, the inclusion length set in packet header is 5 bytes, and in buffer area
The length of inclusion is 3 bytes, illustrates that the inclusion of also 2 bytes is not received, then continues to judge.If judging to wrap in buffer area
The length of body is equal to the inclusion length set in packet header, illustrates that inclusion has all been stored in buffer area, is then unpacked
Work to obtain the data content in inclusion, so as to efficiently and reliably avoid data occur in transmitting procedure packet splicing and
Situation about unpacking, and ensure that the mode of data transfer is more flexible, the application under complex scene is disclosure satisfy that, for example, magnanimity
The scene of data transfer.
The executive agent of such scheme is server.When client sends data, client beats data waiting for transmission
Wrap in packet, then the packet is transferred to server.The definition of packet is as shown in table 1.
Table 1
Wherein, Header is packet header, and Data is inclusion, and packet header and inclusion constitute packet, and client is by number to be sent
According to being arranged in Data Content, Data inclusion length is arranged in Length.
In the above-mentioned technical solutions, it is preferable that in the buffer including packet header in the case of, it is described to obtain in packet header
Before the inclusion length of setting, in addition to:Judge whether the length in the packet header is equal to default packet header length;If the packet header
Length be equal to the packet header length, then obtain the inclusion length;If the length in the packet header is less than the packet header length,
Circulation performs whether the length for judging the packet header is equal to the packet header length set in the packet header, until the packet header
Untill when length is equal to the packet header length.
In the technical scheme, if the length of buffer area middle wrapping head is less than the packet header length set in packet header, illustrate not
Packet header is received entirely, for example, the length of buffer area middle wrapping head is 1 byte, and the packet header length set in packet header is 2 words
Section, illustrates that the packet header of also 1 byte is not received, then continues to judge.If judging, the length of buffer area middle wrapping head is equal to
The packet header length set in packet header, illustrates to be received entirely packet header, then obtains the inclusion length set in packet header.Therefore, pass through
Above scheme, the inclusion length set in packet header can be obtained exactly.
In any of the above-described technical scheme, it is preferable that the data content obtained in the inclusion, specifically include:From
The inclusion and the packet header are copied out in the buffering area;Data content in the inclusion is obtained according to the packet header.
In the technical scheme, the data content in inclusion is obtained by packet header, so as to ensure that in the data got
The accuracy and integrality of appearance.
In any of the above-described technical scheme, it is preferable that described that the inclusion and the bag are copied out from the buffering area
After head, in addition to:The packet header and the inclusion are deleted from the buffering area.
In the technical scheme, by the way that packet header and inclusion are deleted from buffering area, by the number behind packet header and inclusion
According to the initial address of buffering area is moved to, processing of unpacking is carried out to data below so as to realize, and avoid packet header and inclusion
Take the space of buffering area.
In any of the above-described technical scheme, it is preferable that before step 202, in addition to:It will be used to realize client and service
The socket of network service is associated with the buffering area between device.
In the technical scheme, server is that each client connects one buffering area of dynamically distributes, by by socket
Associated with buffering area, the socket is used for the network service for realizing client and server, so as to ensure the uniformity of data.
Fig. 3 shows the block diagram of data transmission device according to an embodiment of the invention.
As shown in figure 3, data transmission device 300 according to an embodiment of the invention, including:Memory cell 302,
One acquiring unit 304, the first judging unit 306 and second acquisition unit 308.
Memory cell 302, for when receiving data by TCP, the data received to be stored in buffering area;First
Acquiring unit 304, for when the buffering area includes packet header, obtaining the inclusion length set in the packet header;First sentences
Disconnected unit 306, for judging whether the length of inclusion corresponding with the packet header in the buffering area is equal to the inclusion length;
Second acquisition unit 308, if the length for judging the inclusion for first judging unit 306 is equal to the inclusion length,
Then obtain the data content in the inclusion;First judging unit 306 is additionally operable to, if first judging unit 306 is sentenced
The length of the fixed inclusion is less than the inclusion length, then circulation performs corresponding with the packet header in the judgement buffering area
Inclusion length whether be equal to the inclusion length, until the inclusion length be equal to the inclusion length when untill.
In the technical scheme, packet is made up of packet header and inclusion, if the length of inclusion is less than packet header in buffer area
The inclusion length of middle setting, illustrates that some inclusion is not stored in buffer area also, for example, the inclusion length set in packet header
For 5 bytes, and the length of the inclusion in buffer area is 3 bytes, illustrate also have the inclusion of 2 bytes not receive, then after
It is continuous to judge.If judging, the length of inclusion in buffer area is equal to the inclusion length set in packet header, illustrates that inclusion is all deposited
It has been put into buffer area, has then carried out unpacking work to obtain the data content in inclusion, so as to efficiently and reliably avoids number
According to the situation for occurring packet splicing in transmitting procedure He unpacking, and ensure that the mode of data transfer is more flexible, disclosure satisfy that multiple
Application under miscellaneous scene, for example, the scene of mass data transfers.
In the above-mentioned technical solutions, it is preferable that also include:Second judging unit 310, the length for judging the packet header
Whether default packet header length is equal to;The first acquisition unit 304 is specifically for if second judging unit 310 judges
The length in the packet header is equal to the packet header length, then obtains the inclusion length;Second judging unit 310 is additionally operable to,
If second judging unit 310 judges that the length in the packet header is less than the packet header length, circulation performs the judgement institute
Whether the length for stating packet header is equal to the packet header length set in the packet header, until the length in the packet header is long equal to the packet header
Untill when spending.
In the technical scheme, if the length of buffer area middle wrapping head is less than the packet header length set in packet header, illustrate not
Packet header is received entirely, for example, the length of buffer area middle wrapping head is 1 byte, and the packet header length set in packet header is 2 words
Section, illustrates that the packet header of also 1 byte is not received, then continues to judge.If judging, the length of buffer area middle wrapping head is equal to
The packet header length set in packet header, illustrates to be received entirely packet header, then obtains the inclusion length set in packet header.Therefore, pass through
Above scheme, the inclusion length set in packet header can be obtained exactly.
In any of the above-described technical scheme, it is preferable that the second acquisition unit 308 is specifically for from the buffering area
In copy out the inclusion and the packet header, the data content in the inclusion is obtained according to the packet header.
In the technical scheme, the data content in inclusion is obtained by packet header, so as to ensure that in the data got
The accuracy and integrality of appearance.
In any of the above-described technical scheme, it is preferable that also include:Unit 312 is deleted, for by the packet header and the bag
Body is deleted from the buffering area.
In the technical scheme, by the way that packet header and inclusion are deleted from buffering area, by the number behind packet header and inclusion
According to the initial address of buffering area is moved to, processing of unpacking is carried out to data below so as to realize, and avoid packet header and inclusion
Take the space of buffering area.
In any of the above-described technical scheme, it is preferable that also include:Associative cell 314, for will be used to realizing client and
The socket of network service is associated with the buffering area between server.
In the technical scheme, server is that each client connects one buffering area of dynamically distributes, by by socket
Associated with buffering area, the socket is used for the network service for realizing client and server, so as to ensure the uniformity of data.
Fig. 4 shows the block diagram of server according to an embodiment of the invention.
Any one of as shown in figure 4, server 400 according to an embodiment of the invention, including above-mentioned technical proposal
Described data transmission device 300, therefore, the server 400 has to be passed with the data any one of above-mentioned technical proposal
The defeated identical technique effect of device 300, will not be repeated here.
Technical scheme is described in detail above in association with accompanying drawing, by technical scheme, can efficiently,
Reliably avoid data from occurring packet splicing and situation about unpacking in transmitting procedure, and ensure that implementation is more flexible, can
Meet the application under complex scene.In addition, this programme is applied in building ring product, and after tested, the general-purpose of unit 54
Family is simultaneously online, and forwarding message level per second is limited to 9900 message, the problem of related packet splicing do not occur.Technology is realized with traditional
Compare, performance boost is to more than hundred times.
In the present invention, term " first ", " second " are only used for the purpose described, and it is not intended that indicating or implying phase
To importance;Term " multiple " represents two or more;Term " connected ", " connection " etc. all should be interpreted broadly, for example,
Can be fixedly connected or be detachably connected, or be integrally connected;Can be joined directly together, centre can also be passed through
Medium is indirectly connected to.For the ordinary skill in the art, above-mentioned term can be understood in this hair as the case may be
Concrete meaning in bright.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.
Claims (11)
1. a kind of data transmission method, it is characterised in that including:
When receiving data by TCP, the data received are stored in buffering area;
When the buffering area includes packet header, the inclusion length set in the packet header is obtained;
Judge whether the length of inclusion corresponding with the packet header in the buffering area is equal to the inclusion length;
If the length of the inclusion is equal to the inclusion length, the data content in the inclusion is obtained;
If the length of the inclusion is less than in the inclusion length, the circulation execution judgement buffering area and the packet header
Whether the length of corresponding inclusion is equal to the inclusion length, is when the length of the inclusion is equal to the inclusion length
Only.
2. data transmission method according to claim 1, it is characterised in that the inclusion set in the acquisition packet header
Before length, in addition to:
Judge whether the length in the packet header is equal to default packet header length;
If the length in the packet header is equal to the packet header length, the inclusion length is obtained;
If the length in the packet header is less than the packet header length, circulation performs whether the length for judging the packet header is equal to
The packet header length set in the packet header, untill when the length in the packet header is equal to the packet header length.
3. data transmission method according to claim 1, it is characterised in that in the data in the acquisition inclusion
Hold, specifically include:
The inclusion and the packet header are copied out from the buffering area;
Data content in the inclusion is obtained according to the packet header.
4. data transmission method according to claim 3, it is characterised in that it is described copied out from the buffering area it is described
After inclusion and the packet header, in addition to:
The packet header and the inclusion are deleted from the buffering area.
5. data transmission method according to any one of claim 1 to 4, it is characterised in that described to be received by TCP
During data, before the data received are stored in buffering area, in addition to:
By for realizing that the socket of network service between client and server is associated with the buffering area.
6. a kind of data transmission device, it is characterised in that including:
Memory cell, for when receiving data by TCP, the data received to be stored in buffering area;
First acquisition unit, for when the buffering area includes packet header, obtaining the inclusion length set in the packet header;
First judging unit, for judging whether the length of inclusion corresponding with the packet header in the buffering area is equal to the bag
Body length;
Second acquisition unit, if the length for judging the inclusion for first judging unit is equal to the inclusion length,
Obtain the data content in the inclusion;
First judging unit is additionally operable to, if first judging unit judges that the length of the inclusion is long less than the inclusion
Degree, then whether the circulation execution length for judging inclusion corresponding with the packet header in the buffering area is long equal to the inclusion
Degree, untill when the length of the inclusion is equal to the inclusion length.
7. data transmission device according to claim 6, it is characterised in that also include:
Second judging unit, for judging whether the length in the packet header is equal to default packet header length;
The first acquisition unit is specifically for if second judging unit judges that the length in the packet header is equal to the packet header
Length, then obtain the inclusion length;
Second judging unit is additionally operable to, if second judging unit judges that the length in the packet header is long less than the packet header
Degree, then circulation performs whether the length for judging the packet header is equal to the packet header length set in the packet header, until described
Untill when the length in packet header is equal to the packet header length.
8. data transmission device according to claim 6, it is characterised in that the second acquisition unit specifically for,
The inclusion and the packet header are copied out from the buffering area, is obtained according to the packet header in the data in the inclusion
Hold.
9. data transmission device according to claim 8, it is characterised in that also include:
Unit is deleted, for the packet header and the inclusion to be deleted from the buffering area.
10. the data transmission device according to any one of claim 6 to 9, it is characterised in that also include:
Associative cell, for by for realizing that the socket of network service is closed with the buffering area between client and server
Connection.
11. a kind of server, it is characterised in that including:Data transmission device as any one of claim 6 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710256091.9A CN107135167A (en) | 2017-04-19 | 2017-04-19 | Data transmission method, data transmission device and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710256091.9A CN107135167A (en) | 2017-04-19 | 2017-04-19 | Data transmission method, data transmission device and server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107135167A true CN107135167A (en) | 2017-09-05 |
Family
ID=59715988
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710256091.9A Pending CN107135167A (en) | 2017-04-19 | 2017-04-19 | Data transmission method, data transmission device and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107135167A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108718311A (en) * | 2018-05-18 | 2018-10-30 | 深圳市腾讯网络信息技术有限公司 | Webpage live broadcasting method, the apparatus and system of mobile terminal |
CN108882064A (en) * | 2018-06-26 | 2018-11-23 | 潍坊学院 | A kind of port data packet transmission method and system based on GPON system |
CN109257355A (en) * | 2018-09-26 | 2019-01-22 | 郑州云海信息技术有限公司 | One kind being based on Transmission Control Protocol data transmission method, system and associated component |
CN109347825A (en) * | 2018-10-19 | 2019-02-15 | 海南易乐物联科技有限公司 | A kind of processing method based on the glutinous packet of Transmission Control Protocol data subpackage |
CN112702322A (en) * | 2020-12-17 | 2021-04-23 | 中国电子科技集团公司第四十一研究所 | Communication data packet exception handling method for intelligent management of production line |
CN114422624A (en) * | 2022-01-25 | 2022-04-29 | 电信科学技术第五研究所有限公司 | Data receiving method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101753586A (en) * | 2010-01-20 | 2010-06-23 | 北京数码视讯科技股份有限公司 | Method for transmitting data, process method for receiving data and device |
CN102984253A (en) * | 2012-11-27 | 2013-03-20 | 山东中创软件工程股份有限公司 | Transmission control protocol sticky package processing method and device |
CN103414538A (en) * | 2013-08-05 | 2013-11-27 | 国云科技股份有限公司 | Data package sorting method for network data communication in distributed environment |
CN103532668A (en) * | 2013-10-12 | 2014-01-22 | 成都阜特科技股份有限公司 | Method for ensuring integrity and correctness of TCP (transmission control protocol) communication data |
-
2017
- 2017-04-19 CN CN201710256091.9A patent/CN107135167A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101753586A (en) * | 2010-01-20 | 2010-06-23 | 北京数码视讯科技股份有限公司 | Method for transmitting data, process method for receiving data and device |
CN102984253A (en) * | 2012-11-27 | 2013-03-20 | 山东中创软件工程股份有限公司 | Transmission control protocol sticky package processing method and device |
CN103414538A (en) * | 2013-08-05 | 2013-11-27 | 国云科技股份有限公司 | Data package sorting method for network data communication in distributed environment |
CN103532668A (en) * | 2013-10-12 | 2014-01-22 | 成都阜特科技股份有限公司 | Method for ensuring integrity and correctness of TCP (transmission control protocol) communication data |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108718311A (en) * | 2018-05-18 | 2018-10-30 | 深圳市腾讯网络信息技术有限公司 | Webpage live broadcasting method, the apparatus and system of mobile terminal |
CN108882064A (en) * | 2018-06-26 | 2018-11-23 | 潍坊学院 | A kind of port data packet transmission method and system based on GPON system |
CN108882064B (en) * | 2018-06-26 | 2021-02-02 | 潍坊学院 | Port data packet sending method and system based on GPON system |
CN109257355A (en) * | 2018-09-26 | 2019-01-22 | 郑州云海信息技术有限公司 | One kind being based on Transmission Control Protocol data transmission method, system and associated component |
CN109347825A (en) * | 2018-10-19 | 2019-02-15 | 海南易乐物联科技有限公司 | A kind of processing method based on the glutinous packet of Transmission Control Protocol data subpackage |
CN109347825B (en) * | 2018-10-19 | 2020-01-14 | 海南易乐物联科技有限公司 | TCP protocol-based data packet and sticky packet processing method |
CN112702322A (en) * | 2020-12-17 | 2021-04-23 | 中国电子科技集团公司第四十一研究所 | Communication data packet exception handling method for intelligent management of production line |
CN114422624A (en) * | 2022-01-25 | 2022-04-29 | 电信科学技术第五研究所有限公司 | Data receiving method |
CN114422624B (en) * | 2022-01-25 | 2024-05-17 | 电信科学技术第五研究所有限公司 | Data receiving method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107135167A (en) | Data transmission method, data transmission device and server | |
WO2018094743A1 (en) | Method for processing packet, and computer device | |
WO2020125572A1 (en) | Camera sharing method and apparatus | |
CN110417766A (en) | A kind of method and apparatus of protocol analysis | |
US20170289071A1 (en) | System, apparatus and method for autonomous messaging integration | |
KR102257121B1 (en) | Method and system for dual role handling in a wireless environment | |
CN103391319B (en) | A kind of resource sharing method, resource sharing system, cloud device and user terminal | |
CN108363621A (en) | Message forwarding method, device, storage medium under numa frameworks and electronic equipment | |
TW201737681A (en) | Method and apparatus for implementing instant messaging | |
WO2015180513A1 (en) | Data transmission method and computer | |
US9615285B2 (en) | System, electronic device, method of communicating, and and non-transitory computer-readable storage medium | |
CN107277244A (en) | Screenshot processing method and device | |
CN112910802A (en) | Message processing method and device | |
TW201335867A (en) | Validation method and device for business object | |
CN105281987B (en) | Router and data uploading method, device, system | |
CN105991442A (en) | Message forwarding method and device | |
CN108307369A (en) | Pairing method, pairing information transmission method, device and equipment | |
CN109391522A (en) | A kind of network flow based on RDMA determines method and device | |
CN110024395A (en) | Image real time transfer, transmission method and controlling terminal | |
WO2016150332A1 (en) | Method for updating target 3d animation based on mobile terminal and device thereof | |
US8447878B2 (en) | Receiving apparatus, transmitting apparatus, communication system, and method of detecting buffer setting of relay server | |
US8539109B1 (en) | Third party direct memory access protocol extension to separate data path from control path | |
CN101472290A (en) | Flow control method and apparatus for mobile data business platform performance test | |
CN109766347B (en) | Data updating method, device, system, computer equipment and storage medium | |
CN106506522B (en) | The management method and device of TCP connection |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170905 |
|
RJ01 | Rejection of invention patent application after publication |