CN103916936A - Method and system for realizing data long connection, mobile terminal and server - Google Patents

Method and system for realizing data long connection, mobile terminal and server Download PDF

Info

Publication number
CN103916936A
CN103916936A CN201310000666.2A CN201310000666A CN103916936A CN 103916936 A CN103916936 A CN 103916936A CN 201310000666 A CN201310000666 A CN 201310000666A CN 103916936 A CN103916936 A CN 103916936A
Authority
CN
China
Prior art keywords
mobile terminal
terminal
role
agent
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310000666.2A
Other languages
Chinese (zh)
Other versions
CN103916936B (en
Inventor
赵学峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group 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 China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201310000666.2A priority Critical patent/CN103916936B/en
Publication of CN103916936A publication Critical patent/CN103916936A/en
Application granted granted Critical
Publication of CN103916936B publication Critical patent/CN103916936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method for realizing data long connection. The method comprises the following steps: a mobile terminal sends an agent long connection request to a network side server, wherein the agent long connection request at least carries CELL ID of a base station that the mobile terminal belongs to, an IP address that the mobile terminal obtains from the network side and terminal unique identification; the mobile terminal receives a determination message from the network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins an agency group; and the mobile terminal carries out corresponding operation according to the role information after joining the agency group. The invention also discloses a corresponding system for realizing the data long connection, the mobile terminal and the server. In each agency group, only an agent heartbeat sending terminal and a back-up agent heartbeat sending terminal need to send heartbeat data packets to the server, thereby improving resource utilization rate, prolonging cell utilization duration of the mobile terminal and improving the user experience.

Description

Method and system for realizing long data connection, mobile terminal and server
Technical Field
The present invention relates to the field of data communications, and in particular, to a method, a system, a mobile terminal, and a server for implementing long data connection.
Background
With the popularization of intelligent mobile terminals, application services such as real-time message communication, voice and video are increasing continuously, in order to improve the real-time performance of interaction with users, more and more applications depend on remote services of a network, background data service servers such as cloud storage and calculation provide data support for terminal application services, and meanwhile, a plurality of applications are in long-term connection with a service platform, so that data of the remote service platform can be timely and accurately pushed to the terminals.
Currently, in a Mobile wireless network such as Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Global System For Mobile Communication (GMS), a long Time online connection between a Mobile terminal and a server is realized, and a method of transmitting a heartbeat packet is generally adopted. However, by adopting a way of sending heartbeat data packets to maintain long data connection, when a mobile terminal uses a certain application product for real-time communication, part of traffic needs to be consumed to maintain long data connection with a network, so that the resource utilization rate is low; meanwhile, the mobile terminal also needs to consume a considerable part of electric quantity to keep the data long connection, thereby influencing the service life of the mobile terminal battery and causing the user experience to be reduced.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method, a system, a mobile terminal, and a server for implementing long data connection, which can improve resource utilization, prolong battery life of the mobile terminal, and improve user experience while maintaining long data connection between the mobile terminal and the server.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method for realizing data length connection comprises the following steps:
the mobile terminal sends a proxy long connection request carrying mobile terminal attribute information to a network side server;
the mobile terminal receives a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in an agent group;
the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, and then the mobile terminal normally sends a heartbeat data packet, receives a notification message from a server and forwards the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication; the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, and then a heartbeat data packet is normally sent; and stopping sending the heartbeat data packet and receiving a notification message from the agent heartbeat sending terminal if the role of the mobile terminal after joining the agent group is a common terminal, and then acquiring real-time data from the server according to the notification message.
The proxy long connection request also carries one or more of the following: the current electric quantity of the mobile terminal, the online connection time and the distance from the mobile terminal to the base station.
The mobile terminal sends a proxy long connection request carrying mobile terminal attribute information to a network side server, and the proxy long connection request comprises the following steps: and when the mobile terminal determines that the CELL ID of the base station of the mobile terminal does not change within a preset time period, sending a proxy long connection request carrying the attribute information of the mobile terminal to a network side server.
The method further comprises the following steps:
the mobile terminal receives a role adjustment message from a network side server, wherein the role adjustment message carries new role information of the mobile terminal in an agent group;
and the mobile terminal executes corresponding operation according to the new role.
A method for realizing data length connection comprises the following steps:
the server receives an agent long connection request carrying mobile terminal attribute information from the mobile terminal;
the server determines an agent group added by the mobile terminal and a role after the agent group is added according to the agent long connection request, and returns a determination message to the mobile terminal, wherein the determination message carries role information after the mobile terminal is added into the agent group;
the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, the server keeps long connection with the mobile terminal, and sends a notification message to the agent heartbeat sending terminal when real-time communication is required to be carried out with a common terminal in the agent group, wherein the notification message carries terminal information required to be carried out with the real-time communication; the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, and the server keeps long connection with the mobile terminal; and if the role of the mobile terminal after joining the agent group is a common terminal, the server is disconnected from the long connection with the mobile terminal.
The server determines the agent group added by the mobile terminal and the role after the agent group is added according to the agent long connection request as follows: determining an agent group added by the mobile terminal according to a base station CELL ID of a base station to which the mobile terminal belongs, wherein the base station CELL ID corresponds to the agent group one by one, and then determining the role of the mobile terminal after the mobile terminal is added into the agent group according to one or more of the following items: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
The method further comprises the following steps:
the server re-determines the roles of the mobile terminals in the agent group periodically or when the server fails to keep long connection with the agent heartbeat sending terminal, and sends role adjusting information to the corresponding mobile terminals, wherein the role adjusting information carries new role information of the mobile terminals in the agent group.
A mobile terminal, comprising: the device comprises a sending module, a receiving module and an execution module; wherein,
the sending module is used for sending the proxy long connection request carrying the attribute information of the mobile terminal to the network side server;
the receiving module is used for receiving a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in the proxy group;
the execution module is used for normally sending a heartbeat data packet when the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, receiving a notification message from the server, and forwarding the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication; when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, normally sending a heartbeat data packet; and when the role of the mobile terminal after joining the agent group is a common terminal, stopping sending the heartbeat data packet, receiving a notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message.
The mobile terminal further comprises a judging module for judging whether the mobile terminal is in a normal state,
the judging module is used for judging whether the CELL ID of the base station of the mobile terminal is changed within a preset time period;
the sending module is specifically configured to send a proxy long connection request to a network side server when a CELL ID of a base station to which the mobile terminal belongs is not changed within a preset time period.
The receiving module is further configured to receive a role adjustment message from a network side server, where the role adjustment message carries new role information of the mobile terminal in the proxy group;
and the execution module is also used for executing corresponding operation according to the new role.
A server, comprising: the device comprises a receiving module, a determining module, a sending module and an executing module; wherein,
the receiving module is used for receiving a proxy long connection request carrying mobile terminal attribute information from a mobile terminal;
the determining module is used for determining the agent group added by the mobile terminal and the role after the agent group is added according to the agent long connection request;
the sending module is used for returning a confirmation message to the mobile terminal, wherein the confirmation message carries role information of the mobile terminal after the mobile terminal joins the agent group;
the execution module is used for keeping long connection with the mobile terminal when the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, and sending a notification message to the agent heartbeat sending terminal when real-time communication is required to be carried out with a common terminal in the agent group, wherein the notification message carries terminal information required to be carried out with the real-time communication; when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, the long connection with the mobile terminal is kept; and when the role of the mobile terminal after joining the agent group is a common terminal, disconnecting the long connection with the mobile terminal.
The determining module is specifically configured to determine, according to a CELL ID of a base station CELL of a base station to which the mobile terminal belongs, an agent group to which the mobile terminal joins, where the CELL ID of the base station CELL corresponds to the agent group one to one, and then determine, according to one or more of the following items, a role of the mobile terminal after joining the agent group: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
The determining module is further configured to re-determine the role of the mobile terminal in the proxy group periodically or when the long connection with the proxy heartbeat sending terminal fails;
the sending module is further configured to send a role adjustment message to a corresponding mobile terminal, where the role adjustment message carries new role information of the mobile terminal in the agent group.
A system for realizing long data connection comprises a mobile terminal and a server, wherein,
the mobile terminal is used for sending an agent long connection request carrying mobile terminal attribute information to the network side server; receiving a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in the proxy group; when the role after joining the agent group is an agent heartbeat sending terminal, normally sending a heartbeat data packet, receiving a notification message from a server, and forwarding the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication, when the role after joining the agent group is a backup agent heartbeat sending terminal, normally sending the heartbeat data packet, when the role after joining the agent group is the common terminal, stopping sending the heartbeat data packet, receiving the notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message;
the server is used for determining the agent group added by the mobile terminal and the role after the agent group is added according to the agent long connection request, and returning a determination message to the mobile terminal; and when real-time communication with a common terminal in the agent group is needed, sending a notification message to the agent heartbeat sending terminal, wherein the notification message carries terminal information needing the real-time communication.
The server is specifically configured to determine, according to a CELL ID of a base station CELL of a base station to which the mobile terminal belongs, an agent group to which the mobile terminal joins, where the CELL ID of the base station CELL corresponds to the agent group one to one, and then determine, according to one or more of the following items, a role of the mobile terminal after joining the agent group: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
The server is further configured to re-determine the role of the mobile terminal in the proxy group periodically or when the long connection with the proxy heartbeat sending terminal fails, and send a role adjustment message to the corresponding mobile terminal, where the role adjustment message carries new role information of the mobile terminal in the proxy group.
The invention relates to a method, a system, a mobile terminal and a server for realizing long data connection, wherein the mobile terminal sends a proxy long connection request carrying mobile terminal attribute information to a network side server; the mobile terminal receives a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in an agent group; and the mobile terminal executes corresponding operation according to the role information after joining the agent group. Based on the technical scheme of the invention, in each agent group, only the agent heartbeat sending terminal and the backup agent heartbeat sending terminal need to send heartbeat data packets to the server, and the common terminal only needs to obtain real-time information from the server according to the notification of the agent heartbeat sending terminal, so that the resource utilization rate can be improved, the service life of the mobile terminal battery can be prolonged, and the user experience can be improved.
Drawings
Fig. 1 is a schematic flow chart of a method for implementing long data connection according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for implementing long data connection according to another embodiment of the present invention;
FIG. 3 is a schematic overall flowchart illustrating implementation of long data connection according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a server structure according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a system for implementing long data connection according to an embodiment of the present invention.
Detailed Description
The basic idea of the invention is: the mobile terminal sends a proxy long connection request carrying mobile terminal attribute information to a network side server; the mobile terminal receives a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in an agent group; and the mobile terminal executes corresponding operation according to the role information after joining the agent group.
Wherein the mobile terminal attribute information includes: the CELL ID of the base station to which the mobile terminal belongs, the IP address and the terminal unique identification which are acquired by the mobile terminal from a network side; the role is an agent heartbeat sending terminal, a backup agent heartbeat sending terminal or a common terminal.
The embodiment of the invention provides a method for realizing long data connection, which comprises the following steps of:
step 101: the mobile terminal sends a proxy long connection request carrying mobile terminal attribute information to a network side server;
here, the mobile terminal attribute information includes: the CELL ID of the base station to which the mobile terminal belongs, the IP address and the terminal unique identification which are acquired by the mobile terminal from a network side;
step 102: the mobile terminal receives a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in an agent group;
here, the role is a proxy heartbeat sending terminal, a backup proxy heartbeat sending terminal or a common terminal;
step 103: and the mobile terminal executes corresponding operation according to the role information after joining the agent group.
Optionally, when the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, the mobile terminal performs corresponding operations according to the role information after joining the agent group, including: normally sending a heartbeat data packet, receiving a notification message from a server, and forwarding the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication;
when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, the mobile terminal executes corresponding operations according to the role information after joining the agent group, wherein the operations comprise that: normally sending heartbeat data packets;
when the role of the mobile terminal after joining the agent group is a common terminal, the mobile terminal executes corresponding operations according to the role information after joining the agent group, wherein the operations comprise that: stopping sending the heartbeat data packet, receiving a notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message.
It should be noted that the server directly sends the real-time data of the proxy heartbeat sending terminal and the backup proxy heartbeat sending terminal to the corresponding terminals.
Optionally, the proxy long connection request further carries one or more of the following items: the current electric quantity of the mobile terminal, the online connection time and the distance from the mobile terminal to the base station.
Optionally, the sending, by the mobile terminal to the network side server, the proxy long connection request carrying the attribute information of the mobile terminal is: and when the mobile terminal determines that the CELL ID of the base station of the mobile terminal does not change within a preset time period, the mobile terminal sends a proxy long connection request to a network side server.
Generally, when a service application used by a terminal starts to be opened, firstly, a data long connection is maintained in a normal mode, that is, a heartbeat packet mode is adopted, whether the current position of the terminal is stable or not is detected after the terminal operates for a period of time, that is, the position of the terminal does not change too much within a certain period of time, for example, after the mobile terminal operates for t0, the base station CELL ID is obtained and recorded, the base station CELL ID is obtained again after t1 minutes, whether the obtained base station CELL ID is the same or not is compared, the position is determined to be relatively stable if the base station CELL ID is stable after k times of comparison, basic information (such as the base station number information (CELL ID) of the base station, an IP address obtained from a 2G/3G network, a terminal unique identifier (IMEI/MAC), the terminal power and the distance from the terminal to the base station) is collected, the server divides different connection groups according to registered base station CELLID information, each connection group forms a wireless internal local area network by depending on an IP address dynamically allocated by a mobile network base station, a proxy heartbeat sending terminal (MASTER) and a BACKUP proxy heartbeat sending terminal (BACKUP) are selected in the group according to an instant strategy and an algorithm, the proxy heartbeat sending terminal (MASTER) keeps connection communication for common members in the group, and the proxy heartbeat sending terminal is sent to a target terminal after receiving proxy information.
Optionally, the method further includes: the mobile terminal receives a role adjustment message from a network side server, wherein the role adjustment message carries new role information of the mobile terminal in an agent group; and the mobile terminal executes corresponding operation according to the new role.
The embodiment of the present invention further provides a method for implementing long data connection, as shown in fig. 2, the method includes:
step 201: the server receives an agent long connection request carrying mobile terminal attribute information from the mobile terminal;
here, the mobile terminal attribute information includes: base station number information CELL ID of a base station to which the mobile terminal belongs, an IP address and a terminal unique identifier which are acquired by the mobile terminal from a network side;
step 202: the server determines an agent group added by the mobile terminal and a role after the agent group is added according to the agent long connection request, and returns a determination message to the mobile terminal, wherein the determination message carries role information after the mobile terminal is added into the agent group;
the role is an agent heartbeat sending terminal, a backup agent heartbeat sending terminal or a common terminal;
step 203: and the server executes corresponding operation according to the role information of the mobile terminal after the mobile terminal joins the agent group.
Optionally, when the role of the mobile terminal after joining the agent group is the agent heartbeat sending terminal, the server executes corresponding operations according to the role information of the mobile terminal after joining the agent group, including: maintaining a long connection with the mobile terminal; when real-time communication with a common terminal in the agent group is needed, sending a notification message to the agent heartbeat sending terminal, wherein the notification message carries terminal information needing the real-time communication;
when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, the server executes corresponding operations according to the role information of the mobile terminal after joining the agent group as follows: maintaining a long connection with the mobile terminal;
when the role of the mobile terminal after joining the agent group is a common terminal, the server executes corresponding operations according to the role information of the mobile terminal after joining the agent group, wherein the operations comprise: and disconnecting the long connection with the mobile terminal, and sending a notification message to an agent heartbeat sending terminal in an agent group to which the mobile terminal belongs when the long connection with the mobile terminal is required to communicate with the mobile terminal.
Optionally, the server determines, according to the proxy long connection request, a proxy group to which the mobile terminal joins and a role after joining the proxy group as follows: determining an agent group added by the mobile terminal according to a base station CELL ID of a base station to which the mobile terminal belongs, wherein the base station CELL ID corresponds to the agent group one by one, and then determining the role of the mobile terminal after the mobile terminal is added into the agent group according to one or more of the following items: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
It should be noted that parameters such as the current power of the mobile terminal, the time of online connection, and the distance from the mobile terminal to the base station to which the mobile terminal belongs may be carried by the proxy long connection request, or may be carried by other interactive messages.
Specifically, after receiving the proxy long connection request, the server queries whether a proxy group exists according to a base station CELL ID carried in the proxy long connection request, if the group exists, the mobile terminal is added into the proxy group, otherwise, the proxy group identified by the base station CELL ID is established, after the server completes processing, the server returns a confirmation message to the terminal, the message contains a role after the terminal is added into the proxy group, if the role is a common terminal, namely, the proxy group is established, the terminal stops the heartbeat data packet originally maintaining the long data connection and simultaneously starts a service for receiving the message to wait for the message forwarded by a proxy heartbeat sending terminal (MASTER) and processes the return result, and the MASTER returns a correct message forwarding state to the server after receiving the processing result.
Optionally, after receiving the proxy long connection request of the mobile terminal, if only one mobile device is in the proxy group to which the mobile terminal belongs, the server automatically becomes MASTER, and the latest stations added in the later stage become BACKUP proxy heartbeat sending terminals (BACKUP); if a plurality of mobile terminals simultaneously apply for joining in the agent group, the server determines whether to act according to the number of the mobile terminals in the group, for example, the number of the mobile terminals in the group reaches 10, and selects a MASTER terminal and a plurality of BACKUP terminals according to the electric quantity and the message number of the mobile terminals.
Optionally, the method further includes: the server re-determines the roles of the mobile terminals in the agent group periodically or when the server fails to keep long connection with the agent heartbeat sending terminal, and sends role adjusting information to the corresponding mobile terminals, wherein the role adjusting information carries new role information of the mobile terminals in the agent group.
For example, when a long connection between the server and the MASTER is abnormal, the MASTER is adjusted according to parameters such as certain terminal power and the like from several BACKUP terminals, and one or more BACKUP terminals are determined according to parameters such as mobile terminal power and the like from the proxied terminals.
It should be noted that, when the role of the mobile terminal in the proxy group is determined again, the determination may be further performed in combination with the number of messages processed by the mobile terminal, and if the number of messages processed by the MASTER exceeds a preset value, a new MASTER is selected from the BACKUP terminals.
It should be noted that, after determining that the own role is the proxy heartbeat sending terminal according to the determination message or the role adjustment message, the mobile terminal will broadcast the own role to other mobile terminals in the proxy group.
Fig. 3 is a schematic diagram of an overall flow for implementing long data connection according to an embodiment of the present invention.
The embodiment of the present invention further provides a mobile terminal accordingly, as shown in fig. 4, the mobile terminal includes: a sending module 41, a receiving module 42 and an executing module 43; wherein,
a sending module 41, configured to send a proxy long connection request carrying mobile terminal attribute information to a network side server;
here, the mobile terminal attribute information includes: base station number information CELL ID of a base station to which the mobile terminal belongs, an IP address and a terminal unique identifier which are acquired by the mobile terminal from a network side;
a receiving module 42, configured to receive a determination message from a network side server, where the determination message carries role information of the mobile terminal after joining the proxy group;
here, the role is a proxy heartbeat sending terminal, a backup proxy heartbeat sending terminal or a common terminal;
and the executing module 43 is configured to execute a corresponding operation according to the role information after joining the proxy group.
Optionally, the executing module 43 is specifically configured to, when the role of the mobile terminal after joining the proxy group is a proxy heartbeat sending terminal, normally send a heartbeat data packet, receive a notification message from the server, and forward the notification message to a corresponding ordinary terminal, where the notification message carries terminal information that needs to be communicated in real time; when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, normally sending a heartbeat data packet; and when the role of the mobile terminal after joining the agent group is a common terminal, stopping sending the heartbeat data packet, receiving a notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message.
Optionally, the mobile terminal further includes a determining module 44, configured to determine whether a CELL ID of a base station to which the mobile terminal belongs changes within a preset time period;
the sending module 41 is specifically configured to send the proxy long connection request to the network side server when the CELL ID of the base station to which the mobile terminal belongs is not changed within a preset time period.
Optionally, the receiving module 42 is further configured to receive a role adjustment message from a network side server, where the role adjustment message carries new role information of the mobile terminal in the proxy group;
and the execution module 43 is further configured to execute a corresponding operation according to the new role.
The embodiment of the present invention further provides a server accordingly, as shown in fig. 5, the server includes: a receiving module 51, a determining module 52, a sending module 53 and an executing module 54; wherein,
a receiving module 51, configured to receive a proxy long connection request carrying mobile terminal attribute information from a mobile terminal;
here, the mobile terminal attribute information includes: base station number information CELL ID of a base station to which the mobile terminal belongs, an IP address and a terminal unique identifier which are acquired by the mobile terminal from a network side;
a determining module 52, configured to determine, according to the proxy long connection request, a proxy group to which the mobile terminal joins and a role after joining the proxy group;
here, the role is a proxy heartbeat sending terminal, a backup proxy heartbeat sending terminal or a common terminal;
a sending module 53, configured to return a confirmation message to the mobile terminal, where the confirmation message carries role information of the mobile terminal after joining the proxy group;
here, the role is a proxy heartbeat sending terminal, a backup proxy heartbeat sending terminal or a common terminal;
and the executing module 54 is configured to execute a corresponding operation according to the determined role of the mobile terminal after joining the proxy group.
Optionally, the executing module 54 is specifically configured to, when the role of the mobile terminal after joining the proxy group is a proxy heartbeat sending terminal, maintain long connection with the mobile terminal, and when real-time communication needs to be performed with a common terminal in the proxy group, send a notification message to the proxy heartbeat sending terminal, where the notification message carries terminal information that needs to be performed with the real-time communication; when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, the long connection with the mobile terminal is kept; and when the role of the mobile terminal after joining the agent group is a common terminal, disconnecting the long connection with the mobile terminal.
Optionally, the determining module 52 is specifically configured to determine, according to a CELL ID of a base station CELL of a base station to which the mobile terminal belongs, an agent group to which the mobile terminal joins, where the CELL ID of the base station CELL corresponds to the agent group one to one, and then determine, according to one or more of the following items, a role of the mobile terminal after joining the agent group: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
Optionally, the determining module 52 is further configured to determine the role of the mobile terminal in the proxy group again periodically or when the long connection with the proxy heartbeat sending terminal fails;
the sending module 53 is further configured to send a role adjustment message to a corresponding mobile terminal, where the role adjustment message carries new role information of the mobile terminal in the proxy group.
The embodiment of the invention also correspondingly provides a system for realizing the long data connection, which comprises more than one mobile terminal and a server, wherein,
the mobile terminal is used for sending an agent long connection request carrying mobile terminal attribute information to the network side server; receiving a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in the proxy group; when the role after joining the agent group is an agent heartbeat sending terminal, normally sending a heartbeat data packet, receiving a notification message from a server, and forwarding the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication, when the role after joining the agent group is a backup agent heartbeat sending terminal, normally sending the heartbeat data packet, when the role after joining the agent group is the common terminal, stopping sending the heartbeat data packet, receiving the notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message;
the server is used for determining the agent group added by the mobile terminal and the role after the agent group is added according to the agent long connection request, and returning a determination message to the mobile terminal; and when real-time communication with a common terminal in the agent group is needed, sending a notification message to the agent heartbeat sending terminal, wherein the notification message carries terminal information needing the real-time communication.
Optionally, the server is specifically configured to determine, according to a CELL ID of a base station CELL of a base station to which the mobile terminal belongs, an agent group to which the mobile terminal joins, where the CELL ID of the base station CELL corresponds to the agent group one to one, and then determine, according to one or more of the following items, a role of the mobile terminal after joining the agent group: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
Optionally, the server is further configured to, periodically or when the long connection with the proxy heartbeat sending terminal fails, re-determine the role of the mobile terminal in the proxy group, and send a role adjustment message to the corresponding mobile terminal, where the role adjustment message carries new role information of the mobile terminal in the proxy group.
The present invention will be described in further detail with reference to specific examples.
Examples
In this embodiment, the mobile terminal device in the group managed by the server has three roles:
the agent heartbeat sending terminal (MASTER) is generally a terminal and is mainly responsible for sending heartbeat information in real time to interact with the server, receiving real-time messages of the terminal or other mobile phones in the group, sending the messages to the target terminal according to the IP address after receiving the messages, and returning message processing state information to the server after the target terminal confirms the reception.
The BACKUP proxy heartbeat terminal (BACKUP) is generally one or more, the application executes the normal function of maintaining long data connection after being started, and the server selects to replace the original MASTER according to the conditions of the electric quantity of the terminal, the quantity of real-time messages and the like under the condition that the MASTER cannot normally work.
And after the registration process is finished, the ordinary terminal does not send heartbeat any more, and if the IP or CELLID is changed, the ordinary terminal logs in the server again to perform registration.
In addition, the MASTER can receive the proxy message sent by the server, send the proxy message to the target terminal according to the IP address after receiving the proxy message, and return the processing state of the proxy message to the server.
In this embodiment, the server mainly has functions including:
1) the method comprises the steps of maintaining data long connection with terminal equipment, receiving heartbeat sent by the terminal, replying confirmation, receiving management service messages and pushing the management service messages to a target terminal.
2) Maintaining a normal online device state;
3) the agent group management is to establish groups according to the division of the base station CELL ID, the serial number of each group is the corresponding base station CELL ID, and the specific information of each terminal, including the unique identification (IMEI/MAC) of the terminal equipment, the IP address acquired by connecting the mobile network, the current electric quantity of the terminal, the online connection time and the base station distance, is recorded in the group; managing the status of devices in the group; selecting MASTER and BACKUP in the group; and checking the long connection state of the terminal equipment and switching a BACKUP to be a proxy heartbeat sending terminal to realize the alternate management of MASTER.
Fig. 6 is a schematic structural diagram of a system for implementing long data connection according to an embodiment of the present invention, and as shown in fig. 6, the system includes a proxy heartbeat sending terminal T1, two backup proxy heartbeat sending terminals T2 and T3, and a plurality of common terminals T4...... Tn, T1, T2 and T3, where an interval for sending heartbeat data packets to a server is less than 3 minutes, and no heartbeat data packet is sent between the T4.... Tn and the server, and when the server needs to send real-time data to T4, a notification message is forwarded through T1.
By adopting the scheme of the invention, the power consumption of the terminal can be greatly reduced, the influence of a large number of small data packet connections on the base station can be reduced, the user flow can be saved, the concurrent control of the connection server can be reduced, the user experience can be improved, and the service life of the mobile phone can be prolonged.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (16)

