CN103546391A - Method and device for sending data packet and terminal - Google Patents
Method and device for sending data packet and terminal Download PDFInfo
- Publication number
- CN103546391A CN103546391A CN201310538493.XA CN201310538493A CN103546391A CN 103546391 A CN103546391 A CN 103546391A CN 201310538493 A CN201310538493 A CN 201310538493A CN 103546391 A CN103546391 A CN 103546391A
- Authority
- CN
- China
- Prior art keywords
- packet
- client
- buffer area
- duplicate packages
- buffer
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
- H04L1/1867—Arrangements specially adapted for the transmitter end
- H04L1/188—Time-out mechanisms
Abstract
The invention discloses a method and device for sending a data packet and a terminal, and belongs to the technical field of the Internet. The method for sending the data packet comprises the steps of (1) sending the data packet to a client, caching a repeated packet of the data packet in a cache region, and (2) taking out the repeated packet of the data packet from the cache region after first preset time, and sending the repeated packet of the data packet to the client. According to the method and device for sending the data packet and the terminal, due to the facts that the repeated packet of the data packet is cached in the cache region, the repeated packet of the data packet is taken out from the cache region after the first preset time, and the repeated packet of the data packet is sent to the client, the purpose that the data packet and the repeated packet of the data packet are sent to the client at different times is achieved, when a network is abnormal or the network is jammed during a certain time period, the frequency of the phenomenon that the data packet and the repeated packet of the data packet are lost at the same time is reduced, and then the packet loss probability of the sent data packet is reduced.
Description
Technical field
The present invention relates to Internet technical field, particularly a kind of method, device and terminal that sends packet.
Background technology
Along with developing rapidly of Internet technology, the data on the Internet are more and more abundanter, and user can obtain various data from the Internet by client, as video data, voice data etc.And according to TCP(Transmission Control Protocol, transmission control protocol)/IP(Internet Protocol, Internet Interconnection agreement) network transmission protocol such as, network equipment is when sending the data to client, can pack the data to packet, with the form of packet, send the data to client.Yet, at network equipment, Packet Generation, in the process to client, can be caused due to reasons such as network congestion or Network Abnormals to the loss of packet conventionally.Therefore, be necessary to propose a kind of method that sends packet, to reduce the packet loss that sends packet.
In prior art, when sending packet, the method conventionally adopting is descending two sending out.Be specially: network equipment sends the duplicate packages of packet when sending packet, make client reach by least one reception in the duplicate packages of packet or packet the object that reduces the packet loss that sends packet.
In realizing process of the present invention, inventor finds that prior art at least exists following problem:
Because network congestion or Network Abnormal usually occur in some specific time periods, therefore, if send the duplicate packages of packet and packet simultaneously, likely when network congestion or Network Abnormal, there is the situation that the duplicate packages of packet and packet is lost simultaneously, cause the poor effect that reduces the packet loss that sends packet.
Summary of the invention
In order to solve the problem of prior art, the embodiment of the present invention provides a kind of method, device and terminal that sends packet.Described technical scheme is as follows:
First aspect, provides a kind of method that sends packet, and described method comprises:
To client, send packet, and by the duplicate packages buffer memory of described packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out described packet from described buffer area;
The duplicate packages of described packet is sent to described client.
Second aspect, provides a kind of device that sends packet, and described device comprises:
The first sending module, for sending packet to client;
Cache module, for by the duplicate packages buffer memory of described packet to buffer area;
Take out module, after the first Preset Time of interval, the duplicate packages of taking out described packet from described buffer area;
The second sending module, for sending to described client by the duplicate packages of described packet.
The third aspect, provides a kind of terminal, and described terminal comprises the device of the transmission packet described in above-mentioned second aspect.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realization sends to client at different time respectively by the duplicate packages of packet and packet; thereby when section Network Abnormal or network congestion sometime, reduce the situation that the duplicate packages of packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is a kind of method flow diagram that sends packet that the embodiment of the present invention one provides;
Fig. 2 is a kind of method flow diagram that sends packet that the embodiment of the present invention two provides;
Fig. 3 is the structural representation in a kind of Circular buffer district of providing of the embodiment of the present invention two;
Fig. 4 is a kind of structural representation that sends the device of packet that the embodiment of the present invention three provides;
Fig. 5 is the structural representation that the another kind that provides of the embodiment of the present invention three sends the device of packet;
Fig. 6 is the structural representation of a kind of terminal of providing of the embodiment of the present invention five.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment mono-
In order to be subject in limited time in network shakiness or network in general bandwidth resources, reduce network equipment and to client, send the packet loss of the packets such as video, audio frequency, the embodiment of the present invention provides a kind of method that sends packet, and referring to Fig. 1, the method flow that the embodiment of the present invention provides comprises:
101: to client, send packet, and by the duplicate packages buffer memory of packet to buffer area.
Preferably, buffer area is Circular buffer district;
The duplicate packages buffer memory of packet, to buffer area, being comprised:
Judge that whether buffer area is full;
If buffer area is less than the duplicate packages of data cached bag after, the memory location of the duplicate packages of having stored in buffer area.
102: after the first Preset Time of interval, the duplicate packages of taking out packet from buffer area.
103: the duplicate packages of packet is sent to client.
Preferably, the duplicate packages buffer memory of packet, to before buffer area, is also comprised:
Determine the packet loss that client is corresponding;
Judge whether packet loss corresponding to client surpasses predetermined threshold value;
If packet loss corresponding to client surpasses predetermined threshold value, carry out the step to buffer area by the duplicate packages buffer memory of packet.
Wherein, determine the packet loss that client is corresponding, comprising:
Statistics receives the number of times of the descending re-send request may of client transmission in the second Preset Time;
According to the total number that receives the number of times of descending re-send request may and send packet in the second Preset Time, determine the packet loss that client is corresponding.
Preferably, after the duplicate packages of packet is sent to client, also comprise:
Every the 3rd Preset Time, redefine packet loss corresponding to client;
Whether packet loss corresponding to client that judgement redefines surpasses predetermined threshold value;
If packet loss corresponding to the client redefining surpasses predetermined threshold value, to client, send next packet, and by the duplicate packages buffer memory of next packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out next packet from buffer area, and the duplicate packages of next packet is sent to client.
Preferably, packet loss corresponding to client that judgement redefines also comprises after whether surpassing predetermined threshold value:
If packet loss corresponding to the client redefining do not surpass predetermined threshold value, to client, send next packet, and stop the duplicate packages buffer memory of next packet to buffer area.
The method that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Embodiment bis-
In conjunction with the content of above-described embodiment one, the embodiment of the present invention provides a kind of method that sends packet.In concrete application, consider the performance of the duplicate packages of the filtering data bag that client has the requirement of real-time of audio data transmission and audio player, the embodiment of the present invention be take packet that network equipment sends to client as packets of audio data is example, and the method that the embodiment of the present invention is provided is illustrated.Referring to Fig. 2, the method flow that the embodiment of the present invention provides comprises:
201: to client, send packet.
For this step, the mode that triggering sends packet to client has multiple, due in some conventional network transmission protocols such as ICP/IP protocol, can pack the data to packet one by one transmits, therefore, network equipment can be packaged into packet by the data of client-requested after receiving the request of data of client transmission, thereby trigger to client, sends packet.For example,, if client, according to the actual requirements to a certain voice data of network equipment request, after network equipment can be packaged into packet by the voice data of client-requested, sends this packet to client.
Certainly, except above-mentioned triggering is to client sends the mode of packet, can also have other triggering modes, the present embodiment does not specifically limit triggering to the mode of client transmission packet.
About network equipment, to client, send the mode of packet, can have a variety ofly yet, the embodiment of the present invention does not specifically limit sending the mode of packet.During concrete enforcement, include but not limited to that network equipment can be divided into all packets some parts, each portion sending wherein; In addition, can also sort to all packets, then each each packet wherein that sends in order.
202: determine the packet loss that client is corresponding, and judge whether packet loss corresponding to client surpasses predetermined threshold value.
This step is preferred steps; in mode due to existing transmission packet; for when Network Abnormal or the network congestion; reduce network equipment to the probability of the data-bag lost of client transmission; network equipment, when sending packets to all clients, also sends the duplicate packages of packet to client, to realize when the data-bag lost; make client can receive the duplicate packages of packet, thereby guarantee the probability that packet is successfully received by client.Yet, under different time or network condition corresponding to zones of different, send to the packet of client sometimes can't lose, if packet can not lost, client can filter out the duplicate packages of the packet receiving, therefore, the duplicate packages of the packet sending to client is unnecessary sometimes, now, not only reduce the transmitting efficiency of packet, also wasted certain Internet resources.For this reason, the method that the embodiment of the present invention provides is when sending packet, for all clients, and not all send the duplicate packages of packet, but first determine packet loss corresponding to client, the client that surpasses predetermined threshold value for packet loss just takes to send the mode of the duplicate packages of packet, thereby saves the Internet resources of wasting because sending the duplicate packages of unnecessary packet.
About determining the mode of the packet loss that client is corresponding, can have a variety of.During concrete enforcement, after the packet that client network equipment sends, can analyze the situation of the packet receiving, determine and do not receive which packet.For the packet not receiving, client can send descending re-send request may to network equipment, requires network equipment to resend the packet that those do not receive.In addition, network equipment also can be added up total number of the packet sending to client in a period of time.Therefore,, while determining packet loss corresponding to client, include but not limited in the following way:
Statistics receives the number of times of the descending re-send request may of client transmission in the second Preset Time;
According to the total number that receives the number of times of descending re-send request may and send packet in the second Preset Time, determine the packet loss that client is corresponding.
Wherein, the size of the second Preset Time can have multiple numerical value, and for example, this second Preset Time was 3 seconds, and in 5 seconds, in 10 seconds etc., the embodiment of the present invention does not limit the concrete size of the second Preset Time.
For example, second Preset Time of take was example as 10 seconds, if within this time period, the number of times that network equipment receives the descending re-send request may of client transmission is 10 times, and within this time period, total number of the packet that network equipment sends to this client is 100, and now packet loss corresponding to this client is 10%.
Certainly, except adopting the mode of packet loss corresponding to above-mentioned definite client, can also adopt other to determine mode, the embodiment of the present invention is not done concrete restriction to this.
Further, after determining packet loss corresponding to client, judge when whether packet loss corresponding to client surpasses predetermined threshold value, corresponding packet loss and the predetermined threshold value of definite client can be compared.About the size of predetermined threshold value, while specifically implementing, can determine according to difference and the network operation situation of the packet sending, for example, can predetermined threshold value be set to 6%, 8% etc., the present embodiment does not specifically limit the size of predetermined threshold value equally.In practical application, no matter the size of predetermined threshold value is how many, and this predetermined threshold value all can reflect the packet loss situation of client.For example, if client packet loss surpasses predetermined threshold value, illustrate that the packet drop of this client is more serious; If client packet loss does not surpass predetermined threshold value, the packet drop that this client is described is not very serious.
203: if packet loss corresponding to client surpasses predetermined threshold value, by the duplicate packages buffer memory of packet to buffer area.
For this step, the packet loss corresponding due to client surpasses predetermined threshold value, the packet drop that this client is described is more serious, in order to improve the success rate of client packet, the method that the embodiment of the present invention provides, after client sends packet, also will send the duplicate packages of packet by subsequent step to client.Consider again when the duplicate packages of packet and packet is sent simultaneously, the likelihood ratio that the duplicate packages of packet and packet is lost is simultaneously larger, for this reason, the method that the embodiment of the present invention provides is after sending packet, first by the duplicate packages buffer memory of packet to buffer area, to realize, the duplicate packages of packet and packet sent to client at different time respectively, and then to reduce the probability that the duplicate packages of packet and packet is lost simultaneously.
Wherein, buffer area includes but not limited to adopt queue buffer area, adopts Circular buffer district etc., and the embodiment of the present invention does not limit the form of buffer area.Because Circular buffer district is when data cached, do not need to allocate in advance memory location, but according to predetermined access data order, as clockwise order, and access is directly carried out to data in order in the position of write pointer and read pointer, can realize access data rapidly, therefore, the embodiment of the present invention can preferentially be selected Circular buffer district.About the concrete structure in Circular buffer district, the structural representation in Circular buffer district that can be shown in Figure 3.Tu3Zhong, Circular buffer district, except having annular storage area, also comprises two pointers that point to corresponding stored region.Wherein, one is write pointer, is used to indicate in buffer area the next storage area of the storage area of the duplicate packages of last buffer memory in the storage area of duplicate packages of last buffer memory or buffer area.Another is read pointer, is used to indicate a upper storage area of the storage area of current duplicate packages to be read in the storage area of current duplicate packages to be read in buffer area or buffer area.
The duplicate packages buffer memory of packet during to buffer area, can be had to various ways, if buffer area is Circular buffer district, the mode by the duplicate packages buffer memory of packet to buffer area includes but not limited to: judge that whether buffer area is full; If buffer area is less than the duplicate packages of data cached bag after, the memory location of the duplicate packages of having stored in buffer area.
Further, judging that buffer area is whether completely time, can be by detecting the read pointer of annular buffer area and the storage area of write pointers point judges.For example, if write pointer is used to indicate the storage area of the duplicate packages of last buffer memory in buffer area, read pointer is used to indicate the storage area of current duplicate packages to be read, if now the read pointer in Circular buffer district and write pointer refer at adjacent storage area, judge that buffer area is full, otherwise buffer area less than.While having expired due to buffer area, data cached bag, therefore determines by the duplicate packages buffer memory of packet the operation failure to buffer area again; If buffer area is less than the duplicate packages of data cached bag after, the memory location of the duplicate packages of having stored in buffer area.
204: after the first Preset Time of interval, the duplicate packages of taking out packet from buffer area, and the duplicate packages of packet is sent to client.
Wherein, the first Preset Time can be set according to actual conditions.For example, this first Preset Time can be 1 second, 2 seconds or 3 seconds etc., and the present embodiment does not limit the first Preset Time.
In addition, after the first Preset Time of interval, while taking out the duplicate packages of packet from buffer area, can also comprise and judge whether buffer area is empty step.If buffer area is empty, determine the operation failure of the duplicate packages of taking out packet from buffer area; If buffer area is not empty, take out the duplicate packages of the packet of assigned address.If buffer area is Circular buffer district, while taking out the duplicate packages of packet from buffer area, can take out according to the access data setting in advance the duplicate packages of the duplicate packages of packet of read pointer indication position or the packet of the next storage area of read pointer indication position in turn.
If buffer area is Circular buffer district, when judging whether buffer area is sky, if write pointer is used to indicate the next storage area of the duplicate packages of last buffer memory in buffer area, read pointer is used to indicate a upper storage area of the storage area of current duplicate packages to be read, now can be by judging whether read pointer and write pointer point to same position and realize.When read pointer and the same position of write pointers point, judgement buffer area is empty, otherwise buffer area is not empty.In addition, when buffer area is not empty, during the duplicate packages of the packet in taking out buffer area, the duplicate packages that can take out successively packet in buffer area according to the access data order setting in advance.
Preferably; because network congestion or Network Abnormal can change to some extent along with the time; and the packet loss of client can constantly change along with the variation of network congestion or Network Abnormal situation; therefore; after the duplicate packages of packet is sent to client; the method that the present embodiment provides can also redefine packet loss corresponding to client every the 3rd Preset Time, to determine whether to continue the duplicate packages buffer memory of the next packet sending to buffer area according to the packet loss redefining.If the packet loss redefining still surpasses predetermined threshold value, still need the duplicate packages buffer memory of the next packet sending to buffer area; After the first Preset Time of interval, the duplicate packages of taking out the next packet of this transmission from buffer area, and the duplicate packages of this next one packet is sent to client.
If packet loss corresponding to the client redefining do not surpass predetermined threshold value, the packet drop that this client is described is not very serious, if send again the duplicate packages of packet to this client, can take a large amount of bandwidth resources, thereby cause network congestion, therefore, when packet loss corresponding to client redefining in judgement do not surpass predetermined threshold value, to client, send next packet, and stop the duplicate packages buffer memory of next packet to buffer area.That is to say, to client, sending after next packet, no longer carry out the duplicate packages buffer memory of next packet to buffer area, after the first Preset Time of interval, from buffer area, take out the duplicate packages of packet, and the duplicate packages of packet is sent to the step of client.Can reduce thus the number that sends the duplicate packages of packet to client, save network bandwidth resources.
Wherein, the size of the 3rd Preset Time can be set according to actual conditions, and the embodiment of the present invention does not specifically limit the size of the 3rd Preset Time.In order to understand at any time packet loss corresponding to client in the time short as far as possible, what the 3rd Preset Time can be arranged is the smaller the better, for example, can be set to 10 seconds by the 3rd Preset Time.
The method that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Embodiment tri-
Referring to Fig. 4, the embodiment of the present invention provides a kind of device that sends packet, and this device comprises:
The first sending module 401, for sending packet to client;
Take out module 403, after the first Preset Time of interval, the duplicate packages of taking out packet from buffer area;
The second sending module 404, for sending to client by the duplicate packages of packet.
Preferably, buffer area is Circular buffer district;
Judging unit, for judging that whether buffer area is full;
Buffer unit, for when buffer area less than time, the duplicate packages of data cached bag after the memory location of the duplicate packages of having stored in buffer area.
Preferably, referring to Fig. 5, this device also comprises:
Preferably, determination module 405, comprising:
Statistic unit, for adding up the number of times of the descending re-send request may that receives client transmission in the second Preset Time;
Determining unit, for determining according to the total number that receives the number of times of descending re-send request may and send packet in the second Preset Time the packet loss that client is corresponding.
Preferably, determination module 405, also for redefining packet loss corresponding to client every the 3rd Preset Time;
The first sending module 401, while also surpassing predetermined threshold value for packet loss corresponding to the client when redefining, sends next packet to client;
Take out module 403, also for after the first Preset Time of interval, the duplicate packages of taking out next packet from buffer area;
The second sending module 404, also for sending to client by the duplicate packages of next packet.
Preferably, the first sending module 401, while also not surpassing predetermined threshold value for packet loss corresponding to the client when redefining, sends next packet to client;
The device that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Embodiment tetra-
The embodiment of the present invention provides a kind of terminal, and this terminal comprises the device that sends packet.
Wherein, this device is as the device of the transmission packet providing in above-described embodiment three.The content that specifically refers to above-described embodiment three repeats no more herein.
The terminal that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Embodiment five
Please refer to Fig. 6, it shows the structural representation of the related terminal of the embodiment of the present invention, and this terminal can be for the method for the transmission packet implementing to provide in above-described embodiment.Specifically:
Terminal 600 can comprise RF(Radio Frequency, radio frequency) circuit 110, the memory 120 that includes one or more computer-readable recording mediums, input unit 130, display unit 140, transducer 150, voicefrequency circuit 160, WiFi(Wireless Fidelity, Wireless Fidelity) module 170, include the parts such as or above processor 180 of processing core and power supply 190.It will be understood by those skilled in the art that the not restriction of structure paired terminal of the terminal structure shown in Fig. 6, can comprise the parts more more or less than diagram, or combine some parts, or different parts are arranged.Wherein:
Input unit 130 can be used for receiving numeral or the character information of input, and generation arranges with user and function is controlled relevant keyboard, mouse, action bars, optics or the input of trace ball signal.Particularly, input unit 130 can comprise touch-sensitive surperficial 131 and other input equipments 132.Touch-sensitive surperficial 131, also referred to as touch display screen or Trackpad, can collect user or near touch operation (using any applicable object or near the operations of annex on touch-sensitive surperficial 131 or touch-sensitive surperficial 131 such as finger, stylus such as user) thereon, and drive corresponding jockey according to predefined formula.Optionally, touch-sensitive surperficial 131 can comprise touch detecting apparatus and two parts of touch controller.Wherein, touch detecting apparatus detects user's touch orientation, and detects the signal that touch operation is brought, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 180, and the order that energy receiving processor 180 is sent is also carried out.In addition, can adopt the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave to realize touch-sensitive surperficial 131.Except touch-sensitive surperficial 131, input unit 130 can also comprise other input equipments 132.Particularly, other input equipments 132 can include but not limited to one or more in physical keyboard, function key (controlling button, switch key etc. such as volume), trace ball, mouse, action bars etc.
WiFi belongs to short range wireless transmission technology, terminal 600 by WiFi module 170 can help that user sends and receive e-mail, browsing page and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 6 shows WiFi module 170, be understandable that, it does not belong to must forming of terminal 600, completely can be as required in not changing the essential scope of invention and omit.
Although not shown, terminal 600 can also comprise camera, bluetooth module etc., does not repeat them here.Specifically in the present embodiment, the display unit of terminal is touch-screen display, and terminal also includes memory, and one or more than one program, one of them or an above program are stored in memory, and are configured to be carried out by more than one or one processor.The above program package of described one or one is containing for carrying out the instruction of following operation:
To client, send packet, and by the duplicate packages buffer memory of packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out packet from buffer area;
The duplicate packages of packet is sent to client.
Supposing above-mentioned is the possible execution mode of the first,, in the possible execution mode of the first execution mode possible as the second basic and that provide, in the memory of terminal, also comprises for carrying out the instruction of following operation: buffer area is Circular buffer district; The duplicate packages buffer memory of packet, to buffer area, being comprised:
Judge that whether buffer area is full;
If buffer area is less than the duplicate packages of data cached bag after, the memory location of the duplicate packages of having stored in buffer area.
In the third the possible execution mode providing as basis at the possible execution mode of the first, in the memory of terminal, also comprise for carrying out the instruction of following operation: the duplicate packages buffer memory of packet, to before buffer area, is also comprised:
Determine the packet loss that client is corresponding;
Judge whether packet loss corresponding to client surpasses predetermined threshold value;
If packet loss corresponding to client surpasses predetermined threshold value, carry out the step to buffer area by the duplicate packages buffer memory of packet.
In the 4th kind of possible execution mode providing as basis at the third possible execution mode, in the memory of terminal, also comprise for carrying out the instruction of following operation: determine the packet loss that client is corresponding, comprising:
Statistics receives the number of times of the descending re-send request may of client transmission in the second Preset Time;
According to the total number that receives the number of times of descending re-send request may and send packet in the second Preset Time, determine the packet loss that client is corresponding.
In the 5th kind of possible execution mode that the third or the 4th kind of possible execution mode provide as basis, in the memory of terminal, also comprise for carrying out the instruction of following operation: after the duplicate packages of packet is sent to client, also comprise:
Every the 3rd Preset Time, redefine packet loss corresponding to client;
Whether packet loss corresponding to client that judgement redefines surpasses predetermined threshold value;
If packet loss corresponding to the client redefining surpasses predetermined threshold value, to client, send next packet, and by the duplicate packages buffer memory of next packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out next packet from buffer area, and the duplicate packages of next packet is sent to client.
In the 6th kind of possible execution mode providing as basis at the 5th kind of possible execution mode, in the memory of terminal, also comprise for carrying out the instruction of following operation: packet loss corresponding to client that judgement redefines also comprises after whether surpassing predetermined threshold value:
If packet loss corresponding to the client redefining do not surpass predetermined threshold value, to client, send next packet, and stop the duplicate packages buffer memory of next packet to buffer area.
The terminal that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Embodiment six
The embodiment of the present invention provides a kind of computer-readable recording medium, and this computer-readable recording medium can be the computer-readable recording medium comprising in the memory in above-described embodiment; Also can be individualism, be unkitted the computer-readable recording medium of allocating in terminal.This computer-readable recording medium stores the above program of or, and this or above program are used for carrying out by one or more than one processor and realize the method that sends packet, and the method comprises:
To client, send packet, and by the duplicate packages buffer memory of packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out packet from buffer area;
The duplicate packages of packet is sent to client.
Supposing above-mentioned is the possible execution mode of the first,, in the possible execution mode of the first execution mode possible as the second basic and that provide, in the memory of terminal, also comprises for carrying out the instruction of following operation: buffer area is Circular buffer district; The duplicate packages buffer memory of packet, to buffer area, being comprised:
Judge that whether buffer area is full;
If buffer area is less than the duplicate packages of data cached bag after, the memory location of the duplicate packages of having stored in buffer area.
In the third the possible execution mode providing as basis at the possible execution mode of the first, in the memory of terminal, also comprise for carrying out the instruction of following operation: the duplicate packages buffer memory of packet, to before buffer area, is also comprised:
Determine the packet loss that client is corresponding;
Judge whether packet loss corresponding to client surpasses predetermined threshold value;
If packet loss corresponding to client surpasses predetermined threshold value, carry out the step to buffer area by the duplicate packages buffer memory of packet.
In the 4th kind of possible execution mode providing as basis at the third possible execution mode, in the memory of terminal, also comprise for carrying out the instruction of following operation: determine the packet loss that client is corresponding, comprising:
Statistics receives the number of times of the descending re-send request may of client transmission in the second Preset Time;
According to the total number that receives the number of times of descending re-send request may and send packet in the second Preset Time, determine the packet loss that client is corresponding.
In the 5th kind of possible execution mode that the third or the 4th kind of possible execution mode provide as basis, in the memory of terminal, also comprise for carrying out the instruction of following operation: after the duplicate packages of packet is sent to client, also comprise:
Every the 3rd Preset Time, redefine packet loss corresponding to client;
Whether packet loss corresponding to client that judgement redefines surpasses predetermined threshold value;
If packet loss corresponding to the client redefining surpasses predetermined threshold value, to client, send next packet, and by the duplicate packages buffer memory of next packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out next packet from buffer area, and the duplicate packages of next packet is sent to client.
In the 6th kind of possible execution mode providing as basis at the 5th kind of possible execution mode, in the memory of terminal, also comprise for carrying out the instruction of following operation: packet loss corresponding to client that judgement redefines also comprises after whether surpassing predetermined threshold value:
If packet loss corresponding to the client redefining do not surpass predetermined threshold value, to client, send next packet, and stop the duplicate packages buffer memory of next packet to buffer area.
The computer-readable recording medium that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
Embodiment seven
A kind of graphical user interface is provided in the embodiment of the present invention, and this graphical user interface is used in terminal, and this terminal comprises touch-screen display, memory and for carrying out one or more than one processor of one or more than one program; This graphical user interface comprises:
To client, send packet, and by the duplicate packages buffer memory of packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out packet from buffer area;
The duplicate packages of packet is sent to client.
The graphical user interface that the embodiment of the present invention provides; by by the duplicate packages buffer memory of packet to buffer area; and after the first Preset Time of interval; from buffer area, take out the duplicate packages of packet; the duplicate packages of packet is sent to client; realized the duplicate packages of packet and packet has been sent to client at different time respectively; thereby when section Network Abnormal or network congestion sometime; the situation that the duplicate packages of minimizing packet and packet is lost simultaneously, and then reduce the packet loss that sends packet.
It should be noted that: the device of the transmission packet that above-described embodiment provides is when sending packet, only the division with above-mentioned each functional module is illustrated, in practical application, can above-mentioned functions be distributed and by different functional modules, completed as required, the internal structure that is about to device is divided into different functional modules, to complete all or part of function described above.In addition, the device of the transmission packet that above-described embodiment provides belongs to same design with the embodiment of the method that sends packet, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can come the hardware that instruction is relevant to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.
Claims (13)
1. a method that sends packet, is characterized in that, described method comprises:
To client, send packet, and by the duplicate packages buffer memory of described packet to buffer area;
After the first Preset Time of interval, the duplicate packages of taking out described packet from described buffer area;
The duplicate packages of described packet is sent to described client.
2. method according to claim 1, is characterized in that, described buffer area is Circular buffer district;
Described by the duplicate packages buffer memory of described packet to buffer area, comprising:
Judge that whether described buffer area is full;
If described buffer area is less than the duplicate packages of packet described in buffer memory after, the memory location of the duplicate packages of having stored in described buffer area.
3. method according to claim 1, is characterized in that, described by the duplicate packages buffer memory of described packet to before buffer area, also comprise:
Determine the packet loss that described client is corresponding;
Judge whether packet loss corresponding to described client surpasses predetermined threshold value;
If packet loss corresponding to described client surpasses predetermined threshold value, carry out the step to buffer area by the duplicate packages buffer memory of described packet.
4. method according to claim 3, is characterized in that, described definite packet loss corresponding to described client, comprising:
Statistics receives the number of times of the descending re-send request may of described client transmission in the second Preset Time;
According to the total number that receives the number of times of described descending re-send request may and send packet in described the second Preset Time, determine the packet loss that described client is corresponding.
5. according to the method described in claim 3 or 4, it is characterized in that, the described duplicate packages by described packet also comprises after sending to described client:
Every the 3rd Preset Time, redefine packet loss corresponding to described client;
Whether packet loss corresponding to described client that judgement redefines surpasses described predetermined threshold value;
If packet loss corresponding to the described client redefining surpasses described predetermined threshold value, to described client, send next packet, and by the duplicate packages buffer memory of described next packet to described buffer area;
Described in interval, after the first Preset Time, from described buffer area, take out the duplicate packages of described next packet, and the duplicate packages of described next packet is sent to described client.
6. method according to claim 5, is characterized in that, packet loss corresponding to described client that described judgement redefines also comprises after whether surpassing described predetermined threshold value:
If packet loss corresponding to the described client redefining do not surpass described predetermined threshold value, to described client, send next packet, and stop the duplicate packages buffer memory of described next packet to buffer area.
7. a device that sends packet, is characterized in that, described device comprises:
The first sending module, for sending packet to client;
Cache module, for by the duplicate packages buffer memory of described packet to buffer area;
Take out module, after the first Preset Time of interval, the duplicate packages of taking out described packet from described buffer area;
The second sending module, for sending to described client by the duplicate packages of described packet.
8. device according to claim 7, is characterized in that, described buffer area is Circular buffer district;
Described cache module, comprising:
Judging unit, for judging that whether described buffer area is full;
Buffer unit, for when described buffer area less than time, the duplicate packages of packet described in buffer memory after the memory location of the duplicate packages of having stored in described buffer area.
9. device according to claim 7, is characterized in that, described device, also comprises:
Determination module, for determining packet loss corresponding to described client;
Judge module, for judging whether packet loss corresponding to described client surpasses predetermined threshold value;
Described cache module, for when packet loss corresponding to described client surpasses predetermined threshold value, carries out by the duplicate packages buffer memory of described packet the step to buffer area.
10. device according to claim 9, is characterized in that, described determination module, comprising:
Statistic unit, for adding up the number of times of the descending re-send request may that receives described client transmission in the second Preset Time;
Determining unit, for determining according to the total number that receives the number of times of described descending re-send request may and send packet in described the second Preset Time the packet loss that described client is corresponding.
11. according to the device described in claim 9 or 10, it is characterized in that, described determination module, also for redefining packet loss corresponding to described client every the 3rd Preset Time;
Described judge module, also for judging whether packet loss corresponding to described client redefining surpasses described predetermined threshold value;
Described the first sending module, while also surpassing described predetermined threshold value for packet loss corresponding to the described client when redefining, sends next packet to described client;
Described cache module, also for by the duplicate packages buffer memory of described next packet to described buffer area;
Described taking-up module also, for after the first Preset Time described in interval, is taken out the duplicate packages of described next packet from described buffer area;
Described the second sending module, also for sending to described client by the duplicate packages of described next packet.
12. devices according to claim 11, is characterized in that, described the first sending module, while also not surpassing described predetermined threshold value for packet loss corresponding to the described client when redefining, sends next packet to described client;
Described cache module, also for stopping the duplicate packages buffer memory of described next packet to buffer area.
13. 1 kinds of terminals, is characterized in that, described terminal comprises the device that sends packet;
Wherein, the device of the device of described transmission packet as described in any one claim in claim 7 to 12.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310538493.XA CN103546391A (en) | 2013-11-04 | 2013-11-04 | Method and device for sending data packet and terminal |
PCT/CN2014/088765 WO2015062418A1 (en) | 2013-11-04 | 2014-10-16 | Method, apparatus and equipment for sending data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310538493.XA CN103546391A (en) | 2013-11-04 | 2013-11-04 | Method and device for sending data packet and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103546391A true CN103546391A (en) | 2014-01-29 |
Family
ID=49969455
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310538493.XA Pending CN103546391A (en) | 2013-11-04 | 2013-11-04 | Method and device for sending data packet and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103546391A (en) |
WO (1) | WO2015062418A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015062418A1 (en) * | 2013-11-04 | 2015-05-07 | 腾讯科技(深圳)有限公司 | Method, apparatus and equipment for sending data packet |
CN105871744A (en) * | 2016-03-31 | 2016-08-17 | 北京小米移动软件有限公司 | Method and device for controlling traffic dynamically |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110958641B (en) * | 2019-11-29 | 2024-03-22 | 湖南超捷科技有限公司 | WIFI data receiving and transmitting control method and device for mobile terminal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040017773A1 (en) * | 2002-07-23 | 2004-01-29 | Eyeball Networks Inc. | Method and system for controlling the rate of transmission for data packets over a computer network |
CN101222311A (en) * | 2008-01-29 | 2008-07-16 | 杭州华三通信技术有限公司 | Real-time packet loss recovery method, system and receiving terminal unit |
EP2256991A1 (en) * | 2009-05-25 | 2010-12-01 | Canon Kabushiki Kaisha | Method and device for determining types of packet loss in a communication network |
CN102801508A (en) * | 2012-07-26 | 2012-11-28 | 苏州科达科技有限公司 | Control method for processing network packet loss |
CN103269260A (en) * | 2013-06-03 | 2013-08-28 | 腾讯科技(深圳)有限公司 | Data transmission method, data receiving terminal, data sending terminal and data transmission system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007051343A1 (en) * | 2005-10-31 | 2007-05-10 | Zte Corporation | A bandwidth adaptive stream medium transmission system of a stream medium serving system and a method thereof |
CN101931897B (en) * | 2009-06-22 | 2013-07-31 | 电信科学技术研究院 | Method, system and device for sending data packet |
CN101729230A (en) * | 2009-11-30 | 2010-06-09 | 中国人民解放军国防科学技术大学 | Multiplexing route method for delay tolerant network |
CN103546391A (en) * | 2013-11-04 | 2014-01-29 | 腾讯科技(武汉)有限公司 | Method and device for sending data packet and terminal |
-
2013
- 2013-11-04 CN CN201310538493.XA patent/CN103546391A/en active Pending
-
2014
- 2014-10-16 WO PCT/CN2014/088765 patent/WO2015062418A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040017773A1 (en) * | 2002-07-23 | 2004-01-29 | Eyeball Networks Inc. | Method and system for controlling the rate of transmission for data packets over a computer network |
CN101222311A (en) * | 2008-01-29 | 2008-07-16 | 杭州华三通信技术有限公司 | Real-time packet loss recovery method, system and receiving terminal unit |
EP2256991A1 (en) * | 2009-05-25 | 2010-12-01 | Canon Kabushiki Kaisha | Method and device for determining types of packet loss in a communication network |
CN102801508A (en) * | 2012-07-26 | 2012-11-28 | 苏州科达科技有限公司 | Control method for processing network packet loss |
CN103269260A (en) * | 2013-06-03 | 2013-08-28 | 腾讯科技(深圳)有限公司 | Data transmission method, data receiving terminal, data sending terminal and data transmission system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015062418A1 (en) * | 2013-11-04 | 2015-05-07 | 腾讯科技(深圳)有限公司 | Method, apparatus and equipment for sending data packet |
CN105871744A (en) * | 2016-03-31 | 2016-08-17 | 北京小米移动软件有限公司 | Method and device for controlling traffic dynamically |
Also Published As
Publication number | Publication date |
---|---|
WO2015062418A1 (en) | 2015-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104142862B (en) | The overload protection method of server and device | |
CN105005909A (en) | Method and device for predicting lost users | |
CN104967896A (en) | Method for displaying bulletscreen comment information, and apparatus thereof | |
CN104301504A (en) | Message viewing method and device and mobile terminal | |
CN104135561A (en) | Method and device of reminding user of flow of terminal as well as terminal | |
CN103442330A (en) | Position notification method and device | |
CN103501259A (en) | Packet loss detection method and detector | |
CN103677633B (en) | Unlocking screen method, device and terminal | |
CN105306383A (en) | Message push method, terminal and push server | |
CN104427074A (en) | Method, device and system for displaying incoming information | |
CN106528282A (en) | Method, device and terminal for closing process | |
CN103368828B (en) | A kind of message temporary storage and system | |
CN104093123A (en) | Application program information pushing method, device and system and mobile terminal | |
CN104133757A (en) | Method for obtaining memory information and terminal | |
CN103312597B (en) | A kind of speech message generation method and device | |
CN104967634A (en) | File upload method and apparatus thereof | |
CN104065693A (en) | Method, device and system for accessing network data in webpage applications | |
CN104159140A (en) | Video processing method, apparatus and system | |
CN104133728A (en) | Method and device for communication between processes | |
CN103561400A (en) | Method for initiating communication, device thereof and mobile terminal | |
CN104780401A (en) | Video data sending method and device | |
CN103280232A (en) | Method and device for audio recording and terminal equipment | |
CN103634311A (en) | Safety protection method and device, and terminal | |
CN103561155B (en) | Send the method for note, device and terminal | |
CN103533139B (en) | Data management method and device of multi-card user and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140129 |