CN106972977A - The long connection maintaining method of one kind and device - Google Patents

The long connection maintaining method of one kind and device Download PDF

Info

Publication number
CN106972977A
CN106972977A CN201710374187.5A CN201710374187A CN106972977A CN 106972977 A CN106972977 A CN 106972977A CN 201710374187 A CN201710374187 A CN 201710374187A CN 106972977 A CN106972977 A CN 106972977A
Authority
CN
China
Prior art keywords
client
type
network
long connection
service end
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710374187.5A
Other languages
Chinese (zh)
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.)
Beijing Panda Mutual Entertainment Technology Co Ltd
Original Assignee
Beijing Panda Mutual Entertainment Technology 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 Beijing Panda Mutual Entertainment Technology Co Ltd filed Critical Beijing Panda Mutual Entertainment Technology Co Ltd
Priority to CN201710374187.5A priority Critical patent/CN106972977A/en
Publication of CN106972977A publication Critical patent/CN106972977A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the present invention provides a kind of long connection maintaining method and device, is related to Internet technical field.Wherein, methods described includes:Obtain the attribute information for the client that long connection communication is set up with service end;It is the long connection maintenance strategy of client configuration according to the attribute information;Safeguard that the client is connected with the length of the service end according to the long maintenance strategy that connects.The embodiment of the present invention can be while effective maintenance long connection, it is to avoid produce the consumption of some unnecessary electric energy and Internet resources.

Description