1. A method for implementing a data length connection, the method comprising:
the mobile terminal sends a proxy long connection request carrying mobile terminal attribute information to a network side server;
the mobile terminal receives a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in an agent group;
the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, and then the mobile terminal normally sends a heartbeat data packet, receives a notification message from a server and forwards the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication; the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, and then a heartbeat data packet is normally sent; and stopping sending the heartbeat data packet and receiving a notification message from the agent heartbeat sending terminal if the role of the mobile terminal after joining the agent group is a common terminal, and then acquiring real-time data from the server according to the notification message.
2. The method of claim 1, wherein the proxy long connection request further carries one or more of: the current electric quantity of the mobile terminal, the online connection time and the distance from the mobile terminal to the base station.
3. The method according to claim 1 or 2, wherein the sending of the proxy long connection request carrying the mobile terminal attribute information from the mobile terminal to the network side server is as follows: and when the mobile terminal determines that the CELL ID of the base station of the mobile terminal does not change within a preset time period, sending a proxy long connection request carrying the attribute information of the mobile terminal to a network side server.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
the mobile terminal receives a role adjustment message from a network side server, wherein the role adjustment message carries new role information of the mobile terminal in an agent group;
and the mobile terminal executes corresponding operation according to the new role.
5. A method for implementing a data length connection, the method comprising:
the server receives an agent long connection request carrying mobile terminal attribute information from the mobile terminal;
the server determines an agent group added by the mobile terminal and a role after the agent group is added according to the agent long connection request, and returns a determination message to the mobile terminal, wherein the determination message carries role information after the mobile terminal is added into the agent group;
the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, the server keeps long connection with the mobile terminal, and sends a notification message to the agent heartbeat sending terminal when real-time communication is required to be carried out with a common terminal in the agent group, wherein the notification message carries terminal information required to be carried out with the real-time communication; the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, and the server keeps long connection with the mobile terminal; and if the role of the mobile terminal after joining the agent group is a common terminal, the server is disconnected from the long connection with the mobile terminal.
6. The method according to claim 5, wherein the server determines, according to the proxy long connection request, that the proxy group to which the mobile terminal has joined and the role after joining the proxy group are: determining an agent group added by the mobile terminal according to a base station CELL ID of a base station to which the mobile terminal belongs, wherein the base station CELL ID corresponds to the agent group one by one, and then determining the role of the mobile terminal after the mobile terminal is added into the agent group according to one or more of the following items: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
7. The method of claim 5, further comprising:
the server re-determines the roles of the mobile terminals in the agent group periodically or when the server fails to keep long connection with the agent heartbeat sending terminal, and sends role adjusting information to the corresponding mobile terminals, wherein the role adjusting information carries new role information of the mobile terminals in the agent group.
8. A mobile terminal, characterized in that the mobile terminal comprises: the device comprises a sending module, a receiving module and an execution module; wherein,
the sending module is used for sending the proxy long connection request carrying the attribute information of the mobile terminal to the network side server;
the receiving module is used for receiving a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in the proxy group;
the execution module is used for normally sending a heartbeat data packet when the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, receiving a notification message from the server, and forwarding the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication; when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, normally sending a heartbeat data packet; and when the role of the mobile terminal after joining the agent group is a common terminal, stopping sending the heartbeat data packet, receiving a notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message.
9. The mobile terminal of claim 8, wherein the mobile terminal further comprises a determining module,
the judging module is used for judging whether the CELL ID of the base station of the mobile terminal is changed within a preset time period;
the sending module is specifically configured to send a proxy long connection request to a network side server when a CELL ID of a base station to which the mobile terminal belongs is not changed within a preset time period.
10. The mobile terminal of claim 9,
the receiving module is further configured to receive a role adjustment message from a network side server, where the role adjustment message carries new role information of the mobile terminal in the proxy group;
and the execution module is also used for executing corresponding operation according to the new role.
11. A server, comprising: the device comprises a receiving module, a determining module, a sending module and an executing module; wherein,
the receiving module is used for receiving a proxy long connection request carrying mobile terminal attribute information from a mobile terminal;
the determining module is used for determining the agent group added by the mobile terminal and the role after the agent group is added according to the agent long connection request;
the sending module is used for returning a confirmation message to the mobile terminal, wherein the confirmation message carries role information of the mobile terminal after the mobile terminal joins the agent group;
the execution module is used for keeping long connection with the mobile terminal when the role of the mobile terminal after joining the agent group is an agent heartbeat sending terminal, and sending a notification message to the agent heartbeat sending terminal when real-time communication is required to be carried out with a common terminal in the agent group, wherein the notification message carries terminal information required to be carried out with the real-time communication; when the role of the mobile terminal after joining the agent group is a backup agent heartbeat sending terminal, the long connection with the mobile terminal is kept; and when the role of the mobile terminal after joining the agent group is a common terminal, disconnecting the long connection with the mobile terminal.
12. The server according to claim 11,
the determining module is specifically configured to determine, according to a CELL ID of a base station CELL of a base station to which the mobile terminal belongs, an agent group to which the mobile terminal joins, where the CELL ID of the base station CELL corresponds to the agent group one to one, and then determine, according to one or more of the following items, a role of the mobile terminal after joining the agent group: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
13. The server according to claim 11,
the determining module is further configured to re-determine the role of the mobile terminal in the proxy group periodically or when the long connection with the proxy heartbeat sending terminal fails;
the sending module is further configured to send a role adjustment message to a corresponding mobile terminal, where the role adjustment message carries new role information of the mobile terminal in the agent group.
14. A system for realizing long data connection is characterized in that the system comprises a mobile terminal and a server, wherein,
the mobile terminal is used for sending an agent long connection request carrying mobile terminal attribute information to the network side server; receiving a determination message from a network side server, wherein the determination message carries role information of the mobile terminal after the mobile terminal joins in the proxy group; when the role after joining the agent group is an agent heartbeat sending terminal, normally sending a heartbeat data packet, receiving a notification message from a server, and forwarding the notification message to a corresponding common terminal, wherein the notification message carries terminal information needing real-time communication, when the role after joining the agent group is a backup agent heartbeat sending terminal, normally sending the heartbeat data packet, when the role after joining the agent group is the common terminal, stopping sending the heartbeat data packet, receiving the notification message from the agent heartbeat sending terminal, and then acquiring real-time data from the server according to the notification message;
the server is used for determining the agent group added by the mobile terminal and the role after the agent group is added according to the agent long connection request, and returning a determination message to the mobile terminal; and when real-time communication with a common terminal in the agent group is needed, sending a notification message to the agent heartbeat sending terminal, wherein the notification message carries terminal information needing the real-time communication.
15. The system of claim 14,
the server is specifically configured to determine, according to a CELL ID of a base station CELL of a base station to which the mobile terminal belongs, an agent group to which the mobile terminal joins, where the CELL ID of the base station CELL corresponds to the agent group one to one, and then determine, according to one or more of the following items, a role of the mobile terminal after joining the agent group: the number of terminals in the agent group, the current electric quantity of the mobile terminal, the online connection time and the distance from the base station to which the mobile terminal belongs.
16. The system of claim 14 or 15,
the server is further configured to re-determine the role of the mobile terminal in the proxy group periodically or when the long connection with the proxy heartbeat sending terminal fails, and send a role adjustment message to the corresponding mobile terminal, where the role adjustment message carries new role information of the mobile terminal in the proxy group.
CN201310000666.2A 2013-01-04 2013-01-04 Realize method, system and mobile terminal, the server of data connection long Active CN103916936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310000666.2A CN103916936B (en) 2013-01-04 2013-01-04 Realize method, system and mobile terminal, the server of data connection long

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310000666.2A CN103916936B (en) 2013-01-04 2013-01-04 Realize method, system and mobile terminal, the server of data connection long

