CN103746938A - Method and device for transmitting data packet - Google Patents
Method and device for transmitting data packet Download PDFInfo
- Publication number
- CN103746938A CN103746938A CN201410015242.8A CN201410015242A CN103746938A CN 103746938 A CN103746938 A CN 103746938A CN 201410015242 A CN201410015242 A CN 201410015242A CN 103746938 A CN103746938 A CN 103746938A
- Authority
- CN
- China
- Prior art keywords
- packet
- sent
- sends
- preset value
- buffer memory
- 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
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and a device for transmitting a data packet. The method comprises the steps of obtaining the data packet to be transmitted; caching the obtained data packet to be transmitted; when the caching satisfies preset data packet transmission conditions, transmitting the data packet to be transmitted. Since the data packet to be transmitted is cached and is transmitted when the caching satisfies the preset data packet transmission conditions, system overhead load caused to a transmitting end and operating load caused to relevant equipment due to frequent transmission of the data packet can be reduced, and the costs of the relevant equipment are saved.
Description
Technical field
The present invention relates to communication technical field, relate in particular to a kind of method and device that sends packet.
Background technology
Packet is the elementary cell that transmitting terminal and receiving terminal carry out transmission information, packet the inside is comprising the data message that needs communication interaction, transmitting terminal is to be connected and to be cut by network or other interconnected carrier with receiving terminal, then carries out the sending and receiving of packet.
The transmitting terminal of packet is received the packet that needs send at present, and no matter it is small data packets or large packet, and transmitting terminal all can arrive corresponding receiving terminal Packet Generation at once.
But, can there is like this shortcoming, as not having under the harsh environment requiring sending the real-time of packet at one, call operation system sends packet too continually, to the operating system of transmitting terminal, can cause very large overhead because call continually, to the relevant device of transmitting terminal, also can cause very large operating load.
Summary of the invention
The object of the invention is to propose a kind of method and device that sends packet, to reduce the overhead load of Packet Generation end and the operating load of relevant device.
The invention provides a kind of method that sends packet, described method comprises:
Obtain packet to be sent;
The packet described to be sent obtaining is carried out to buffer memory;
When buffer memory meets default Packet Generation condition, send described packet to be sent.
Optionally, described when buffer memory meets default Packet Generation condition, send described data to be sent, comprising:
When current time and the time interval between the last moment that sends packet reach the second preset value, or, when described current time and the time interval between the last moment that sends packet do not reach the second preset value, and when the quantity of all packets of buffer memory reaches the first preset value
The all packets that send buffer memory, described all packets comprise the packet described to be sent obtaining.
Optionally, described the packet described to be sent obtaining is carried out to buffer memory, comprising:
The packet described to be sent obtaining is deposited in to the buffer queue of first in first out.
Optionally, described when buffer memory meets default Packet Generation condition, send described data to be sent, comprising:
When current time and the time interval between the last moment that sends packet do not reach the second preset value, and the quantity of the packet in described buffer queue is while reaching the first preset value, sends the packet in described buffer queue.
Optionally, after the described packet to be sent of described transmission, also comprise:
By described buffer queue zero clearing.
Accordingly, the invention allows for a kind of device that sends packet, described device comprises:
Packet acquisition module, for obtaining packet to be sent;
Data pack buffer module, for carrying out buffer memory to the packet described to be sent obtaining;
Packet Generation module, when meeting default Packet Generation condition when buffer memory, sends described packet to be sent.
Optionally, described Packet Generation module, specifically for:
When current time and the time interval between the last moment that sends packet reach the second preset value, or, when described current time and the time interval between the last moment that sends packet do not reach the second preset value, and when the quantity of all packets of buffer memory reaches the first preset value
The all packets that send buffer memory, described all packets comprise the packet described to be sent obtaining.
Optionally, described data pack buffer module, specifically for:
The packet described to be sent obtaining is deposited in to the buffer queue of first in first out.
Optionally, described Packet Generation module, specifically for:
When current time and the time interval between the last moment that sends packet do not reach the second preset value, and the quantity of the packet in described buffer queue is while reaching the first preset value, sends the packet in described buffer queue.
Optionally, after the described packet to be sent of described transmission, also comprise:
Replacement module, for by described buffer queue zero clearing.
The method and apparatus of transmission packet provided by the invention, by carrying out buffer memory to sent packet, and when buffer memory meets default Packet Generation condition, send described packet to be sent, can reduce the operating load that overhead is loaded and relevant device brings transmitting terminal being brought because of the packet that takes place frequently, thereby realize the cost input of saving relevant device.
Accompanying drawing explanation
Fig. 1 is a kind of flow chart that sends the method for packet that the embodiment of the present invention provides;
Fig. 2 is the flow chart that the another kind that provides of the embodiment of the present invention sends the method for packet;
Fig. 3 is the schematic diagram of the method for the transmission packet that provides of the embodiment of the present invention;
Fig. 4 is a kind of structural representation that sends the device of packet that the embodiment of the present invention provides.
Embodiment
For the technical scheme of technical problem that the present invention is solved, employing and the technique effect that reaches clearer, below in conjunction with drawings and Examples, the present invention is described in further detail.Be understandable that, specific embodiment described herein is only for explaining the present invention, but not limitation of the invention.It also should be noted that, for convenience of description, in accompanying drawing, only show part related to the present invention but not full content.
Fig. 1 is a kind of flow chart that sends the method for packet that the embodiment of the present invention provides.The device of the transmission packet that the method that the present invention executes example to be provided can be provided by the embodiment of the present invention is carried out, and this device can be realized by software and/or hardware.As shown in Figure 1, the method that the embodiment of the present invention provides comprises:
For example, transmit block receives the packet to be sent of the reflection user request being produced by the system under this transmit block, and transmit block has been obtained packet to be sent.Wherein, described packet can be small data packets, and it can comprise such as log statistic data waiting for transmission, chat data waiting for transmission etc.
For example, the packet described to be sent obtaining can be stored into common buffer has in the computer-readable storage medium of caching function as internal memory, CPU etc., also can be stored to FIFO(First Input First Output, first in first out), in buffer, the packet described to be sent that is about to obtain deposits the buffer queue of first in first out in.
For example, when current time and the time interval between the last moment that sends packet reach the second preset value, or, when described current time and the time interval between the last moment that sends packet do not reach the second preset value, and when the quantity of all packets of buffer memory reaches the first preset value, the all packets that send buffer memory, described all packets comprise the packet described to be sent obtaining.Wherein, described the second preset value can be millisecond or microsecond magnitude can guarantee that time delay can ignore substantially on the impact of Packet Generation, does not affect user's normal use.Can judge when current time and the time interval between the moment of last transmission packet by timer, counter etc., can obtain by buffer queue the quantity of the packet to be sent of buffer memory.
Or for example, when above-mentioned steps 102 deposits the packet described to be sent obtaining the buffer queue of first in first out in, and the time interval between the moment of current time and last transmission packet does not reach the second preset value, and when the quantity of the packet in described buffer queue reaches the first preset value, send the packet in described buffer queue.
Exemplary, after sending described packet to be sent, the method for the transmission packet that the embodiment of the present invention provides can also comprise: by described buffer queue zero clearing.In addition, the mode that sends described packet to be sent can be wired mode, also can be wireless mode.
The method of the transmission packet that the present embodiment provides, by the packet to be sent obtaining is carried out to buffer memory, and when buffer memory meets default Packet Generation condition, send described packet to be sent, can reduce the operating load that overhead is loaded and relevant device brings transmitting terminal being brought because of the packet that takes place frequently, thereby realize the cost input of saving relevant device.Especially for some, frequently send small data packets, and packet transmitting time is not had to the harsh scene requiring, have more practicality, so the popularization of technology is convenient, cost is low.
Fig. 2 is the flow chart that the another kind that provides of the embodiment of the present invention sends the method for packet.The device of the transmission packet that the method that the present invention executes example to be provided can be provided by the embodiment of the present invention is carried out, and this device can be realized by software and/or hardware.As shown in Figure 2, the method that the embodiment of the present invention provides comprises:
Before obtaining packet to be sent, set up timer and buffer queue, and described timer and described buffer queue are carried out to initialization.For example, described timer is initialized as to 0, described buffer queue is initialized as to sky.
Wherein, the buffer queue of first in first out can guarantee the order of packet turnover buffer queue.
By timer, judge whether current time and the time interval between the last moment that sends packet reach the second preset value, by buffer queue, obtain the quantity of the packet to be sent of buffer memory.As shown in Figure 3, t
i-1represent to send the moment of packet the i-1 time, at t
i-1to t
i-1in the time interval of+T, the first data cached bag of buffer queue a
1, due to data cached bag a now
1moment distance send the time interval in the moment of packet for the i-1 time and do not reach the second preset value, so the data cached bag a of buffer queue continuation
2, when reaching t
iin the time of constantly, due to t
ithe time interval in the moment of the i-1 time transmission packet of distance is the second preset value T constantly, sends described packet a to be sent
1with packet a
2, transmit block is at t
iconstantly complete the i time and send packet to be sent; At t
ito t
iin the time interval of+T, t wherein
i+ T is t
n, the first data cached bag of buffer queue b
1, due to data cached bag b now
1moment distance send the time interval in the moment of packet for the i time and do not reach the second preset value, so the data cached bag b of buffer queue continuation
2, until buffer queue is at t
i+1data cached bag b of the moment
ntime, in buffer queue, the quantity of all packets of buffer memory reaches the first preset value n, t now
i+1the time interval in the moment of the i time transmission packet of distance is T ' constantly, and T ' can not reach the second preset value T apart from the time interval in the moment of the i time transmission packet, sends packet b to be sent
1, packet b
2..., packet b
n, transmit block is at t
i+1constantly complete the i+1 time and send packet to be sent.
Further, after sending all packets of buffer memory, described counter is reset to 0, by described buffer queue zero clearing.
The method of the transmission packet that the present embodiment provides, by the data pack buffer described to be sent obtaining is entered in the buffer queue of first in first out, and when buffer memory meets default Packet Generation condition, send described packet to be sent, can reduce the operating load that overhead is loaded and relevant device brings transmitting terminal being brought because of the packet that takes place frequently, thereby realize the cost input of saving relevant device.
One of ordinary skill in the art will appreciate that realizing in said method embodiment is to come the hardware that instruction is relevant to complete by program in whole or in part, described program can be stored in a computer read/write memory medium, above-mentioned storage medium, as ROM/RAM, disk and CD etc.
Fig. 4 is a kind of structural representation that sends the device of packet that the embodiment of the present invention provides.As shown in Figure 4, the device that the embodiment of the present invention provides comprises: packet acquisition module 401, data pack buffer module 403 and Packet Generation module 403.
Wherein, described packet acquisition module 401 is for obtaining packet to be sent; Described data pack buffer module 402 is for carrying out buffer memory to the packet described to be sent obtaining; Described Packet Generation module 403 when meeting default Packet Generation condition when buffer memory, sends described packet to be sent.
Further, described Packet Generation module 403 can be specifically for:
When current time and the time interval between the last moment that sends packet reach the second preset value, or, when described current time and the time interval between the last moment that sends packet do not reach the second preset value, and when the quantity of all packets of buffer memory reaches the first preset value, the all packets that send buffer memory, described all packets comprise the packet described to be sent obtaining.
Further, described data pack buffer module 402 can be specifically for:
The packet described to be sent obtaining is deposited in to the buffer queue of first in first out.
In such scheme, described Packet Generation module 403 can be specifically for:
When current time and the time interval between the last moment that sends packet do not reach the second preset value, and the quantity of the packet in described buffer queue is while reaching the first preset value, sends the packet in described buffer queue.
Further, after the described packet to be sent of described transmission, also comprise:
Replacement module, for by described buffer queue zero clearing.
The device of the transmission packet that the present embodiment provides, by packet acquisition module, obtain packet to be sent, by data pack buffer module, the packet described to be sent obtaining is carried out to buffer memory, by Packet Generation module when buffer memory the meets default Packet Generation condition, send described packet to be sent, can reduce the operating load that overhead is loaded and relevant device brings transmitting terminal being brought because of the packet that takes place frequently, thereby realize the cost input of saving relevant device.
The device of the transmission packet that the present embodiment provides, for the method for the transmission packet carrying out any embodiment of the present invention and provide, possesses corresponding functional module, reaches identical technique effect, the content reference method embodiment not describing in detail in device embodiment.
Note, foregoing is only preferred embodiment of the present invention.Skilled person in the art will appreciate that and the invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious variations, readjust and substitute and can not depart from protection scope of the present invention.Therefore, although the present invention is described in further detail by above embodiment, the present invention is not limited only to above embodiment, in the situation that not departing from the present invention's design, can also comprise more other equivalent embodiment, and scope of the present invention is determined by appended claim scope.
Claims (10)
1. a method that sends packet, is characterized in that, comprising:
Obtain packet to be sent;
The packet described to be sent obtaining is carried out to buffer memory;
When buffer memory meets default Packet Generation condition, send described packet to be sent.
2. method according to claim 1, is characterized in that, described when buffer memory meets default Packet Generation condition, sends described data to be sent, comprising:
When current time and the time interval between the last moment that sends packet reach the second preset value, or, when described current time and the time interval between the last moment that sends packet do not reach the second preset value, and when the quantity of all packets of buffer memory reaches the first preset value
The all packets that send buffer memory, described all packets comprise the packet described to be sent obtaining.
3. method according to claim 1 and 2, is characterized in that, described the packet described to be sent obtaining is carried out to buffer memory, comprising:
The packet described to be sent obtaining is deposited in to the buffer queue of first in first out.
4. method according to claim 3, is characterized in that, described when buffer memory meets default Packet Generation condition, sends described data to be sent, comprising:
When current time and the time interval between the last moment that sends packet do not reach the second preset value, and the quantity of the packet in described buffer queue is while reaching the first preset value, sends the packet in described buffer queue.
5. method according to claim 3, is characterized in that, after the described packet to be sent of described transmission, also comprises:
By described buffer queue zero clearing.
6. a device that sends packet, is characterized in that, comprising:
Packet acquisition module, for obtaining packet to be sent;
Data pack buffer module, for carrying out buffer memory to the packet described to be sent obtaining;
Packet Generation module, when meeting default Packet Generation condition when buffer memory, sends described packet to be sent.
7. device according to claim 6, is characterized in that, described Packet Generation module, specifically for:
When current time and the time interval between the last moment that sends packet reach the second preset value, or, when described current time and the time interval between the last moment that sends packet do not reach the second preset value, and when the quantity of all packets of buffer memory reaches the first preset value
The all packets that send buffer memory, described all packets comprise the packet described to be sent obtaining.
8. according to the device described in claim 6 or 7, it is characterized in that, described data pack buffer module, specifically for:
The packet described to be sent obtaining is deposited in to the buffer queue of first in first out.
9. device according to claim 8, is characterized in that, described Packet Generation module, specifically for:
When current time and the time interval between the last moment that sends packet do not reach the second preset value, and the quantity of the packet in described buffer queue is while reaching the first preset value, sends the packet in described buffer queue.
10. device according to claim 8, is characterized in that, after the described packet to be sent of described transmission, also comprises:
Replacement module, for by described buffer queue zero clearing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410015242.8A CN103746938A (en) | 2014-01-13 | 2014-01-13 | Method and device for transmitting data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410015242.8A CN103746938A (en) | 2014-01-13 | 2014-01-13 | Method and device for transmitting data packet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103746938A true CN103746938A (en) | 2014-04-23 |
Family
ID=50503927
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410015242.8A Pending CN103746938A (en) | 2014-01-13 | 2014-01-13 | Method and device for transmitting data packet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103746938A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103929490A (en) * | 2014-04-28 | 2014-07-16 | 中国科学院微电子研究所 | Data transmission method for body area network system |
CN104468509A (en) * | 2014-10-29 | 2015-03-25 | 北方工业大学 | Method and system for transmitting mobile phone network game data and mobile phone user side |
CN104780401A (en) * | 2015-03-25 | 2015-07-15 | 腾讯科技(深圳)有限公司 | Video data sending method and device |
CN104917593A (en) * | 2015-04-13 | 2015-09-16 | 惠州Tcl移动通信有限公司 | Network terminal and sending method for data packets of network terminal |
CN105519232A (en) * | 2014-08-01 | 2016-04-20 | 华为技术有限公司 | Apparatus and method for data transmission in wireless network |
CN105704063A (en) * | 2014-11-28 | 2016-06-22 | 奇点新源国际技术开发(北京)有限公司 | Information transmission method and apparatus applied to vehicle terminal |
CN107018087A (en) * | 2016-01-28 | 2017-08-04 | 长城汽车股份有限公司 | Data communications method and system |
CN107995315A (en) * | 2017-12-26 | 2018-05-04 | 北京天融信网络安全技术有限公司 | Synchronous method, device, storage medium and the computer equipment of business board-to-board information |
CN109084885A (en) * | 2018-08-14 | 2018-12-25 | 中国科学院上海高等研究院 | A kind of mechanical equipment vibration detection system, method, readable storage medium storing program for executing and terminal |
CN111292514A (en) * | 2018-12-06 | 2020-06-16 | 杭州海康威视系统技术有限公司 | Alarm information sending method and device and electronic equipment |
-
2014
- 2014-01-13 CN CN201410015242.8A patent/CN103746938A/en active Pending
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103929490A (en) * | 2014-04-28 | 2014-07-16 | 中国科学院微电子研究所 | Data transmission method for body area network system |
US10805927B2 (en) | 2014-08-01 | 2020-10-13 | Huawei Technologies Co., Ltd. | Apparatus and method for transmitting data in wireless network |
CN105519232A (en) * | 2014-08-01 | 2016-04-20 | 华为技术有限公司 | Apparatus and method for data transmission in wireless network |
CN105519232B (en) * | 2014-08-01 | 2019-03-01 | 华为技术有限公司 | A kind of device and method of transmission in wireless network data |
CN104468509A (en) * | 2014-10-29 | 2015-03-25 | 北方工业大学 | Method and system for transmitting mobile phone network game data and mobile phone user side |
CN105704063A (en) * | 2014-11-28 | 2016-06-22 | 奇点新源国际技术开发(北京)有限公司 | Information transmission method and apparatus applied to vehicle terminal |
CN105704063B (en) * | 2014-11-28 | 2018-09-07 | 奇点新源国际技术开发(北京)有限公司 | Information transferring method and device applied to car-mounted terminal |
CN104780401A (en) * | 2015-03-25 | 2015-07-15 | 腾讯科技(深圳)有限公司 | Video data sending method and device |
CN104780401B (en) * | 2015-03-25 | 2017-12-22 | 腾讯科技(深圳)有限公司 | The sending method and device of video data |
CN104917593B (en) * | 2015-04-13 | 2018-05-11 | 惠州Tcl移动通信有限公司 | The sending method of the network terminal and its data packet |
CN104917593A (en) * | 2015-04-13 | 2015-09-16 | 惠州Tcl移动通信有限公司 | Network terminal and sending method for data packets of network terminal |
CN107018087A (en) * | 2016-01-28 | 2017-08-04 | 长城汽车股份有限公司 | Data communications method and system |
CN107995315A (en) * | 2017-12-26 | 2018-05-04 | 北京天融信网络安全技术有限公司 | Synchronous method, device, storage medium and the computer equipment of business board-to-board information |
CN109084885A (en) * | 2018-08-14 | 2018-12-25 | 中国科学院上海高等研究院 | A kind of mechanical equipment vibration detection system, method, readable storage medium storing program for executing and terminal |
CN111292514A (en) * | 2018-12-06 | 2020-06-16 | 杭州海康威视系统技术有限公司 | Alarm information sending method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103746938A (en) | Method and device for transmitting data packet | |
CN110278157B (en) | Congestion control method and network equipment | |
CN101877604B (en) | Method and system for transmitting files | |
CN108509299B (en) | Message processing method, device and computer readable storage medium | |
CN104583993B (en) | For optimizing the apparatus and method for partly enlivening live load | |
CN110417650A (en) | Multilink data distribution method, device and electronic equipment | |
CN103973547B (en) | Picture display method and device | |
US11012724B2 (en) | Video transmission method, apparatus, and system, and computer readable storage medium | |
CN111385269B (en) | Data transmission method and device | |
CN101599965B (en) | Self-adaption high-speed information transmission method based on measurement | |
CN102045772A (en) | Data transmission method and device | |
CN101686176A (en) | Method and device for transmitting and receiving message | |
CN101873475A (en) | Control command sending method, data transmission method, monitoring system and device | |
CN104427286A (en) | Method and system for making video call | |
CN105094743A (en) | First input first output (FIFO) data cache and method thereof for performing time delay control | |
WO2024099035A1 (en) | Parameter adjustment method and related apparatus | |
CN102917212A (en) | 3G (The 3rd Generation Telecommunication) wireless video monitoring implementation method and 3G wireless video monitoring system based on RTP (Real Time Protocol) and RTSP (Real Time Streaming Protocol) | |
CN102299861B (en) | A kind of message flux control method | |
CN103916906A (en) | Method, device and system for distributing and processing user data messages | |
CN104714832A (en) | Buffer management method used for airborne data network asynchronous data interaction area | |
EP2798881B1 (en) | Shaping data packet traffic | |
JP6885463B2 (en) | Transmitter, bandwidth estimation device, bandwidth estimation system, method | |
CN108234595B (en) | Log transmission method and system | |
CN103152410A (en) | Data downloading method and device for mobile device | |
CN113726608B (en) | Data processing 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 | ||
CB02 | Change of applicant information |
Address after: 705-708, room two, No. 121, north south of the Five Ridges Avenue, Chancheng District, Guangdong, Foshan, 528000 Applicant after: GUANGDONG RUIJIANG CLOUD COMPUTING CO., LTD. Address before: 528000, south of the Five Ridges building, No. 100, south of the Five Ridges Avenue, Chancheng District, Guangdong, Foshan, 1, 403 Applicant before: Guangdong Efly Network Co., Ltd. |
|
COR | Change of bibliographic data | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140423 |