The long connection maintaining method of one kind and device
Technical field
The present invention relates to Internet technical field, more particularly to a kind of long connection maintaining method and device.
Background technology
At present, most of application programs of in the market are built upon in the long Connection Services of TCP, and the connection of TCP length can have Effect reduces the number of times for setting up TCP connections, it also avoid the network delay caused by frequently setting up connection, improves server response The speed of client.
In the prior art, need to maintain to grow connection by sending heartbeat packet between service end and client, in order to ensure Long connection is not cut off by Virtual network operator, can unify to set heartbeat packet transmission time interval one shorter.And continually send Heartbeat packet, not only can significantly consume electric energy, can also significantly consumption of network resources.Accordingly, it would be desirable to rationally set heartbeat Bag sends the time cycle, could it is effective safeguard long connection while avoid producing some unnecessary electric energy and Internet resources Consumption.
The content of the invention
The present invention provides a kind of long connection maintaining method and device, it is therefore intended that can safeguard the same of long connection effective When, it is to avoid produce the consumption of some unnecessary electric energy and Internet resources.
In order to solve the above-mentioned technical problem, the present invention provides a kind of long connection maintaining method, including:
Obtain the attribute information for the client that long connection communication is set up with service end;
It is the long connection maintenance strategy of client configuration according to the attribute information;
Safeguard that the client is connected with the length of the service end according to the long maintenance strategy that connects.
Alternatively, the attribute information includes:Terminal type, operator's informaiton and the visitor that network service is provided for client The network type at family end.
Alternatively, it is the long connection maintenance strategy of client configuration according to the attribute information, including:
According to the terminal type and/or the network type, judge to safeguard type belonging to the client;
According to the operator's informaiton, the network type and it is described safeguard type, be that the client configures the length Connect maintenance strategy.
Alternatively, it is described according to the terminal type and/or the network type, judge the affiliated maintenance class of client Type, including:
If the terminal type is mobile terminal style and/or the network type is mobile network's type, institute is judged State and safeguard that type is keepalive type belonging to client;
If the terminal type is immobile terminal type and the network type is non-moving network type, institute is judged State and safeguard type belonging to client to visit type living.
Alternatively, according to the operator's informaiton, the network type and it is described safeguard type, be client configuration The long connection maintenance strategy, including:
According to the operator's informaiton and the network type, it is determined that sending the maximum time interval of heartbeat packet;
Type is safeguarded according to described, is that the client configuration is corresponding in the range of maximum time interval restriction Maintenance time interval;
Wherein, it is the long connection maintenance strategy to send heartbeat message to other side according to the maintenance time interval.
Alternatively, the attribute information of the client of long connection communication is set up in the acquisition with service end, including:
From record information, search the client and asking to set up when the length is connected with the service end to be recorded in The attribute information of the client in the record information.
Alternatively, safeguard that the client is connected with the length of the service end according to the long maintenance strategy that connects, including:
When the client is connected the free time with the length of the service end, the client or the service end are according to described Long connection maintenance strategy sends heartbeat packet to other side.
In order to solve the above-mentioned technical problem, the present invention provides a kind of long connection attending device, including:
Acquisition module, the attribute information for obtaining the client that long connection communication is set up with service end;
Configuration module, for according to the attribute information, being the long connection maintenance strategy of client configuration;
Maintenance module, for safeguarding that the client connects with the long of the service end according to the long maintenance strategy that connects Connect.
In embodiments of the present invention, it is not for all when safeguarding the long connection between client and service end Client can configure corresponding long connection dimension using consistent long connection maintenance strategy according to the attribute information of client Shield strategy, be that is to say, different long connection maintenance strategies, this differentiation are configured for the client with different attribute information Allocation plan more conform to actual conditions, also more rationally, effectively prevent and connect for the long of all clients configuration consistency Connecing the unreasonable of maintenance strategy causes the unnecessary consumption of electric energy and Internet resources.
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 accompanying drawing used required 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.
The schematic flow sheet for the long connection maintaining method that Fig. 1 provides for one embodiment of the invention;
The schematic flow sheet for the long connection maintaining method that Fig. 2 provides for further embodiment of this invention;
The structural representation for the long connection attending device that Fig. 3 provides for one embodiment of the invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
The term used in embodiments of the present invention is the purpose only merely for description specific embodiment, and is not intended to be limiting The present invention." one kind ", " described " and "the" of singulative used in the embodiment of the present invention and appended claims It is also intended to including most forms, unless context clearly shows that other implications, " a variety of " generally comprise at least two, but not Exclude and include at least one situation.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, represent There may be three kinds of relations, for example, A and/or B, can be represented:Individualism A, while there is A and B, individualism B these three Situation.In addition, character "/" herein, it is a kind of relation of "or" to typically represent forward-backward correlation object.
It will be appreciated that though XXX may be described using term first, second, third, etc. in embodiments of the present invention, but These XXX should not necessarily be limited by these terms.These terms are only used for XXX being distinguished from each other out.For example, not departing from implementation of the present invention In the case of example scope, the first XXX can also be referred to as the 2nd XXX, similarly, and the 2nd XXX can also be referred to as the first XXX.
Depending on linguistic context, word as used in this " if ", " if " can be construed to " ... when " or " when ... " or " in response to determining " or " in response to monitoring ".Similarly, depending on linguistic context, phrase " if it is determined that " or " such as Fruit monitoring (condition or event of statement) " can be construed to " when it is determined that when " or " in response to determine " or " when monitoring (statement Condition or event) when " or " in response to monitoring (condition or event of statement) ".
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability Comprising, so that commodity or system including a series of key elements not only include those key elements, but also including without clear and definite Other key elements listed, or also include for this commodity or the intrinsic key element of system.In the feelings of not more limitations Under condition, the key element limited by sentence "including a ...", it is not excluded that in the commodity or system including the key element also There is other identical element.
The schematic flow sheet for the long connection maintaining method that Fig. 1 provides for one embodiment of the invention.As shown in figure 1, this method Including:
101st, the attribute information for the client that long connection communication is set up with service end is obtained.
102nd, it is the long connection maintenance strategy of client configuration according to the attribute information.
103rd, safeguard that the client is connected with the length of the service end according to the long maintenance strategy that connects.
In above-mentioned steps 101, the client refers to the application APP installed on user terminal (Application, using), for example:Instant messaging APP, browser APP, online live APP etc..Client can be by clothes Business end sends the long solicited message connected of a foundation and service end is set up length and is connected, and the long specific implementation connected of foundation is such as Under, in response to the operation of the relevant foundation length connection for the client, a request for setting up long connection is sent to service end Information;Receive the response message that service end is returned in response to the solicited message.Client receives the response message of service end Indicate that the length connection between client and service end is successfully established.In actual applications, when user is intended to realize by client Online chatting, online browse webpage or during audio frequency and video are live in real time send or receive the functions such as barrage information when, all Need to set up long connection with corresponding server.For example, user is intended to watch live in a certain direct broadcasting room by online live APP While video, by sending barrage and main broadcaster or other participate in users and carry out real-time interactive, the online live APP be accomplished by with Barrage server sets up long connection, to send barrage information in real time and receive other barrage information for participating in user.
The step of attribute information for the client that the acquisition sets up long connection communication with service end, can be in the following manner In one or more realize:
Method one, send and set up in the solicited message of long connection to service end in client, the client in carrying Attribute information, service end is after the solicited message is received, in the local database by the client in the solicited message End attribute information is recorded.So, when needing to obtain the client terminal attribute information to configure long connection maintenance strategy, i.e., It can search the client from the record information of service end local data base and set up the length even in request and the service end The attribute information for the client being recorded in when connecing in the record information.
Method two, when long connection maintenance strategy is configured when needing to obtain the client terminal attribute information, service end can be to Client sends a solicited message for obtaining attribute information;Solicited message described in client end response, by client terminal attribute information Reach the service end.
In above-mentioned steps 102, according to the attribute information, for the corresponding length of the client of attribute information configuration Connect maintenance strategy.
Wherein, the attribute information of the client includes:Terminal type, operator's letter that network service is provided for client The network type of breath and client.Terminal type includes mobile terminal style and immobile terminal type, as its name suggests, mobile whole End refers to the information processor being convenient for carrying, and such as smart mobile phone, tablet personal computer, immobile terminal refers to seldom moving Dynamic information processor, such as desktop computer, notebook computer, intelligent television.The fortune of network service is provided for client Seeking business's information includes operator name.The network type of client has:Mobile network's type, such as 4G, 3G, 2G, and it is non-moving Network type, for example:Cable network, wifi.
Because power consumption is compared in the transmitting-receiving operation of heartbeat packet, flow is consumed.For mobile type terminal, its battery capacity has Limit, therefore, when configuring long connection maintenance strategy for such terminal, it is necessary to which the time interval for sending heartbeat packet is set It is longer;And for those non-moving type terminals, because they are typically all to be realized indoors by plug-in source Operation, therefore, there is no need to excessively consider power consumption problem, can be in connection maintenance strategy long for the configuration of such terminal, will It is more shorter that the time interval of transmission heartbeat packet is set, and is so conducive to client or service end to grasp the shape of other side in time State.
Certainly, while terminal type is considered, it is also contemplated that to network type and network operator information.Example Such as, it is that the long connection of mobile type terminal configuration is safeguarded therefore under mobile network's type, it is necessary to consider flow consumption problem The time interval that heartbeat packet is sent in strategy is longer than what is set under non-moving network type, so, sends heartbeat packet Frequency can be lower, also just reduce the consumption of flow.In another example, in the long connection maintenance strategy of configuration, send heartbeat packet Time interval can not be more than the most long duration that Virtual network operator set in idle condition for long connection (Virtual network operator exists It was found that when a certain long time of the connection in idle condition exceedes most long duration, then length connection can be disconnected).
In above-mentioned steps 103, after corresponding long connection maintenance strategy is configured for client, service end can be according to The long connection maintenance strategy actively sends heartbeat packet to client, and client is after the heartbeat packet is received, to service end Send a response bag;Either client actively sends heartbeat packet, service end according to the long connection maintenance strategy to service end After the heartbeat packet is received, a response bag is sent to client.
In embodiments of the present invention, it is not for all when safeguarding the long connection between client and service end Client can configure corresponding long connection dimension using consistent long connection maintenance strategy according to the attribute information of client Shield strategy, be that is to say, different long connection maintenance strategies, this differentiation are configured for the client with different attribute information Allocation plan more conform to actual conditions, also more rationally, effectively prevent and connect for the long of all clients configuration consistency Connecing the unreasonable of maintenance strategy causes the unnecessary consumption of electric energy and Internet resources.
The schematic flow sheet for the long connection maintaining method that Fig. 2 provides for further embodiment of this invention.As shown in Fig. 2 the party Method includes:
201st, the attribute information for the client that long connection communication is set up with service end is obtained, wherein, the attribute information bag Include:The network type of terminal type, the operator's informaiton that network service is provided for client and client.
202nd, according to the terminal type and/or the network type, judge to safeguard type belonging to the client.
203rd, according to the operator's informaiton, the network type and it is described safeguard type, be client configuration institute State long connection maintenance strategy.
204th, safeguard that the client is connected with the length of the service end according to the long maintenance strategy that connects.
Above-mentioned steps 201, reference can be made to the description of above-described embodiment, here is omitted.
In actual applications, once Virtual network operator finds that a certain long time of the connection in idle condition exceedes setting Most long duration, will disconnect length connection.Like this, when client ask again access service end when, it is necessary to again with clothes Being engaged in, end foundation is long to be connected, and it is to need certain time to set up long connection, and this will necessarily increase the network total time-consuming in request process, Reduce the speed of service end processing request.Accordingly, it would be desirable to before Virtual network operator disconnects length connection, client/server A heartbeat packet is sent to other side to ensure length connection not by operator to disconnection.
It is described to safeguard that type includes keepalive type and visits type living in above-mentioned steps 202." keep-alive " refers to transporting in network Business is sought for long connection in the most long duration that idle condition is set, server or client send a heartbeat packet to other side, Do not disconnected at one's leisure by Virtual network operator with the long connection ensured between it, therefore, in the client configuration for keepalive type During long connection maintenance strategy, the time interval for sending heartbeat packet can be configured to the most long duration set close to Virtual network operator, But it is necessarily less than the most long duration." visit and live " refers to client or service end by sending heartbeat packet to other side with timely Partner state is solved, in order to recognize partner state in time, long connection maintenance strategy is being configured to visit the client of type living When, can the time interval that send heartbeat packet be set more short better.
In a kind of achievable scheme, according to the terminal type and/or the network type, the client is judged It is affiliated the step of safeguard type, it may include:If the terminal type is mobile terminal style and/or the network type is mobile Network type, then judge to safeguard type as keepalive type belonging to the client;If the terminal type is immobile terminal class Type and the network type are non-moving network type, then judge to safeguard type belonging to the client to visit type living.Namely It is that the client that the client on mobile terminal is either networked by mobile network is determined as keepalive type, will be non-moving The client networked by non-moving network in terminal is judged to visiting type living.
In above-mentioned steps 203, according to the operator's informaiton, the network type and it is described safeguard type, be the visitor The step of configuration length in family end connects maintenance strategy, specific implementation is as follows, according to the operator's informaiton and the net Network type, it is determined that sending the maximum time interval of heartbeat packet;Type is safeguarded according to described, is limited in the maximum time interval In the range of be that the client configures corresponding maintenance time interval;Wherein, sent according to the maintenance time interval to other side Heartbeat message is the long connection maintenance strategy.
According to the operator's informaiton and the network type, it is determined that the step of sending the maximum time interval of heartbeat packet, Specific implementation is as follows:Obtain the operator and be in the most long of idle condition for the long connection that each network type is set The mapping table of duration and each network type;According to the operator's informaiton and the network type, closed from the correspondence It is in table, to determine long most long duration of the connection in idle condition that the operator sets for the network type;By institute State Virtual network operator and be defined as the transmission for long most long duration of the connection in idle condition that the network type is set The maximum time interval of heartbeat packet.Generally, the most long duration that heterogeneous networks operator sets for long connection in idle condition It is different, therefore, for different Virtual network operators, the maximum time interval of the transmission heartbeat packet is also different.Also, it is same One Virtual network operator be also for long most long duration of the connection in idle condition that different network type is set it is different, because This, for the different network type under consolidated network operator, the maximum time interval of the transmission heartbeat packet is also different.
It is the client configuration in the range of maximum time interval setting if it is keepalive type to safeguard type One longer maintenance time interval;If safeguarding type to visit type living, it is in the range of maximum time interval setting The client configures a shorter maintenance time interval.
For example, customer end A, for the application program on smart mobile phone, the smart mobile phone passes through China Telecom's 4G nets Network networks.For 4G networks, a length of 4min during most long in idle condition of the long connection of China Telecom's setting.Due to the visitor Family end A terminal type is mobile terminal style, and network type is mobile network's type, therefore, can determine that the customer end A It is affiliated safeguard type be keepalive type, and the most long duration set according to China Telecom can determine that send heartbeat packet maximum when Between at intervals of 4min, because the client of keepalive type is on the premise of electricity and flow is saved, it is ensured that long connection will not be by Operator disconnects, therefore, and maintenance time interval can be close to maximum time interval, as long as no more than maximum time interval 4min, example Such as, configuration is in more than 3min.
Customer end B, for the application program on desktop computer, the desktop computer is connected by China Telecom's cable broadband Net.For wired broadband network, a length of 5min during most long in idle condition of the long connection of China Telecom's setting.Due to described The terminal type of customer end B is immobile terminal type, and network type is non-moving network type, therefore, be can determine that described Type is safeguarded belonging to customer end B to visit type living, and the most long duration set according to China Telecom can determine that transmission heartbeat packet Maximum time interval be 5min, because the client for visiting type living is need not to consider the problems such as electricity and flow are consumed, therefore, Maintenance time interval is more short more is able to ensure that service end or client recognize partner state in time, for example, configuration 1min with It is interior.
In above-mentioned steps 204, the client or the service end are sent according to the maintenance time interval to other side Heartbeat message, to safeguard the long connection between service end and client.
Specifically, when the client is connected the free time with the length of the service end, the client or the service end According to the long maintenance strategy that connects to other side's transmission heartbeat packet, i.e., in long connection no data contact, the client or institute State service end and send heartbeat packet to other side according to the maintenance time interval.
In embodiments of the present invention, it is not for all when safeguarding the long connection between client and service end Client can configure corresponding long connection dimension using consistent long connection maintenance strategy according to the attribute information of client Shield strategy, be that is to say, different long connection maintenance strategies, this differentiation are configured for the client with different attribute information Allocation plan more conform to actual conditions, also more rationally, effectively prevent and connect for the long of all clients configuration consistency Connecing the unreasonable of maintenance strategy causes the unnecessary consumption of user terminal electric energy and flow.
The structural representation for the long connection attending device that Fig. 3 provides for one embodiment of the invention.As shown in figure 3, the device Including:Acquisition module 301, configuration module 302 and maintenance module 303:
Acquisition module 301, the attribute information for obtaining the client that long connection communication is set up with service end.
Configuration module 302, for according to the attribute information, being the long connection maintenance strategy of client configuration.
Maintenance module 303, for according to the long length for connecting the maintenance strategy maintenance client and the service end Connection.
Alternatively, the attribute information includes:Terminal type, operator's informaiton and the visitor that network service is provided for client The network type at family end.
Alternatively, the configuration module 302, including:
Identifying unit, for according to the terminal type and/or the network type, judging to safeguard belonging to the client Type.
Dispensing unit, for according to the operator's informaiton, the network type and it is described safeguard type, be the client The end configuration long connection maintenance strategy.
Alternatively, the dispensing unit, including:
Determination subelement, for according to the operator's informaiton and the network type, it is determined that sending the maximum of heartbeat packet Time interval.
Subelement is configured, is described in the range of maximum time interval restriction for safeguarding type according to described Client configures corresponding maintenance time interval;Wherein, it is institute to send heartbeat message to other side according to the maintenance time interval State long connection maintenance strategy.
Alternatively, the acquisition module 301, including:
Searching unit, the length is set up for from record information, searching the client in request and the service end The attribute information for the client being recorded in during connection in the record information.
Alternatively, the maintenance module 303, including:
Transmitting element, for when the client and the service end long is connected the free time, the client or described Service end is according to the long maintenance strategy that connects to other side's transmission heartbeat packet.
Need exist for explanation be:The long connection attending device that the present embodiment is provided can realize above-mentioned each long connection dimension The technical scheme that maintaining method embodiment is provided, concrete implementation principle can be found in the corresponding contents in the various embodiments described above, herein Repeat no more.
In embodiments of the present invention, it is not for all when safeguarding the long connection between client and service end Client can configure corresponding long connection dimension using consistent long connection maintenance strategy according to the attribute information of client Shield strategy, be that is to say, different long connection maintenance strategies, this differentiation are configured for the client with different attribute information Allocation plan more conform to actual conditions, also more rationally, effectively prevent and connect for the long of all clients configuration consistency Connecing the unreasonable of maintenance strategy causes the unnecessary consumption of user terminal electric energy and flow.
Device embodiment described above is only schematical, wherein the unit illustrated as separating component can To be or may not be physically separate, the part shown as unit can be or may not be physics list Member, you can with positioned at a place, or can also be distributed on multiple NEs.It can be selected according to the actual needs In some or all of module realize the purpose of this embodiment scheme.Those of ordinary skill in the art are not paying creativeness Work in the case of, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can Realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Understood based on such, on The part that technical scheme substantially in other words contributes to prior art is stated to embody in the form of software product, should Computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including some fingers Order is to cause a computer equipment (can be personal computer, server, or network equipment etc.) to perform each implementation Method described in some parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although The present invention is described in detail with reference to the foregoing embodiments, it will be understood by those within the art that:It still may be used To be modified to the technical scheme described in foregoing embodiments, or equivalent substitution is carried out to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (14)

1. the long connection maintaining method of one kind, it is characterised in that including:
Obtain the attribute information for the client that long connection communication is set up with service end;
It is the long connection maintenance strategy of client configuration according to the attribute information;
Safeguard that the client is connected with the length of the service end according to the long maintenance strategy that connects.
2. according to the method described in claim 1, it is characterised in that the attribute information includes:Terminal type, carry for client The network type of operator's informaiton and client for network service.
3. method according to claim 2, it is characterised in that according to the attribute information, is the client configuration length Maintenance strategy is connected, including:
According to the terminal type and/or the network type, judge to safeguard type belonging to the client;
According to the operator's informaiton, the network type and it is described safeguard type, be the client configuration long connection Maintenance strategy.
4. method according to claim 3, it is characterised in that according to the terminal type and/or the network type, sentence Type is safeguarded belonging to the fixed client, including:
If the terminal type is mobile terminal style and/or the network type is mobile network's type, the visitor is judged It is keepalive type that type is safeguarded belonging to the end of family;
If the terminal type is immobile terminal type and the network type is non-moving network type, the visitor is judged Type is safeguarded belonging to the end of family to visit type living.
5. method according to claim 3, it is characterised in that according to the operator's informaiton, the network type and institute State and safeguard type, be the client configuration long connection maintenance strategy, including:
According to the operator's informaiton and the network type, it is determined that sending the maximum time interval of heartbeat packet;
Type is safeguarded according to described, being that the client configuration is corresponding in the range of maximum time interval restriction safeguards Time interval;
Wherein, it is the long connection maintenance strategy to send heartbeat message to other side according to the maintenance time interval.
6. method according to any one of claim 1 to 5, it is characterised in that the acquisition sets up long connect with service end The attribute information of the client of letter is connected, including:
From record information, search described in the client sets up with the service end and be recorded in when the length is connected in request The attribute information of the client in record information.
7. method according to any one of claim 1 to 5, it is characterised in that tieed up according to the long maintenance strategy that connects The client is protected to be connected with the length of the service end, including:
When the client is connected the free time with the length of the service end, the client or the service end connect according to the length Connect maintenance strategy and send heartbeat packet to other side.
8. the long connection attending device of one kind, it is characterised in that including:
Acquisition module, the attribute information for obtaining the client that long connection communication is set up with service end;
Configuration module, for according to the attribute information, being the long connection maintenance strategy of client configuration;
Maintenance module, for safeguarding that the client is connected with the length of the service end according to the long maintenance strategy that connects.
9. device according to claim 8, it is characterised in that the attribute information includes:Terminal type, carry for client The network type of operator's informaiton and client for network service.
10. device according to claim 9, it is characterised in that the configuration module, including:
Identifying unit, for according to the terminal type and/or the network type, judging the affiliated maintenance class of client Type;
Dispensing unit, for according to the operator's informaiton, the network type and it is described safeguard type, be that the client is matched somebody with somebody Put the long connection maintenance strategy.
11. device according to claim 10, it is characterised in that the identifying unit, is additionally operable to:
If the terminal type is mobile terminal style and/or the network type is mobile network's type, the visitor is judged It is keepalive type that type is safeguarded belonging to the end of family;
If the terminal type is immobile terminal type and the network type is non-moving network type, the visitor is judged Type is safeguarded belonging to the end of family to visit type living.
12. device according to claim 10, it is characterised in that the dispensing unit, including:
Determination subelement, for according to the operator's informaiton and the network type, it is determined that sending the maximum time of heartbeat packet Interval;
Subelement is configured, is the client in the range of maximum time interval restriction for safeguarding type according to described The end corresponding maintenance time interval of configuration;Wherein, it is the length to send heartbeat message to other side according to the maintenance time interval Connect maintenance strategy.
13. the device according to any one of claim 8 to 12, it is characterised in that the acquisition module, including:
Searching unit, for from record information, the lookup client to be set up the length with the service end in request and is connected When be recorded in the attribute information of the client in the record information.
14. the device according to any one of claim 8 to 12, it is characterised in that the maintenance module, including:
Transmitting element, for when the client and the service end long is connected the free time, the client or the service End is according to the long maintenance strategy that connects to other side's transmission heartbeat packet.
CN201710374187.5A 2017-05-24 2017-05-24 The long connection maintaining method of one kind and device Pending CN106972977A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710374187.5A CN106972977A (en) 2017-05-24 2017-05-24 The long connection maintaining method of one kind and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710374187.5A CN106972977A (en) 2017-05-24 2017-05-24 The long connection maintaining method of one kind and device

Publications (1)

Publication Number Publication Date
CN106972977A true CN106972977A (en) 2017-07-21

Family

ID=59325726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710374187.5A Pending CN106972977A (en) 2017-05-24 2017-05-24 The long connection maintaining method of one kind and device

Country Status (1)

Country Link
CN (1) CN106972977A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110324677A (en) * 2018-03-30 2019-10-11 武汉斗鱼网络科技有限公司 A kind of barrage server connection method, client and readable storage medium storing program for executing
WO2019200714A1 (en) * 2018-04-17 2019-10-24 平安科技(深圳)有限公司 Server connection method, computer readable storage medium, terminal device, and apparatus
CN111651294A (en) * 2020-05-13 2020-09-11 浙江华创视讯科技有限公司 Node abnormity detection method and device
CN114390453A (en) * 2022-02-09 2022-04-22 福建天泉教育科技有限公司 Message pushing optimization method and terminal
CN114466437A (en) * 2022-01-24 2022-05-10 深圳市睿联技术股份有限公司 Heartbeat keep-alive method, device, equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685241A (en) * 2013-11-26 2014-03-26 中国科学院计算技术研究所 Adaptive heartbeat method and adaptive heartbeat system for maintaining long connection of TCP (transmission control protocol)
CN105577507A (en) * 2014-11-10 2016-05-11 ***通信集团广东有限公司 Heartbeat packet transmission interval adjustment method, device and server
CN106411627A (en) * 2015-07-31 2017-02-15 博雅网络游戏开发(深圳)有限公司 Network connection detection method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685241A (en) * 2013-11-26 2014-03-26 中国科学院计算技术研究所 Adaptive heartbeat method and adaptive heartbeat system for maintaining long connection of TCP (transmission control protocol)
CN105577507A (en) * 2014-11-10 2016-05-11 ***通信集团广东有限公司 Heartbeat packet transmission interval adjustment method, device and server
CN106411627A (en) * 2015-07-31 2017-02-15 博雅网络游戏开发(深圳)有限公司 Network connection detection method and apparatus

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110324677A (en) * 2018-03-30 2019-10-11 武汉斗鱼网络科技有限公司 A kind of barrage server connection method, client and readable storage medium storing program for executing
CN110324677B (en) * 2018-03-30 2021-09-07 武汉斗鱼网络科技有限公司 Bullet screen server connection method, client and readable storage medium
WO2019200714A1 (en) * 2018-04-17 2019-10-24 平安科技(深圳)有限公司 Server connection method, computer readable storage medium, terminal device, and apparatus
CN111651294A (en) * 2020-05-13 2020-09-11 浙江华创视讯科技有限公司 Node abnormity detection method and device
CN114466437A (en) * 2022-01-24 2022-05-10 深圳市睿联技术股份有限公司 Heartbeat keep-alive method, device, equipment and computer readable storage medium
CN114466437B (en) * 2022-01-24 2024-02-20 深圳市睿联技术股份有限公司 Heartbeat keep-alive method, device, equipment and computer readable storage medium
CN114390453A (en) * 2022-02-09 2022-04-22 福建天泉教育科技有限公司 Message pushing optimization method and terminal
CN114390453B (en) * 2022-02-09 2023-09-08 福建天泉教育科技有限公司 Message pushing optimization method and terminal