Publications (2)

Publication Number Publication Date
CN103916936A true CN103916936A (en) 2014-07-09
CN103916936B CN103916936B (en) 2017-06-23

Family

ID=51042241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310000666.2A Active CN103916936B (en) 2013-01-04 2013-01-04 Realize method, system and mobile terminal, the server of data connection long

Country Status (1)

Country Link
CN (1) CN103916936B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254579A (en) * 2016-09-30 2016-12-21 携程计算机技术(上海)有限公司 A kind of dynamic IP agent pool and building and management method
CN107332880A (en) * 2017-06-05 2017-11-07 深圳市酷开网络科技有限公司 Method, device and computer-readable recording medium that information is pushed
CN107800585A (en) * 2016-09-07 2018-03-13 腾讯科技(深圳)有限公司 The method and apparatus of network service, the method and apparatus of PUSH message
CN108650329A (en) * 2018-05-22 2018-10-12 深圳市海亿康科技有限公司 Main control device electoral machinery in a kind of more peer nodes communication
CN109716828A (en) * 2016-09-15 2019-05-03 佳能株式会社 Communication equipment, communication means and program
CN111064608A (en) * 2019-12-11 2020-04-24 北京奇艺世纪科技有限公司 Master-slave switching method and device of message system, electronic equipment and storage medium
CN113765948A (en) * 2020-06-02 2021-12-07 华为技术有限公司 Long connection device and network system
CN115225715A (en) * 2022-06-30 2022-10-21 深圳市云洲创新科技有限公司 Data interaction method and data interaction system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060020555A1 (en) * 2004-07-26 2006-01-26 Septon Daven W Monitoring a license proxy
CN102177697A (en) * 2011-04-29 2011-09-07 华为技术有限公司 Method for controlling internet services, and relevant device and system
CN102209302A (en) * 2011-07-07 2011-10-05 深圳市金立通信设备有限公司 System and method for realizing information push of mobile terminal
CN102572939A (en) * 2011-01-04 2012-07-11 中国移动通信有限公司 Heartbeat packet sending method, device thereof and system thereof
CN102769603A (en) * 2011-05-03 2012-11-07 中国移动通信集团公司 Method, system and apparatus for data transmission
WO2012167464A1 (en) * 2011-07-01 2012-12-13 华为技术有限公司 Heartbeat message transmission method and heartbeat proxy server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060020555A1 (en) * 2004-07-26 2006-01-26 Septon Daven W Monitoring a license proxy
CN102572939A (en) * 2011-01-04 2012-07-11 中国移动通信有限公司 Heartbeat packet sending method, device thereof and system thereof
CN102177697A (en) * 2011-04-29 2011-09-07 华为技术有限公司 Method for controlling internet services, and relevant device and system
CN102769603A (en) * 2011-05-03 2012-11-07 中国移动通信集团公司 Method, system and apparatus for data transmission
WO2012167464A1 (en) * 2011-07-01 2012-12-13 华为技术有限公司 Heartbeat message transmission method and heartbeat proxy server
CN102209302A (en) * 2011-07-07 2011-10-05 深圳市金立通信设备有限公司 System and method for realizing information push of mobile terminal

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107800585A (en) * 2016-09-07 2018-03-13 腾讯科技(深圳)有限公司 The method and apparatus of network service, the method and apparatus of PUSH message
CN107800585B (en) * 2016-09-07 2021-01-12 腾讯科技(深圳)有限公司 Network communication method and device, and message pushing method and device
US11622023B2 (en) 2016-09-15 2023-04-04 Canon Kabushiki Kaisha Communication apparatus, communication method, and storage medium
CN109716828A (en) * 2016-09-15 2019-05-03 佳能株式会社 Communication equipment, communication means and program
CN106254579B (en) * 2016-09-30 2019-09-24 携程计算机技术(上海)有限公司 It a kind of dynamic IP agent pool and its builds and management method
CN106254579A (en) * 2016-09-30 2016-12-21 携程计算机技术(上海)有限公司 A kind of dynamic IP agent pool and building and management method
CN107332880A (en) * 2017-06-05 2017-11-07 深圳市酷开网络科技有限公司 Method, device and computer-readable recording medium that information is pushed
CN108650329A (en) * 2018-05-22 2018-10-12 深圳市海亿康科技有限公司 Main control device electoral machinery in a kind of more peer nodes communication
CN111064608A (en) * 2019-12-11 2020-04-24 北京奇艺世纪科技有限公司 Master-slave switching method and device of message system, electronic equipment and storage medium
CN113765948B (en) * 2020-06-02 2022-12-27 华为技术有限公司 Long connection device and network system
CN113765948A (en) * 2020-06-02 2021-12-07 华为技术有限公司 Long connection device and network system
CN115225715A (en) * 2022-06-30 2022-10-21 深圳市云洲创新科技有限公司 Data interaction method and data interaction system
CN115225715B (en) * 2022-06-30 2024-01-26 深圳市云洲创新科技有限公司 Data interaction method and data interaction system

