CN104135460A - Method for keeping push channel active and push server - Google Patents
Method for keeping push channel active and push server Download PDFInfo
- Publication number
- CN104135460A CN104135460A CN201310161909.0A CN201310161909A CN104135460A CN 104135460 A CN104135460 A CN 104135460A CN 201310161909 A CN201310161909 A CN 201310161909A CN 104135460 A CN104135460 A CN 104135460A
- Authority
- CN
- China
- Prior art keywords
- access
- keepalive period
- heartbeat keepalive
- described client
- client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a method for keeping a push channel active and a push server, relates to the field of communication, and aims to set a heartbeat keep-active period according to the access network configuration of a client. Compared with the prior art in which the heartbeat keep-active period is fixedly set to be smaller than the ageing time of a whole network, the method has the advantages that the heartbeat keep-active period is prolonged, and the consumption of electric quantity and flow of the client is lowered. The method comprises the following steps that: the client transmits a heartbeat keep-active period acquisition request to the push server; and the push server acquires a heartbeat keep-active period corresponding to access network configuration information in the received heartbeat keep-active period acquisition request of the client according to the access network configuration information, and pushes the heartbeat keep-active period to the client. The embodiment of the invention is used for keeping the push channel active.
Description
Technical field
The present invention relates to the communications field, relate in particular to a kind of push channel keepalive method and push server.
Background technology
Popular along with mobile App (Application, application), when App operator can in time run to some notices of user Push (propellings movement), message, excited users is used App more effectively, less unloads App and applies.When using Push technology; need to maintain (the Transmission Control Protocol of TCP between client and server; transmission control protocol) long connection; such as: can maintain TCP (Transmission Control Protocol by the mode of regularly heartbeat keep-alive between client and server; transmission control protocol) long connection, to save electric weight, flow.If user is provided with heartbeat, during long connection of TCP maintaining between client and server, between client and server, will within the regular hour, send the heartbeat of the number of times of user's setting.So-called " heartbeat " is exactly self-defining structure of client timed sending (heartbeat packet or heartbeat frame), allows server know that client is online, to guarantee the validity of the long validity connecting to guarantee to connect.Propelling movement is that server is sent to client by the information of renewal in real time, a kind of technology without client active to server obtaining information.
In the prior art, because be subject to IP (the Internet Protocol of IPv4 (Internet communications protocol the 4th edition), Internet protocol) number of addresses quantitative limitation, the IP address that operator distributes to client is the IP address of operator's Intranet, client is wanted connecting Internet, need to be a NAT (Network Address Translation, network address translation) by the gateway of operator and process,, after processing by NAT, can convert private network IP to public network IP.Process the NAT device of NAT when safeguarding the session that each TCP connects, for each session, be provided with " aging " time, and the ageing time of the NAT device of different operators, zones of different is different, and differ larger.Wherein, in order to guarantee the fail safe of network, fire compartment wall is provided with a life span for each session, can be understood as the threshold value of a time span, this life span is known as ageing time, when two continuous messages of a session arrive the ageing time interval greater than this session of fire compartment wall, fire compartment wall is just deleted this session from session list.
Therefore; in order to guarantee client, in variety of network environments, can normally work; in the prior art; by the shortest ageing time in the whole network NAT device that is less than of heartbeat keepalive period setting; but can cause like this: client is carried out heartbeat keep-alive frequently, increase power consumption, make client stand-by time shorten, increase the expense that client traffic has expended, increased user.
Summary of the invention
Embodiments of the invention provide a kind of push channel keepalive method and push server, have solved the problem that client stand-by time shortens and flow expends.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, provides a kind of push channel keepalive method, and described method comprises:
The heartbeat keepalive period that receives that client sends is obtained request, and the described heartbeat keepalive period request of obtaining comprises the access network configuration information of client;
Corresponding relation according to access network configuration information and heartbeat keepalive period, obtains the heartbeat keepalive period corresponding with the access network configuration information of described client;
To described client, send the heartbeat keepalive period corresponding with the access network configuration information of described client.
In conjunction with first aspect, in the possible implementation of the first, described access network configuration information comprises the access point type of described client and/or the access IP information of described client;
Described according to the corresponding relation of access network configuration information and heartbeat keepalive period, obtain heartbeat keepalive period that access network configuration information with described client is corresponding to comprise:
If the access point type that described access network configuration information is described client, obtains with the corresponding relation of heartbeat keepalive period and obtains the heartbeat keepalive period corresponding with the access point type of described client according to access point type; Or
If the access IP information that described access network configuration information is described client, obtains the heartbeat keepalive period corresponding with the access IP information of described client according to access IP acquisition of information with the corresponding relation of heartbeat keepalive period; Or
If the access point type that described access network configuration information is described client and access IP information, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client, if cannot obtain the heartbeat keepalive period corresponding with the access point type of described client, according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; Or; according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; if cannot obtain the heartbeat keepalive period corresponding with the access IP information of described client, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client.
In conjunction with the possible implementation of the first of first aspect or first aspect, described access point type comprises super joint and WAP (wireless access point); Described WAP (wireless access point) comprises wireless compatible authenticating network WiFi, the 3rd third generation mobile communication network 3G, 2nd generation mobile communications network 2G, long-term evolving network LTE;
Described access IP information comprises access IP address and the subnet mask length of described client.
In conjunction with the possible implementation of the second of first aspect, in the third possible implementation, describedly according to access IP acquisition of information and the corresponding relation of heartbeat keepalive period, obtain heartbeat keepalive period corresponding to access IP information with described client and comprise:
The network number of the IP address that obtains described client according to the access IP address of described client and subnet mask length;
According to the network number of IP address, subnet mask length and the corresponding relation of heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with network number, the subnet mask length of the IP address of described client;
Wherein, corresponding with the network number of the IP address of described client and subnet mask length heartbeat keepalive period is according to the corresponding relation configuration of heartbeat keepalive period and network address translation apparatus ageing time.
In conjunction with the third possible implementation of first aspect, in the 4th kind of possible implementation, the corresponding relation of described heartbeat keepalive period and network address translation apparatus ageing time comprises:
T
h=Max (kT
n, T
n-T), wherein, T
hfor described heartbeat keepalive period, T
nfor described network address translation apparatus ageing time, k is coefficient, and T is and T
nthe time constant that unit is identical.
In conjunction with the 4th kind of possible implementation of first aspect, the 5th kind of possible implementation kind, if cannot obtain the heartbeat keepalive period corresponding with the access network configuration information of described client, described method also comprises:
To described client, send default heartbeat keepalive period.
Second aspect, provides a kind of push server, and described server comprises:
Request reception unit, obtains request for the heartbeat keepalive period that receives that client sends, and the described heartbeat keepalive period request of obtaining comprises the access network configuration information of client, and the access network configuration information of described client is sent to cycle dispensing unit;
Cycle dispensing unit, for according to the corresponding relation of access network configuration information and heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with the access network configuration information of described client, and heartbeat keepalive period corresponding to the access network configuration information with described client is sent to push unit;
Push unit, heartbeat keepalive period corresponding to the access network configuration information with described client sending for receiving described cycle dispensing unit, and send the heartbeat keepalive period corresponding with the access network configuration information of described client to described client.
In conjunction with second aspect, in the possible implementation of the first, the access network configuration information of the described client receiving comprises the access point type of described client and/or the access IP information of described client;
Described cycle dispensing unit specifically for:
If the access point type that described access network configuration information is described client, obtains with the corresponding relation of heartbeat keepalive period and obtains the heartbeat keepalive period corresponding with the access point type of described client according to access point type; Or
If the access IP information that described access network configuration information is described client, obtains the heartbeat keepalive period corresponding with the access IP information of described client according to access IP acquisition of information with the corresponding relation of heartbeat keepalive period; Or
If the access point type that described access network configuration information is described client and access IP information, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client, if cannot obtain the heartbeat keepalive period corresponding with the access point type of described client, according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; Or; according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; if cannot obtain the heartbeat keepalive period corresponding with the access IP information of described client, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client.
In conjunction with the possible implementation of the first of second aspect, in the possible implementation of the second of second aspect, described cycle dispensing unit specifically for:
The network number of the IP address that obtains described client according to the access IP address of described client and subnet mask length;
According to the network number of IP address, subnet mask length and the corresponding relation of heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with network number, the subnet mask length of the IP address of described client;
Wherein, corresponding with the network number of the IP address of described client and subnet mask length heartbeat keepalive period is according to the corresponding relation configuration of heartbeat keepalive period and network address translation apparatus ageing time.
In conjunction with second aspect, in the third possible implementation, described push unit also for:
If cannot obtain the heartbeat keepalive period corresponding with the access network configuration information of described client, to described client, send default heartbeat keepalive period.
Embodiments of the invention provide a kind of push channel keepalive method and push server, the access network configuration information obtaining in request according to heartbeat keepalive period of the client receiving obtains the heartbeat keepalive period corresponding with access network configuration information, can realize according to the access network of client and configure to arrange heartbeat keepalive period, compared to existing technology by the fixing ageing time of being arranged to be less than the whole network of heartbeat keepalive period, extended heartbeat keepalive period, reduced the heartbeat interaction times of client and server, thereby reduced the consumption of client electric weight and flow.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The schematic flow sheet of a kind of push channel keepalive method that Fig. 1 provides for the embodiment of the present invention;
The schematic flow sheet of the another kind of push channel keepalive method that Fig. 2 provides for the embodiment of the present invention;
The structural representation of a kind of push server that Fig. 3 provides for the embodiment of the present invention;
The structural representation of the another kind of push server that Fig. 4 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of push channel keepalive method, and as shown in Figure 1, the method comprises:
101, heartbeat keepalive period that push server receives that client sends is obtained request, and the heartbeat keepalive period request of obtaining comprises the access network configuration information of client.
Wherein, in client, to push server, send before heartbeat keepalive period obtains request, first will set up TCP with push server and be connected.The access network configuration information of above-mentioned client can be the access point type of client, such as client access point can be WiFi (Wireless Fidelity, wireless compatible authenticating network) or Wired (wired connection), or access IP information, this access IP information can comprise access IP address and the subnet mask length of client.
102, push server, according to the corresponding relation of access network configuration information and heartbeat keepalive period, is obtained the heartbeat keepalive period corresponding with the access network configuration information of client.
Wherein, the corresponding relation of access network configuration information and heartbeat keepalive period can be a relation mapping table, and this table can set in advance in push server.Certainly, the corresponding relation of access network configuration information and heartbeat keepalive period also can be arranged to other forms.
103, push server sends the heartbeat keepalive period corresponding with the access network configuration information of client to client.
Embodiments of the invention provide a kind of push channel keepalive method; the access network configuration information obtaining in request according to heartbeat keepalive period of the client receiving obtains the heartbeat keepalive period corresponding with access network configuration information; can realize according to the access network of client and configure to arrange heartbeat keepalive period; compared to existing technology by the fixing ageing time of being arranged to be less than the whole network of heartbeat keepalive period; extended heartbeat keepalive period; reduce the heartbeat interaction times of client and server, thereby reduced the consumption of client electric weight and flow.
In order to make those skilled in the art can more clearly understand the technical scheme that the embodiment of the present invention provides; below by specific embodiment; the another kind of push channel keepalive method that the embodiment of the present invention is provided is elaborated, and as shown in Figure 2, the method comprises:
201, client is set up TCP with push server and is connected.
When network service adopts Transmission Control Protocol; before client and push server generation data interaction; between client and push server, must first set up a TCP is connected; TCP connection is in embodiments of the present invention commonly referred to as the long connection of TCP; be client with push server between this TCP of setting up be not connected and can initiatively close; follow-up data interaction may continue to use this link; so need to obtain heartbeat keepalive period, maintain within heartbeat keepalive period that this TCP is long to be connected.
202, client sends heartbeat keepalive period to push server and obtains request, and this heartbeat keepalive period request of obtaining carries the access network configuration information of client.
The access network configuration information of above-mentioned client can be the access point type of client, such as client access point can be wireless connections, such as WiFi, 3G (3rd Generation, the 3rd third generation mobile communication network), 2G (2nd Generation, 2nd generation mobile communications network), LTE (Long Term Evolution, long-term evolving network) etc., client access point can be also super joint, or access network configuration information can be the access IP information of client, this access IP information can comprise access IP address and the subnet mask length of client.
After step 202, between step 203 and 204, there is no fixing order, can first perform step 203, if execution step 203 successes, next step directly performs step 206; If execution step 203 is failed, continue execution step 204, if execution step 204 successes, next step performs step 206, if execution step 204 failures, next step execution step 205.
Or, also can first perform step 204, if execution step 204 successes, next step directly performs step 206; If execution step 204 is failed, continue execution step 203, if execution step 203 successes, next step performs step 206, if execution step 203 failures, next step execution step 205.Wherein, the present embodiment be take and first performed step 203 as example.
203, push server, according to the corresponding relation of access point type and heartbeat keepalive period, is obtained the heartbeat keepalive period corresponding with the access point type of client.
Exemplary; in push server end, can store the record sheet of the corresponding relation of access point type and heartbeat keepalive period; in this record sheet, recorded the heartbeat keepalive period corresponding with various access point type; here this record sheet can be called to heart beat cycle table; push server is after obtaining the access point type of client, and only need search this heart beat cycle table just can obtain the heartbeat keepalive period corresponding with access point type.For example, record the access point type of client and the heart beat cycle table of heartbeat keepalive period corresponding relation can be as shown in table 1:
Table 1
When push server cannot be obtained the heartbeat corresponding with the access point type of client during keepalive period according to table 1, represent to have obtained heartbeat keepalive period failure according to the access point type of client, now can perform step 204.
204, push server, according to the corresponding relation of access IP information and heartbeat keepalive period, is obtained the heartbeat keepalive period corresponding with the access IP information of client.
Exemplary, access IP information can comprise access IP address and the subnet mask length of client.
Exemplary, behind the access IP address and subnet mask length of the client receiving, first according to access IP address and subnet mask length, obtain the network number of the IP address of client.
Concrete, the network number of the IP address of client can obtain in the following manner:
The first step, is binary system by the access IP address transition of client, supposes that the access IP address of client is 192.9.200.13, and transferring binary value to is 11,000,000 0,000,100,111,001,000 00001101;
Second step, is converted to binary system by the subnet mask length of client, supposes that the subnet mask length of client is 24, and being converted to binary value is 11,111,111 1,111,111,111,111,111 00000000 (being first 24 is 1);
The 3rd step, " 11,000,000 00,001,001 11,001,000 00001101 " and " 11,111,111 11,111,111 11,111,111 00000000 " are carried out to logic and operation, obtain 11,000,000 00,001,001 11,001,000 00000000, by 11,000,000 0,000,100,111,001,000 00000000, be converted to 10 systems again and obtain 192.9.200.0, this 192.9.200.0 is the network number of the IP address of client.
The heart beat cycle table of the corresponding relation of network number that can storing IP address in push server end and subnet mask length and heartbeat keepalive period, push server only need be searched this heart beat cycle table just can obtain the heartbeat keepalive period corresponding with the network number of IP address and subnet mask length.For example, recording the network number of IP address and the heart beat cycle table of subnet mask length and heartbeat keepalive period corresponding relation of client can be as shown in table 2:
Table 2
According to IP address network in table 2 number and the corresponding relation of heartbeat keepalive period, just can find client IP address network number for " 192.9.200.0 ", subnet mask length be that 24 corresponding heartbeat keepalive periods were 900 seconds.
Wherein, the heartbeat keepalive period in table 2 is to configure according to the ageing time of NAT device.Concrete collocation method can comprise:
First according to the access IP address of client, determine the NAT device ageing time corresponding with access IP address, then calculate corresponding heartbeat keepalive period according to NAT device ageing time, computing formula is as follows:
T
h=Max (kT
n, T
n-T), wherein, T
hfor heartbeat keepalive period, T
nfor NAT device ageing time, k is coefficient, and T is and T
nthe time constant that unit is identical.Exemplary, NAT device ageing time T
nunit can for minute, now the unit of T is also minute, such as T can be 10 minutes, k can be 0.9, certainly, T, k also can specifically need arrange according to actual needs for other are worth, and do not limit herein.
In addition, when push server cannot be obtained the heartbeat corresponding with the access IP information of client during keepalive period according to table 2, represent to obtain the also failure of heartbeat keepalive period corresponding to access IP information with client, now can perform step 205.
205, push server is obtained default (Default) heartbeat keepalive period.
Default heartbeat keepalive period of push server configuration is relatively shorter according to heartbeat keepalive period of access point type or access IP acquisition of information, to adapt to the shortest keepalive period of various complex networks.
In addition; except above-mentioned cannot be according to the situation of heartbeat keepalive period of access point type or access IP acquisition of information; for not sending heartbeat keepalive period to push server, obtain request, push server also can make it use default heartbeat keepalive period.
206, push server is pushed to client by heartbeat keepalive period of obtaining.
207, the heartbeat keep-alive that client is carried out push channel with the heartbeat keepalive period receiving from push server is processed.
Embodiments of the invention provide a kind of push channel keepalive method; the access network configuration information obtaining in request according to heartbeat keepalive period of the client receiving obtains the heartbeat keepalive period corresponding with access network configuration information; can realize according to the access network of client and configure to arrange heartbeat keepalive period; compared to existing technology by the fixing ageing time of being arranged to be less than the whole network of heartbeat keepalive period; extended heartbeat keepalive period; reduce the heartbeat interaction times of client and server, thereby reduced the consumption of client electric weight and flow.
The embodiment of the present invention also provides a kind of push server 1, and as shown in Figure 3, push server 1 comprises:
Request reception unit 11, obtains request for the heartbeat keepalive period that receives that client sends, and the heartbeat keepalive period request of obtaining comprises the access network configuration information of client, and the access network configuration information of client is sent to cycle dispensing unit 12;
Cycle dispensing unit 12, for receiving the access network configuration information of the client of request reception unit 11 transmissions, according to the corresponding relation of access network configuration information and heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with the access network configuration information of client, and heartbeat keepalive period corresponding to the access network configuration information with client is sent to push unit 13;
Push unit 13, heartbeat keepalive period corresponding to the access network configuration information with client sending for receiving cycle dispensing unit 12, and send the heartbeat keepalive period corresponding with the access network configuration information of client to client.
Optionally, push unit 13 can also be for:
If cannot obtain the heartbeat keepalive period corresponding with the access network configuration information of client, to client, send default heartbeat keepalive period.
Wherein, the access network configuration information that push server 1 receives comprises the access point type of client and/or the access IP information of client.
Optionally, cycle dispensing unit 12 can be specifically for:
If the access point type that access network configuration information is client, obtains with the corresponding relation of heartbeat keepalive period and obtains the heartbeat keepalive period corresponding with the access point type of client according to access point type; Or
If the access IP information that access network configuration information is client, obtains the heartbeat keepalive period corresponding with the access IP information of client according to access IP acquisition of information with the corresponding relation of heartbeat keepalive period; Or
If the access point type that access network configuration information is client and access IP information, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of client, if cannot obtain the heartbeat keepalive period corresponding with the access point type of client, according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of client with the corresponding relation of heartbeat keepalive period; Or; according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of client with the corresponding relation of heartbeat keepalive period; if cannot obtain the heartbeat keepalive period corresponding with the access IP information of client, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of client.
Wherein, above-mentioned access point type comprises super joint and WAP (wireless access point); WAP (wireless access point) comprises WiFi, 3G, 2G, LTE etc.
Optionally, when according to the corresponding relation of access IP information and heartbeat keepalive period, obtain the heartbeat corresponding with the access IP information of client during keepalive period, cycle dispensing unit 12 can be specifically for:
The network number of the IP address that obtains client according to the access IP address of client and subnet mask length;
According to the network number of IP address, subnet mask length and the corresponding relation of heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with network number, the subnet mask length of the IP address of client;
Wherein, corresponding with the network number of the IP address of client and subnet mask length heartbeat keepalive period is according to the corresponding relation configuration of heartbeat keepalive period and network address translation apparatus ageing time.
Wherein, the corresponding relation of heartbeat keepalive period and network address translation apparatus ageing time comprises:
T
h=Max (kT
n, T
n-T), wherein, T
hfor heartbeat keepalive period, T
nfor network address translation apparatus ageing time, k is coefficient, and T is and T
nthe time constant that unit is identical.
Embodiments of the invention provide a kind of push server, the access network configuration information that this push server was obtained in request according to heartbeat keepalive period of the client receiving obtains the heartbeat keepalive period corresponding with access network configuration information, can realize according to the access network of client and configure to arrange heartbeat keepalive period, compared to existing technology by the fixing ageing time of being arranged to be less than the whole network of heartbeat keepalive period, extended heartbeat keepalive period, reduced the heartbeat interaction times of client and server, thereby reduced the consumption of client electric weight and flow.
The embodiment of the present invention also provides another kind of push server 3, and as shown in Figure 4, this push server 3 comprises bus 31, and is connected to interface 32, memory 33 and processor 34 in bus 31; Wherein, interface 32 for net element communication, memory 33 is for storage program 331, processor 34 executive programs 331 for:
The heartbeat keepalive period that receives that client sends is obtained request, and the heartbeat keepalive period request of obtaining comprises the access network configuration information of client;
Corresponding relation according to access network configuration information and heartbeat keepalive period, obtains the heartbeat keepalive period corresponding with the access network configuration information of client;
To client, send the heartbeat keepalive period corresponding with the access network configuration information of client.
Optionally, processor 34 executive programs 331 can also be for: if cannot obtain the heartbeat keepalive period corresponding with the access network configuration information of client, to client, send default heartbeat keepalive period.
Wherein, the access network configuration information of client comprises the access point type of client and/or the access IP information of client.
Optionally, processor 34 executive programs 331 can also be specifically for:
If the access point type that access network configuration information is client, obtains with the corresponding relation of heartbeat keepalive period and obtains the heartbeat keepalive period corresponding with the access point type of client according to access point type; Or
If the access IP information that access network configuration information is client, obtains the heartbeat keepalive period corresponding with the access IP information of client according to access IP acquisition of information with the corresponding relation of heartbeat keepalive period; Or
If the access point type that access network configuration information is client and access IP information, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of client, if cannot obtain the heartbeat keepalive period corresponding with the access point type of client, according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of client with the corresponding relation of heartbeat keepalive period; Or; according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of client with the corresponding relation of heartbeat keepalive period; if cannot obtain the heartbeat keepalive period corresponding with the access IP information of client, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of client.
Wherein, above-mentioned access point type comprises super joint and WAP (wireless access point); WAP (wireless access point) comprises WiFi, 3G, 2G, LTE etc.
Optionally, processor 34 executive programs 331 can also be specifically for:
The network number of the IP address that obtains client according to the access IP address of client and subnet mask length;
According to the network number of IP address, subnet mask length and the corresponding relation of heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with network number, the subnet mask length of the IP address of client;
Wherein, corresponding with the network number of the IP address of client and subnet mask length heartbeat keepalive period is according to the corresponding relation configuration of heartbeat keepalive period and network address translation apparatus ageing time.
Wherein, the corresponding relation of heartbeat keepalive period and network address translation apparatus ageing time comprises:
T
h=Max (kT
n, T
n-T), wherein, T
hfor heartbeat keepalive period, T
nfor network address translation apparatus ageing time, k is coefficient, and T is and T
nthe time constant that unit is identical.
Embodiments of the invention provide a kind of push server, the access network configuration information that this push server was obtained in request according to heartbeat keepalive period of the client receiving obtains the heartbeat keepalive period corresponding with access network configuration information, can realize according to the access network of client and configure to arrange heartbeat keepalive period, compared to existing technology by the fixing ageing time of being arranged to be less than the whole network of heartbeat keepalive period, extended heartbeat keepalive period, reduced the heartbeat interaction times of client and server, thereby reduced the consumption of client electric weight and flow.
In the several embodiment that provide in the application, should be understood that disclosed method and apparatus can be realized by another way.For example, device embodiment described above is only schematic, for example, the division of described unit, be only that a kind of logic function is divided, during actual realization, can have other dividing mode, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit comprises, also can be integrated in a unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that also can adopt hardware to add SFU software functional unit realizes.
The integrated unit that the above-mentioned form with SFU software functional unit realizes, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprise some instructions with so that computer equipment (can be personal computer, server, or the network equipment etc.) carry out the part steps of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (Read-Only Memory, be called for short ROM), the various media that can be program code stored such as random access memory (Random Access Memory is called for short RAM), magnetic disc or CD.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of described claim.
Claims (10)
1. a push channel keepalive method, is characterized in that, described method comprises:
The heartbeat keepalive period that receives that client sends is obtained request, and the described heartbeat keepalive period request of obtaining comprises the access network configuration information of client;
Corresponding relation according to access network configuration information and heartbeat keepalive period, obtains the heartbeat keepalive period corresponding with the access network configuration information of described client;
To described client, send the heartbeat keepalive period corresponding with the access network configuration information of described client.
2. method according to claim 1, is characterized in that, described access network configuration information comprises the access point type of described client and/or the access IP information of described client;
Described according to the corresponding relation of access network configuration information and heartbeat keepalive period, obtain heartbeat keepalive period that access network configuration information with described client is corresponding to comprise:
If the access point type that described access network configuration information is described client, obtains with the corresponding relation of heartbeat keepalive period and obtains the heartbeat keepalive period corresponding with the access point type of described client according to access point type; Or
If the access IP information that described access network configuration information is described client, obtains the heartbeat keepalive period corresponding with the access IP information of described client according to access IP acquisition of information with the corresponding relation of heartbeat keepalive period; Or
If the access point type that described access network configuration information is described client and access IP information, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client, if cannot obtain the heartbeat keepalive period corresponding with the access point type of described client, according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; Or; according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; if cannot obtain the heartbeat keepalive period corresponding with the access IP information of described client, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client.
3. method according to claim 1 and 2, is characterized in that, described access point type comprises super joint and WAP (wireless access point); Described WAP (wireless access point) comprises wireless compatible authenticating network WiFi, the 3rd third generation mobile communication network 3G, 2nd generation mobile communications network 2G, long-term evolving network LTE;
Described access IP information comprises access IP address and the subnet mask length of described client.
4. method according to claim 3, is characterized in that, describedly according to access IP acquisition of information and the corresponding relation of heartbeat keepalive period, obtains heartbeat keepalive period corresponding to access IP information with described client and comprises:
The network number of the IP address that obtains described client according to the access IP address of described client and subnet mask length;
According to the network number of IP address, subnet mask length and the corresponding relation of heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with network number, the subnet mask length of the IP address of described client;
Wherein, corresponding with the network number of the IP address of described client and subnet mask length heartbeat keepalive period is according to the corresponding relation configuration of heartbeat keepalive period and network address translation apparatus ageing time.
5. method according to claim 4, is characterized in that, the corresponding relation of described heartbeat keepalive period and network address translation apparatus ageing time comprises:
T
h=Max (kT
n, T
n-T), wherein, T
hfor described heartbeat keepalive period, T
nfor described network address translation apparatus ageing time, k is coefficient, and T is and T
nthe time constant that unit is identical.
6. method according to claim 1, is characterized in that, if cannot obtain the heartbeat keepalive period corresponding with the access network configuration information of described client, described method also comprises:
To described client, send default heartbeat keepalive period.
7. a push server, is characterized in that, described server comprises:
Request reception unit, obtains request for the heartbeat keepalive period that receives that client sends, and the described heartbeat keepalive period request of obtaining comprises the access network configuration information of client, and the access network configuration information of described client is sent to cycle dispensing unit;
Cycle dispensing unit, for receiving the access network configuration information of the described client of described request receiving element transmission, according to the corresponding relation of access network configuration information and heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with the access network configuration information of described client, and heartbeat keepalive period corresponding to the access network configuration information with described client is sent to push unit;
Push unit, heartbeat keepalive period corresponding to the access network configuration information with described client sending for receiving described cycle dispensing unit, and send the heartbeat keepalive period corresponding with the access network configuration information of described client to described client.
8. server according to claim 7, is characterized in that, the access network configuration information of the described client receiving comprises the access point type of described client and/or the access IP information of described client;
Described cycle dispensing unit specifically for:
If the access point type that described access network configuration information is described client, obtains with the corresponding relation of heartbeat keepalive period and obtains the heartbeat keepalive period corresponding with the access point type of described client according to access point type; Or
If the access IP information that described access network configuration information is described client, obtains the heartbeat keepalive period corresponding with the access IP information of described client according to access IP acquisition of information with the corresponding relation of heartbeat keepalive period; Or
If the access point type that described access network configuration information is described client and access IP information, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client, if cannot obtain the heartbeat keepalive period corresponding with the access point type of described client, according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; Or; according to access IP acquisition of information, obtain the heartbeat keepalive period corresponding with the access IP information of described client with the corresponding relation of heartbeat keepalive period; if cannot obtain the heartbeat keepalive period corresponding with the access IP information of described client, according to access point type, obtain with the corresponding relation of heartbeat keepalive period and obtain the heartbeat keepalive period corresponding with the access point type of described client.
9. server according to claim 8, is characterized in that, described cycle dispensing unit specifically for:
The network number of the IP address that obtains described client according to the access IP address of described client and subnet mask length;
According to the network number of IP address, subnet mask length and the corresponding relation of heartbeat keepalive period, obtain the heartbeat keepalive period corresponding with network number, the subnet mask length of the IP address of described client;
Wherein, corresponding with the network number of the IP address of described client and subnet mask length heartbeat keepalive period is according to the corresponding relation configuration of heartbeat keepalive period and network address translation apparatus ageing time.
10. server according to claim 7, is characterized in that, described push unit also for:
If cannot obtain the heartbeat keepalive period corresponding with the access network configuration information of described client, to described client, send default heartbeat keepalive period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310161909.0A CN104135460B (en) | 2013-05-03 | 2013-05-03 | A kind of push channel keepalive method and push server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310161909.0A CN104135460B (en) | 2013-05-03 | 2013-05-03 | A kind of push channel keepalive method and push server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104135460A true CN104135460A (en) | 2014-11-05 |
CN104135460B CN104135460B (en) | 2017-11-24 |
Family
ID=51807984
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310161909.0A Active CN104135460B (en) | 2013-05-03 | 2013-05-03 | A kind of push channel keepalive method and push server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104135460B (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243719A (en) * | 2013-06-08 | 2014-12-24 | 中国移动通信集团公司 | Heartbeat period determining method, system and device for long connection in mobile communication network |
CN105071956A (en) * | 2015-07-23 | 2015-11-18 | 苏州汉明科技有限公司 | Communication method and system for commercial WIFI |
CN105897813A (en) * | 2015-06-10 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Heartbeat message sending method, heartbeat message receiving method, heartbeat message sending device and heartbeat message receiving device |
CN106535309A (en) * | 2016-10-28 | 2017-03-22 | 珠海市魅族科技有限公司 | Method and device for keeping network connection |
CN106803833A (en) * | 2015-11-26 | 2017-06-06 | 北京百度网讯科技有限公司 | Processing method, the apparatus and system of heartbeat in connection long |
WO2017215614A1 (en) * | 2016-06-16 | 2017-12-21 | 中兴通讯股份有限公司 | Method, device and system for realising heart beat keepalive |
CN108234578A (en) * | 2016-12-22 | 2018-06-29 | 航天信息股份有限公司 | A kind of method and device of push |
CN111857863A (en) * | 2020-06-19 | 2020-10-30 | 微梦创科网络科技(中国)有限公司 | Dynamic configuration method and system |
CN111917581A (en) * | 2020-07-31 | 2020-11-10 | 深圳乐播科技有限公司 | Communication connection maintenance method, device, equipment and storage medium |
CN112202626A (en) * | 2020-08-04 | 2021-01-08 | 长春创世麒麟科技有限公司 | Real-time data communication heartbeat packet pushing method |
CN114390453A (en) * | 2022-02-09 | 2022-04-22 | 福建天泉教育科技有限公司 | Message pushing optimization method and terminal |
CN114697377A (en) * | 2022-04-07 | 2022-07-01 | 深信服科技股份有限公司 | Keep-alive method, system and device for client product and readable storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1870646A (en) * | 2006-02-17 | 2006-11-29 | 华为技术有限公司 | Method for improving jump mechanism of media gateway control protocol centre |
US20100015974A1 (en) * | 2008-07-15 | 2010-01-21 | Kevin Stubbings | Method and apparatus for reducing push-to-talk (ptt) latency in a wcdma network |
CN102149215A (en) * | 2010-02-05 | 2011-08-10 | 华为技术有限公司 | Method for transmitting keep-alive information, terminal and network equipment |
CN102523178A (en) * | 2011-12-20 | 2012-06-27 | 华为技术有限公司 | Push-based heartbeat message sending method and terminal |
WO2012110103A1 (en) * | 2011-02-18 | 2012-08-23 | Birdstep Technology | Method, gateway, and client for optimizing keep-alive message handling |
CN102685768A (en) * | 2011-03-08 | 2012-09-19 | 华为技术有限公司 | Processing method of heartbeat message, acquisition method of heartbeat period and access network equipment |
CN103037483A (en) * | 2011-09-30 | 2013-04-10 | 联想(北京)有限公司 | Network server and method for connecting same and application server |
CN103209089A (en) * | 2012-01-17 | 2013-07-17 | 华为技术有限公司 | Method for obtaining heart beat period, terminal and server |
-
2013
- 2013-05-03 CN CN201310161909.0A patent/CN104135460B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1870646A (en) * | 2006-02-17 | 2006-11-29 | 华为技术有限公司 | Method for improving jump mechanism of media gateway control protocol centre |
US20100015974A1 (en) * | 2008-07-15 | 2010-01-21 | Kevin Stubbings | Method and apparatus for reducing push-to-talk (ptt) latency in a wcdma network |
CN102149215A (en) * | 2010-02-05 | 2011-08-10 | 华为技术有限公司 | Method for transmitting keep-alive information, terminal and network equipment |
WO2012110103A1 (en) * | 2011-02-18 | 2012-08-23 | Birdstep Technology | Method, gateway, and client for optimizing keep-alive message handling |
CN102685768A (en) * | 2011-03-08 | 2012-09-19 | 华为技术有限公司 | Processing method of heartbeat message, acquisition method of heartbeat period and access network equipment |
CN103037483A (en) * | 2011-09-30 | 2013-04-10 | 联想(北京)有限公司 | Network server and method for connecting same and application server |
CN102523178A (en) * | 2011-12-20 | 2012-06-27 | 华为技术有限公司 | Push-based heartbeat message sending method and terminal |
CN103209089A (en) * | 2012-01-17 | 2013-07-17 | 华为技术有限公司 | Method for obtaining heart beat period, terminal and server |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243719A (en) * | 2013-06-08 | 2014-12-24 | 中国移动通信集团公司 | Heartbeat period determining method, system and device for long connection in mobile communication network |
CN105897813A (en) * | 2015-06-10 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Heartbeat message sending method, heartbeat message receiving method, heartbeat message sending device and heartbeat message receiving device |
CN105071956A (en) * | 2015-07-23 | 2015-11-18 | 苏州汉明科技有限公司 | Communication method and system for commercial WIFI |
CN106803833A (en) * | 2015-11-26 | 2017-06-06 | 北京百度网讯科技有限公司 | Processing method, the apparatus and system of heartbeat in connection long |
WO2017215614A1 (en) * | 2016-06-16 | 2017-12-21 | 中兴通讯股份有限公司 | Method, device and system for realising heart beat keepalive |
CN106535309A (en) * | 2016-10-28 | 2017-03-22 | 珠海市魅族科技有限公司 | Method and device for keeping network connection |
CN106535309B (en) * | 2016-10-28 | 2019-11-15 | 珠海市魅族科技有限公司 | A kind of method and device keeping network connection |
CN108234578A (en) * | 2016-12-22 | 2018-06-29 | 航天信息股份有限公司 | A kind of method and device of push |
CN111857863A (en) * | 2020-06-19 | 2020-10-30 | 微梦创科网络科技(中国)有限公司 | Dynamic configuration method and system |
CN111857863B (en) * | 2020-06-19 | 2023-10-27 | 微梦创科网络科技(中国)有限公司 | Dynamic configuration method and system |
CN111917581A (en) * | 2020-07-31 | 2020-11-10 | 深圳乐播科技有限公司 | Communication connection maintenance method, device, equipment and storage medium |
CN112202626A (en) * | 2020-08-04 | 2021-01-08 | 长春创世麒麟科技有限公司 | Real-time data communication heartbeat packet pushing method |
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 |
CN114697377A (en) * | 2022-04-07 | 2022-07-01 | 深信服科技股份有限公司 | Keep-alive method, system and device for client product and readable storage medium |
CN114697377B (en) * | 2022-04-07 | 2023-09-05 | 深信服科技股份有限公司 | Keep-alive method, keep-alive system, keep-alive device and readable storage medium for client products |
Also Published As
Publication number | Publication date |
---|---|
CN104135460B (en) | 2017-11-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104135460A (en) | Method for keeping push channel active and push server | |
US10392823B2 (en) | Synthetic client | |
US20230247388A1 (en) | Communication system, method and device for miniature intelligent sensor | |
WO2017215614A1 (en) | Method, device and system for realising heart beat keepalive | |
US10154106B2 (en) | Method for sending heartbeat message and mobile terminal | |
CN103209089A (en) | Method for obtaining heart beat period, terminal and server | |
JP6013598B2 (en) | Immediate connection after device discovery | |
CN103916879A (en) | Equipment discovery method, apparatus and system | |
US9241007B1 (en) | System, method, and computer program for providing a vulnerability assessment of a network of industrial automation devices | |
CN104320328A (en) | Message synchronization method, terminal and server | |
CN102333335A (en) | Service recovery method, equipment and system for wireless local area network (WLAN) | |
CN105188056A (en) | Method and device for connecting WiFi (Wireless Fidelity) equipment with access point | |
JP5255035B2 (en) | Failover system, storage processing apparatus, and failover control method | |
US20110258270A1 (en) | Apparatus and method for establishing partnership with a peer-to-peer (p2p) service based on gossip | |
CN103068052B (en) | Dynamic resource allocation method, system and Portal server | |
JP2014513453A (en) | Communication method for wireless terminal and host device, wireless terminal, and host device | |
CN104243473B (en) | A kind of method and device of data transmission | |
EP2874375B1 (en) | Method, apparatus and computer program product for managing storage system | |
CN109600436A (en) | A kind of distribution iscsi service implementing method, system and relevant apparatus | |
CN102882906A (en) | Method and device of data communication in constrained application protocol | |
CN104969521A (en) | Data sending and processing method and router | |
CN104065519A (en) | Method for improving conversation interactive performance and automatic configuration server | |
CN104333615A (en) | Method and device for tracing address source | |
CN104333872A (en) | Method and system for establishing session based on bidirectional forwarding detection technology | |
CN104506425A (en) | Instant messaging system based on family cloud host and method thereof |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20200211 Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee after: HUAWEI TECHNOLOGIES Co.,Ltd. Address before: 210012 HUAWEI Nanjing base, 101 software Avenue, Yuhuatai District, Jiangsu, Nanjing Patentee before: Huawei Technologies Co.,Ltd. |