Similar Documents

Publication Publication Date Title
CN106972977A (en) The long connection maintaining method of one kind and device
CN104935583B (en) A kind of cloud service platform, information processing method and data processing system
CN108093014A (en) A kind of resource monitoring method and device
CN102891877B (en) Realize the Online Processing System and method of terminal applies
CN102754397A (en) Information processing device, and method of processing information upon information processing device
CN104301161B (en) Computational methods, computing device and the communication system of quality of service index
CN101345948A (en) Monitoring mobile phone, mobile phone monitoring system and method for monitoring mobile phone
CN106227780A (en) Automatization's sectional drawing evidence collecting method of a kind of magnanimity webpage and system
CN109246741A (en) Wireless network connecting method for terminal
CN103347084B (en) A kind of more accounts unify interconnected system and correlating method
CN107846457A (en) Load-balancing method, device, storage medium and the system of server cluster
WO2014015787A1 (en) Method, server, and client for pushing and displaying splash screen
CN106101264A (en) Content distributing network daily record method for pushing, device and system
CN107800767A (en) A kind of access response management method, server and computer-readable recording medium
CN106850384A (en) A kind of method and mobile terminal for realizing accessing equipment in LAN
CN105530149A (en) Method and device for providing household appliance control scheme
CN107341028A (en) Update method and device, the storage medium and processor of patch
CN111859127A (en) Subscription method and device of consumption data and storage medium
CN114567600B (en) Traffic management method and related equipment
CN1450756A (en) Method for real time detecting ethernet connected computer on-line state through insertion equipment
CN101594257B (en) System and method for collecting user information
CN103797751B (en) Method and device for querying for user online state
CN101420336A (en) Method for recognizing network telephone flow quantity in network and system thereof
CN103209199B (en) A kind of method and information carrying means of transmission information
CN104483880B (en) A kind of collecting method and data acquisition server

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170721

RJ01 Rejection of invention patent application after publication