Also Published As

Publication number Publication date
CN103916936B (en) 2017-06-23

Similar Documents

Publication Publication Date Title
CN103916936B (en) Realize method, system and mobile terminal, the server of data connection long
US8521135B2 (en) Message relay host for delivering messages to out of coverage communications devices
US10841751B2 (en) Group multicast method, group creation method, and mobile network platform
CN103379469B (en) The closely register method of information, querying method and subscriber equipment
CN102647667B (en) Group management method and PUSH server
RU2011104508A (en) SEARCH CALL AND ENERGY CONSUMPTION MANAGEMENT SCHEMES FOR ACCESS TO A LOCAL NETWORK
CN104813637A (en) Push service without persistent TCP connection in mobile network
CN106576227B (en) Method, device and system for conventional interconnection and intercommunication of DMR/PDT cluster and DMR/PDT
CN105392185B (en) A kind of networking method of smart machine, apparatus and system
CN103348609B (en) For receiving method and the M2M equipment thereof of multi-case data in a wireless communication system
CN104283743A (en) Home network equipment and proxy service discovering method
CN105142116B (en) A kind of the communication network switching method and switching system of smart machine
US8576274B2 (en) Wireless video conference system and multi-conference switching method thereof
CN104580013A (en) Network communication method and system capable of realizing fast access point selection
CN105072145A (en) IOT (Internet of Things) communication method and system
US20180249319A1 (en) Device Association Method and Related Device
CN102801856A (en) Method for executing task in accordance with position
CN101909009B (en) Method for routing in intelligent domestic system, route system and Service Gateway
US10122540B2 (en) Device and method for managing multicast group in wireless network
CN103002548B (en) The method of the connection of mobile terminal and maintenance mobile terminal and application server
CN102388663B (en) Method for distributing paging message, and base station controller
CN104427616B (en) Method and device for paging terminal
CN103582035B (en) A kind of management method and system of radio-resource-configuration
JP6807952B2 (en) Methods and devices for determining the communication network that provides communication services to terminal communication devices
CN102404697A (en) Multi-media message service system, method and device

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