CN107040581A - A kind of network packet transmission method, device, server and system - Google Patents

A kind of network packet transmission method, device, server and system Download PDF

Info

Publication number
CN107040581A
CN107040581A CN201710060957.9A CN201710060957A CN107040581A CN 107040581 A CN107040581 A CN 107040581A CN 201710060957 A CN201710060957 A CN 201710060957A CN 107040581 A CN107040581 A CN 107040581A
Authority
CN
China
Prior art keywords
network packet
preset
target
sending
target account
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.)
Granted
Application number
CN201710060957.9A
Other languages
Chinese (zh)
Other versions
CN107040581B (en
Inventor
种道伟
刘林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710060957.9A priority Critical patent/CN107040581B/en
Publication of CN107040581A publication Critical patent/CN107040581A/en
Application granted granted Critical
Publication of CN107040581B publication Critical patent/CN107040581B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the present application provides a kind of network packet transmission method, device, server and system, and by receiving the network bag that application server is sent, the network bag indicates there is target account information;According to the one-to-one relationship of default accounts information and buffering area, it is determined that buffering area corresponding with the target account information, the buffering area is stored in by the network bag;If it is determined that presently described buffering area, which meets default network bag, sends condition, treated network bag is uncompressed to all in presently described buffering area and is compressed processing, an objective network bag is obtained;The target account indicated to the target account information sends the mode of the objective network bag, it ensure that and realize that application takes device and the purpose of network bag is returned to online user's (target account) on the basis of processing is compressed to network bag, and then reduce application server and consumed to flow during online user's return network bag.

Description

Network packet sending method, device, server and system
Technical Field
The present invention relates to the field of network packet transmission technologies, and in particular, to a network packet transmission method, apparatus, server, and system.
Background
At present, the variety of computer applications is increasing, and great convenience is provided for the life of users. The functionality of a computer application client running on a terminal is typically supported by services provided by a corresponding application server located in the background. For example, after receiving a request sent by an online user through a computer application client on a terminal, the application server may return a request result of the request to the online user in the form of a return network packet.
As the number of online users of computer applications increases, the number of network packets returned by the application server to the online users becomes larger and larger, and the traffic consumption becomes larger and larger. Especially, for a large-scale multi-user simultaneous online game (MMO for short), the number of network packets returned by the application server to the online user is huge, which causes a problem of huge traffic consumption when the application server returns a huge number of network packets to the online user.
In view of the above, it is an urgent need to provide a method, an apparatus, a server and a system for sending a network packet to reduce traffic consumption when an application server returns a network packet to an online user.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a server, and a system for sending a network packet, so as to reduce traffic consumption when an application server returns a network packet to an online user.
In order to achieve the above purpose, the technical solutions provided by the embodiments of the present invention are as follows:
a method for sending network packets comprises the following steps:
receiving a network packet sent by an application server, wherein the network packet indicates target account information;
determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet;
and sending the target network packet to the target account indicated by the target account information.
A network packet transmitting apparatus comprising:
the network packet receiving unit is used for receiving a network packet sent by an application server, and the network packet indicates target account information;
the network packet storing unit is used for determining a buffer area corresponding to the target account information according to the one-to-one correspondence relationship between the preset account information and the buffer area, and storing the network packet into the buffer area;
the target network packet determining unit is used for compressing all network packets which are not compressed in the current buffer area to obtain a target network packet if the current buffer area is determined to meet the preset network packet sending condition;
and the target network packet sending unit is used for sending the target network packet to the target account indicated by the target account information.
A network packet transmission server includes the network packet transmission apparatus.
A network packet transmission system comprises an application server and the network packet transmission server.
The embodiment of the application provides a network packet sending method, a device, a server and a system, wherein the network packet sent by an application server is received, and the network packet indicates target account information; determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area; if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet; the mode of sending the target network packet to the target account indicated by the target account information ensures that the purpose of returning the network packet to the online user (target account) by the application server is realized on the basis of compressing the network packet, thereby reducing the flow consumption when the application server returns the network packet to the online user.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for sending a network packet according to an embodiment of the present application;
fig. 2 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 3 is a flowchart of a method for compressing all network packets that are not compressed in the buffer to obtain a target network packet according to an embodiment of the present disclosure;
fig. 4 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 5 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 6 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 7 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 8 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 9 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 10 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 11 is a flowchart of another method for sending a network packet according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a network packet transmitting device according to an embodiment of the present application;
fig. 13 is a schematic detailed structural diagram of a target network packet determining unit according to an embodiment of the present disclosure;
fig. 14 is a block diagram of a hardware structure of a network packet transmitting apparatus according to an embodiment of the present disclosure;
fig. 15 is a schematic structural diagram of a network packet sending system according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example (b):
fig. 1 is a flowchart of a method for sending a network packet according to an embodiment of the present application.
As shown in fig. 1, the method includes:
s101, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
optionally, the embodiment of the present application provides a network packet sending method applied to a network packet sending server. The network packet sending server is preferably a gateway access server, wherein a computer application client on the terminal is accessed to an application server for providing service support for the computer application client through the gateway access server, and the gateway access server is responsible for the transmission of uplink and downlink network packets between the computer application client and the application server.
The above is only a preferred mode of the network packet sending server provided in the embodiment of the present application, and the inventor can arbitrarily set the concrete expression form of the network packet sending server according to his own needs, and does not make modern work here.
Optionally, when the application server returns a network packet to an online user (online account) of the computer application client located on the terminal, the network packet sending method provided in the embodiment of the present application is configured to receive each network packet sent by the application server, where each network packet indicates target account information. Optionally, the different target account information indicates different target accounts, and the target account is an online account.
S102, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
optionally, a one-to-one correspondence relationship between the account information and the buffer is preset, and after a network packet sent by the application server is received, the buffer corresponding to the target account information indicated by the network packet may be determined, and the network packet is stored in the determined buffer.
Optionally, the manner of presetting the one-to-one correspondence relationship between the account information and the buffer area includes: the method comprises the steps of receiving a request for accessing an application server sent by a computer application client on a terminal (the request for accessing the application server carries login information, and the login information indicates that an account and a password exist), sending the request for accessing the application server to the application server, determining that the account indicated by the login information is an online account by the application server when the login information is successfully verified by the application server, and allocating a buffer zone which is used for uniquely corresponding to the account at the moment when the local (network packet sending server) of the network packet sending method provided by the embodiment of the application runs.
Further, in order to save space, when it is determined that the account is logged out at the application server (when the application server determines that the account is an offline account), the buffer area, which is used for uniquely corresponding to the account, in the local area (network packet transmission server) where the network packet transmission method provided by the embodiment of the present application is executed is deleted.
S103, if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet;
optionally, after the network packet is stored in the buffer, it is determined whether the current buffer meets a preset network packet sending condition, and if it is determined that the current buffer meets the preset network packet sending condition, all network packets that are not compressed in the current buffer are compressed to obtain a target network packet.
Further, when it is determined that the current buffer does not satisfy the preset network packet sending condition, no processing is performed on the network packet stored in the current buffer, and when a network packet corresponding to the next indicated destination account information and the buffer is received, the next received network packet is stored in the buffer, and step S103 is executed.
And S104, sending the target network packet to the target account indicated by the target account information.
Optionally, under the condition that it is determined that the current buffer area meets the preset network packet sending condition, the purpose of sending all the network packets that are not compressed in the current buffer area to the target account indicated by the target account information is achieved by compressing all the network packets that are not compressed in the current buffer area to obtain a target network packet and sending the target network packet to the target account indicated by the target account information. And (4) optional. The target network packet obtained by compression processing is adopted to replace all network packets compressed to obtain the target network packet, so that the purpose of sending all network packets to the target account indicated by the target account information is achieved, and therefore the reduction of consumption flow in the sending process is guaranteed.
The embodiment of the application provides a network packet sending method, which comprises the steps of receiving a network packet sent by an application server, wherein the network packet indicates target account information; determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area; if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet; the mode of sending the target network packet to the target account indicated by the target account information ensures that the purpose of returning the network packet to the online user (target account) by the application server is realized on the basis of compressing the network packet, thereby reducing the flow consumption when the application server returns the network packet to the online user.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 2 for describing another network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 2, the method includes:
s201, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s202, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s203, if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet;
s204, deleting all network packets which are compressed to obtain the target network packet from the current buffer area;
s205, sending the target network packet to the target account indicated by the target account information.
Compared with the network packet transmission method shown in fig. 1, another network packet transmission method shown in fig. 2 provided by the embodiment of the present application is characterized in that: another method for sending a network packet as shown in fig. 2 further includes: after all the network packets that are not compressed in the current buffer area are compressed to obtain a target network packet, all the network packets that are compressed to obtain the target network packet are deleted from the current buffer area, please refer to step S204.
Optionally, step S204 may also be performed after step S205, which is not limited herein.
Optionally, compressing all network packets that are not compressed in the current buffer to obtain a target network packet, including: and acquiring all network packets which are not subjected to compression processing in the current buffer area, and compressing all the acquired network packets to obtain a target network packet.
It should be noted that: and acquiring all network packets which are not compressed in the buffer area at present, and performing a compression process on all the acquired network packets without influencing the network packets stored in the buffer area at present. Therefore, according to another network packet sending method provided in this embodiment of the present application, after all network packets that are not compressed in the current buffer area are compressed to obtain a target network packet, all network packets that are compressed to obtain the target network packet are deleted from the current buffer area, so that only the network packets that are not compressed are stored in the buffer area, and the network packets that are compressed are not included, thereby achieving the purpose of saving the space of the buffer area.
To more fully explain a network packet sending method provided in the embodiment of the present application, a method for compressing all network packets that are not compressed in the buffer to obtain a target network packet provided in the embodiment of the present application is described in detail with reference to fig. 3.
As shown in fig. 3, the method includes:
s301, based on the sequence of storing the network packets into the buffer area, compressing all the network packets which are not compressed in the buffer area to obtain compressed data used as a packet body;
optionally, based on the sequence in which the network packets are stored in the buffer, the compression processing is performed on all the network packets that are not subjected to compression processing in the buffer at present (according to the sequence in which the network packets are stored in the buffer, the compression processing is performed on all the network packets that are not subjected to compression processing in the buffer at present, so as to obtain compressed data used as the packet body.
Optionally, the sequence of the network packets stored in the buffer is the same as the sequence of the network packets stored in the buffer, and based on the sequence of the network packets stored in the buffer, all the network packets that are not compressed in the buffer are compressed to obtain compressed data for serving as a packet body, including: and compressing all the network packets which are not subjected to compression processing in the buffer area according to the storage sequence of the network packets in the buffer area to obtain compressed data used as a packet body.
S302, determining a packet header of the packet body to obtain a target network packet, wherein the determined packet header is used for indicating the data length of the compressed data.
Optionally, a packet header is determined for the compressed data as the packet body, so that the packet body and the packet header form a target network packet, wherein the packet header determined for the compressed data as the packet body is used to indicate the data length of the compressed data.
Optionally, when the target account indicated by the target account information receives the target network packet, it may be determined whether the complete target network packet is received according to the packet header, and when it is determined that the complete target network packet is received, the target network packet is decompressed to obtain each network packet, where the obtained network packets are arranged according to the sequence in which the network packets are stored in the buffer. Furthermore, the sequence of sequentially processing each obtained network packet by the target account is the same as the sequence of the network packet sent by the application server and received by the network packet sending method provided by the embodiment of the present application.
Optionally, in a specific implementation of the method for compressing all network packets that are not compressed in the current buffer to obtain a target network packet, an algorithm used in the method includes: GoogleLZ compression algorithm.
The above is only a preferred mode provided by the embodiment of the present application, and an algorithm used by the method for compressing all network packets that are not compressed in the buffer area and obtain a target network packet provided by the embodiment of the present application may be arbitrarily set by the inventor according to his own needs, and is not limited herein.
By the above further introduction of the method for compressing all the network packets that are not compressed in the buffer area to obtain a target network packet, the network packet sending method provided by the embodiment of the present application is clearer and more complete, and is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 4 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 4, the method includes:
s401, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s402, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s403, judging whether the network packet carries identification information or not; if the network packet carries the identification information, executing step S406; if the network packet does not carry the identification information, executing step S404;
optionally, the identification information is used to indicate that the network packet needs to be immediately sent to the target account indicated by the target account information.
Optionally, for a situation that the network package needs to be immediately sent to the target account indicated by the target account information indicated by the network package, the application server often sets identification information for the network package, where the identification information is used to indicate that the network package needs to be immediately sent to the target account indicated by the target account information.
According to the network packet sending method provided by the embodiment of the application, after a network packet sent by an application server is received and steps S401-S402 are executed, whether the network packet carries identification information or not is judged, and if the network packet carries the identification information, step S406 is executed; if the network packet does not carry the identification information, step S404 is executed.
S404, judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, and executing the step S406 if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit; if the network packet which is not compressed in the buffer does not reach the preset upper storage limit, executing step S405;
optionally, the preset storage upper limit is matched with a maximum transmission unit of a network card used for sending the target network packet to the target account indicated by the target account information.
Optionally, in a case that the network packet sending method provided in the embodiment of the present application is applied to a network packet sending server (for example, a gateway access server), the network packet sending server corresponds to a network card, and the network packet sending server is configured to send a target network packet to a target account indicated by target account information through the network card. Please refer to the description of steps S301-S302, which is not described herein.
It should be noted that: matching the preset storage upper limit with the maximum transmission unit of the network card for sending the target network packet to the target account indicated by the target account information, and indicating: and when the network packet which is not compressed in the current buffer zone reaches a preset storage upper limit, compressing the network packet which is not compressed in the current buffer zone to obtain a target network packet, and matching the target network packet with the maximum transmission unit of the network card for sending the target network packet to the target account indicated by the target account information.
Preferably, the matching of the preset storage upper limit and the maximum transmission unit of the network card used for sending the target network packet to the target account indicated by the target account information includes: the size of the target network packet is close to the size of the network packet which can be sent by the maximum transmission unit of the network card to the maximum extent.
Optionally, the preset storage upper limit is preset information.
The above is only a preferable mode of the embodiment of the present application, and the inventor can arbitrarily set the specific value of the preset storage upper limit according to his own needs, and is not limited herein.
S405, judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer zone to the present reaches a preset time threshold, and executing the step S406 if the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer zone to the present reaches the preset time threshold;
optionally, whether a time interval between the last time when the current buffer area sends the target network packet to the target account indicated by the target account information and the present time reaches a preset time threshold includes: with respect to the current buffer, determining the latest time for sending the target network packet to the target account indicated by the target account information, determining whether the time interval from the determined time to the current time reaches a preset time threshold, and if the time interval reaches the preset time threshold, executing step S406.
Further, in this embodiment of the application, if the time interval does not reach the preset time threshold, no processing is performed on the network packet stored in the buffer, and when the next indicated destination account information and the network packet corresponding to the buffer are received, the next network packet received is stored in the buffer, and step S403 is executed.
S406, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet;
s407, sending the target network packet to the target account indicated by the target account information.
For example, the buffer 1 uniquely corresponds to the account information 1, receives the network packet 1 sent by the application server, the network packet 1 indicates that there is target account information (account information 1), stores the network packet 1 in the buffer 1, executes step S403, and if the process goes to step S406, compresses all the network packets that are not compressed in the buffer to obtain a target network packet, and further executes step S407, and sends the target network packet to the target account indicated by the target account information (the time for sending the target network packet to the target account indicated by the target account information is recorded as time point 1). The next time a network packet 2 sent by an application server is received, when the network packet 2 indicates that account information 1 exists, the network packet 2 is stored in a buffer 1, step S403 is executed, when step S405 is executed, whether a time interval from time point 1 to the present reaches a preset time threshold is judged, if the time interval reaches the preset time threshold, step S406 is executed, and if the time interval does not reach the preset time threshold, no processing is performed on the network packet stored in the buffer at present. And receiving the network packet 3 sent by the application server again, and storing the network packet 3 into the buffer area when the network packet 3 indicates that the account information 1 exists, and executing the step S403.
It should be noted that: if the time for sending the target network packet to the target account indicated by the target account information last time corresponding to the current buffer does not exist (that is, for the buffer, the situation that the network packet which is not compressed in the buffer does not exist yet to obtain a target network packet and the target network packet is sent to the target account indicated by the target account information does not exist yet), the time for allocating the buffer for the target account information is used as the time for sending the target network packet to the target account indicated by the target account information last time corresponding to the current buffer.
Obviously, in the network packet sending method shown in fig. 4 provided in this embodiment of the present application, the determination of whether the result of determining that the current buffer area satisfies the preset network packet sending condition is satisfied is jointly implemented through three conditions, namely, "determining whether the network packet carries the identification information", "determining whether the network packet that is not compressed in the current buffer area reaches the preset storage upper limit", and "determining whether the time interval between the last time when the current buffer area sends the target network packet to the target account indicated by the target account information and the present time reaches the preset time threshold".
For example, if the network packet carries identification information, it is determined that the current buffer area meets a preset network packet sending condition; if the network packet does not carry identification information, the network packet which is not compressed in the buffer zone reaches a preset storage upper limit, and the current buffer zone is determined to meet a preset network packet sending condition; if the network packet does not carry identification information, the network packet which is not compressed in the buffer zone does not reach a preset storage upper limit, and a time interval between the last time when the current buffer zone sends the target network packet to the target account indicated by the target account information and the present time reaches a preset time threshold, determining that the current buffer zone meets a preset network packet sending condition; if the network packet does not carry identification information, the network packet which is not compressed in the buffer zone does not reach a preset storage upper limit, and a time interval between the last time when the target network packet is sent to the target account indicated by the target account information and the present time corresponding to the buffer zone does not reach a preset time threshold, it is determined that the buffer zone does not meet preset network packet sending conditions.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 5 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 5, the method includes:
s501, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s502, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s503, judging whether the network packet carries identification information or not; if the network packet carries the identification information, executing step S504;
further, in another network packet sending method provided in this embodiment of the present application, if the network packet does not carry the identification information, no processing is performed on the network packet stored in the buffer, and when a network packet corresponding to the next indicated destination account information and the buffer is received, the next network packet received is stored in the buffer, and step S503 is executed.
S504, compressing all network packets which are not compressed in the buffer area to obtain a target network packet;
and S505, sending the target network packet to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method provided in the embodiment of the present application and shown in fig. 5 and the network packet sending method provided in the above embodiment and shown in fig. 4 is that: as shown in fig. 5, the network packet sending method only uses the condition of "determining whether the network packet carries the identification information", that is, determining whether the result of "determining that the current buffer meets the preset network packet sending condition" is true. For example, if the network packet carries identification information, it is determined that the current buffer area meets a preset network packet sending condition; and if the network packet does not carry identification information, determining that the current buffer zone does not meet the preset network packet sending condition.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 6 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 6, the method includes:
s601, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s602, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s603, judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, and executing the step S604 if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit;
further, in another network packet sending method provided in this embodiment of the present application, if a network packet that is not compressed in the current buffer does not reach a preset upper storage limit, no processing is performed on the network packet that is stored in the current buffer, and when a network packet corresponding to the next indicated destination account information and the buffer is received, the next network packet that is received is stored in the buffer, and step S603 is executed.
S604, compressing all network packets which are not compressed in the buffer area to obtain a target network packet;
s605, sending the target network packet to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method provided in the embodiment of the present application and shown in fig. 6 and the network packet sending method provided in the above embodiment and shown in fig. 4 is that: as shown in fig. 6, the network packet sending method only uses a condition of "determining whether the network packet that is not compressed in the current buffer reaches the preset storage upper limit", that is, determining whether the result of "determining that the current buffer meets the preset network packet sending condition" is satisfied. For example, if the network packet that is not compressed in the current buffer reaches a preset storage upper limit, it is determined that the current buffer meets a preset network packet sending condition; and if the network packet which is not compressed in the buffer zone does not reach the preset storage upper limit, determining that the current buffer zone does not meet the preset network packet sending condition.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 7 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 7, the method includes:
s701, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s702, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s703, judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer zone to the present reaches a preset time threshold, and executing S704 if the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer zone to the present reaches the preset time threshold;
further, in another network packet sending method provided in this embodiment of the present application, if a time interval between a last time when a target network packet is sent to a target account indicated by the target account information and a next time when the target account information indicated by the target account information corresponds to the current buffer does not reach a preset time threshold, no processing is performed on the network packet stored in the current buffer, and when a network packet corresponding to a next indicated target account information and the buffer is received, a next network packet received is stored in the buffer, and step S703 is executed.
S704, compressing all network packets which are not compressed in the buffer area to obtain a target network packet;
s705, the target network packet is sent to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method provided in the embodiment of the present application and shown in fig. 7 and the network packet sending method provided in the above embodiment and shown in fig. 4 is that: as shown in fig. 7, the network packet sending method only determines whether the result of determining that the current buffer satisfies the preset network packet sending condition is satisfied by determining whether a time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time interval reaches a preset time threshold. For example, if a time interval between the last time when the current buffer area corresponds to the target account indicated by the target account information and the current time when the target network packet is sent to the target account indicated by the target account information reaches a preset time threshold, it is determined that the current buffer area meets a preset network packet sending condition; and if the time interval of the last time of sending the target network packet to the target account indicated by the target account information does not reach the preset time threshold value, determining that the current buffer zone does not meet the preset network packet sending condition.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 8 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 8, the method includes:
s801, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s802, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s803, judging whether the network packet carries identification information; if the network packet carries the identification information, executing step S805; if the network packet does not carry the identification information, executing step S804;
s804, judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, and executing the step S805 if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit;
further, in this embodiment of the present application, if the network packet that is not compressed in the buffer does not reach the preset upper storage limit, when a network packet corresponding to the next indicated destination account information and the buffer is received, the next received network packet is stored in the buffer, and step S803 is executed.
S805, compressing all network packets which are not compressed in the buffer area to obtain a target network packet;
s806, sending the target network packet to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method provided in the embodiment of the present application and shown in fig. 8 and the network packet sending method provided in the above embodiment and shown in fig. 4 is that: the network packet sending method shown in fig. 8 provided in this embodiment of the present application is a determination of whether a result of determining that a current buffer area satisfies a preset network packet sending condition is satisfied or not, which is achieved jointly through two conditions, namely "determining whether the network packet carries identification information" and "determining whether a network packet that is not compressed in the current buffer area reaches a preset storage upper limit".
For example, if the network packet carries identification information, it is determined that the current buffer area meets a preset network packet sending condition; if the network packet does not carry identification information, the network packet which is not compressed in the buffer zone reaches a preset storage upper limit, and the current buffer zone is determined to meet a preset network packet sending condition; if the network packet does not carry identification information, the network packet which is not compressed in the buffer zone does not reach a preset storage upper limit, and the current buffer zone is determined not to meet the preset network packet sending condition.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 9 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 9, the method includes:
s901, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s902, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s903, judging whether the network packet carries identification information; if the network packet carries the identification information, executing step S905; if the network packet does not carry the identification information, executing step S904;
s904, judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer zone to the present reaches a preset time threshold, if the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer zone to the present reaches the preset time threshold, executing the step S905;
further, in this embodiment of the application, if a time interval between the last time when the current buffer area corresponds to the target account indicated by the target account information and the current time when the target network packet is sent to the target account indicated by the target account information does not reach a preset time threshold, when the next indicated target account information and the network packet corresponding to the buffer area are received, the next received network packet is stored in the buffer area, and step S903 is executed.
S905, compressing all network packets which are not compressed in the buffer area to obtain a target network packet;
s906, sending the target network packet to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method shown in fig. 9 provided in the embodiment of the present application and the network packet sending method shown in fig. 4 provided in the above embodiment is that: the network packet sending method shown in fig. 9 provided in this embodiment of the present application is to jointly determine whether a result of determining that a current buffer area satisfies a preset network packet sending condition is satisfied by two conditions, namely "determining whether the network packet carries identification information" and "determining whether a time interval between a last time when the current buffer area sends a target network packet to a target account indicated by the target account information and a present time reaches a preset time threshold".
For example, if the network packet carries identification information, it is determined that the current buffer area meets a preset network packet sending condition; if the network packet does not carry identification information, determining that the current buffer area meets the preset network packet sending condition when the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time reaches a preset time threshold value; if the network packet does not carry identification information, determining that the current buffer area does not meet the preset network packet sending condition when the time interval of the last time of sending the target network packet to the target account indicated by the target account information does not reach the preset time threshold.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 10 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 10, the method includes:
s1001, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s1002, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s1003, judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, and executing step S1005 if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit; if the network packet not compressed in the buffer does not reach the preset upper storage limit, executing step S1004;
s1004, determining whether a time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer area to the present time reaches a preset time threshold, and if the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the current buffer area to the present time reaches the preset time threshold, executing step S1005;
further, in this embodiment of the application, if a time interval between the last time when the current buffer area corresponds to the target account indicated by the target account information and the current time when the target network packet is sent to the target account indicated by the target account information does not reach a preset time threshold, when the next indicated target account information and the network packet corresponding to the buffer area are received, the next received network packet is stored in the buffer area, and step S1003 is executed.
S1005, compressing all the uncompressed network packets in the current buffer to obtain a target network packet;
s1006, sending the target network packet to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method shown in fig. 10 provided in the embodiment of the present application and the network packet sending method shown in fig. 4 provided in the above embodiment is that: the network packet sending method shown in fig. 10 provided in this embodiment of the present application is a determination that whether a result of determining that a current buffer area satisfies a preset network packet sending condition is satisfied is achieved jointly through two conditions, namely "determining whether a network packet that is not compressed in the current buffer area reaches a preset storage upper limit" and "determining whether a time interval between a last time that the current buffer area corresponds to a time interval when a target network packet is sent to a target account indicated by the target account information and a current time interval reaches a preset time threshold".
For example, if the network packet that is not compressed in the current buffer reaches a preset storage upper limit, it is determined that the current buffer meets a preset network packet sending condition; if the network packet which is not compressed in the buffer zone does not reach the preset storage upper limit, the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time reaches the preset time threshold, and the current buffer zone is determined to meet the preset network packet sending condition; if the network packet which is not compressed in the buffer zone does not reach the preset storage upper limit, the time interval between the last time when the target account indicated by the target account information is sent by the buffer zone and the current time does not reach the preset time threshold, and the current buffer zone is determined not to meet the preset network packet sending condition.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
For more fully explaining a network packet sending method provided in the embodiment of the present application, please refer to fig. 11 for describing a further network packet sending method provided in the embodiment of the present application in detail.
As shown in fig. 11, the method includes:
s1101, receiving a network packet sent by an application server, wherein the network packet indicates target account information;
s1102, determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
s1103, determining whether a time interval from the last time of sending the target network packet to the target account indicated by the target account information, which corresponds to the current buffer area, reaches a preset time threshold, and if the time interval from the last time of sending the target network packet to the target account indicated by the target account information, which corresponds to the current buffer area, reaches the preset time threshold, executing step S1105; if the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time corresponding to the buffer does not reach the preset time threshold, executing step S1104;
s1104, judging whether the network packet which is not compressed in the buffer area reaches a preset storage upper limit, and executing S1105 if the network packet which is not compressed in the buffer area reaches the preset storage upper limit;
further, in this embodiment of the application, if the network packet that is not compressed in the buffer does not reach the preset upper storage limit, when a network packet corresponding to the next indicated destination account information and the buffer is received, the next received network packet is stored in the buffer, and step S1103 is executed.
S1105, compressing all the network packets which are not compressed in the current buffer area to obtain a target network packet;
s1106, sending the target network packet to the target account indicated by the target account information.
Optionally, the difference between the network packet sending method shown in fig. 11 provided in the embodiment of the present application and the network packet sending method shown in fig. 4 provided in the above embodiment is that: the network packet sending method shown in fig. 11 provided in this embodiment of the present application is a determination that whether a result of determining that a current buffer satisfies a preset network packet sending condition is satisfied is jointly implemented by two conditions, namely "determining whether a time interval between a last time of sending a target network packet to a target account indicated by the target account information and a current time interval between the last time of sending the target network packet to the target account reaches a preset time threshold" and "determining whether a network packet that is not compressed in the current buffer reaches a preset storage upper limit".
For example, if a time interval between the last time when the current buffer area corresponds to the target account indicated by the target account information and the current time when the target network packet is sent to the target account indicated by the target account information reaches a preset time threshold, it is determined that the current buffer area meets a preset network packet sending condition; if the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time interval does not reach the preset time threshold, determining that the current buffer area meets the preset network packet sending condition, wherein the network packet which is not subjected to compression processing in the current buffer area reaches the preset storage upper limit; and if the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time interval does not reach the preset time threshold value corresponding to the current buffer area, determining that the current buffer area does not meet the preset network packet sending condition, wherein the network packet which is not subjected to compression processing in the current buffer area does not reach the preset storage upper limit.
Through the further introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, which is convenient for a person skilled in the art to understand.
In this embodiment of the present application, preferably, the determining that the current buffer meets a preset network packet sending condition includes: judging whether the network packet carries identification information or not, if so, determining that the current buffer area meets the preset network packet sending condition, wherein the identification information is used for indicating that the network packet needs to be sent to a target account indicated by the target account information immediately; or judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
In this embodiment of the present application, preferably, if the network packet does not carry identification information, the determining that the current buffer meets a preset network packet sending condition further includes: judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
In this embodiment of the present application, preferably, the step of when the current state of the buffer reaches a preset sending state includes: judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the state of the buffer zone reaches a preset sending state, and the preset storage upper limit is matched with a maximum transmission unit of a network card used for sending the target network packet to a target account indicated by the target account information; or, judging whether a time interval from the last time when the current buffer zone corresponds to the target account indicated by the target account information to the target network packet is sent until the current time interval reaches a preset time threshold, and if the time interval from the last time when the current buffer zone corresponds to the target account indicated by the target account information to the target network packet is sent until the current time interval reaches the preset time threshold, the current state of the buffer zone reaches a preset sending state.
In this embodiment of the present application, preferably, if a network packet that is not compressed in the current buffer does not reach a preset upper storage limit, the state of the current buffer reaches a preset sending state, further including: judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information reaches a preset time threshold or not, if so, judging that the current state of the buffer zone reaches a preset sending state.
In this embodiment of the present application, preferably, if a time interval between a last time when the current buffer area sends the target network packet to the target account indicated by the target account information and a next time does not reach a preset time threshold, the state of the current buffer area reaches a preset sending state, further including: judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the state of the buffer zone reaches a preset sending state, and the preset storage upper limit is matched with the maximum transmission unit of the network card used for sending the target network packet to the target account indicated by the target account information.
In the embodiment of the present application, preferably, one buffer corresponds to one unique timer.
Further, in the network package sending method provided in the embodiment of the present application, after the sending the target network package to the target account indicated by the target account information, the method further includes: and controlling a timer corresponding to the buffer area to count again.
Optionally, in the network packet sending method provided in this embodiment of the present application, after the target network packet is sent to the target account indicated by the target account information, a manner of controlling a timer corresponding to the buffer to count again is performed, and whether a time interval between a last time when the target network packet is sent to the target account indicated by the target account information and a next time when the last time when the target network packet is sent to the target account indicated by the target account information, which corresponds to the buffer, and the next time reaches a preset time threshold may be determined according to a current count time of the timer corresponding to the buffer, where the current count time is used to indicate a time interval between a last time when the target network packet is sent to the target account indicated by the target account information and the next time.
When the current timing time of a timer corresponding to a buffer zone reaches a preset time threshold, determining that the time interval between the last time when a target network packet is sent to a target account indicated by the target account information and the current time corresponding to the buffer zone reaches the preset time threshold; when the current timing time of the timer corresponding to the buffer area does not reach a preset time threshold, determining that the time interval between the last time when the target network packet is sent to the target account indicated by the target account information and the current time corresponding to the buffer area does not reach the preset time threshold.
Through the further detailed introduction of the network packet sending method provided by the embodiment of the present application, the network packet sending method provided by the embodiment of the present application is clearer and more complete, and is convenient for a person skilled in the art to understand.
The method is described in detail in the embodiments disclosed above, and the method of the present invention can be implemented by various types of apparatuses, so that the present invention also discloses an apparatus, and the following detailed description will be given of specific embodiments.
Fig. 12 is a schematic structural diagram of a network packet transmitting device according to an embodiment of the present application.
As shown in fig. 12, the apparatus includes:
a network packet receiving unit 121, configured to receive a network packet sent by an application server, where the network packet indicates that target account information exists;
a network packet storing unit 122, configured to determine, according to a one-to-one correspondence relationship between preset account information and a buffer area, a buffer area corresponding to the target account information, and store the network packet in the buffer area;
a target network packet determining unit 123, configured to, if it is determined that the current buffer area meets a preset network packet sending condition, perform compression processing on all network packets that are not subjected to compression processing in the current buffer area, to obtain a target network packet;
a target network packet sending unit 124, configured to send the target network packet to the target account indicated by the target account information.
Further, a network packet sending apparatus provided in an embodiment of the present application further includes: a unit for deleting the data from the data storage unit,
the deleting unit is configured to perform compression processing on all network packets that are not subjected to compression processing in the current buffer area to obtain a target network packet, and delete all network packets that are subjected to compression processing in the current buffer area to obtain the target network packet.
Fig. 13 shows an optional structure of the target network packet determining unit 123 according to an embodiment of the present invention.
As shown in fig. 13, the destination network packet determining unit 123 includes:
a compressed data determining unit 131, configured to, if it is determined that the current buffer area meets a preset network packet sending condition, perform compression processing on all network packets that are not subjected to compression processing in the current buffer area based on the sequence in which the network packets are stored in the buffer area, so as to obtain compressed data used as a packet body;
a target network packet determining subunit 132, configured to determine that a packet header of the packet body obtains a target network packet, where the determined packet header is used to indicate a data length of the compressed data.
Optionally, the compressed data determining unit is specifically configured to: judging whether the network packet carries identification information or not, if so, determining that the current buffer area meets the preset network packet sending condition, wherein the identification information is used for indicating that the network packet needs to be sent to a target account indicated by the target account information immediately; or judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
Optionally, the compressed data determining unit is further specifically configured to: if the network packet does not carry identification information, judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
Optionally, the compressed data determining unit is specifically configured to: judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the state of the buffer zone reaches a preset sending state, and the preset storage upper limit is matched with a maximum transmission unit of a network card used for sending the target network packet to a target account indicated by the target account information; or, judging whether a time interval from the last time when the current buffer zone corresponds to the target account indicated by the target account information to the target network packet is sent until the current time interval reaches a preset time threshold, and if the time interval from the last time when the current buffer zone corresponds to the target account indicated by the target account information to the target network packet is sent until the current time interval reaches the preset time threshold, the current state of the buffer zone reaches a preset sending state.
Optionally, the compressed data determining unit is further specifically configured to: if the network packet which is not compressed in the buffer zone does not reach the preset upper storage limit, judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the buffer zone to the current time reaches the preset time threshold, and if the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the buffer zone to the current time reaches the preset time threshold, the state of the buffer zone reaches the preset sending state.
Optionally, the compressed data determining unit is further specifically configured to: if the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time interval does not reach the preset time threshold, judging whether the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the current state of the buffer zone reaches the preset sending state, and the preset storage upper limit is matched with the maximum transmission unit of the network card used for sending the target network packet to the target account indicated by the target account information.
Optionally, one buffer corresponds to one unique timer, and the network packet sending apparatus further includes: and the control unit is used for controlling a timer corresponding to the buffer area to count again after the target network packet is sent to the target account indicated by the target account information.
Alternatively, the network packet sending apparatus may be a hardware device, and the above-described modules and units may be functional modules disposed in the network packet sending apparatus. Fig. 14 is a block diagram showing a hardware configuration of a network packet transmitting apparatus, and referring to fig. 14, the network packet transmitting apparatus may include: a processor 141, a communication interface 142, a memory 143, and a communication bus 144; the processor 141, the communication interface 142 and the memory 143 communicate with each other through the communication bus 144; optionally, the communication interface 142 may be an interface of a communication module, such as an interface of a GSM module;
a processor 141 for executing a program; a memory 143 for storing programs; the program may include program code comprising computer operating instructions;
processor 141 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention; memory 143 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Among them, the procedure can be specifically used for:
receiving a network packet sent by an application server, wherein the network packet indicates target account information;
determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet;
and sending the target network packet to the target account indicated by the target account information.
Further, the embodiment of the invention also discloses a network packet sending server which comprises the network packet sending device.
Optionally, the network packet sending server is a gateway access server.
The above is only a preferred mode of the network packet sending server provided in the embodiment of the present application, and the inventor may arbitrarily set a specific expression form of the network packet sending server according to his own needs, which is not limited herein.
Furthermore, the embodiment of the invention also discloses a network packet sending system. Fig. 15 is a schematic structural diagram of a network packet transmission system according to an embodiment of the present application.
As shown in fig. 15, the network packet transmission system includes: an application server 151 and a network packet transmission server 152 as described above.
The embodiment of the application provides a network packet sending device, a server and a system, wherein the network packet sent by an application server is received, and the network packet indicates target account information; determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area; if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet; the mode of sending the target network packet to the target account indicated by the target account information ensures that the purpose of returning the network packet to the online user (target account) by the application server is realized on the basis of compressing the network packet, thereby reducing the flow consumption when the application server returns the network packet to the online user.
To sum up:
the embodiment of the application provides a network packet sending method, a device, a server and a system, wherein the network packet sent by an application server is received, and the network packet indicates target account information; determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area; if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet; the mode of sending the target network packet to the target account indicated by the target account information ensures that the purpose of returning the network packet to the online user (target account) by the application server is realized on the basis of compressing the network packet, thereby reducing the flow consumption when the application server returns the network packet to the online user.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (20)

1. A method for transmitting a network packet, comprising:
receiving a network packet sent by an application server, wherein the network packet indicates target account information;
determining a buffer area corresponding to the target account information according to a one-to-one correspondence relationship between preset account information and the buffer area, and storing the network packet into the buffer area;
if the current buffer area is determined to meet the preset network packet sending condition, compressing all network packets which are not compressed in the current buffer area to obtain a target network packet;
and sending the target network packet to the target account indicated by the target account information.
2. The method of claim 1, wherein after compressing all uncompressed network packets in the buffer to obtain a target network packet, the method further comprises:
deleting all network packets compressed to obtain the target network packet from the current buffer.
3. The method according to claim 1 or 2, wherein the compressing all the uncompressed network packets in the current buffer to obtain a target network packet comprises:
compressing all network packets which are not subjected to compression processing in the buffer area currently based on the sequence of the network packets stored in the buffer area to obtain compressed data used as a packet body;
and determining a packet header of the packet body to obtain a target network packet, wherein the determined packet header is used for indicating the data length of the compressed data.
4. The method of claim 2, wherein the determining that the current buffer satisfies a predetermined network packet transmission condition comprises:
judging whether the network packet carries identification information or not, if so, determining that the current buffer area meets the preset network packet sending condition, wherein the identification information is used for indicating that the network packet needs to be sent to a target account indicated by the target account information immediately;
or,
judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
5. The method of claim 4, wherein if the network packet does not carry identification information, the determining that the current buffer meets a preset network packet sending condition further comprises:
judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
6. The method according to claim 4 or 5, wherein the current state of the buffer reaches a preset transmission state, comprising:
judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the state of the buffer zone reaches a preset sending state, and the preset storage upper limit is matched with a maximum transmission unit of a network card used for sending the target network packet to a target account indicated by the target account information;
or,
judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information reaches a preset time threshold or not, if so, judging that the current state of the buffer zone reaches a preset sending state.
7. The method of claim 6, wherein if the network packet not compressed in the buffer currently reaches a preset upper storage limit, the current state of the buffer reaches a preset sending state, further comprising:
judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information reaches a preset time threshold or not, if so, judging that the current state of the buffer zone reaches a preset sending state.
8. The method of claim 6, wherein if a time interval between a last time when the current buffer corresponds to the target account indicated by the target account information and a next time when the target network packet is sent to the target account does not reach a preset time threshold, the current state of the buffer reaches a preset sending state, further comprising:
judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the state of the buffer zone reaches a preset sending state, and the preset storage upper limit is matched with the maximum transmission unit of the network card used for sending the target network packet to the target account indicated by the target account information.
9. The method of claim 6, wherein a buffer corresponds to a unique timer, and wherein after sending the target network packet to the target account indicated by the target account information, the method further comprises:
and controlling a timer corresponding to the buffer area to count again.
10. A network packet transmission apparatus, comprising:
the network packet receiving unit is used for receiving a network packet sent by an application server, and the network packet indicates target account information;
the network packet storing unit is used for determining a buffer area corresponding to the target account information according to the one-to-one correspondence relationship between the preset account information and the buffer area, and storing the network packet into the buffer area;
the target network packet determining unit is used for compressing all network packets which are not compressed in the current buffer area to obtain a target network packet if the current buffer area is determined to meet the preset network packet sending condition;
and the target network packet sending unit is used for sending the target network packet to the target account indicated by the target account information.
11. The apparatus of claim 10, further comprising a deletion unit,
the deleting unit is configured to perform compression processing on all network packets that are not subjected to compression processing in the current buffer area to obtain a target network packet, and delete all network packets that are subjected to compression processing in the current buffer area to obtain the target network packet.
12. The apparatus according to claim 10 or 11, wherein the target network packet determining unit comprises:
a compressed data determining unit, configured to, if it is determined that the current buffer area meets a preset network packet sending condition, perform compression processing on all network packets that are not subjected to compression processing in the current buffer area based on the sequence in which the network packets are stored in the buffer area, so as to obtain compressed data used as a packet body;
and the target network packet determining subunit is configured to determine that a packet header of the packet body obtains a target network packet, where the determined packet header is used to indicate the data length of the compressed data.
13. The apparatus according to claim 11, wherein the compressed data determining unit is specifically configured to:
judging whether the network packet carries identification information or not, if so, determining that the current buffer area meets the preset network packet sending condition, wherein the identification information is used for indicating that the network packet needs to be sent to a target account indicated by the target account information immediately;
or,
judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
14. The apparatus of claim 13, wherein the compressed data determination unit is further specifically configured to:
if the network packet does not carry identification information, judging whether the current state of the buffer zone reaches a preset sending state, and if the current state of the buffer zone reaches the preset sending state, determining that the current buffer zone meets preset network packet sending conditions.
15. The apparatus according to claim 13 or 14, wherein the compressed data determining unit is specifically configured to:
judging whether the network packet which is not compressed in the buffer zone reaches a preset storage upper limit or not, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the state of the buffer zone reaches a preset sending state, and the preset storage upper limit is matched with a maximum transmission unit of a network card used for sending the target network packet to a target account indicated by the target account information;
or,
judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information reaches a preset time threshold or not, if so, judging that the current state of the buffer zone reaches a preset sending state.
16. The apparatus of claim 15, wherein the compressed data determining unit is further specifically configured to:
if the network packet which is not compressed in the buffer zone does not reach the preset upper storage limit, judging whether the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the buffer zone to the current time reaches the preset time threshold, and if the time interval from the last time of sending the target network packet to the target account indicated by the target account information corresponding to the buffer zone to the current time reaches the preset time threshold, the state of the buffer zone reaches the preset sending state.
17. The apparatus of claim 15, wherein the compressed data determining unit is further specifically configured to:
if the time interval between the last time of sending the target network packet to the target account indicated by the target account information and the current time interval does not reach the preset time threshold, judging whether the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, if the network packet which is not compressed in the buffer zone reaches the preset storage upper limit, the current state of the buffer zone reaches the preset sending state, and the preset storage upper limit is matched with the maximum transmission unit of the network card used for sending the target network packet to the target account indicated by the target account information.
18. The apparatus of claim 15, wherein a buffer corresponds to a unique timer, the apparatus further comprising: a control unit for controlling the operation of the display unit,
and the control unit is used for controlling a timer corresponding to the buffer area to count again after the target network packet is sent to the target account indicated by the target account information.
19. A network packet transmission server, comprising the network packet transmission apparatus according to any one of claims 10 to 18.
20. A network packet transmission system comprising an application server and a network packet transmission server according to claim 19.
CN201710060957.9A 2017-01-25 2017-01-25 Network packet sending method, device, server and system Active CN107040581B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710060957.9A CN107040581B (en) 2017-01-25 2017-01-25 Network packet sending method, device, server and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710060957.9A CN107040581B (en) 2017-01-25 2017-01-25 Network packet sending method, device, server and system

Publications (2)

Publication Number Publication Date
CN107040581A true CN107040581A (en) 2017-08-11
CN107040581B CN107040581B (en) 2021-03-02

Family

ID=59534386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710060957.9A Active CN107040581B (en) 2017-01-25 2017-01-25 Network packet sending method, device, server and system

Country Status (1)

Country Link
CN (1) CN107040581B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111292514A (en) * 2018-12-06 2020-06-16 杭州海康威视系统技术有限公司 Alarm information sending method and device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007107457A1 (en) * 2006-03-23 2007-09-27 International Business Machines Corporation Memory compression in information handling systems
CN101340574A (en) * 2008-08-04 2009-01-07 中兴通讯股份有限公司 Method and system realizing zero-copy transmission of stream media data
CN102027457A (en) * 2008-05-14 2011-04-20 起元技术有限责任公司 Managing storage of individually accessible data units
CN104579753A (en) * 2014-12-15 2015-04-29 腾讯科技(深圳)有限公司 User data statistical method, access layer server and statistical server
CN105337961A (en) * 2012-11-02 2016-02-17 北京奇虎科技有限公司 Method for communication with client side and server
CN106209945A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 Based on multi-link data transmission method for uplink and device
CN106302372A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 Network media stream packet receiving method, Apparatus and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007107457A1 (en) * 2006-03-23 2007-09-27 International Business Machines Corporation Memory compression in information handling systems
CN102027457A (en) * 2008-05-14 2011-04-20 起元技术有限责任公司 Managing storage of individually accessible data units
CN101340574A (en) * 2008-08-04 2009-01-07 中兴通讯股份有限公司 Method and system realizing zero-copy transmission of stream media data
CN105337961A (en) * 2012-11-02 2016-02-17 北京奇虎科技有限公司 Method for communication with client side and server
CN104579753A (en) * 2014-12-15 2015-04-29 腾讯科技(深圳)有限公司 User data statistical method, access layer server and statistical server
CN106209945A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 Based on multi-link data transmission method for uplink and device
CN106302372A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 Network media stream packet receiving method, Apparatus and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111292514A (en) * 2018-12-06 2020-06-16 杭州海康威视系统技术有限公司 Alarm information sending method and device and electronic equipment

Also Published As

Publication number Publication date
CN107040581B (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN109565833B (en) Method and apparatus for allocating power
EP3046394A1 (en) Message processing method and mme selection method and device
KR102266089B1 (en) Mec(mobile edge computing) system and control method thereof
US10045263B2 (en) Network switching method and terminal device
CN111885733B (en) Resource allocation method, device, storage medium and network equipment
CN114500633A (en) Data forwarding method, related device, program product and data transmission system
CN105900481A (en) Bandwidth selection method of wireless fidelity technology and access point (ap)
CN104539508A (en) Access control method and device
CN107040581B (en) Network packet sending method, device, server and system
CN103139098B (en) Data transfer control method, device and system and fibre channel media
CN113259260A (en) Method and device for deploying application instance and scheduling application instance
CN109756464B (en) Communication method, server and client
EP2731017A1 (en) Content distribution system, cache server and content distribution method
CN109766347B (en) Data updating method, device, system, computer equipment and storage medium
JP6180225B2 (en) Portable device and communication control method
KR20120107948A (en) Data packet priority level management
CN106506669B (en) Method, device and system for processing session information
CN104010353B (en) A kind of information processing method and electronic equipment
CN110062470B (en) Data transmission method, device, storage medium and system based on wireless ad hoc network
CN111641565B (en) Method, device and system for transmitting Ethernet message
CN107431965B (en) Method and device for realizing Transmission Control Protocol (TCP) transmission
CN103974456A (en) Communication system and method
CN108632355B (en) Routing method for household appliance network, control terminal, readable storage medium and equipment
CN117014379A (en) Code rate control method, device, electronic equipment and storage medium
CN109905901A (en) Network selecting method and device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant