CN104734939B - Session keep-alive method and equipment - Google Patents

Session keep-alive method and equipment Download PDF

Info

Publication number
CN104734939B
CN104734939B CN201310723732.9A CN201310723732A CN104734939B CN 104734939 B CN104734939 B CN 104734939B CN 201310723732 A CN201310723732 A CN 201310723732A CN 104734939 B CN104734939 B CN 104734939B
Authority
CN
China
Prior art keywords
message
sent
client
mail
business datum
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.)
Active
Application number
CN201310723732.9A
Other languages
Chinese (zh)
Other versions
CN104734939A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310723732.9A priority Critical patent/CN104734939B/en
Publication of CN104734939A publication Critical patent/CN104734939A/en
Application granted granted Critical
Publication of CN104734939B publication Critical patent/CN104734939B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application discloses a kind of session keep-alive method and equipment, to solve the problems, such as that the Mail Contents that existing session keep-alive techniques client receives are tampered.This method includes:Proxy server receives the business datum that client is sent by the session between proxy server and client and obtains request, and is transmitted to real server;The first message that the real server is sent is received, first message is used to respond the business datum acquisition request, and first message is carried to represent that the real server starts the information of transmission services data;The proxy server to the client by sending at least two second messages successively, described information is sent to the client, each message carries the fragment of described information, and the transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session;When the proxy server has sent described information, in the ageing time of session, business datum is sent to client by the session.

Description

Session keep-alive method and equipment
Technical field
The present invention relates to computer and communication technical field, more particularly to a kind of session keep-alive method and a kind of agency service Device.
Background technology
Specific purpose can be realized by possessing the network equipment of proxy server functions, such as improves Internet protocol (Internet Protocol, abbreviation IP)Address resource utilization rate, the security for ensuring interaction data etc..Proxy server Operation principle be in client and real server(To refer to stand alone as the server that client provides service, in order to Proxy server is mutually distinguished, and is referred to as in this application " real server ")Between set a proxy server, proxy server Session is established with client and real server respectively, the message for coming from client is handled, and by the report after processing Text is sent to real server, and the message to coming from real server is handled, and the message after processing is sent To client.The above-mentioned network equipment can be deployed in fire wall, gateway device of internet and LAN junction etc..
By it is common act on behalf of mail server exemplified by, act on behalf of mail server receive that the mail that client is sent obtains please Ask, and after mail acquisition request is transmitted into physical mail server, receive the number for the mail that physical mail server is sent According to, and the data of reception are cached, parsed and detected, after by detecting the determination mail as normal email, pass through The data of mail are sent to client by the session acted on behalf of between mail server and client, and client is receiving agency's clothes Session after the data of the mail of business device forwarding between meeting normal switching-off and proxy server.But in actual applications, often The phenomenon that the session between client and proxy server is closed extremely occurs:Such as because mail is larger, such as more than 5,000,000 (M), or mail server is acted on behalf of due to the more low factor of the excessive detection speed of load, proxy server is in the data to mail The long period is consumed when being handled, is preset so as to cause client to exceed in the session between proxy server The conversation aging time do not receive act on behalf of mail server transmission any data, so as to disconnect and act on behalf of mail server it Between session.
In order to avoid there is actual customer end and acting on behalf of the phenomenon that the session between mail server closes extremely, existing skill Art proposes a kind of session keepalive scheme:Mail server is acted on behalf of to be cached in the data to mail, decoded, detected etc. During reason, periodically to client send carry " X-KeepAlive r n " keep Alive Packet.After detection, such as Fruit mail is normal email, then the data of the mail cached is sent into client;If mail is exception mail, such as is taken With rogue program or fishing client, then the abnormal data of caching is deleted, such as after the annex of mail, based on original mail Structure reconfigures an envelope circular mail and informs the above-mentioned testing result of client.
But such scheme can cause in the case that mail is normal email, the mail that client receives with it is true Real mail server, which is sent to, to be acted on behalf of the mail of mail server and compares, and Mail Contents are distorted, and are read and are caused to user It is difficult.Also, the proxy server that such scheme is not suitable for providing other application conversates keep-alive.
The content of the invention
The embodiment of the present invention provides a kind of session keep-alive method, to solve the reception of existing session keep-alive techniques client The problem of Mail Contents are tampered.
Accordingly, the embodiment of the present invention additionally provides a kind of proxy server and network system.
Technical scheme provided in an embodiment of the present invention is as follows:
First aspect, there is provided a kind of session keep-alive method, including:
Proxy server receives the industry that client is sent by the session between the proxy server and the client Business data acquisition request, and business datum acquisition request is transmitted to real server;
The proxy server receives the first message that the real server is sent, and first message is used to respond institute State business datum and obtain request, first message is carried to represent that the real server starts the letter of transmission services data Breath;
The proxy server is sent out by sending at least two second messages to the client successively to the client Sending described information, each message at least two second message carries the fragment of described information, and described at least two the The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in two messages;
When the proxy server has sent described information, in the ageing time of the session, the agency service Device sends the first business datum by the session to the client.
In the first possible implementation of first aspect, order of transmission is adjacent at least two second message Position of the fragment that carries respectively of two messages in described information it is adjacent.
In the possible implementation of the first of first aspect or first aspect, the second of first aspect is additionally provided The possible implementation of kind, before the proxy server sends the first business datum by the session to the client, Also include:
The proxy server receives the second business datum that the real server is sent;
The second business datum that the real server is sent is handled, obtains first business datum;
The proxy server is sent out by sending at least two second messages to the client successively to the client Described information is sent, including:
If the proxy server has handled the second business datum that the real server is sent
Described information is not yet sent, generation one carries all pieces not sent in described information
The message of section,
And the message of generation is sent to the client.
In second of possible realization of the first possible implementation or first aspect of first aspect, first aspect In mode, the third possible implementation of first aspect is additionally provided, the proxy server passes through successively to the visitor Family end sends at least two second messages, and described information is sent to the client, including:
At least one message at least two second message is sent to the client;
Message to be sent at least two second message is sent to the client, sends the report to be sent Text is treated with sending the time interval of the previous message sent according in predefined parameter and at least two second message The quantity of the message of transmission determines that the predefined parameter includes following at least one:The proxy server and the true clothes The transmission bandwidth of session between business device, the progress of proxy server processing second business datum.
In second of possible implementation of first aspect, the 4th kind of possible realization of first aspect is additionally provided Mode, determines whether second business datum includes abnormal data;
If it is determined that second business datum does not include abnormal data, then using second business datum as described first Business datum;
If it is determined that the business datum includes abnormal data, then by removing the exception from second business datum Data obtain first business datum.
In second of possible realization of the first possible implementation or first aspect of first aspect, first aspect In mode, the 5th kind of possible implementation of first aspect is additionally provided, at least two second reports are sent to the client Text, it is specially:
With transmission time interval set in advance, each second report at least two second message is sent one by one Text, the transmission time interval set in advance are less than the conversation aging time of the client.
In second of possible realization of the first possible implementation or first aspect of first aspect, first aspect In mode, the 6th kind of possible implementation of first aspect is additionally provided, the proxy server includes being based on post office protocol 3rd edition(Post Office Protocol3, abbreviation POP3)Mail proxy server, based on interactive message access protocol 4th edition(Internet Message Access Protocol4, abbreviation IMAP4)Mail proxy server and hypertext pass Defeated agreement(HyperText Transfer Protocol, abbreviation HTTP)Web proxy.
In the 6th kind of possible implementation of first aspect, the 7th kind of possible realization of first aspect is additionally provided Mode, if the proxy server is the mail proxy server based on POP3 agreements, the business datum obtains request and is The mail for carrying mail piece identifiers obtains request;
Before the proxy server receives the business datum acquisition request, methods described also includes:
The mail tabulation that the client is sent is obtained request and is transmitted to the real server by the proxy server;
Obtain the real server and respond the mail tabulation that the mail tabulation obtains request return;
Screening obtains super large mail tabulation and preserved from the mail tabulation, and the super large mail tabulation includes mail mark Know and corresponding mail size, the mail size that the super large mail tabulation includes exceed predefined size;
The proxy server sends described information to the client, including:
The proxy server judges that whether obtaining request comprising the business datum in the super large mail tabulation carries Mail piece identifiers;
If it is determined that obtain the mail piece identifiers that request carries, then basis comprising the business datum in the super large mail tabulation Business datum described in the super large mail tabulation obtains mail size corresponding to the mail piece identifiers that request carries, and calculates the second hair Send time interval, second transmission time interval is directly proportional to mail size;
According to second transmission time interval, each message at least two second message, institute are sent one by one State the conversation aging time that the second transmission time interval is less than the client.
In the possible implementation of any one of first aspect or above-mentioned first aspect, first aspect is additionally provided The 8th kind of possible implementation, the size of each fragment of described information is 1 byte.
Second aspect, there is provided a kind of proxy server, including:
Receiving module, pass through the session transmission between the proxy server and the client for receiving client Business datum obtains request;
Sending module, the business datum for the receiving module to be received obtain request and are transmitted to real service Device;
The receiving module, it is additionally operable to receive the first message that the real server is sent, first message is used for Respond the business datum that the sending module is sent and obtain request, first message is carried to represent the true clothes Business device starts the information of transmission services data;
The sending module, it is additionally operable to by sending at least two second messages to the client successively, to the visitor Family end sends described information, and each message at least two second message carries the fragment of described information, it is described at least The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in two the second messages;Sending out When having sent described information, in the ageing time of the session, the proxy server is by the session to the client Send the first business datum.
In the first possible implementation of second aspect, in addition to processing module;
The receiving module, it is additionally operable to send the first business datum to the client by the session in sending module Before, the second business datum that the real server is sent is received;
The processing module, second business datum received for handling the receiving module, obtains described first Business datum;
When the sending module is to client transmission described information, if handled specifically for the processing module Described information is not yet sent during the second business datum that the real server is sent, generation one is carried in described information The message of all fragments not sent;The message of generation is sent to the client.
In the possible implementation of the first of second aspect or second aspect, the second of second aspect is additionally provided Kind possible implementation, the sending module to the client send described information when, specifically for the client Send at least one message at least two second message;
Message to be sent at least two second message is sent to the client, sends the report to be sent Text is treated with sending the time interval of the previous message sent according in predefined parameter and at least two second message The quantity of the message of transmission determines that the predefined parameter includes following at least one:The proxy server and the true clothes The transmission bandwidth of session between business device, the progress of proxy module processing second business datum.
In the first possible implementation of second aspect, the third possible realization of second aspect is additionally provided Mode, the processing module specifically include:
Judging unit, for determining whether second business datum includes abnormal data;
Determining unit, if determining that second business datum does not include abnormal data for the judging unit, by institute The second business datum is stated as first business datum;And if the judging unit determines that second business datum includes Abnormal data, then obtain first business datum by removing the abnormal data from second business datum.
In the possible implementation of the first of second aspect or second aspect, the 4th of second aspect is additionally provided The possible implementation of kind, if the proxy server is the mail proxy server based on pop3 post office protocol version 3 POP3 POP3 agreements, It is that the mail for carrying mail piece identifiers obtains request that then the business datum, which obtains request,;The proxy server also includes screening Module;
The receiving module, it is additionally operable to before receiving the business datum and obtaining request, receives the client and send Mail tabulation obtain request;
The sending module, be additionally operable to by mail tabulation that the receiving module receives obtain request be transmitted to it is described true Server;
The receiving module, it is additionally operable to obtain the postal that the real server responds the mail tabulation acquisition request return Part list;
The screening module, super large mail row are obtained for screening in the mail tabulation that is received from the receiving module Table simultaneously preserves, and the super large mail tabulation includes mail piece identifiers and corresponding mail size, and the super large mail tabulation includes Mail size exceed predefined size;
When the sending module is to client transmission described information, it is specifically used for:Judge that the screening module obtains The super large mail tabulation in whether comprising the business datum obtain request carry mail piece identifiers;If it is determined that the super large The mail piece identifiers of request carrying are obtained in mail tabulation comprising the business datum, then according to the super large mail tabulation Business datum obtains mail size corresponding to the mail piece identifiers that request carries, and calculates the second transmission time interval, second hair Send time interval directly proportional to mail size;According to second transmission time interval, described at least two second are sent one by one Each message in message, second transmission time interval are less than the conversation aging time of the client.
The third aspect, additionally provide a kind of proxy server, including memory, network interface and processor;
The memory, for store program codes;
The network interface, sent out for receiving client by the session between the proxy server and the client The business datum sent obtains request, and business datum acquisition request is transmitted into real server;Receive the true clothes The first message that business device is sent, first message are used to respond the business datum acquisition request, the first message carrying To represent that the real server starts the information of transmission services data;
The processor, for reading the program code stored in the memory, perform:
At least two second messages are sent to the client successively by the network interface, sent to the client Described information, each message at least two second message carry the fragment of described information, and described at least two second The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in message;
When the network interface has sent described information, in the ageing time of the session, by the session to The client sends the first business datum.
In the first possible implementation of the third aspect, the processor is by the session to the client Before sending the first business datum, the network interface is additionally operable to receive the second business datum that the real server is sent;
The processor, it is additionally operable to handle the second business datum that the real server is sent, obtains first industry Business data;
The processor by the network interface to the client send described information when, be specifically used for:
If the processor has not yet sent described when having handled the second business datum that the real server is sent Information, a message for carrying all fragments not sent in described information is generated, and will be generated by the network interface The message be sent to the client.
In the possible implementation of the first of the third aspect or the third aspect, the second of second aspect is additionally provided Kind possible implementation, the processor by the network interface to the client send described information when, it is specific to use In:
Pass through at least one message of the network interface into client transmission at least two second message;
Message to be sent at least two second message is sent to the client by the network interface, Send the message to be sent with send the time interval of the previous message sent according to predefined parameter and it is described extremely The quantity of message to be sent determines that the predefined parameter includes following at least one in few two the second messages:The agency The transmission bandwidth of session between server and the real server, the processor handle entering for second business datum Degree.
In the first possible implementation of the third aspect, the third possible realization of second aspect is additionally provided Mode, the processor handle the second business datum that the real server is sent, when obtaining first business datum, tool Body is used for:
Determine whether second business datum includes abnormal data;
If it is determined that second business datum does not include abnormal data, then using second business datum as described first Business datum;And if it is determined that second business datum includes abnormal data, then by from second business datum Except the abnormal data obtains first business datum.
In the possible implementation of the first of the third aspect or the third aspect, the 4th of second aspect is additionally provided The possible implementation of kind, if the proxy server is the mail proxy server based on pop3 post office protocol version 3 POP3 POP3 agreements, It is that the mail for carrying mail piece identifiers obtains request that then the business datum, which obtains request,;
Before the network interface receives the business datum acquisition request, the mail for sending the client is additionally operable to List obtains request and is transmitted to the real server;The real server response mail tabulation acquisition request is obtained to return The mail tabulation returned;
The processor, it is additionally operable to the screening from the mail tabulation and obtains super large mail tabulation and preserve, the super large Mail tabulation includes mail piece identifiers and corresponding mail size, and the mail size that the super large mail tabulation includes exceedes predetermined Size;
The processor by the network interface to the client send described information when, be specifically used for:
Judge whether the mail piece identifiers for asking to carry are obtained comprising the business datum in the super large mail tabulation;
If it is determined that the postal mark of request carrying is obtained in the super large mail tabulation comprising the business datum, then according to institute State business datum described in super large mail tabulation and obtain mail size corresponding to the mail piece identifiers that request carries, calculating second is sent Time interval, second transmission time interval are directly proportional to mail size;
The network interface sends described at least two one by one according to second transmission time interval
Each message in two messages, second transmission time interval are less than the conversation aging time of the client.
Fourth aspect, additionally provides a kind of network system, including client, real server and the above-mentioned third aspect, Or the proxy server described in any one possible implementation of the third aspect.
In the session provided in an embodiment of the present invention between proxy server and client carries out keepalive method, agency Server receive real server transmission carry represent that the real server starts transmission services data After first message of information, by the way that the information is distributed in multiple second messages, described information is sent to client, wherein The transmission time interval of two adjacent messages of order of transmission is less than the aging of the session at least two second message Time.When the proxy server has sent described information, in the ageing time of the session, the proxy server leads to Cross the first business datum after the session is handled to the client transmission.That is proxy server by cutting above- mentioned information, And carried by the second message of the fragment for carrying above- mentioned information to realize session keepalive, rather than as prior art passes through to send " X-KeepAlive r n " keep Alive Packets realize session keepalive, avoid in the case of Mail Contents are normal, client's termination The problem of Mail Contents of receipts are tampered.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can be with root Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the deployment architecture schematic diagram of the middle proxy server of the embodiment of the present invention;
Fig. 2 is the flow chart for the session keep-alive method that the embodiment of the present invention one provides;
Fig. 3 is the schematic diagram for another session keep-alive method that the embodiment of the present invention one provides;
Fig. 4 is the schematic diagram for another session keep-alive method that the embodiment of the present invention one provides;
Fig. 5 is the schematic diagram for another session keep-alive method that the embodiment of the present invention two provides;
Fig. 6 is a kind of schematic diagram for session keep-alive method that the embodiment of the present invention three provides;
Fig. 7 is a kind of schematic diagram for session keep-alive method that the embodiment of the present invention four provides;
Fig. 8 is a kind of structural representation for proxy server that the embodiment of the present invention five provides;
Fig. 9 is the structural representation for another proxy server that the embodiment of the present invention five provides;
Figure 10 is the structural representation for another proxy server that the embodiment of the present invention five provides;
Figure 11 is the structural representation for another proxy server that the embodiment of the present invention five provides.
Embodiment
Client receives data by the session between proxy server in the prior art, and according to the data received When recombinating out mail, the payload content of keep Alive Packet, such as " X-KeepAlive r n " be also recombined in mail.So as to Even if it is normal email to cause mail, the mail for recombinating to obtain through client is compared with the mail that real server is sent, mail Content can also distort, and read to user and cause difficult and unnecessary interference.
To solve the above problems, the embodiment of the present invention proposes a kind of session protection scheme, followed by multiple implementations The program is described in detail example.
Embodiment one
The embodiments of the invention provide a kind of session keep-alive method, the executive agent of this method is that possess proxy server work( Can the network equipment, alternatively, the network equipment can be network firewall or special http proxy server, Mail proxy server etc..Wherein mail server comprises at least the mail proxy server based on POP3, based on IMAP4 again Mail proxy server.
Proxy server in accompanying drawing 1 is located at the position that LAN border exports, is connected with bearer network, in addition agency service Device can also be deployed in real server front end, i.e., between real server and internet, or in other positions deployment. Proxy server respectively with client(Such as the client 100 in Fig. 1, client 101 and client 102)Session is established, simultaneously Session is established with server.Client and server in the application can be that entity device can also operate in entity device On application program.
Accompanying drawing 2 is the flow chart of session keep-alive method provided in an embodiment of the present invention, and this method includes:
Step 10, proxy server receives client and sent out by the session between the proxy server and the client The business datum sent obtains request, and business datum acquisition request is transmitted into real server.
According to type of service and the difference of bearing protocol, business datum does not obtain the specific message format of request also not Together.But for it is most of based on the service of request for, client is often required to before the business datum of server is obtained Business datum, which is sent, to server obtains request.For example, for mail service, client sends mail to server first and obtained Request, then server obtains according to mail asks to return to required mail data to client;For web service, client Sent first to server and carry URL(Uniform Resource Locator, abbreviation URL)Or filename Claim etc. resource identification web-page requests, then server according to web-page requests to client return needed for resource, the resource can To be web data or file data etc..
Step 20, the proxy server receives the first message that the real server is sent, and first message is used Request is obtained in responding the business datum, first message is carried to represent that the real server starts transmission services The information of data.
It is similar with business datum acquisition request above, according to type of service and the difference of bearing protocol, the first message Specific message format it is also different.Client is just ready to receive business datum after above- mentioned information is received Prepare, the payload content of subsequently received message is subjected to IP fragmentation and reassembly, so as to obtain required business datum.
Step 30, the proxy server to the client by sending at least two second messages successively, to described Client sends described information, and each message at least two second message carries the fragment of described information, it is described extremely The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in few two the second messages.
Proxy server is not directly to turn the first message as prior art after above-mentioned first message is received Client is issued, but the information that the first message is carried is distributed at least two second messages, wherein each second message The fragment of described information is carried, by sending at least two second messages, a side to the client successively in the session The effect to client forwarding described information is realized in face, on the other hand realizes the effect of session keepalive.
Wherein, the fragment that two adjacent messages of order of transmission carry respectively at least two second message exists Position in described information is adjacent.So client is receiving at least two second message, by described at least two The fragment for the information that individual second message carries is recombinated, it is possible to complete described information is obtained, so as to be receipt of subsequent industry Business data are ready.
Alternatively, the size of the fragment for the described information that each message at least two second message carries can be with It is identical, can also be different.
Alternatively, the proxy server, can be with setting when sending at least two second messages to the client Time interval, each second message at least two second message is periodically sent one by one, wherein the time of the setting Conversation aging time of the interval less than the client.
The proxy server can also be sent at least two second message one by one with the time interval of change Each second message, for example, the transmission time interval between first the second message and second the second message, with second Transmission time interval between two messages and the 3rd the second message is different, as long as ensureing two second adjacent reports of order of transmission The transmission time interval of text is less than the conversation aging time of the client.
Step 40, when the proxy server has sent described information, in the ageing time of the session, the generation Manage server and the first business datum is sent to the client by the session.
In other words, between last second message sent and the message of the business datum of carrying first sent at first Transmission time interval be also required in the ageing time less than the session, to prevent the proxy server and the client Between session closed extremely because not transmitting data for a long time.
Need to illustrate herein is:Above-mentioned first message and the second message are not order of representation in present specification Relation, but in order to distinguish different types of message, such as carries different types of information or the message of data, the first business datum with And the second business datum occurred below, also for different business datums is distinguished, such as the first business datum is proxy server The business datum of client is sent to, the second business datum is the business datum that real server is sent to proxy server.
The embodiments of the invention provide a kind of method that session between proxy server and client is protected, generation Reason server receive real server transmission carry represent that the real server starts transmission services data Information the first message after, by the way that the information is distributed in multiple second messages, described information is sent to client, its Described at least two second messages the transmission time interval of two adjacent messages of order of transmission be less than the old of the session Change the time.When the proxy server has sent described information, in the ageing time of the session, the proxy server The first business datum after being handled by the session to the client transmission.So, client receive it is described at least After two the second messages, above- mentioned information can be obtained by restructuring, and business datum can be directly received after the information is obtained. In other words, proxy server is by cutting above- mentioned information, and is realized by the second message of the fragment for carrying above- mentioned information Session keepalive, rather than keep Alive Packet is reconfigured, so as to avoid prior art client after above- mentioned information is received, receive Before the first business datum sent to proxy server, multiple carrying " X- constructed by proxy server can be also received KeepAlive r business datum after restructuring caused by n " keep Alive Packets the problem of unreasonably being distorted.
And session keep-alive method provided in an embodiment of the present invention, it is mail agent service not only to adapt to proxy server The situation of device, when proxy server is http proxy server or FTP(File Transfer Protocol, abbreviation FTP)It is equally applicable during the proxy server of other business such as proxy server or agreement, have well Versatility.
Alternatively, accompanying drawing 3 is refer to, the present embodiment additionally provides another session keep-alive method, wherein step 10 to step Rapid 40 with essentially identical in accompanying drawing 2, herein just not reinflated description.The present embodiment on the basis of method shown in accompanying drawing 2, Processing to business datum during session keepalive has carried out more detailed introduction.
Step 10, proxy server receives client and sent out by the session between the proxy server and the client The business datum sent obtains request, and business datum acquisition request is transmitted into real server.
Step 20, the proxy server receives the first message that the real server is sent, and first message is used Request is obtained in responding the business datum, first message is carried to represent that the real server starts transmission services The information of data.
Step 30, the proxy server to the client by sending at least two second messages successively, to described Client sends described information, and each message at least two second message carries the fragment of described information, it is described extremely The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in few two the second messages.
Step 40, when the proxy server has sent described information, in the ageing time of the session, the generation Manage server and the first business datum is sent to the client by the session.
Before above-mentioned steps 40, also include after step 20:
Step 50, the proxy server receives the second business datum that the real server is sent;
Step 60, the proxy server handles the second business datum that the real server is sent, and obtains described the One business datum.
Specific processing includes but is not limited to:First business datum is cached, and safety detection is carried out to buffered results To determine that second business datum does not include abnormal data;Or digital watermarking is added in the first business datum, is reminded The tentation datas such as information, advertising message.It will not enumerate herein.
In this case, the step 30 further comprises:
Step 301, when the proxy server has handled the second business datum that the real server is sent, judgement is It is no distributed it is described representing that the real server starts the information of transmission services data;If perform step 40;If The proxy server has not yet sent described information when having handled the second business datum that the real server is sent, and performs Step 302.
Step 302, if the proxy server has handled the second business datum fashion that the real server is sent Described information has not been sent, and the proxy server generates a report for carrying all fragments not sent in described information Text,
Step 303, the message of generation is sent to the client by the proxy server, performs step 40.
In scheme provided in an embodiment of the present invention, if the proxy server has handled what the real server was sent Described information has not yet been sent during the second business datum, then all fragments not sent have been bundled to last second message, And last second message is sent to the client by this.Then in the ageing time of the session, the meeting is passed through Talk about to the client and send the first business datum.In other words, after the proxy server obtains the first business datum, without Stay in again etc. after sending multiple second messages, the first business datum could be sent to client, shorten client from transmission Business datum obtains request to receiving the stand-by period of business datum, while reduces and passed between client and proxy server Defeated message amount.
Alternatively, in the above-mentioned steps 30 of accompanying drawing 2, proxy server to the client by sending at least two successively Second message, during sending described information to the client, proxy server can also adjust transmission in real time at any time The transmission time interval of the second adjacent message of order, so as to it will not be closed extremely in guarantee session in the case of, accurately really Determine the transmission time interval of two adjacent the second messages of transmission order.Accompanying drawing 4 is refer to, this method includes:
Step 401, proxy server sends at least one report at least two second message to the client Text.
That is, the opportunity for readjusting transmission time interval is a lot, specifically, sending described at least two second After first message in message, before not yet described information has been sent, transmission time interval can be adjusted.
Step 402, proxy server sends message to be sent at least two second message to the client, Send the message to be sent with send the time interval of the previous message sent according to predefined parameter and it is described extremely The quantity of message to be sent determines that the predefined parameter includes following at least one in few two the second messages:The agency The transmission bandwidth of session between server and the real server, proxy server processing second business datum Progress.
Specifically, proxy server obtains to be sent in predefined parameter and at least two second message first The quantity of message.In at least two second message quantity of message to be sent be more than 1 and less than or equal to it is described not yet The quantity of the fragment of the described information of transmission.Because each second message at least carries the fragment of a described information.One Individual specific example is:
Proxy server takes out the fragment of 1 byte from described information every time, is encapsulated in second message, by this Second message is sent to client.It is assumed that the conversation aging time of client is 5 seconds, to represent that the real server is opened The information of beginning transmission services data includes 5 bytes, and the benchmark for sending interval is 2 seconds.
Proxy server is sending first the second message(Carry the fragment of the described information of 1 byte)Afterwards, 4 be there remains The fragment of the described information of byte, the quantity for now determining the second message to be sent are 4(Each second message carries 1 word The fragment of the described information of section), naturally it is also possible to the quantity for determining the second message to be sent is 3(Two of which second is reported Text carries the fragment of the described information of 1 byte, and second message carries the fragment of the described information of 2 bytes), by that analogy, Other possible situations will not enumerate.Here only illustrated so that the quantity of the second message to be sent is 4 as an example.
Proxy server is according to the transmission bandwidth of the session between proxy server and the real server and/or described The progress of proxy server processing second business datum, estimation have handled the time needed for second business datum, entered And time interval when determining to send second message to be sent.Specific estimation scheme can be inquiry previously according to warp Test the record sheet or other estimation schemes of value setting, it is assumed here that according only to entering for processing second business datum Spend to estimate:The empirical value of the proxy server processing data is 1,000,000/second, also have in the second business datum it is 9,000,000 untreated, It is contemplated that having handled the second business datum also needs 9 seconds.If sent still according to 2 second interval time, remaining 4 have been sent During the second message, the second data are not yet disposed, then time interval when can be sent with proper extension, such as will be to be sent The transmission time interval of 4 the second messages is adjusted to 3 seconds, to ensure to send to be sent the according to the time interval after adjustment Two messages will not cause session to be closed extremely.In this example, the transmission time interval of adjacent message divides in 5 the second messages It is not:2 seconds, 3 seconds, 3 seconds, 3 seconds.When last 1 message is sent, the second business datum can be disposed, proxy server Can starts to send the first business datum to client, so as to avoid because transmission time interval is more than 5 seconds conversation aging time Session is caused to close extremely.
In the above-described example, when sending above- mentioned information by multiple second messages, the operation of transmission time interval is adjusted It can be performed a plurality of times, after such as having sent second the second message, the Adjusted Option of accompanying drawing 4 can be performed again, again adjustment hair Send the time interval of remaining 3 the second messages.
The scheme that accompanying drawing of the embodiment of the present invention 4 provides, give and start transmission services number in the expression real server According to information size it is limited in the case of, how to adjust at least two second message follow-up message to be sent in real time Transmission time interval method, so as to improve session keep-alive method implement when reliability.
Embodiment two
The embodiment of the present invention is so that proxy server is based on POP3 mail proxy server as an example, with reference to shown in accompanying drawing 5 Timing diagram, session keep-alive method provided in an embodiment of the present invention is introduced.
As shown in Figure 5, client, proxy server and real mail server are comprised at least in network system(Under Face abbreviation mail server).
Step 501, client sends mail tabulation and obtains request, payload content entrained by the request for " LIST r n”.The mark of client is also carried in the request.
The specific setting means of payload content refer to POP3 agreement relevant criterions in the request message of different purposes, at this In without be described in detail.
Step 502, mail tabulation acquisition request is transmitted to the mail server by proxy server.
Step 503, mail server returns to mail tabulation and is used as to institute after receiving above-mentioned mail tabulation and obtaining request State the response that mail tabulation obtains request.
Specifically, mail server is after receiving above-mentioned mail tabulation and obtaining request, according to the mark of the client of carrying Know the mail tabulation for inquiring about the client, and the mail tabulation is returned into the client.Mail is included in the mail tabulation Mark and corresponding mail size.Table 1 is an example of mail tabulation.
Table 1
Mail piece identifiers Mail size(Million)
1 20M
2 2M
3 0.5M
Step 504, after proxy server obtains above-mentioned mail tabulation, screened from the mail tabulation and obtain super large mail List simultaneously preserves, and the super large mail tabulation includes mail piece identifiers and corresponding mail size, the super large mail tabulation bag The mail size contained exceedes predefined size.
Screening rule selects the mail piece identifiers of the condition of satisfaction and corresponding postal for proxy server from mail tabulation Part size, it is saved in super large mail tabulation, the mail in super large mail tabulation, should caching and detecting because data volume is larger Longer the time required to during mail, the possibility that generation session is closed extremely is higher, so needing the keep-alive that conversates.No Mail in super large mail tabulation is because data volume is smaller, and it is relatively low to occur the possibility that session is closed extremely, so need not Conversate keep-alive.
Screening rule specifically can flexibly be set according to the process performance of proxy server, if proxy server is handled Performance is higher, then the screening threshold value in screening rule can be set larger, such as be arranged to 10M, if proxy server treatability Can be relatively low, then the screening threshold value in screening rule can be set smaller, such as be arranged to 2M.
In this example, it is assumed that screening rule provides to select the addition that mail size corresponding to mail piece identifiers exceedes 10M Super large mail tabulation.The super large mail tabulation of acquisition is as shown in table 2.
Table 2
Mail piece identifiers Mail size(Million)
1 20M
Proxy server is realized by super large mail tabulation and only part mail is carried out in mail data processing procedure Session keepalive processing, rather than the keep-alive processing that conversated to each mail during detection process, it is complicated to simplify processing Property.
Step 505, above-mentioned mail tabulation is transmitted to client by proxy server.
The execution sequence of above-mentioned steps 504 and step 505 is without limiting.
Step 506, client sends mail data and obtains request, it is specific carry payload content for " RETR1 r n ".
In the present embodiment, business datum obtains request and obtains request for mail, and mail, which obtains, carries mail mark in request Know, the mail piece identifiers in the present embodiment are 1, i.e., client wants will obtain the data for the mail that mail piece identifiers are 1.
Step 507, the acquisition request of above-mentioned mail data is transmitted to mail server by proxy server.
Step 508, whether above-mentioned mail data is included in the super large mail tabulation that proxy server judgment step 504 obtains Obtain the mail piece identifiers carried in request.
If it is determined that obtaining the mail piece identifiers of request carrying in super large mail tabulation comprising the mail data, then clothes are acted on behalf of Device be engaged in after the first message is received, performs step 510.Otherwise after the first message is received, perform existing without session guarantor Handling process living:The first message is directly forwarded to client, the mail data then sent to mail server delays The processing such as deposit, detect, the mail data after processing is sent to client, session keepalive processing need not be performed in the process.
Step 509, mail server sends the first message, and first message please for responding above-mentioned mail data acquisition Ask, first message is carried to represent that the real server starts the information of transmission services data.In the present embodiment, institute State information be specially "+OK r n ".
Step 510, proxy server business datum according to the super large mail tabulation obtains the postal that request carries Mail size corresponding to part mark, calculates transmission time interval, and the transmission time interval is directly proportional to mail size.
Specifically, first the mail size 20,000,000 according to corresponding to mail piece identifiers in table 2 are 1, estimation have been handled proxy server Time needed for 20000000 mail datas, specific estimation scheme can be record sheet of the inquiry previously according to empirical value setting, Can be other estimation schemes, it is assumed here that the record sheet set based on experience value is as shown in table 3.
Table 3
Mail size(Million) Processing time(Second)
20M 10 seconds
30M 15 seconds
40M 20 seconds
Proxy server can determine that 20,000,000 mail datas for having handled mail 1 substantially need 10 seconds according to table 3, first Message carry to represent that the information that the real server starts transmission services data is 5 bytes, if according to each The mode that second message carries 1 byte carrys out cutting above- mentioned information, then can at most be cut into 5 fragments(When producing 4 transmissions Between be spaced)If transmission time interval is 3 seconds(10 seconds/4=3 seconds), it is ensured that carry above- mentioned information last 1 having sent Before second message of the fragment of byte, 20,000,000 mail datas can be handled, and the transmission time interval is less than conversation aging Time, meet to require.
If carry out cutting above- mentioned information in the way of above-mentioned second message carries 1 byte, the transmission time interval calculated More than the conversation aging time, then recalculate when carrying out cutting above- mentioned information with smaller cutting scheme, such as with 0.5 byte cutting During above- mentioned information, obtained transmission time interval, the like, until finding a kind of cutting scheme, the second message is cut with this kind When dividing result carrying above- mentioned information, untill transmission time interval is less than the conversation aging time, no longer illustrate one by one herein.
Step 511, the transmission time interval that proxy server calculates according to step 510, to client in above-mentioned session End sends 5 the second messages.
As first the second message carry content be "+", second the second message carry content be " O ", the 3rd second Message carry content be " K ", the 4th the second message carry content for " r ", the 5th the second message carry content be " n ", The transmission time interval of above-mentioned each second message is 3 seconds.
Step 512, the mail data that proxy server receipt mail server is sent.
Step 513, the mail data that proxy server is sent to mail server is handled.
Specifically, the mail data that proxy server is sent to mail server carries out safety detection, such as is swept with virus Retouch the mail data that engine is sent to mail server and carry out security sweep, to determine whether to include abnormal data;
If it is determined that the mail data that mail server is sent does not include abnormal data, then the mail sent mail server Data are as the business datum after processing;And if it is determined that the mail server send mail data include abnormal data, Then the mail number after the processing is obtained by removing the abnormal data in the mail data that is sent from the mail server According to.
It should be noted that:The sub-process being made up of above-mentioned steps 512 and step 513 can perform parallel with step 511.
Step 514, proxy server is sent in the ageing time of the session by the session to the client Mail data after processing.
It is alternatively possible to it is combined with the concrete mode in embodiment one, for example, proxy server has handled mail service During the business datum that device is sent, find not yet to have sent last 2 bytes in described information(“\r\n”), generate one and take Message with above-mentioned last 2 bytes, and the message of generation is sent to the client, afterwards can start to Business datum after client transmission processing.
Alternatively, proxy server can also use in step 511 and adjust hair corresponding to the accompanying drawing 4 of embodiment one in real time Send the mode of the transmission time interval of the second adjacent message of order.Implementation principle is with substantially similar in embodiment one, so tool Body is no longer developed in details herein.
The embodiment of the present invention so that proxy server is based on POP3 mail proxy server as an example, protect by the session to offer Activating method is described in detail.Because POP3 is before mail server sends mail data to client, proxy server The mail tabulation comprising mail piece identifiers and corresponding mail size can first be obtained.Therefore, can have in follow-up proxy server Keep Alive Packet selectively is sent during being cached to the mail data of big mail, the processing such as detect, and to small mail Mail data the processing procedure such as cached, detected and omit the step of sending keep Alive Packet, simplify processing complexity, help In saving bandwidth resources.
Embodiment three
The embodiment of the present invention is so that proxy server is based on IMAP4 mail proxy server as an example, with reference to shown in accompanying drawing 6 Timing diagram, session keep-alive method provided in an embodiment of the present invention is introduced.
As shown in Figure 6, client, proxy server and real mail server are comprised at least in network system.Visitor Family end needs to obtain an envelope mail from mail server by proxy server, it is assumed that client signs in mailbox by certification In.
Step 601, client sends mail data and obtains request, and the specific payload content that carries is " hmvx UID FETCH28(UID FLAGS BODY.PEEK[])”。
Step 602, the acquisition request of above-mentioned mail data is transmitted to mail server by proxy server.
Step 603, mail server sends the first message, and first message please for responding above-mentioned mail data acquisition Ask, first message is carried to represent that the mail server starts to transmit the information of mail data.In the present embodiment, institute It is specially " * 1FETCH (UID28FLAGS (Recent) BODY [] " to state information.
Step 604, proxy server by the session to client send at least two second messages, described at least two Each message in individual second message carries the fragment of described information, and order of transmission is adjacent at least two second message The transmission time interval of two messages is less than the ageing time of the session.
It is alternatively possible to send at least two second messages according to transmission time interval set in advance, it is assumed that session is old It is 5 seconds to change the time, then above-mentioned transmission time interval is less than 5 seconds, for example, could be arranged to 2 seconds, or 3 seconds.In the present embodiment In each second message carry above- mentioned information 1 byte fragment, but this does not form restriction.What each second message carried The clip size of described information is unlimited, as long as the fragment that adjacent two messages of order of transmission carry respectively is in described information In position it is adjacent, ensure client can recombinate out above- mentioned information.For example, first the second message carries above- mentioned information 3 byte " * SPACE1 "(Wherein SPACE represents space), 1 byte of second the second message carrying above- mentioned information " SPACE ", the 3rd the second message carry 2 bytes " FE " of above- mentioned information etc..In order to handle convenience, each second report Text can carry 1 byte of above- mentioned information, in the present embodiment by taking 1 byte that each second message carries above- mentioned information as an example Illustrate.
Alternatively, can also be with the hair of the second adjacent message of real-time adjustment order of transmission corresponding to the accompanying drawing 4 of embodiment one The mode of time interval is sent, at least two second messages are sent to client.For example, it is assumed that carried in each second message above-mentioned 1 byte in information, proxy server obtain 2 seconds after asking in reception mail data(During benchmark set in advance Between), first the second message for carrying above- mentioned information first character section " * " is sent to client, continues the second report after transmission Wen Shi, transmission time interval is adjusted according to predefined parameter in real time.Implementation principle is with substantially similar in embodiment one, so specifically existing Here no longer it is developed in details.
Step 605, the word for the mail data to be sent that proxy server receipt mail server is sent(literal)Value 24773。
Step 606, the mail data that proxy server receipt mail server is sent.
Step 607, the mail data that proxy server is sent to mail server is handled.
Specifically, assume that the mail data that proxy server is sent to mail server carries out safe inspection in the present embodiment Being found after survey, the mail data that mail server is sent does not meet security strategy set in advance, such as carries abnormal annex, Then from mail server send mail data in delete attachment data and add declaration after handled after mail data, Then literal value is recalculated, literal value is reduced to 1800 by 24773.
The sub-process that above-mentioned steps 605~607 form can perform parallel with step 604.
Step 608, proxy server is sent in the ageing time of the session by the session to the client Literal value and mail data after processing.
Specifically, the first message is carried to represent that the real server starts transmission services number in the present embodiment According to information data volume it is larger, it is assumed that at the mail data that step 607 proxy server is sent to mail server There is fragment " ETCH (UID28FLAGS (Recent) BODY [] " not yet to send at the end of reason, in above- mentioned information, then agency's clothes Business device generates second report for carrying the above-mentioned fragment " ETCH (UID28FLAGS (Recent) BODY [] " not yet sent Text, and the message of generation is sent to the client, can starts the word after being handled to client transmission afterwards Value and mail data.Obviously, the second message for carrying " ETCH (UID28FLAGS (Recent) BODY [] " is sent with sending Carry the transmission time interval between the message of literal value and should be less than the conversation aging time.
The embodiment of the present invention is so that proxy server is based on IMAP4 mail proxy server as an example, the session to offer Keepalive method is described in detail.
Example IV
The embodiment of the present invention is so that proxy server is based on HTTP Web proxy as an example, with reference to shown in accompanying drawing 7 Timing diagram, session keep-alive method provided in an embodiment of the present invention is introduced.
As shown in Figure 7, client, proxy server and real HTTP server are comprised at least in network system(Below Abbreviation HTTP server).Client needs to obtain an entitled eicar.rar from HTTP server by proxy server File.
Step 701, client sends business datum and obtains request, and the specific payload content that carries is " GET/eicar.rar HTTP/1.1”。
Step 702, the acquisition request of above-mentioned business datum is transmitted to HTTP server by proxy server.
Step 703, HTTP server sends the first message, and first message please for responding above-mentioned business datum acquisition Ask, first message is carried to represent that the HTTP server starts the information of transmission services data.In the present embodiment, institute It is specially " HTTP/1.1200OK " to state information.
Step 704, proxy server sends at least two second messages to client, at least two second message Each message carry the fragment of described information, the hair of two adjacent messages of order of transmission at least two second message Time interval is sent to be less than the ageing time of the session.
It is alternatively possible to send at least two second messages according to transmission time interval set in advance, it is assumed that session is old It is 5 seconds to change the time, then above-mentioned transmission time interval is less than 5 seconds, for example, could be arranged to 2 seconds, or 3 seconds.Each second report The clip size for the described information that text carries is unlimited, as long as the fragment that adjacent two messages of order of transmission carry respectively exists Position in described information is adjacent, ensures that client can recombinate out above- mentioned information.With each second report in the present embodiment Text illustrates exemplified by carrying 1 byte of above- mentioned information.
Alternatively, can also be with the hair of the second adjacent message of real-time adjustment order of transmission corresponding to the accompanying drawing 4 of embodiment one The mode of time interval is sent, at least two second messages are sent to client.For example, it is assumed that carried in each second message above-mentioned 1 byte in information, proxy server obtain 2 seconds after asking in reception business datum(During benchmark set in advance Between), first the second message for carrying above- mentioned information first character section " H " is sent to client, continues the second report after transmission Wen Shi, transmission time interval is adjusted according to predefined parameter in real time.Implementation principle is with substantially similar in embodiment one, so specifically existing Here no longer it is developed in details.
Step 705, proxy server receives the data for the file eicar.rar that HTTP server is sent.
Step 706, the data for the file eicar.rar that proxy server is sent to HTTP server are handled.
Specifically, the data for the file eicar.rar that proxy server is sent to HTTP server cached and safety Detection.Assume that the data for the file eicar.rar that proxy server is sent to HTTP server carry out safety in the present embodiment Found after detection, the data fit security strategy set in advance for the file eicar.rar that HTTP server is sent.HTTP service The data for the file eicar.rar that device is sent are the business datum after handling.
The sub-process that above-mentioned steps 705 and step 706 form can perform parallel with step 704.
Step 707, proxy server is sent in the ageing time of the session by the session to the client Business datum after processing.
Specifically, it is assumed that enter in the data for the file eicar.rar that step 706 proxy server is sent to HTTP server Also having fragment at the end of row processing, in above- mentioned information, "/1.1200OK " is not yet sent, then proxy server generates one and carried It is above-mentioned not yet send fragment "/1.1200OK " the second message, and the message of generation is sent to the client, it Can starts the business datum after being handled to client transmission afterwards.Obviously, send and carry "/1.1200OK " the second message The transmission time interval between message with sending the business datum after carrying processing should be less than the conversation aging time.
The embodiment of the present invention so that proxy server is based on HTTP Web proxy as an example, protect by the session to offer Activating method is described in detail.
Embodiment five
The embodiments of the invention provide a kind of proxy server, accompanying drawing 8 is the structural representation of the proxy server, the generation Reason server includes:Receiving module 801 and sending module 802, wherein:
Receiving module 801, sent out for receiving client by the session between the proxy server and the client The business datum sent obtains request;
Sending module 802, the business datum for the receiving module 801 to be received obtain request and are transmitted to truly Server;
The receiving module 801, it is additionally operable to receive the first message that the real server is sent, first message is used Request is obtained in the business datum that response sending module 802 is sent, first message is carried to represent described true Server starts the information of transmission services data;
The sending module 802, it is additionally operable to by sending at least two second messages to the client successively, to described Client sends the described information that the first message that the receiving module 803 receives carries, at least two second message Each message carry the fragment of described information, the hair of two adjacent messages of order of transmission at least two second message Time interval is sent to be less than the ageing time of the session;When having sent described information, in the ageing time of the session, institute State proxy server and the first business datum is sent to the client by the session.
Alternatively, the proxy server shown in accompanying drawing 8 also includes processing module 803, in this case:
The receiving module 801, it is additionally operable to send the first industry to the client by the session in sending module 802 Before data of being engaged in, the second business datum that the real server is sent is received;
The processing module 803, second business datum received for handling the receiving module 801, obtain First business datum;
When the sending module 802 is to client transmission described information, if specifically for the processing module 803 Described information is not yet sent when having handled the second business datum that the real server is sent, generation one carries described The message of all fragments not sent in information;The message of generation is sent to the client.
Alternatively, the sending module to the client send described information when, when can be with transmission set in advance Between be spaced, regularly to the client send carry described information fragment the second message, hair can also be adjusted in real time The transmission time interval of adjacent second message is sent, i.e.,:
When 802 pieces of the transmission mould is to client transmission described information, specifically for sending institute to the client State at least one message at least two second messages;
Message to be sent at least two second message is sent to the client, sends the report to be sent Text is treated with sending the time interval of the previous message sent according in predefined parameter and at least two second message The quantity of the message of transmission determines that the predefined parameter includes following at least one:The proxy server and the true clothes The transmission bandwidth of session between business device, the progress of proxy module processing second business datum.
Alternatively, accompanying drawing 9 is refer to, processing module can specifically carry out safety detection to determine to the first business datum State the second business datum and do not include abnormal data, above-mentioned processing module 803 specifically includes:
Judging unit 901, for determining whether second business datum includes abnormal data;
Determining unit 902, if determining that second business datum does not include abnormal data for the judging unit 901, Then using second business datum as first business datum;And if the judging unit 901 determines second industry Business packet contains abnormal data, then obtains first business by removing the abnormal data from second business datum Data.
Accompanying drawing 10 is refer to, if the proxy server in accompanying drawing 8 or 9 is the postal based on pop3 post office protocol version 3 POP3 POP3 agreements Part proxy server, then it is that the mail for carrying mail piece identifiers obtains request that the business datum, which obtains request,;Agency's clothes Business device also includes screening module 804;
The receiving module 801, it is additionally operable to before receiving the business datum and obtaining request, receives the client hair The mail tabulation sent obtains request;
The sending module 802, the mail tabulation acquisition request for the receiving module 801 to be received are transmitted to described Real server;
The receiving module 803, it is additionally operable to obtain the described of the real server response transmission of sending module 802 Mail tabulation obtains the mail tabulation that request returns;
The screening module 804, super large is obtained for screening in the mail tabulation that is received from the receiving module 803 Mail tabulation simultaneously preserves, and the super large mail tabulation includes mail piece identifiers and corresponding mail size, the super large mail row The mail size that table includes exceedes predefined size;
When the sending module 802 is to client transmission described information, specifically for judging the screening module 804 Whether the mail piece identifiers of request carrying are obtained comprising the business datum in the obtained super large mail tabulation;If it is determined that institute The mail piece identifiers for obtaining request carrying in super large mail tabulation comprising the business datum are stated, then according to the super large mail tabulation Described in business datum obtain request carry mail piece identifiers corresponding to mail size, calculate the second transmission time interval, it is described Second transmission time interval is directly proportional to mail size;According to second transmission time interval, send one by one described at least two Each message in individual second message, second transmission time interval are less than the conversation aging time of the client.
The embodiment of the present invention additionally provides another proxy server, the structure of the proxy server as shown in Figure 11, Including memory 110, network interface 120 and processor 130;Memory 110, network interface 120 and processor 130 pass through bus Realize and be connected with each other.
The memory 110, for store program codes;
The network interface 120, pass through the meeting between the proxy server and the client for receiving client The business datum that words are sent obtains request, and business datum acquisition request is transmitted into real server;Receive described true The first message that real server is sent, first message are used to respond the business datum acquisition request, first message Carry to represent that the real server starts the information of transmission services data;
The processor 130, for reading the program code stored in the memory, perform:
At least two second messages are sent to the client by the network interface 120 successively, to the client Described information is sent, each message at least two second message carries the fragment of described information, and described at least two The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in second message;
When the network interface 120 has sent described information, in the ageing time of the session, pass through the session The first business datum is sent to the client.
Alternatively, it is described before the processor 130 sends the first business datum by the session to the client Network interface is additionally operable to receive the second business datum that the real server is sent;
The processor 130, it is additionally operable to handle the second business datum that the real server is sent, obtains described first Business datum;
The processor 130 by the network interface 120 to the client send described information when, be specifically used for:
If the processor 130 has not yet sent institute when having handled the second business datum that the real server is sent Information is stated, generates a message for carrying all fragments not sent in described information, and will by the network interface 120 The message of generation is sent to the client.
Alternatively, the processor 130 by the network interface 120 to the client send described information when, tool Body is used for:
Pass through at least one report of the network interface 120 into client transmission at least two second message Text;
Report to be sent at least two second message is sent to the client by the network interface 120 Text, the time interval of the message to be sent and the previous message sent of transmission is sent according to predefined parameter and described The quantity of message to be sent determines at least two second messages, and the predefined parameter includes following at least one:The generation Manage the transmission bandwidth of the session between server and the real server, the processor handles the 130 second business numbers According to progress.
Alternatively, the processor 130 handles the second business datum that the real server is sent, and obtains described first During business datum, it is specifically used for:
Determine whether second business datum includes abnormal data;
If it is determined that second business datum does not include abnormal data, then using second business datum as described first Business datum;And if it is determined that second business datum includes abnormal data, then by from second business datum Except the abnormal data obtains first business datum.
Alternatively, if the proxy server is the mail proxy server based on POP3 agreements, the business datum It is that the mail for carrying mail piece identifiers obtains request to obtain request;
Before the network interface 120 receives the business datum acquisition request, it is additionally operable to send the client Mail tabulation obtains request and is transmitted to the real server;Obtaining the real server response mail tabulation acquisition please Seek the mail tabulation of return;
The processor 130, it is additionally operable to the screening from the mail tabulation and obtains super large mail tabulation and preserve, it is described super Big mail tabulation includes mail piece identifiers and corresponding mail size, and the mail size that the super large mail tabulation includes exceedes pre- Determine size;
The processor 130 by the network interface 120 to the client send described information when, be specifically used for:
Judge whether the mail piece identifiers for asking to carry are obtained comprising the business datum in the super large mail tabulation;
If it is determined that the postal mark of request carrying is obtained in the super large mail tabulation comprising the business datum, then according to institute State business datum described in super large mail tabulation and obtain mail size corresponding to the mail piece identifiers that request carries, calculating second is sent Time interval, second transmission time interval are directly proportional to mail size;
The network interface 120 sends at least two second message one by one according to second transmission time interval In each message, second transmission time interval be less than the client the conversation aging time.
Proxy server provided in an embodiment of the present invention and other network equipments, such as client, real server are detailed Thin interaction, and detailed process refer to the description of previous methods embodiment, be not repeated herein.
The embodiment of the present invention additionally provides a kind of network system, and the network system includes client, real server and attached Proxy server shown in Figure 11, the deployment schematic diagram of the network system is as shown in Figure 1.
The embodiments of the invention provide a kind of proxy server, the proxy server is receiving real server transmission After the first message for carrying to represent the information that the real server starts transmission services data, by by the information point Described information is sent to client by cloth in multiple second messages, wherein order of transmission at least two second message The transmission time interval of two adjacent messages is less than the ageing time of the session.Described in having been sent when the proxy server During information, in the ageing time of the session, the proxy server is handled by the session to the client transmission The first business datum afterwards.In other words, proxy server is by cutting above- mentioned information, and by carrying the fragment of above- mentioned information The second message realize session keepalive, rather than keep Alive Packet is reconfigured, so as to avoiding prior art client from receiving After to above- mentioned information, receive proxy server transmission the first business datum before, can also receive multiple by agency service Device construction carrying " X-KeepAlive r asking of unreasonably being distorted of business datum after restructuring caused by n " keep Alive Packets Topic.
It will be recognized by those of ordinary skill in the art that the possibility implementation of various aspects of the invention or various aspects System, method or computer program product can be embodied as.Therefore, each aspect of the present invention or various aspects Possible implementation can use complete hardware embodiment, complete software embodiment (including firmware, resident software etc.), or The form of the embodiment of integration software and hardware aspect, collectively referred to herein as " circuit ", " module " or " system ".In addition, The possibility implementation of each aspect of the present invention or various aspects can use the form of computer program product, computer journey Sequence product refers to be stored in the computer readable program code in computer-readable medium.
Computer-readable medium can be computer-readable signal media or computer-readable recording medium.Computer can Read storage medium including but not limited to electronics, magnetic, optics, electromagnetism, infrared or semiconductor system, equipment either device or Foregoing is any appropriately combined, such as random access memory (RAM), read-only storage (ROM), the read-only storage of erasable programmable Device (EPROM or flash memory), optical fiber, portable read-only storage (CD-ROM).
Processor in computer reads the computer readable program code being stored in computer-readable medium so that place Reason device is able to carry out function action specified in the combination of each step or each step in flow charts;Generation is implemented in block diagram Each piece or each piece of combination specified in function action device.
Computer readable program code can be performed completely on the local computer of user, partly counted in the local of user On calculation machine perform, as single software kit, partly on the local computer of user and part on the remote computer, or Person performs on remote computer or server completely.It is also noted that in some alternate embodiments, in flow charts Each piece of function of indicating may not be occurred by the order indicated in figure in each step or block diagram.For example, dependent on involved Function, two steps or two blocks shown in succession may be actually executed substantially concurrently, or these blocks sometimes may Performed with reverse order.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (20)

  1. A kind of 1. session keep-alive method, it is characterised in that including:
    Proxy server receives the business number that client is sent by the session between the proxy server and the client Asked according to obtaining, and business datum acquisition request is transmitted to real server;
    The proxy server receives the first message that the real server is sent, and first message is used to respond the industry Business data acquisition request, first message are carried to represent that the real server starts the information of transmission services data;
    The proxy server sends institute by sending at least two second messages to the client successively, to the client State information, each message at least two second message carries the fragment of described information, at least two second report The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in text;
    The proxy server receives the second business datum that the real server is sent after first message;
    The proxy server has handled second business datum, so as to obtain the first business datum;
    When the proxy server has sent described information, in the ageing time of the session, the proxy server leads to Cross the session and send first business datum to the client.
  2. 2. the method as described in claim 1, it is characterised in that order of transmission is adjacent at least two second message two Position of the fragment that individual message carries respectively in described information is adjacent.
  3. 3. method as claimed in claim 1 or 2, it is characterised in that the proxy server passes through successively to the client At least two second messages are sent, described information is sent to the client, including:
    If the proxy server has not yet sent described information when having handled second business datum, a carrying is generated There is the message of all fragments not sent in described information,
    And the message of generation is sent to the client.
  4. 4. method as claimed in claim 1 or 2, it is characterised in that the proxy server passes through successively to the client At least two second messages are sent, described information is sent to the client, including:
    At least one message at least two second message is sent to the client;
    Message to be sent at least two second message is sent to the client, send the message to be sent with The time interval of the previous message sent is sent according to be sent in predefined parameter and at least two second message The quantity of message determine that the predefined parameter includes following at least one:The proxy server and the real server Between the transmission bandwidth of session, the progress of proxy server processing second business datum.
  5. 5. method as claimed in claim 3, it is characterised in that the proxy server to the client by sending successively At least two second messages, described information is sent to the client, including:
    At least one message at least two second message is sent to the client;
    Message to be sent at least two second message is sent to the client, send the message to be sent with The time interval of the previous message sent is sent according to be sent in predefined parameter and at least two second message The quantity of message determine that the predefined parameter includes following at least one:The proxy server and the real server Between the transmission bandwidth of session, the progress of proxy server processing second business datum.
  6. 6. method as claimed in claim 3, it is characterised in that second business for having handled the real server and having sent Data, so as to obtain first business datum, including:
    Determine whether second business datum includes abnormal data;
    If it is determined that second business datum does not include abnormal data, then using second business datum as first business Data;
    If it is determined that the business datum includes abnormal data, then by removing the abnormal data from second business datum Obtain first business datum.
  7. 7. method as claimed in claim 1 or 2, it is characterised in that the proxy server includes being based on pop3 post office protocol version 3 POP3 POP3 mail proxy server, the mail proxy server based on the 4th edition IMAP4 of interactive message access protocol and it is based on HTTP HTTP Web proxy.
  8. 8. method as claimed in claim 7, it is characterised in that if the proxy server is the mail generation based on POP3 agreements Server is managed, then it is that the mail for carrying mail piece identifiers obtains request that the business datum, which obtains request,;
    Before the proxy server receives the business datum acquisition request, methods described also includes:
    The mail tabulation that the client is sent is obtained request and is transmitted to the real server by the proxy server;
    Obtain the real server and respond the mail tabulation that the mail tabulation obtains request return;
    From the mail tabulation screening obtain super large mail tabulation and preserve, the super large mail tabulation include mail piece identifiers with And corresponding mail size, the mail size that the super large mail tabulation includes exceed predefined size;
    The proxy server sends described information to the client, including:
    The proxy server judges whether obtain the postal of request carrying in the super large mail tabulation comprising the business datum Part identifies;
    If it is determined that the mail piece identifiers of request carrying are obtained in the super large mail tabulation comprising the business datum, then according to Business datum described in super large mail tabulation obtains mail size corresponding to the mail piece identifiers that request carries, when calculating the second transmission Between be spaced, second transmission time interval is directly proportional to mail size;
    According to second transmission time interval, each message at least two second message is sent one by one, described Two transmission time intervals are less than the conversation aging time of the client.
  9. 9. method as claimed in claim 1 or 2, it is characterised in that the size of each fragment of described information is 1 byte.
  10. A kind of 10. proxy server, it is characterised in that including:
    Receiving module, the business sent for receiving client by the session between the proxy server and the client Data acquisition request;
    Sending module, the business datum for the receiving module to be received obtain request and are transmitted to real server;
    The receiving module, it is additionally operable to receive the first message that the real server is sent, first message is used to respond The business datum that the sending module is sent obtains request, and first message is carried to represent the real server Start the information of transmission services data;
    The receiving module, it is additionally operable to receive the second business number that the real server is sent after first message According to;
    Processing module, second business datum received for having handled the receiving module, so as to obtain the first business number According to;
    The sending module, it is additionally operable to by sending at least two second messages to the client successively, to the client Described information is sent, each message at least two second message carries the fragment of described information, and described at least two The transmission time interval of two adjacent messages of order of transmission is less than the ageing time of the session in second message;Sending During described information, in the ageing time of the session, the proxy server is sent by the session to the client First business datum.
  11. 11. proxy server as claimed in claim 10, it is characterised in that
    When the sending module is to client transmission described information, if handled specifically for the processing module described Described information has not yet been sent during the second business datum, has generated a report for carrying all fragments not sent in described information Text;The message of generation is sent to the client.
  12. 12. the proxy server as described in claim 10 or 11, it is characterised in that
    When the sending module is to client transmission described information, specifically at least two described in client transmission At least one message in individual second message;
    Message to be sent at least two second message is sent to the client, send the message to be sent with The time interval of the previous message sent is sent according to be sent in predefined parameter and at least two second message The quantity of message determine that the predefined parameter includes following at least one:The proxy server and the real server Between the transmission bandwidth of session, the progress of proxy module processing second business datum.
  13. 13. proxy server as claimed in claim 11, it is characterised in that the processing module specifically includes:
    Judging unit, for determining whether second business datum includes abnormal data;
    Determining unit, if determining that second business datum does not include abnormal data for the judging unit, by described Two business datums are as first business datum;And if the judging unit determines that second business datum includes exception Data, then obtain first business datum by removing the abnormal data from second business datum.
  14. 14. the proxy server as described in claim 10 or 11, it is characterised in that if the proxy server is based on post office The mail proxy server of the 3rd edition POP3 agreement of agreement, then it is to carry the postal of mail piece identifiers that the business datum, which obtains request, Part obtains request;The proxy server also includes screening module;
    The receiving module, it is additionally operable to before receiving the business datum and obtaining request, receives the postal that the client is sent Part list obtains request;
    The sending module, it is additionally operable to the mail tabulation acquisition request that the receiving module receives being transmitted to the real service Device;
    The receiving module, it is additionally operable to obtain the mail row that the real server responds the mail tabulation acquisition request return Table;
    The screening module, super large mail tabulation is obtained simultaneously for screening in the mail tabulation that is received from the receiving module Preserve, the super large mail tabulation includes mail piece identifiers and corresponding mail size, the postal that the super large mail tabulation includes Part size exceedes predefined size;
    When the sending module is to client transmission described information, it is specifically used for:Judge the institute that the screening module obtains State the mail piece identifiers for whether obtaining request carrying in super large mail tabulation comprising the business datum;If it is determined that the super large mail The mail piece identifiers of request carrying are obtained in list comprising the business datum, then the business according to the super large mail tabulation Data acquisition request carry mail piece identifiers corresponding to mail size, calculate the second transmission time interval, it is described second send when Between interval it is directly proportional to mail size;According to second transmission time interval, at least two second message is sent one by one In each message, second transmission time interval be less than the client the conversation aging time.
  15. A kind of 15. proxy server, it is characterised in that including memory, network interface and processor;
    The memory, for store program codes;
    The network interface, pass through the session transmission between the proxy server and the client for receiving client Business datum obtains request, and business datum acquisition request is transmitted into real server;Receive the real server The first message sent, first message are used to responding the business datum and obtain request, first message carry to Represent that the real server starts the information of transmission services data;The real server is received after first message The second business datum sent;
    The processor, for reading the program code stored in the memory, perform:
    At least two second messages are sent to the client by the network interface successively, to described in client transmission Information, each message at least two second message carry the fragment of described information, at least two second message The transmission time interval of two adjacent messages of middle order of transmission is less than the ageing time of the session;
    Second business datum is handled, so as to obtain the first business datum;
    When the network interface has sent described information, in the ageing time of the session, by the session to described Client sends first business datum.
  16. 16. proxy server as claimed in claim 15, it is characterised in that the processor is by the network interface to institute When stating client transmission described information, it is specifically used for:
    If the processor has not yet sent described information when having handled second business datum, generate one and carry The message of all fragments not sent in information is stated,
    And the message of generation is sent to by the client by the network interface.
  17. 17. the proxy server as described in claim 15 or 16, it is characterised in that
    The processor by the network interface to the client send described information when, be specifically used for:
    Pass through at least one message of the network interface into client transmission at least two second message;
    Message to be sent at least two second message is sent to the client by the network interface, sends institute Message to be sent is stated with sending the time interval of the previous message sent according to predefined parameter and described at least two The quantity of message to be sent determines in second message, and the predefined parameter includes following at least one:The proxy server The progress of the transmission bandwidth of session between the real server, processor processing second business datum.
  18. 18. proxy server as claimed in claim 16, it is characterised in that
    The processor is specifically used for:
    Determine whether second business datum includes abnormal data;
    If it is determined that second business datum does not include abnormal data, then using second business datum as first business Data;And if it is determined that second business datum includes abnormal data, then by removing institute from second business datum State abnormal data and obtain first business datum.
  19. 19. the proxy server as described in claim 15 or 16, it is characterised in that
    If the proxy server is the mail proxy server based on pop3 post office protocol version 3 POP3 POP3 agreements, the business number It is that the mail for carrying mail piece identifiers obtains request according to request is obtained;
    Before the network interface receives the business datum acquisition request, the mail tabulation for sending the client is additionally operable to Obtain request and be transmitted to the real server;Obtain the real server and respond what the mail tabulation acquisition request returned Mail tabulation;
    The processor, it is additionally operable to the screening from the mail tabulation and obtains super large mail tabulation and preserve, the super large mail List includes mail piece identifiers and corresponding mail size, and the mail size that the super large mail tabulation includes exceedes predetermined big It is small;
    The processor by the network interface to the client send described information when, be specifically used for:
    Judge whether the mail piece identifiers for asking to carry are obtained comprising the business datum in the super large mail tabulation;
    If it is determined that the postal mark of request carrying is obtained in the super large mail tabulation comprising the business datum, then according to described super Business datum obtains mail size corresponding to the mail piece identifiers that request carries described in big mail tabulation, and calculating second sends the time Interval, second transmission time interval are directly proportional to mail size;
    The network interface is sent each at least two second message one by one according to second transmission time interval Message, second transmission time interval are less than the conversation aging time of the client.
  20. 20. a kind of network system, it is characterised in that including client, real server and as claim 15 to 19 is any Described proxy server.
CN201310723732.9A 2013-12-24 2013-12-24 Session keep-alive method and equipment Active CN104734939B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310723732.9A CN104734939B (en) 2013-12-24 2013-12-24 Session keep-alive method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310723732.9A CN104734939B (en) 2013-12-24 2013-12-24 Session keep-alive method and equipment

Publications (2)

Publication Number Publication Date
CN104734939A CN104734939A (en) 2015-06-24
CN104734939B true CN104734939B (en) 2017-11-24

Family

ID=53458390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310723732.9A Active CN104734939B (en) 2013-12-24 2013-12-24 Session keep-alive method and equipment

Country Status (1)

Country Link
CN (1) CN104734939B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909446B (en) * 2015-12-23 2020-06-23 阿里巴巴集团控股有限公司 Keep-alive method and device for application program
CN111163160A (en) * 2019-12-27 2020-05-15 杭州迪普科技股份有限公司 Keep-alive method and system for session table entry
CN111338585B (en) * 2020-02-21 2023-08-29 深圳创维-Rgb电子有限公司 Television, data printing method, control device and readable storage medium
WO2023122972A1 (en) * 2021-12-28 2023-07-06 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for keep session alive in communication network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004049673A1 (en) * 2002-11-25 2004-06-10 Nokia Corporation Method and system for session management wherein a client session identifier is used
CN101299689A (en) * 2008-06-19 2008-11-05 北京立通无限科技有限公司 On-line detection method as well as mail server
CN101753597A (en) * 2008-12-09 2010-06-23 华为技术有限公司 Keeping alive method between peer node and client under peer node-client architecture
CN101778059A (en) * 2010-02-09 2010-07-14 成都市华为赛门铁克科技有限公司 Mail processing method, gateway equipment and network system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004049673A1 (en) * 2002-11-25 2004-06-10 Nokia Corporation Method and system for session management wherein a client session identifier is used
CN101299689A (en) * 2008-06-19 2008-11-05 北京立通无限科技有限公司 On-line detection method as well as mail server
CN101753597A (en) * 2008-12-09 2010-06-23 华为技术有限公司 Keeping alive method between peer node and client under peer node-client architecture
CN101778059A (en) * 2010-02-09 2010-07-14 成都市华为赛门铁克科技有限公司 Mail processing method, gateway equipment and network system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Energy Consumption of Always-On Applications in WCDMA Networks;Henry Haverinen 等;《 Vehicular Technology Conference》;20070425;全文 *

Also Published As

Publication number Publication date
CN104734939A (en) 2015-06-24

Similar Documents

Publication Publication Date Title
Wang et al. How speedy is {SPDY}?
CN106815112B (en) Massive data monitoring system and method based on deep packet inspection
CN102075561B (en) Method, device and system for downloading network resources
CN107404465A (en) Network data analysis method and server
CN102655481B (en) A kind of instant messaging chat content inspection method based on webpage and system
JP5487322B2 (en) Random data stream sampling
CN104734939B (en) Session keep-alive method and equipment
CA2469169A1 (en) Method and apparatus for determination of network topology
CN102739684B (en) Portal authentication method based on virtual IP address, and server thereof
CN109039775A (en) Quality of service monitoring method, apparatus and system
CN107465666A (en) A kind of client ip acquisition methods and device
CN103795762A (en) Reverse agent test system and method
CN108156038A (en) Ask distribution method, device, access gateway and storage medium
CN108390955A (en) Domain Name acquisition method, Website access method and server
US10298508B2 (en) Communication system, receiving-side apparatus and transmission-side apparatus
JP2005184792A (en) Band control device, band control method, and program
CN108512816B (en) Traffic hijacking detection method and device
CN102404345A (en) Distributed attack prevention method and device
CN106713242B (en) Data request processing method and processing device
CN102754488A (en) User access control method, apparatus and system
TWI294087B (en) Systems and methods for file transfer management
Morton Round-trip packet loss metrics
Bateman et al. TCP testing: How well does ns2 match reality?
Van Staden et al. Adding digital forensic readiness to electronic communication using a security monitoring tool
CN114124555A (en) Message playback method and device, electronic equipment and computer readable medium

Legal Events

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