CN104253811A - Network packet communication method and system - Google Patents
Network packet communication method and system Download PDFInfo
- Publication number
- CN104253811A CN104253811A CN201410006305.3A CN201410006305A CN104253811A CN 104253811 A CN104253811 A CN 104253811A CN 201410006305 A CN201410006305 A CN 201410006305A CN 104253811 A CN104253811 A CN 104253811A
- Authority
- CN
- China
- Prior art keywords
- message
- packet
- network packet
- length
- client
- 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
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a network packet communication method. The method includes the steps: a client packages a data packet into a network packet at least including a message ID (identifier), message length and data content; the client transmits the network packet to a server; the server packages data content in another network packet with the same message ID into another data packet. The invention further provides a network packet communication system. The message with length exceeding standard length is split into multiple standard-length messages which are packaged and transmitted to the server, the process that the long message needs to queue for transmission after being split into sub-messages is avoided, and efficiency is improved.
Description
Technical field
The application relates to communication technical field, particularly relates to a kind of network packet communication means and system.
Background technology
In the communications field, great majority communication all utilizes Transmission Control Protocol to carry out, but the maximum length defining a piece of news in Transmission Control Protocol is 65536 bytes.If message-length is more than 65536 bytes, needs this message to split into multiple message, then transmit in a fixed order.
In actual use, the present inventor finds, split in process of transmitting in the message exceeding length, if the sub-message split is owing to connecting instability or other reason, to cause having a strip message to send unsuccessful, then follow-up sub-message must be waited for that this sub-message resends and successfully just can enter transmission; Such send mode efficiency comparison when message-length is large especially or message number is many is low.
Summary of the invention
Technical problems to be solved in this application are to provide a kind of device that can send king-size network packet communication means and correspondence.
In order to solve the problem, this application discloses a kind of network packet communication means, comprising:
Client encapsulated data packet forms the network packet at least comprising message id, message-length and data content;
Client sends network packet to service end;
Data content assembling in the network packet of identical message ID is formed packet by service end.
Further, described service end also comprises after the data content assembling in the network packet of identical message ID is formed packet:
Service end processing said data bag, and result is turned back to client.
Further, the network packet that described client encapsulated data packet formation at least comprises message id, message-length and data content comprises:
The packet that length is greater than predetermined threshold value by client splits into the subdata bag that at least two length are less than or equal to predetermined threshold value;
Described subdata bag is packaged into the network packet comprising message id, message-length and data content by client in order; The message id of described subdata encapsulating is identical.
Further, the data content assembling formation packet in the network packet of identical message ID comprises by described service end:
Network packet identical for message id is carried out parsing and is obtained subdata bag by service end;
Described subdata package dress is formed packet.
Present invention also provides a kind of network packet communication system, comprising:
Client, forms the network packet at least comprising message id, message-length and data content for encapsulated data packet; Send network packet
Service end, for forming packet by the data content assembling in the network packet of identical message ID.
Further, result also for the treatment of described packet, and is turned back to client by described service end.
Further, described client also for:
Packet length being greater than predetermined threshold value splits into the subdata bag that at least two length are less than or equal to predetermined threshold value;
Described subdata bag is packaged into the network packet comprising message id, message-length and data content in order; The message id of described subdata encapsulating is identical.
Further, described service end also for:
Network packet identical for message id is carried out parsing and obtain subdata bag;
Described subdata package dress is formed packet.
Compared with prior art, the application comprises following advantage: also being packed by the message king-size message being split into multiple full-length is sent to service end, avoid occur long message split into sub-message after must queue up send process, improve efficiency.
accompanying drawing explanation
Fig. 1 is the flow chart of a kind of network packet communication means one of the present invention embodiment;
Fig. 2 is the structural representation that a kind of network packet communication system of the present invention unifies embodiment.
Embodiment
For enabling above-mentioned purpose, the feature and advantage of the application more become apparent, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
With reference to Fig. 1, show the flow chart of a kind of network packet communication means one of the application embodiment;
The network packet communication means that the embodiment of the present invention provides, comprising:
Step S101, client encapsulated data packet form the network packet at least comprising message id, message-length and data content;
Further, the network packet that described client encapsulated data packet formation at least comprises message id, message-length and data content comprises:
The packet that length is greater than predetermined threshold value by client splits into the subdata bag that at least two length are less than or equal to predetermined threshold value;
Described subdata bag is packaged into the network packet comprising message id, message-length and data content by client in order; The message id of described subdata encapsulating is identical.
When client is about to send packet by Transmission Control Protocol, first judge that whether this packet is more than 65536 bytes, if more than 65536 bytes, breaks this packet.In partition process, such as this packets need is split into 3 sub-message and could meets three sub-message and be all less than or equal to 65536 bytes after packaging, then this message is divided into three sub-message, carries out encapsulation and form packet.In the packet that encapsulation is formed, at least should comprise the message-length of packet before the message id of this packet belonging to sub-message, partition and the data content of sub-message.What deserves to be explained is, the embodiment of the present invention is when practical application, and client can be the entirety comprising local terminal application software and communication equipment.
Step S102, client send network packet to service end;
Client, when sending the network packet encapsulated, without the need to sending according to sub-message tandem in the packet, only need be queued up according to presetting rule and sending.If in process of transmitting, some network packet send unsuccessfully, and subsequent network bag can send in advance without the need to waiting for, wait second time to send successfully and send sending failed network packet before.
Data content assembling in the network packet of identical message ID is formed packet by step S103, service end.
Further, described service end also comprises after the data content assembling in the network packet of identical message ID is formed packet:
Service end processing said data bag, and result is turned back to client.
Further, the data content assembling formation packet in the network packet of identical message ID comprises by described service end:
Network packet identical for message id is carried out parsing and is obtained subdata bag by service end;
Described subdata package dress is formed packet.
Service end to get under same message id after all-network bag, whether unanimously with the message-length in network packet judges that the length of data content in all-network bag is added the result of gained, if unanimously, all-network bag finishes receiving under judging same message id.After all-network bag finishes receiving, the data content in all-network bag parses by service end, is then packaged into packet.
The embodiment of the present invention by king-size message is split into multiple full-length message and packing be sent to service end, avoid occur long message split into sub-message after must queue up send process, improve efficiency.
Reference Fig. 2 is the structural representation that a kind of network packet communication system of the present invention unifies embodiment.
The application provides a kind of network packet communication system, comprising:
Client 21, forms the network packet at least comprising message id, message-length and data content for encapsulated data packet;
Service end 22, for receiving network packet; Data content assembling in the network packet of identical message ID is formed packet.
Further, result also for the treatment of described packet, and is turned back to client 21 by described service end 22.
Further, described client 21 also for:
Packet length being greater than predetermined threshold value splits into the subdata bag that at least two length are less than or equal to predetermined threshold value;
Described subdata bag is packaged into the network packet comprising message id, message-length and data content in order; The message id of described subdata encapsulating is identical.
Further, described service end 22 also for:
Network packet identical for message id is carried out parsing and obtain subdata bag;
Described subdata package dress is formed packet.
When client 21 is about to send packet by Transmission Control Protocol, first judge that whether this packet is more than 65536 bytes, if more than 65536 bytes, breaks this packet.In partition process, such as this packets need is split into 3 sub-message and could meets three sub-message and be all less than or equal to 65536 bytes after packaging, then this message is divided into three sub-message, carries out encapsulation and form packet.In the packet that encapsulation is formed, at least should comprise the message-length of packet before the message id of this packet belonging to sub-message, partition and the data content of sub-message.What deserves to be explained is, the embodiment of the present invention is when practical application, and client 21 can be the entirety comprising local terminal application software and communication equipment.
Client 21, when sending the network packet encapsulated, without the need to sending according to sub-message tandem in the packet, only need be queued up according to presetting rule and sending.If in process of transmitting, some network packet send unsuccessfully, and subsequent network bag can send in advance without the need to waiting for, wait second time to send successfully and send sending failed network packet before.
Service end 22 to get under same message id after all-network bag, whether unanimously with the message-length in network packet judges that the length of data content in all-network bag is added the result of gained, if unanimously, all-network bag finishes receiving under judging same message id.After all-network bag finishes receiving, the data content in all-network bag parses by service end 22, is then packaged into packet.
For system embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.
A kind of network packet communication means above the application provided and system, be described in detail, apply specific case herein to set forth the principle of the application and execution mode, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.
Claims (8)
1. a network packet communication means, is characterized in that, comprising:
Client encapsulated data packet forms the network packet at least comprising message id, message-length and data content;
Client sends network packet to service end;
Data content assembling in the network packet of identical message ID is formed packet by service end.
2. method according to claim 1, is characterized in that, described service end also comprises after the data content assembling in the network packet of identical message ID is formed packet:
Service end processing said data bag, and result is turned back to client.
3. method according to claim 2, is characterized in that, described client encapsulated data packet forms the network packet at least comprising message id, message-length and data content and comprises:
The packet that length is greater than predetermined threshold value by client splits into the subdata bag that at least two length are less than or equal to predetermined threshold value;
Described subdata bag is packaged into the network packet comprising message id, message-length and data content by client in order; The message id of described subdata encapsulating is identical.
4. method according to claim 3, is characterized in that, the data content assembling in the network packet of identical message ID is formed packet and comprises by described service end:
Network packet identical for message id is carried out parsing and is obtained subdata bag by service end;
Described subdata package dress is formed packet.
5. a network packet communication system, is characterized in that, comprising:
Client, forms the network packet at least comprising message id, message-length and data content for encapsulated data packet; Send network packet;
Service end, for forming packet by the data content assembling in the network packet of identical message ID.
6. system according to claim 5, is characterized in that, result also for the treatment of described packet, and is turned back to client by described service end.
7. system according to claim 6, is characterized in that, described client also for:
Packet length being greater than predetermined threshold value splits into the subdata bag that at least two length are less than or equal to predetermined threshold value;
Described subdata bag is packaged into the network packet comprising message id, message-length and data content in order; The message id of described subdata encapsulating is identical.
8. system according to claim 7, is characterized in that, described service end also for:
Network packet identical for message id is carried out parsing and obtain subdata bag;
Described subdata package dress is formed packet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410006305.3A CN104253811A (en) | 2014-01-07 | 2014-01-07 | Network packet communication method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410006305.3A CN104253811A (en) | 2014-01-07 | 2014-01-07 | Network packet communication method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104253811A true CN104253811A (en) | 2014-12-31 |
Family
ID=52188348
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410006305.3A Pending CN104253811A (en) | 2014-01-07 | 2014-01-07 | Network packet communication method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104253811A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108471399A (en) * | 2018-02-07 | 2018-08-31 | 平安科技(深圳)有限公司 | Generation method, storage medium and the server of data packet in a kind of anti money washing operation |
CN110611644A (en) * | 2018-06-15 | 2019-12-24 | 视联动力信息技术股份有限公司 | Data transmission method and device |
US12010008B2 (en) | 2017-12-29 | 2024-06-11 | Alibaba Group Holding Limited | Network communication method and apparatus |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1547348A (en) * | 2003-12-10 | 2004-11-17 | 中国科学院计算技术研究所 | A Method of User-Level Parallel Communication Between Computers Based on Intelligent Network Card |
CN101119219A (en) * | 2007-09-12 | 2008-02-06 | 中兴通讯股份有限公司 | Method and system for implementing data transmission of broadcast/multicast service |
CN101931919A (en) * | 2010-08-18 | 2010-12-29 | 中国电信股份有限公司 | Long short message sending processing method and device, business gateway and communication system |
-
2014
- 2014-01-07 CN CN201410006305.3A patent/CN104253811A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1547348A (en) * | 2003-12-10 | 2004-11-17 | 中国科学院计算技术研究所 | A Method of User-Level Parallel Communication Between Computers Based on Intelligent Network Card |
CN101119219A (en) * | 2007-09-12 | 2008-02-06 | 中兴通讯股份有限公司 | Method and system for implementing data transmission of broadcast/multicast service |
CN101931919A (en) * | 2010-08-18 | 2010-12-29 | 中国电信股份有限公司 | Long short message sending processing method and device, business gateway and communication system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US12010008B2 (en) | 2017-12-29 | 2024-06-11 | Alibaba Group Holding Limited | Network communication method and apparatus |
CN108471399A (en) * | 2018-02-07 | 2018-08-31 | 平安科技(深圳)有限公司 | Generation method, storage medium and the server of data packet in a kind of anti money washing operation |
CN108471399B (en) * | 2018-02-07 | 2020-06-26 | 平安科技(深圳)有限公司 | Data packet generation method in anti-money laundering operation, storage medium and server |
CN110611644A (en) * | 2018-06-15 | 2019-12-24 | 视联动力信息技术股份有限公司 | Data transmission method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10868767B2 (en) | Data transmission method and apparatus in optoelectronic hybrid network | |
CN108270732B (en) | A kind of Streaming Media processing method and system | |
CN104937896B (en) | The processing method and transponder of address resolution protocol message, controller | |
CN108521343B (en) | OAM message processing method and device | |
US20170085473A1 (en) | OPENFLOW Communication Method and System, Controller, and Service Gateway | |
WO2017198236A1 (en) | Data transmission method, device, and system | |
CN109547162B (en) | Data communication method based on two sets of one-way boundaries | |
CN104158625B (en) | A kind of information transfer distribution method of subway dispatching communication | |
CN107948217B (en) | Switch system and communication method | |
WO2016062142A1 (en) | Method, apparatus and system for converged transmission of packets | |
US10980043B2 (en) | Data transmission method and device, and base station | |
US20180109451A1 (en) | Protocol frame transmission method, apparatus, and system, and node device | |
CN109120540A (en) | Method, proxy server and the computer readable storage medium of transmitting message | |
EP2913977A2 (en) | Resource information acquisition method, system and device for internet of things terminal device | |
CN104253811A (en) | Network packet communication method and system | |
EP3672189B1 (en) | Data transmission method, device and system | |
CN108696900A (en) | A kind of packaging method of data packet, analytic method, device and equipment | |
CN107995315B (en) | Method and device for synchronizing information between service boards, storage medium and computer equipment | |
CN109067922A (en) | A kind of data transmission method and device | |
US9762353B2 (en) | Data packet for bidirectional transmission of data packets during data transmission between a first and a second communication appliance, and method for transmitting such a data packet | |
CN118200253A (en) | RDMA UD transmission-oriented reliable communication method, electronic equipment and readable medium | |
CN112118594A (en) | Data uploading method, downloading method, electronic device and storage medium | |
EP2876830A1 (en) | Data transmission method and device | |
WO2019015487A1 (en) | Data retransmission method, rlc entity and mac entity | |
CN114846774B (en) | Communication method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20141231 |
|
RJ01 | Rejection of invention patent application after publication |